mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
a7c9b25b05
commit
3e127a059f
5 changed files with 156 additions and 9 deletions
|
@ -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());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue