mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-19 09:54:15 +01:00
Create new setting "autoselect"
This commit is contained in:
parent
844bc79f45
commit
fce8038cf4
@ -46,8 +46,9 @@ using namespace Core::Internal;
|
||||
GeneralSettings::GeneralSettings():
|
||||
m_dialog(0),
|
||||
m_saveSettingsOnExit(true),
|
||||
m_autoConnect(true)
|
||||
m_autoConnect(true),m_autoSelect(true)
|
||||
{
|
||||
connect(m_page->checkAutoConnect,SIGNAL(stateChanged(int)),this,SLOT(slotAutoConnect(int)));
|
||||
}
|
||||
|
||||
QString GeneralSettings::id() const
|
||||
@ -116,6 +117,7 @@ QWidget *GeneralSettings::createPage(QWidget *parent)
|
||||
fillLanguageBox();
|
||||
m_page->checkBoxSaveOnExit->setChecked(m_saveSettingsOnExit);
|
||||
m_page->checkAutoConnect->setChecked(m_autoConnect);
|
||||
m_page->checkAutoSelect->setChecked(m_autoSelect);
|
||||
m_page->colorButton->setColor(StyleHelper::baseColor());
|
||||
#ifdef Q_OS_UNIX
|
||||
m_page->terminalEdit->setText(ConsoleProcess::terminalEmulator(Core::ICore::instance()->settings()));
|
||||
@ -148,6 +150,7 @@ void GeneralSettings::apply()
|
||||
|
||||
m_saveSettingsOnExit = m_page->checkBoxSaveOnExit->isChecked();
|
||||
m_autoConnect = m_page->checkAutoConnect->isChecked();
|
||||
m_autoSelect = m_page->checkAutoSelect->isChecked();
|
||||
#ifdef Q_OS_UNIX
|
||||
ConsoleProcess::setTerminalEmulator(Core::ICore::instance()->settings(),
|
||||
m_page->terminalEdit->text());
|
||||
@ -166,6 +169,7 @@ void GeneralSettings::readSettings(QSettings* qs)
|
||||
m_language = qs->value(QLatin1String("OverrideLanguage"),QLocale::system().name()).toString();
|
||||
m_saveSettingsOnExit = qs->value(QLatin1String("SaveSettingsOnExit"),m_saveSettingsOnExit).toBool();
|
||||
m_autoConnect = qs->value(QLatin1String("AutoConnect"),m_autoConnect).toBool();
|
||||
m_autoSelect = qs->value(QLatin1String("AutoSelect"),m_autoSelect).toBool();
|
||||
qs->endGroup();
|
||||
|
||||
}
|
||||
@ -181,6 +185,7 @@ void GeneralSettings::saveSettings(QSettings* qs)
|
||||
|
||||
qs->setValue(QLatin1String("SaveSettingsOnExit"), m_saveSettingsOnExit);
|
||||
qs->setValue(QLatin1String("AutoConnect"), m_autoConnect);
|
||||
qs->setValue(QLatin1String("AutoSelect"), m_autoSelect);
|
||||
qs->endGroup();
|
||||
}
|
||||
|
||||
@ -250,3 +255,16 @@ bool GeneralSettings::autoConnect() const
|
||||
{
|
||||
return m_autoConnect;
|
||||
}
|
||||
|
||||
bool GeneralSettings::autoSelect() const
|
||||
{
|
||||
return m_autoSelect;
|
||||
}
|
||||
|
||||
void GeneralSettings::slotAutoConnect(int value)
|
||||
{
|
||||
if (value==Qt::Checked)
|
||||
m_page->checkAutoSelect->setEnabled(false);
|
||||
else
|
||||
m_page->checkAutoSelect->setEnabled(true);
|
||||
}
|
||||
|
@ -57,6 +57,7 @@ public:
|
||||
void finish();
|
||||
bool saveSettingsOnExit() const;
|
||||
bool autoConnect() const;
|
||||
bool autoSelect() const;
|
||||
void readSettings(QSettings* qs);
|
||||
void saveSettings(QSettings* qs);
|
||||
|
||||
@ -65,6 +66,7 @@ private slots:
|
||||
void resetLanguage();
|
||||
void resetExternalEditor();
|
||||
void showHelpForExternalEditor();
|
||||
void slotAutoConnect();
|
||||
#ifdef Q_OS_UNIX
|
||||
void resetTerminal();
|
||||
#endif
|
||||
@ -77,6 +79,7 @@ private:
|
||||
QString m_language;
|
||||
bool m_saveSettingsOnExit;
|
||||
bool m_autoConnect;
|
||||
bool m_autoSelect;
|
||||
QPointer<QWidget> m_dialog;
|
||||
QList<QTextCodec *> m_codecs;
|
||||
|
||||
|
@ -244,7 +244,10 @@
|
||||
<item row="12" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>AutoConnect</string>
|
||||
<string>Automatically connect an OpenPilot USB device</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -258,6 +261,29 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="13" column="0">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>Automatically select an OpenPilot USB device</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="13" column="1">
|
||||
<widget class="QCheckBox" name="checkAutoSelect">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
Loading…
x
Reference in New Issue
Block a user