1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-24 16:55:20 +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)
void AppPreferencesDialog::on_joystickChkB_clicked() {
if (ui->joystickChkB->isChecked()) {

View file

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

View file

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