summaryrefslogtreecommitdiffstats
path: root/qt-ui/configuredivecomputerdialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui/configuredivecomputerdialog.cpp')
-rw-r--r--qt-ui/configuredivecomputerdialog.cpp25
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());
+}