diff options
author | Anton Lundin <glance@acc.umu.se> | 2014-10-18 00:33:47 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-10-18 15:22:22 -0700 |
commit | 74f27a0a399a1f7c63d5542eec744102c301671f (patch) | |
tree | bf56cb41966f9e6de5615fbb516e7c3e2aba2821 /qt-ui | |
parent | d63a3ce420fcaa6a4b576a840b9d17984f776b2a (diff) | |
download | subsurface-74f27a0a399a1f7c63d5542eec744102c301671f.tar.gz |
Add support to reset OSTC3 settings to default
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/configuredivecomputerdialog.cpp | 10 | ||||
-rw-r--r-- | qt-ui/configuredivecomputerdialog.h | 1 | ||||
-rw-r--r-- | qt-ui/configuredivecomputerdialog.ui | 10 |
3 files changed, 21 insertions, 0 deletions
diff --git a/qt-ui/configuredivecomputerdialog.cpp b/qt-ui/configuredivecomputerdialog.cpp index 8a47e018d..92f4c3909 100644 --- a/qt-ui/configuredivecomputerdialog.cpp +++ b/qt-ui/configuredivecomputerdialog.cpp @@ -43,6 +43,7 @@ ConfigureDiveComputerDialog::ConfigureDiveComputerDialog(QWidget *parent) : connect(config, SIGNAL(deviceDetailsChanged(DeviceDetails*)), this, SLOT(deviceDetailsReceived(DeviceDetails*))); connect(ui.retrieveDetails, SIGNAL(clicked()), this, SLOT(readSettings())); + connect(ui.resetButton, SIGNAL(clicked()), this, SLOT(resetSettings())); memset(&device_data, 0, sizeof(device_data)); fill_computer_list(); @@ -329,6 +330,15 @@ void ConfigureDiveComputerDialog::readSettings() config->readSettings(&device_data); } +void ConfigureDiveComputerDialog::resetSettings() +{ + ui.statusLabel->clear(); + ui.errorLabel->clear(); + + getDeviceData(); + config->resetSettings(&device_data); +} + void ConfigureDiveComputerDialog::configMessage(QString msg) { ui.statusLabel->setText(msg); diff --git a/qt-ui/configuredivecomputerdialog.h b/qt-ui/configuredivecomputerdialog.h index f4e364867..9d4068baf 100644 --- a/qt-ui/configuredivecomputerdialog.h +++ b/qt-ui/configuredivecomputerdialog.h @@ -21,6 +21,7 @@ public: private slots: void readSettings(); + void resetSettings(); void configMessage(QString msg); void configError(QString err); void on_cancel_clicked(); diff --git a/qt-ui/configuredivecomputerdialog.ui b/qt-ui/configuredivecomputerdialog.ui index cb192e1f9..c31372649 100644 --- a/qt-ui/configuredivecomputerdialog.ui +++ b/qt-ui/configuredivecomputerdialog.ui @@ -572,6 +572,16 @@ </property> </widget> </item> + <item row="10" column="3" colspan="2"> + <widget class="QPushButton" name="resetButton"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="text"> + <string>Reset device to default settings</string> + </property> + </widget> + </item> </layout> </widget> <widget class="QWidget" name="advancedSettings"> |