App preference to use wizard on new model creation. I noticed there was a stub for it just when I was about to finish - anyway now it's done.

I tried adding a line in the ui to separate the setting like done for other groups, but failed to get a horizontal line that spans the whole width despite spending half an hour in that ******* QT designer.
This commit is contained in:
Andre Bernet
2014-04-03 23:55:35 +02:00
parent ec260cbfa8
commit 09e1ac33b1
5 changed files with 202 additions and 188 deletions
+3
View File
@@ -510,6 +510,7 @@ bool AppData::snapToClpbrd() { return _snapToClpbrd; }
bool AppData::autoCheckApp() { return _autoCheckApp; }
bool AppData::autoCheckFw() { return _autoCheckFw; }
bool AppData::simuSW() { return _simuSW; }
bool AppData::useWizard() { return _useWizard; }
int AppData::backLight() { return _backLight; }
int AppData::embedSplashes() { return _embedSplashes; }
@@ -562,6 +563,7 @@ void AppData::snapToClpbrd (const bool x) { store(x, _snapToClpbrd,
void AppData::autoCheckApp (const bool x) { store(x, _autoCheckApp, "startup_check_companion" );}
void AppData::autoCheckFw (const bool x) { store(x, _autoCheckFw, "startup_check_fw" );}
void AppData::simuSW (const bool x) { store(x, _simuSW, "simuSW" );}
void AppData::useWizard (const bool x) { store(x, _useWizard, "useWizard" );}
void AppData::backLight (const int x) { store(x, _backLight, "backLight" );}
void AppData::embedSplashes (const int x) { store(x, _embedSplashes, "embedded_splashes" );}
@@ -680,6 +682,7 @@ AppData::AppData()
getset( _autoCheckApp, "startup_check_companion" ,true );
getset( _autoCheckFw, "startup_check_fw" ,true );
getset( _simuSW, "simuSW" ,false );
getset( _useWizard, "useWizard" ,true );
getset( _backLight, "backLight" ,0 );
getset( _embedSplashes, "embedded_splashes" ,0 );
+3 -1
View File
@@ -236,6 +236,7 @@ class AppData: protected CompStoreObj
bool _autoCheckApp;
bool _autoCheckFw;
bool _simuSW;
bool _useWizard;
int _backLight;
int _embedSplashes;
@@ -290,6 +291,7 @@ class AppData: protected CompStoreObj
bool autoCheckApp();
bool autoCheckFw();
bool simuSW();
bool useWizard();
int backLight();
int embedSplashes();
@@ -343,7 +345,7 @@ class AppData: protected CompStoreObj
void autoCheckApp (const bool);
void autoCheckFw (const bool);
void simuSW (const bool);
void enableWizard (const bool);
void useWizard (const bool);
void backLight (const int);
void embedSplashes (const int);
+2
View File
@@ -40,6 +40,7 @@ void appPreferencesDialog::writeValues()
g.autoCheckFw(ui->startupCheck_fw->isChecked());
g.showSplash(ui->showSplash->isChecked());
g.simuSW(ui->simuSW->isChecked());
g.useWizard(ui->modelWizard_CB->isChecked());
g.historySize(ui->historySize->value());
g.backLight(ui->backLightColor->currentIndex());
g.libDir(ui->libraryPath->text());
@@ -107,6 +108,7 @@ void appPreferencesDialog::initSettings()
if (getRadioType(g.profile[g.id()].fwType())==6) // TODO - NOT AT ALL OK. THERE SHOULD BE A COMMON RADIO DEFINITION.
ui->backLightColor->setEnabled(false);
ui->simuSW->setChecked(g.simuSW());
ui->modelWizard_CB->setChecked(g.useWizard());
ui->libraryPath->setText(g.libDir());
ui->ge_lineedit->setText(g.gePath());
+193 -186
View File
@@ -45,7 +45,7 @@
<item row="0" column="1">
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
<number>1</number>
</property>
<widget class="QWidget" name="profileTab">
<attribute name="title">
@@ -570,28 +570,69 @@ This is used by the templated to determine which channel goes to what number out
<string>Application Settings</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="1">
<widget class="QLineEdit" name="ge_lineedit">
<property name="minimumSize">
<size>
<width>350</width>
<height>0</height>
</size>
<item row="4" column="1" colspan="4">
<widget class="QCheckBox" name="showSplash">
<property name="text">
<string>Show splash screen when Companion starts</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="6" column="1" colspan="4">
<widget class="QCheckBox" name="startupCheck_companion9x">
<property name="text">
<string>Automatic check for Companion updates</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="9" column="1" colspan="4">
<widget class="QCheckBox" name="backupEnable">
<property name="text">
<string>Enable automatic backup before writing firmware</string>
</property>
</widget>
</item>
<item row="3" column="1" colspan="4">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="7" column="1" colspan="4">
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="5" column="1" colspan="4">
<widget class="QCheckBox" name="startupCheck_fw">
<property name="text">
<string>Automatic check for OpenTX firmware updates</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="12" column="1">
<widget class="QLineEdit" name="libraryPath">
<property name="enabled">
<bool>true</bool>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="10" column="1" colspan="4">
<widget class="Line" name="line_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="0" column="2">
<spacer name="horizontalSpacer_3">
<item row="0" column="3">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
@@ -603,10 +644,123 @@ This is used by the templated to determine which channel goes to what number out
</property>
</spacer>
</item>
<item row="8" column="0">
<widget class="QLabel" name="label_17">
<item row="14" column="1">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="8" column="4">
<widget class="QPushButton" name="backupPathButton">
<property name="text">
<string>Automatic Backup Folder</string>
<string>Open Folder</string>
</property>
</widget>
</item>
<item row="11" column="0">
<widget class="QLabel" name="label_10">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Splash Screen Library</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_5">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Files to keep</string>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QPushButton" name="ge_pathButton">
<property name="text">
<string>Find Executable</string>
</property>
</widget>
</item>
<item row="1" column="1" colspan="4">
<widget class="Line" name="line_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="12" column="4">
<widget class="QPushButton" name="libraryPathButton">
<property name="text">
<string>Open Folder</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QLineEdit" name="backupPath">
<property name="minimumSize">
<size>
<width>350</width>
<height>0</height>
</size>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="ge_label">
<property name="text">
<string>Google Earth Executable</string>
</property>
</widget>
</item>
<item row="11" column="1">
<widget class="QComboBox" name="splashincludeCB">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text">
<string>Only show user splash images</string>
</property>
</item>
<item>
<property name="text">
<string>Show user and companion splash images</string>
</property>
</item>
</widget>
</item>
<item row="12" column="0">
<widget class="QLabel" name="label_9">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>User Splash Screens</string>
</property>
</widget>
</item>
@@ -632,142 +786,15 @@ This is used by the templated to determine which channel goes to what number out
</property>
</widget>
</item>
<item row="12" column="0">
<widget class="QLabel" name="label_9">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item row="8" column="0">
<widget class="QLabel" name="label_17">
<property name="text">
<string>User Splash Screens</string>
<string>Automatic Backup Folder</string>
</property>
</widget>
</item>
<item row="11" column="1">
<widget class="QComboBox" name="splashincludeCB">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text">
<string>Only show user splash images</string>
</property>
</item>
<item>
<property name="text">
<string>Show user and companion splash images</string>
</property>
</item>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="ge_label">
<property name="text">
<string>Google Earth Executable</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QLineEdit" name="backupPath">
<property name="minimumSize">
<size>
<width>350</width>
<height>0</height>
</size>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="12" column="4">
<widget class="QPushButton" name="libraryPathButton">
<property name="text">
<string>Open Folder</string>
</property>
</widget>
</item>
<item row="1" column="1" colspan="4">
<widget class="Line" name="line_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QPushButton" name="ge_pathButton">
<property name="text">
<string>Find Executable</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_5">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Files to keep</string>
</property>
</widget>
</item>
<item row="11" column="0">
<widget class="QLabel" name="label_10">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Splash Screen Library</string>
</property>
</widget>
</item>
<item row="8" column="4">
<widget class="QPushButton" name="backupPathButton">
<property name="text">
<string>Open Folder</string>
</property>
</widget>
</item>
<item row="13" column="1">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="1" colspan="4">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="7" column="1" colspan="4">
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="0" column="3">
<spacer name="horizontalSpacer_4">
<item row="0" column="2">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
@@ -779,50 +806,30 @@ This is used by the templated to determine which channel goes to what number out
</property>
</spacer>
</item>
<item row="12" column="1">
<widget class="QLineEdit" name="libraryPath">
<property name="enabled">
<bool>true</bool>
<item row="0" column="1">
<widget class="QLineEdit" name="ge_lineedit">
<property name="minimumSize">
<size>
<width>350</width>
<height>0</height>
</size>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="1" colspan="4">
<widget class="QCheckBox" name="showSplash">
<item row="13" column="1">
<widget class="QCheckBox" name="modelWizard_CB">
<property name="text">
<string>Show splash screen when Companion starts</string>
</property>
<property name="checked">
<bool>true</bool>
<string>Use model wizard when creating a new model</string>
</property>
</widget>
</item>
<item row="5" column="1" colspan="4">
<widget class="QCheckBox" name="startupCheck_fw">
<property name="text">
<string>Automatic check for OpenTX firmware updates</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="6" column="1" colspan="4">
<widget class="QCheckBox" name="startupCheck_companion9x">
<property name="text">
<string>Automatic check for Companion updates</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="9" column="1" colspan="4">
<widget class="QCheckBox" name="backupEnable">
<property name="text">
<string>Enable automatic backup before writing firmware</string>
<item row="10" column="1" colspan="4">
<widget class="Line" name="line_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
+1 -1
View File
@@ -206,7 +206,7 @@ void MdiChild::openEditWindow()
}
else{
ModelData &model = radioData.models[row - 1];
if (model.isempty()) {
if (model.isempty() && g.useWizard()) {
wizardEdit();
}
else {