1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-26 17:55:19 +03:00

Allow clearing saved simulator control positions

This commit is contained in:
Kilrah 2020-03-27 11:59:08 +01:00
parent 7f6d3f9e01
commit 1d3f04482f
3 changed files with 98 additions and 76 deletions

View file

@ -352,6 +352,13 @@ void AppPreferencesDialog::on_ge_pathButton_clicked()
} }
} }
void AppPreferencesDialog::on_btnClearPos_clicked()
{
SimulatorOptions opts = g.profile[g.sessionId()].simulatorOptions();
opts.controlsState.clear();
g.profile[g.sessionId()].simulatorOptions(opts);
}
#if defined(JOYSTICKS) #if defined(JOYSTICKS)
void AppPreferencesDialog::on_joystickChkB_clicked() { void AppPreferencesDialog::on_joystickChkB_clicked() {
if (ui->joystickChkB->isChecked()) { if (ui->joystickChkB->isChecked()) {

View file

@ -66,6 +66,7 @@ class AppPreferencesDialog : public QDialog
void on_SplashSelect_clicked(); void on_SplashSelect_clicked();
void on_clearImageButton_clicked(); void on_clearImageButton_clicked();
void on_btn_appLogsDir_clicked(); void on_btn_appLogsDir_clicked();
void on_btnClearPos_clicked();
#if defined(JOYSTICKS) #if defined(JOYSTICKS)
void on_joystickChkB_clicked(); void on_joystickChkB_clicked();

View file

@ -1201,7 +1201,38 @@ Mode 4:
<property name="spacing"> <property name="spacing">
<number>6</number> <number>6</number>
</property> </property>
<item row="5" column="1"> <item row="10" column="1">
<widget class="QDoubleSpinBox" name="volumeGain">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="decimals">
<number>1</number>
</property>
<property name="minimum">
<double>0.500000000000000</double>
</property>
<property name="maximum">
<double>3.000000000000000</double>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
</property>
<property name="value">
<double>1.000000000000000</double>
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="QComboBox" name="joystickCB"> <widget class="QComboBox" name="joystickCB">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
@ -1214,14 +1245,20 @@ Mode 4:
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="3"> <item row="0" column="0">
<widget class="QPushButton" name="joystickcalButton"> <widget class="QLabel" name="label_19">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text"> <property name="text">
<string>Calibrate</string> <string>Screenshot capture folder</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="1"> <item row="7" column="1">
<widget class="QComboBox" name="backLightColor"> <widget class="QComboBox" name="backLightColor">
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
@ -1256,31 +1293,22 @@ Mode 4:
</item> </item>
</widget> </widget>
</item> </item>
<item row="0" column="0"> <item row="9" column="3">
<widget class="QLabel" name="label_19"> <widget class="QPushButton" name="joystickcalButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text"> <property name="text">
<string>Screenshot capture folder</string> <string>Calibrate</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="8" column="1"> <item row="0" column="3">
<spacer name="verticalSpacer"> <widget class="QPushButton" name="snapshotPathButton">
<property name="orientation"> <property name="text">
<enum>Qt::Vertical</enum> <string>Select Folder</string>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="flat">
<size> <bool>false</bool>
<width>20</width>
<height>5</height>
</size>
</property> </property>
</spacer> </widget>
</item> </item>
<item row="1" column="1" colspan="3"> <item row="1" column="1" colspan="3">
<widget class="QCheckBox" name="snapshotClipboardCKB"> <widget class="QCheckBox" name="snapshotClipboardCKB">
@ -1295,7 +1323,7 @@ Mode 4:
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="2"> <item row="9" column="2">
<widget class="QCheckBox" name="joystickChkB"> <widget class="QCheckBox" name="joystickChkB">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed"> <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
@ -1308,17 +1336,20 @@ Mode 4:
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="3"> <item row="12" column="1">
<widget class="QPushButton" name="snapshotPathButton"> <spacer name="verticalSpacer">
<property name="text"> <property name="orientation">
<string>Select Folder</string> <enum>Qt::Vertical</enum>
</property> </property>
<property name="flat"> <property name="sizeHint" stdset="0">
<bool>false</bool> <size>
<width>20</width>
<height>5</height>
</size>
</property> </property>
</widget> </spacer>
</item> </item>
<item row="5" column="0"> <item row="9" column="0">
<widget class="QLabel" name="label_11"> <widget class="QLabel" name="label_11">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed"> <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
@ -1331,7 +1362,20 @@ Mode 4:
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="0"> <item row="10" column="0">
<widget class="QLabel" name="label_volumeGain">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Simulator Volume Gain</string>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_3"> <widget class="QLabel" name="label_3">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed"> <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
@ -1369,10 +1413,17 @@ Mode 4:
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="1" colspan="3"> <item row="2" column="0">
<widget class="QLabel" name="label_20">
<property name="text">
<string>Simulator controls</string>
</property>
</widget>
</item>
<item row="2" column="1" colspan="2">
<widget class="QCheckBox" name="simuSW"> <widget class="QCheckBox" name="simuSW">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -1382,47 +1433,10 @@ Mode 4:
</property> </property>
</widget> </widget>
</item> </item>
<item row="6" column="0"> <item row="2" column="3">
<widget class="QLabel" name="label_volumeGain"> <widget class="QPushButton" name="btnClearPos">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text"> <property name="text">
<string>Simulator Volume Gain</string> <string>Clear saved positions</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QDoubleSpinBox" name="volumeGain">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="decimals">
<number>1</number>
</property>
<property name="minimum">
<double>0.500000000000000</double>
</property>
<property name="maximum">
<double>3.000000000000000</double>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
</property>
<property name="value">
<double>1.000000000000000</double>
</property> </property>
</widget> </widget>
</item> </item>