diff options
author | Joseph W. Joshua <joejoshw@gmail.com> | 2014-05-30 10:49:58 +0300 |
---|---|---|
committer | Thiago Macieira <thiago@macieira.org> | 2014-08-09 12:01:56 -0300 |
commit | 3e127a059f598a30e9cfd71411783d71f40b315f (patch) | |
tree | 666f4a3e7de121bf3a74973df1dc29e4ccc84a64 /qt-ui/configuredivecomputerdialog.cpp | |
parent | a7c9b25b053ee77a816e1555f1c00c3e4b996396 (diff) | |
download | subsurface-3e127a059f598a30e9cfd71411783d71f40b315f.tar.gz |
Create class to write settings to dive computer
Adds a class to write settings to dive computer, and modifies
the existing ones to integrate it.
Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Diffstat (limited to 'qt-ui/configuredivecomputerdialog.cpp')
-rw-r--r-- | qt-ui/configuredivecomputerdialog.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/qt-ui/configuredivecomputerdialog.cpp b/qt-ui/configuredivecomputerdialog.cpp index 53544575c..b88715fc9 100644 --- a/qt-ui/configuredivecomputerdialog.cpp +++ b/qt-ui/configuredivecomputerdialog.cpp @@ -7,6 +7,8 @@ #include "../display.h" #include "../divelist.h" #include "configuredivecomputer.h" +#include <QInputDialog> + struct product { const char *product; dc_descriptor_t *descriptor; @@ -185,3 +187,26 @@ void ConfigureDiveComputerDialog::on_cancel_clicked() { this->close(); } + +void ConfigureDiveComputerDialog::on_setDeviceName_clicked() +{ + ui->statusLabel->clear(); + ui->errorLabel->clear(); + ui->availableDetails->clear(); + + QString newDeviceName = QInputDialog::getText(this, tr("Set device name"), tr("Enter the new name for this device:")); + if (newDeviceName.length() > 0) { + getDeviceData(); + config->setDeviceName(&device_data, newDeviceName); + } +} + +void ConfigureDiveComputerDialog::on_setDateAndTime_clicked() +{ + ui->statusLabel->clear(); + ui->errorLabel->clear(); + ui->availableDetails->clear(); + + getDeviceData(); + config->setDeviceDateAndTime(&device_data, QDateTime::currentDateTime()); +} |