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>
This commit is contained in:
Anton Lundin 2014-10-18 00:33:47 +02:00 committed by Dirk Hohndel
parent d63a3ce420
commit 74f27a0a39
7 changed files with 97 additions and 1 deletions

View file

@ -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);