mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Don't allow writing before we got data
Don't allow creation of backup files or writes to the computer before we know we got some data, either from a backup file or from the actual device. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
51ef56fbcb
commit
40bc4b629a
2 changed files with 20 additions and 0 deletions
|
@ -324,6 +324,10 @@ void ConfigureDiveComputerDialog::deviceDetailsReceived(DeviceDetails *newDevice
|
||||||
|
|
||||||
void ConfigureDiveComputerDialog::reloadValues()
|
void ConfigureDiveComputerDialog::reloadValues()
|
||||||
{
|
{
|
||||||
|
// Enable the buttons to do operations on this data
|
||||||
|
ui->saveSettingsPushButton->setEnabled(true);
|
||||||
|
ui->backupButton->setEnabled(true);
|
||||||
|
|
||||||
switch(ui->dcStackedWidget->currentIndex()) {
|
switch(ui->dcStackedWidget->currentIndex()) {
|
||||||
case 0:
|
case 0:
|
||||||
reloadValuesOSTC3();
|
reloadValuesOSTC3();
|
||||||
|
@ -525,6 +529,10 @@ void ConfigureDiveComputerDialog::on_updateFirmwareButton_clicked()
|
||||||
|
|
||||||
void ConfigureDiveComputerDialog::on_DiveComputerList_currentRowChanged(int currentRow)
|
void ConfigureDiveComputerDialog::on_DiveComputerList_currentRowChanged(int currentRow)
|
||||||
{
|
{
|
||||||
|
// Disable the buttons to do operations on this data
|
||||||
|
ui->saveSettingsPushButton->setEnabled(false);
|
||||||
|
ui->backupButton->setEnabled(false);
|
||||||
|
|
||||||
switch (currentRow) {
|
switch (currentRow) {
|
||||||
case 0:
|
case 0:
|
||||||
selected_vendor = "Heinrichs Weikamp";
|
selected_vendor = "Heinrichs Weikamp";
|
||||||
|
|
|
@ -57,6 +57,12 @@
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="saveSettingsPushButton">
|
<widget class="QPushButton" name="saveSettingsPushButton">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Read settnings from backup file or from device before writing to the device</string>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Save changes to device</string>
|
<string>Save changes to device</string>
|
||||||
</property>
|
</property>
|
||||||
|
@ -77,6 +83,12 @@
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="backupButton">
|
<widget class="QPushButton" name="backupButton">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Read settnings from backup file or from device before writing to a backup file</string>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Backup</string>
|
<string>Backup</string>
|
||||||
</property>
|
</property>
|
||||||
|
|
Loading…
Add table
Reference in a new issue