Changed logics for opening model edit windows. Double clicking an empty slot always opens wizard. Clicking en existing always opens model edit. By using right click menu either can be specified.

This commit is contained in:
Kjell Kernen
2014-03-03 16:30:01 +01:00
parent b347b6f9c5
commit 9dfffbf641
9 changed files with 512 additions and 504 deletions
+2 -6
View File
@@ -490,7 +490,6 @@ bool AppData::snapToClpbrd() { return _snapToClpbrd; }
bool AppData::autoCheckApp() { return _autoCheckApp; } bool AppData::autoCheckApp() { return _autoCheckApp; }
bool AppData::autoCheckFw() { return _autoCheckFw; } bool AppData::autoCheckFw() { return _autoCheckFw; }
bool AppData::simuSW() { return _simuSW; } bool AppData::simuSW() { return _simuSW; }
bool AppData::enableWizard() { return _enableWizard; }
int AppData::backLight() { return _backLight; } int AppData::backLight() { return _backLight; }
int AppData::embedSplashes() { return _embedSplashes; } int AppData::embedSplashes() { return _embedSplashes; }
@@ -499,7 +498,6 @@ int AppData::generalEditTab() { return _generalEditTab; }
int AppData::iconSize() { return _iconSize; } int AppData::iconSize() { return _iconSize; }
int AppData::historySize() { return _historySize; } int AppData::historySize() { return _historySize; }
int AppData::jsCtrl() { return _jsCtrl; } int AppData::jsCtrl() { return _jsCtrl; }
int AppData::modelEditTab() { return _modelEditTab; }
int AppData::id() { return _id; } int AppData::id() { return _id; }
int AppData::theme() { return _theme; } int AppData::theme() { return _theme; }
int AppData::warningId() { return _warningId; } int AppData::warningId() { return _warningId; }
@@ -544,7 +542,6 @@ void AppData::snapToClpbrd (const bool x) { store(x, _snapToClpbrd,
void AppData::autoCheckApp (const bool x) { store(x, _autoCheckApp, "startup_check_companion" );} 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::autoCheckFw (const bool x) { store(x, _autoCheckFw, "startup_check_fw" );}
void AppData::simuSW (const bool x) { store(x, _simuSW, "simuSW" );} void AppData::simuSW (const bool x) { store(x, _simuSW, "simuSW" );}
void AppData::enableWizard (const bool x) { store(x, _enableWizard, "wizardEnable" );}
void AppData::backLight (const int x) { store(x, _backLight, "backLight" );} void AppData::backLight (const int x) { store(x, _backLight, "backLight" );}
void AppData::embedSplashes (const int x) { store(x, _embedSplashes, "embedded_splashes" );} void AppData::embedSplashes (const int x) { store(x, _embedSplashes, "embedded_splashes" );}
@@ -553,7 +550,6 @@ void AppData::generalEditTab (const int x) { store(x, _generalEditTab,
void AppData::iconSize (const int x) { store(x, _iconSize, "icon_size" );} void AppData::iconSize (const int x) { store(x, _iconSize, "icon_size" );}
void AppData::historySize (const int x) { store(x, _historySize, "history_size" );} void AppData::historySize (const int x) { store(x, _historySize, "history_size" );}
void AppData::jsCtrl (const int x) { store(x, _jsCtrl, "js_ctrl" );} void AppData::jsCtrl (const int x) { store(x, _jsCtrl, "js_ctrl" );}
void AppData::modelEditTab (const int x) { store(x, _modelEditTab, "modelEditTab" );}
void AppData::id (const int x) { store(x, _id, "profileId" );} void AppData::id (const int x) { store(x, _id, "profileId" );}
void AppData::theme (const int x) { store(x, _theme, "theme" );} void AppData::theme (const int x) { store(x, _theme, "theme" );}
void AppData::warningId (const int x) { store(x, _warningId, "warningId" );} void AppData::warningId (const int x) { store(x, _warningId, "warningId" );}
@@ -611,12 +607,14 @@ AppData::AppData()
settings.remove("default_mode"); settings.remove("default_mode");
settings.remove("firmware"); settings.remove("firmware");
settings.remove("lastFw"); settings.remove("lastFw");
settings.remove("modelEditTab");
settings.remove("Name"); settings.remove("Name");
settings.remove("patchImage"); settings.remove("patchImage");
settings.remove("rename_firmware_files"); settings.remove("rename_firmware_files");
settings.remove("sdPath"); settings.remove("sdPath");
settings.remove("SplashFileName"); settings.remove("SplashFileName");
settings.remove("startup_check_companion9x"); settings.remove("startup_check_companion9x");
settings.remove("wizardEnable");
// Select the new default profile as current profile // Select the new default profile as current profile
id( 0 ); id( 0 );
@@ -662,7 +660,6 @@ AppData::AppData()
getset( _autoCheckApp, "startup_check_companion" ,true ); getset( _autoCheckApp, "startup_check_companion" ,true );
getset( _autoCheckFw, "startup_check_fw" ,true ); getset( _autoCheckFw, "startup_check_fw" ,true );
getset( _simuSW, "simuSW" ,false ); getset( _simuSW, "simuSW" ,false );
getset( _enableWizard, "wizardEnable" ,true );
getset( _backLight, "backLight" ,0 ); getset( _backLight, "backLight" ,0 );
getset( _embedSplashes, "embedded_splashes" ,0 ); getset( _embedSplashes, "embedded_splashes" ,0 );
@@ -671,7 +668,6 @@ AppData::AppData()
getset( _iconSize, "icon_size" ,2 ); getset( _iconSize, "icon_size" ,2 );
getset( _jsCtrl, "js_ctrl" ,0 ); getset( _jsCtrl, "js_ctrl" ,0 );
getset( _historySize, "history_size" ,10 ); getset( _historySize, "history_size" ,10 );
getset( _modelEditTab, "modelEditTab" ,0 );
getset( _id, "profileId" ,0 ); getset( _id, "profileId" ,0 );
getset( _theme, "theme" ,1 ); getset( _theme, "theme" ,1 );
getset( _warningId, "warningId" ,0 ); getset( _warningId, "warningId" ,0 );
-4
View File
@@ -221,7 +221,6 @@ class AppData: protected CompStoreObj
bool _autoCheckApp; bool _autoCheckApp;
bool _autoCheckFw; bool _autoCheckFw;
bool _simuSW; bool _simuSW;
bool _enableWizard;
int _backLight; int _backLight;
int _embedSplashes; int _embedSplashes;
@@ -230,7 +229,6 @@ class AppData: protected CompStoreObj
int _iconSize; int _iconSize;
int _jsCtrl; int _jsCtrl;
int _historySize; int _historySize;
int _modelEditTab;
int _id; int _id;
int _theme; int _theme;
int _warningId; int _warningId;
@@ -277,7 +275,6 @@ class AppData: protected CompStoreObj
bool autoCheckApp(); bool autoCheckApp();
bool autoCheckFw(); bool autoCheckFw();
bool simuSW(); bool simuSW();
bool enableWizard();
int backLight(); int backLight();
int embedSplashes(); int embedSplashes();
@@ -286,7 +283,6 @@ class AppData: protected CompStoreObj
int iconSize(); int iconSize();
int historySize(); int historySize();
int jsCtrl(); int jsCtrl();
int modelEditTab(); // This variable is unused an can be removed
int id(); int id();
int theme(); int theme();
int warningId(); int warningId();
-2
View File
@@ -38,7 +38,6 @@ void appPreferencesDialog::writeValues()
{ {
g.autoCheckApp(ui->startupCheck_companion9x->isChecked()); g.autoCheckApp(ui->startupCheck_companion9x->isChecked());
g.autoCheckFw(ui->startupCheck_fw->isChecked()); g.autoCheckFw(ui->startupCheck_fw->isChecked());
g.enableWizard(ui->wizardEnable_ChkB->isChecked());
g.showSplash(ui->showSplash->isChecked()); g.showSplash(ui->showSplash->isChecked());
g.simuSW(ui->simuSW->isChecked()); g.simuSW(ui->simuSW->isChecked());
g.historySize(ui->historySize->value()); g.historySize(ui->historySize->value());
@@ -101,7 +100,6 @@ void appPreferencesDialog::initSettings()
} }
ui->startupCheck_companion9x->setChecked(g.autoCheckApp()); ui->startupCheck_companion9x->setChecked(g.autoCheckApp());
ui->startupCheck_fw->setChecked(g.autoCheckFw()); ui->startupCheck_fw->setChecked(g.autoCheckFw());
ui->wizardEnable_ChkB->setChecked(g.enableWizard());
ui->showSplash->setChecked(g.showSplash()); ui->showSplash->setChecked(g.showSplash());
ui->historySize->setValue(g.historySize()); ui->historySize->setValue(g.historySize());
ui->backLightColor->setCurrentIndex(g.backLight()); ui->backLightColor->setCurrentIndex(g.backLight());
+444 -446
View File
@@ -26,12 +26,21 @@
<string>Edit Settings</string> <string>Edit Settings</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>6</number>
</property>
<property name="topMargin">
<number>6</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<property name="bottomMargin">
<number>6</number>
</property>
<property name="verticalSpacing"> <property name="verticalSpacing">
<number>2</number> <number>2</number>
</property> </property>
<property name="margin">
<number>6</number>
</property>
<item row="2" column="0" colspan="2"> <item row="2" column="0" colspan="2">
<widget class="QDialogButtonBox" name="buttonBox"> <widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation"> <property name="orientation">
@@ -47,450 +56,9 @@
<property name="currentIndex"> <property name="currentIndex">
<number>0</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="applicationTab">
<attribute name="title">
<string>Application Settings</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_3">
<item row="11" 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">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="9" column="0">
<widget class="QLabel" name="label_17">
<property name="text">
<string>Automatic Backup Folder</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QSpinBox" name="historySize">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>40</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="maximum">
<number>15</number>
</property>
<property name="value">
<number>10</number>
</property>
</widget>
</item>
<item row="13" 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>
<item row="12" 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="5" column="1">
<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="9" 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="13" 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="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="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="12" 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="10" column="1">
<widget class="QCheckBox" name="backupEnable">
<property name="text">
<string>Enable automatic backup before writing firmware</string>
</property>
</widget>
</item>
<item row="9" column="4">
<widget class="QPushButton" name="backupPathButton">
<property name="text">
<string>Open Folder</string>
</property>
</widget>
</item>
<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="3" column="1" colspan="4">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="6" column="1">
<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="8" column="1" colspan="4">
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QCheckBox" name="wizardEnable_ChkB">
<property name="text">
<string>Offer to use wizard for new models</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="1">
<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="0" column="3">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="13" column="1">
<widget class="QLineEdit" name="libraryPath">
<property name="enabled">
<bool>true</bool>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="simulatorTab">
<attribute name="title">
<string>Simulator Settings</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_4">
<item row="3" column="0">
<widget class="QLabel" name="label_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Simulator BackLight</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="QCheckBox" name="joystickChkB">
<property name="text">
<string>Enable</string>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QPushButton" name="snapshotPathButton">
<property name="text">
<string>Open Folder</string>
</property>
<property name="flat">
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="3">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="1">
<widget class="QComboBox" name="backLightColor">
<property name="maximumSize">
<size>
<width>100</width>
<height>16777215</height>
</size>
</property>
<item>
<property name="text">
<string>Blue</string>
</property>
</item>
<item>
<property name="text">
<string>Green</string>
</property>
</item>
<item>
<property name="text">
<string>Red</string>
</property>
</item>
<item>
<property name="text">
<string>Orange</string>
</property>
</item>
<item>
<property name="text">
<string>Yellow</string>
</property>
</item>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_11">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Joystick</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="snapshotClipboardCKB">
<property name="text">
<string>Only capture to clipboard</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QComboBox" name="joystickCB">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="5" column="4">
<widget class="QPushButton" name="joystickcalButton">
<property name="text">
<string>Calibrate</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="simuSW">
<property name="text">
<string>Remember simulator switch values</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_19">
<property name="text">
<string>Simulator capture folder</string>
</property>
</widget>
</item>
<item row="6" column="1">
<spacer name="verticalSpacer">
<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="0" column="1" colspan="2">
<widget class="QLineEdit" name="snapshotPath">
<property name="enabled">
<bool>true</bool>
</property>
<property name="minimumSize">
<size>
<width>350</width>
<height>0</height>
</size>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="profileTab"> <widget class="QWidget" name="profileTab">
<attribute name="title"> <attribute name="title">
<string>Radio Settings Profile</string> <string>Radio Profile</string>
</attribute> </attribute>
<layout class="QGridLayout" name="gridLayout_2"> <layout class="QGridLayout" name="gridLayout_2">
<item row="10" column="1" colspan="3"> <item row="10" column="1" colspan="3">
@@ -989,6 +557,437 @@ This is used by the templated to determine which channel goes to what number out
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="applicationTab">
<attribute name="title">
<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>
</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">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="8" column="0">
<widget class="QLabel" name="label_17">
<property name="text">
<string>Automatic Backup Folder</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QSpinBox" name="historySize">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>40</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="maximum">
<number>15</number>
</property>
<property name="value">
<number>10</number>
</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>
<property name="text">
<string>User Splash Screens</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="5" column="1">
<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="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="9" column="1">
<widget class="QCheckBox" name="backupEnable">
<property name="text">
<string>Enable automatic backup before writing firmware</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="6" column="1">
<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="7" column="1" colspan="4">
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="4" column="1">
<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="0" column="3">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</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>
</layout>
</widget>
<widget class="QWidget" name="simulatorTab">
<attribute name="title">
<string>Simulator Settings</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_4">
<item row="3" column="0">
<widget class="QLabel" name="label_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Simulator BackLight</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="QCheckBox" name="joystickChkB">
<property name="text">
<string>Enable</string>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QPushButton" name="snapshotPathButton">
<property name="text">
<string>Open Folder</string>
</property>
<property name="flat">
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="3">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="1">
<widget class="QComboBox" name="backLightColor">
<property name="maximumSize">
<size>
<width>100</width>
<height>16777215</height>
</size>
</property>
<item>
<property name="text">
<string>Blue</string>
</property>
</item>
<item>
<property name="text">
<string>Green</string>
</property>
</item>
<item>
<property name="text">
<string>Red</string>
</property>
</item>
<item>
<property name="text">
<string>Orange</string>
</property>
</item>
<item>
<property name="text">
<string>Yellow</string>
</property>
</item>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_11">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Joystick</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="snapshotClipboardCKB">
<property name="text">
<string>Only capture to clipboard</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QComboBox" name="joystickCB">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="5" column="4">
<widget class="QPushButton" name="joystickcalButton">
<property name="text">
<string>Calibrate</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="simuSW">
<property name="text">
<string>Remember simulator switch values</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_19">
<property name="text">
<string>Simulator capture folder</string>
</property>
</widget>
</item>
<item row="6" column="1">
<spacer name="verticalSpacer">
<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="0" column="1" colspan="2">
<widget class="QLineEdit" name="snapshotPath">
<property name="enabled">
<bool>true</bool>
</property>
<property name="minimumSize">
<size>
<width>350</width>
<height>0</height>
</size>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</widget> </widget>
</item> </item>
</layout> </layout>
@@ -1001,7 +1000,6 @@ This is used by the templated to determine which channel goes to what number out
<tabstop>showSplash</tabstop> <tabstop>showSplash</tabstop>
<tabstop>startupCheck_fw</tabstop> <tabstop>startupCheck_fw</tabstop>
<tabstop>startupCheck_companion9x</tabstop> <tabstop>startupCheck_companion9x</tabstop>
<tabstop>wizardEnable_ChkB</tabstop>
<tabstop>backupPath</tabstop> <tabstop>backupPath</tabstop>
<tabstop>backupPathButton</tabstop> <tabstop>backupPathButton</tabstop>
<tabstop>backupEnable</tabstop> <tabstop>backupEnable</tabstop>
+3 -3
View File
@@ -1750,7 +1750,7 @@ QMenu *MainWindow::createRecentFileMenu()
QMenu *MainWindow::createProfilesMenu() QMenu *MainWindow::createProfilesMenu()
{ {
QMenu *profilesMenu=new QMenu(tr("Radio Settings Profile")); QMenu *profilesMenu=new QMenu(tr("Radio Profile"));
int i; int i;
for ( i = 0; i < MAX_PROFILES; ++i) { for ( i = 0; i < MAX_PROFILES; ++i) {
profilesMenu->addAction(profileActs[i]); profilesMenu->addAction(profileActs[i]);
@@ -1809,8 +1809,8 @@ void MainWindow::createToolBars()
profileButton->setFocusPolicy(Qt::NoFocus); profileButton->setFocusPolicy(Qt::NoFocus);
profileButton->setMenu(createProfilesMenu()); profileButton->setMenu(createProfilesMenu());
profileButton->setIcon(CompanionIcon("profiles.png")); profileButton->setIcon(CompanionIcon("profiles.png"));
profileButton->setToolTip(tr("Radio Settings Profile")); profileButton->setToolTip(tr("Radio Profile"));
profileButton->setStatusTip(tr("Show a selection list of radio settings profiles")); profileButton->setStatusTip(tr("Show a selection list of radio profiles"));
fileToolBar->addWidget(profileButton); fileToolBar->addWidget(profileButton);
fileToolBar->addAction(editSplashAct); fileToolBar->addAction(editSplashAct);
+49 -38
View File
@@ -110,11 +110,6 @@ void MdiChild::copy()
ui->modelsList->copy(); ui->modelsList->copy();
} }
void MdiChild::openWizard()
{
WizardDialog *wizard = new WizardDialog(this);
wizard->show();
}
void MdiChild::paste() void MdiChild::paste()
{ {
@@ -152,47 +147,63 @@ void MdiChild::on_SimulateTxButton_clicked()
startSimulation(this, radioData, -1); startSimulation(this, radioData, -1);
} }
void MdiChild::OpenEditWindow() void MdiChild::checkAndInitModel( int row )
{
ModelData &model = radioData.models[row - 1];
if (model.isempty()) {
model.setDefault(row - 1);
setModified();
}
}
void MdiChild::generalEdit()
{
GeneralEdit *t = new GeneralEdit(radioData, this);
connect(t, SIGNAL(modelValuesChanged()), this, SLOT(setModified()));
t->show();
}
void MdiChild::modelEdit()
{ {
int row = ui->modelsList->currentRow(); int row = ui->modelsList->currentRow();
bool wizard=false;
if (row) { if (row == 0){
//TODO error checking generalEdit();
bool isNew = false; }
else {
checkAndInitModel( row );
ModelData &model = radioData.models[row - 1]; ModelData &model = radioData.models[row - 1];
ModelEdit *t = new ModelEdit(radioData, (row - 1), false, this);
if (model.isempty()) {
model.setDefault(row - 1);
isNew = true; //modeledit - clear mixes, apply first template
setModified();
}
if (isNew) {
int ret;
if (g.enableWizard()) {
ret = QMessageBox::question(this, tr("Companion"), tr("Do you want to use model wizard? "), QMessageBox::Yes | QMessageBox::No);
if (ret == QMessageBox::Yes) {
wizard=true;
} else {
qSleep(500);
ret = QMessageBox::question(this, tr("Companion"), tr("Ask this question again ? "), QMessageBox::Yes | QMessageBox::No);
if (ret == QMessageBox::No) {
g.enableWizard( false );
}
}
}
}
ModelEdit *t = new ModelEdit(radioData, (row - 1), wizard, this);
// TODO if (isNew && !wizard) t->applyBaseTemplate();
t->setWindowTitle(tr("Editing model %1: ").arg(row) + model.name); t->setWindowTitle(tr("Editing model %1: ").arg(row) + model.name);
connect(t, SIGNAL(modified()), this, SLOT(setModified())); connect(t, SIGNAL(modified()), this, SLOT(setModified()));
//t->exec();
t->show(); t->show();
} }
else { }
GeneralEdit *t = new GeneralEdit(radioData, this);
connect(t, SIGNAL(modelValuesChanged()), this, SLOT(setModified())); void MdiChild::wizardEdit()
t->show(); {
int row = ui->modelsList->currentRow();
if (row > 0) {
checkAndInitModel(row);
WizardDialog *wizard = new WizardDialog(this);
wizard->show();
}
}
void MdiChild::openEditWindow()
{
int row = ui->modelsList->currentRow();
if (row == 0){
generalEdit();
}
else{
ModelData &model = radioData.models[row - 1];
if (model.isempty()) {
wizardEdit();
}
else {
modelEdit();
}
} }
} }
+5 -2
View File
@@ -89,11 +89,14 @@ private slots:
void qSleep(int ms); void qSleep(int ms);
public slots: public slots:
void OpenEditWindow(); void checkAndInitModel(int row);
void generalEdit();
void modelEdit();
void wizardEdit();
void openEditWindow();
void cut(); void cut();
void copy(); void copy();
void openWizard();
void paste(); void paste();
void writeEeprom(); void writeEeprom();
void simulate(); void simulate();
+8 -3
View File
@@ -85,7 +85,7 @@ void ModelsListWidget::ShowContextMenu(const QPoint& pos)
bool hasData = mimeData->hasFormat("application/x-companion"); bool hasData = mimeData->hasFormat("application/x-companion");
QMenu contextMenu; QMenu contextMenu;
contextMenu.addAction(CompanionIcon("edit.png"), tr("&Edit"),this,SLOT(OpenEditWindow())); contextMenu.addAction(CompanionIcon("edit.png"), tr("&Edit"),this,SLOT(EditModel()));
contextMenu.addAction(CompanionIcon("open.png"), tr("&Restore from backup"),this,SLOT(LoadBackup())); contextMenu.addAction(CompanionIcon("open.png"), tr("&Restore from backup"),this,SLOT(LoadBackup()));
contextMenu.addAction(CompanionIcon("wizard.png"), tr("&Model Wizard"),this,SLOT(OpenWizard())); contextMenu.addAction(CompanionIcon("wizard.png"), tr("&Model Wizard"),this,SLOT(OpenWizard()));
contextMenu.addSeparator(); contextMenu.addSeparator();
@@ -103,14 +103,19 @@ void ModelsListWidget::ShowContextMenu(const QPoint& pos)
contextMenu.exec(globalPos); contextMenu.exec(globalPos);
} }
void ModelsListWidget::EditModel()
{
((MdiChild *)parent())->modelEdit();
}
void ModelsListWidget::OpenEditWindow() void ModelsListWidget::OpenEditWindow()
{ {
((MdiChild *)parent())->OpenEditWindow(); ((MdiChild *)parent())->openEditWindow();
} }
void ModelsListWidget::OpenWizard() void ModelsListWidget::OpenWizard()
{ {
((MdiChild *)parent())->openWizard(); ((MdiChild *)parent())->wizardEdit();
} }
void ModelsListWidget::LoadBackup() void ModelsListWidget::LoadBackup()
+1
View File
@@ -81,6 +81,7 @@ public slots:
void copy(); void copy();
void paste(); void paste();
void print(); void print();
void EditModel();
void OpenEditWindow(); void OpenEditWindow();
void LoadBackup(); void LoadBackup();
void OpenWizard(); void OpenWizard();