summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2018-09-20 14:19:03 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-09-23 11:49:30 -0700
commite2ee8c57dfd85d26c3697f5c5f0e7f45e462be1e (patch)
tree6828cd6015055b00d246f56f5da8b6cebbbc4452
parent77a5c9ac65d25000a64cf48fb2138c302cb0b116 (diff)
downloadsubsurface-e2ee8c57dfd85d26c3697f5c5f0e7f45e462be1e.tar.gz
Desktop/remember DCs: base UI
Simply create the buttons that can be used as shortcuts to previously used dive computers. This isn't hooked up at all. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--desktop-widgets/downloadfromdivecomputer.cpp13
-rw-r--r--desktop-widgets/downloadfromdivecomputer.ui110
2 files changed, 78 insertions, 45 deletions
diff --git a/desktop-widgets/downloadfromdivecomputer.cpp b/desktop-widgets/downloadfromdivecomputer.cpp
index b37f854bc..2929a25da 100644
--- a/desktop-widgets/downloadfromdivecomputer.cpp
+++ b/desktop-widgets/downloadfromdivecomputer.cpp
@@ -78,6 +78,19 @@ DownloadFromDCWidget::DownloadFromDCWidget(QWidget *parent, Qt::WindowFlags f) :
ui.product->setCurrentIndex(ui.product->findText(qPrefDiveComputer::product()));
}
+ // now lets set the four shortcuts for previously used dive computers
+#define SETUPDC(num) \
+ if (!qPrefDiveComputer::vendor##num().isEmpty()) { \
+ ui.DC##num->setVisible(true); \
+ ui.DC##num->setText(qPrefDiveComputer::vendor##num() + " - " + qPrefDiveComputer::product##num()); \
+ } else { \
+ ui.DC##num->setVisible(false); \
+ }
+ SETUPDC(1)
+ SETUPDC(2)
+ SETUPDC(3)
+ SETUPDC(4)
+
updateState(INITIAL);
ui.ok->setEnabled(false);
ui.downloadCancelRetryButton->setEnabled(true);
diff --git a/desktop-widgets/downloadfromdivecomputer.ui b/desktop-widgets/downloadfromdivecomputer.ui
index 874da643b..bb72cb0c0 100644
--- a/desktop-widgets/downloadfromdivecomputer.ui
+++ b/desktop-widgets/downloadfromdivecomputer.ui
@@ -46,88 +46,84 @@
<property name="verticalSpacing">
<number>5</number>
</property>
- <item row="4" column="0">
- <widget class="QLabel" name="label_3">
+ <item row="7" column="0">
+ <widget class="QCheckBox" name="forceDownload">
<property name="text">
- <string>Device or mount point</string>
- </property>
- </widget>
- </item>
- <item row="5" column="0">
- <widget class="QComboBox" name="device">
- <property name="editable">
- <bool>true</bool>
+ <string>Force download of all dives</string>
</property>
</widget>
</item>
- <item row="5" column="1">
- <widget class="QToolButton" name="search">
+ <item row="2" column="0" colspan="2">
+ <widget class="QLabel" name="label_2">
<property name="text">
- <string>...</string>
+ <string>Dive computer</string>
</property>
</widget>
</item>
- <item row="6" column="0">
- <widget class="QCheckBox" name="forceDownload">
- <property name="text">
- <string>Force download of all dives</string>
- </property>
- </widget>
+ <item row="1" column="0" colspan="2">
+ <widget class="QComboBox" name="vendor"/>
</item>
- <item row="7" column="0">
+ <item row="8" column="0">
<widget class="QCheckBox" name="preferDownloaded">
<property name="text">
<string>Always prefer downloaded dives</string>
</property>
</widget>
</item>
- <item row="8" column="0">
- <widget class="QCheckBox" name="createNewTrip">
+ <item row="10" column="0">
+ <widget class="QCheckBox" name="logToFile">
<property name="text">
- <string>Download into new trip</string>
+ <string>Save libdivecomputer logfile</string>
</property>
</widget>
</item>
- <item row="9" column="0">
- <widget class="QCheckBox" name="logToFile">
+ <item row="5" column="0">
+ <widget class="QComboBox" name="device">
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="12" column="0">
+ <widget class="QCheckBox" name="bluetoothMode">
<property name="text">
- <string>Save libdivecomputer logfile</string>
+ <string>Choose Bluetooth download mode</string>
</property>
</widget>
</item>
- <item row="9" column="1">
- <widget class="QToolButton" name="chooseLogFile">
+ <item row="12" column="1">
+ <widget class="QToolButton" name="chooseBluetoothDevice">
+ <property name="toolTip">
+ <string>Select a remote Bluetooth device.</string>
+ </property>
<property name="text">
<string>...</string>
</property>
</widget>
</item>
- <item row="10" column="0">
- <widget class="QCheckBox" name="dumpToFile">
+ <item row="5" column="1">
+ <widget class="QToolButton" name="search">
<property name="text">
- <string>Save libdivecomputer dumpfile</string>
+ <string>...</string>
</property>
</widget>
</item>
- <item row="10" column="1">
+ <item row="11" column="1">
<widget class="QToolButton" name="chooseDumpFile">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
- <item row="11" column="0">
- <widget class="QCheckBox" name="bluetoothMode">
+ <item row="4" column="0">
+ <widget class="QLabel" name="label_3">
<property name="text">
- <string>Choose Bluetooth download mode</string>
+ <string>Device or mount point</string>
</property>
</widget>
</item>
- <item row="11" column="1">
- <widget class="QToolButton" name="chooseBluetoothDevice">
- <property name="toolTip">
- <string>Select a remote Bluetooth device.</string>
- </property>
+ <item row="10" column="1">
+ <widget class="QToolButton" name="chooseLogFile">
<property name="text">
<string>...</string>
</property>
@@ -140,19 +136,43 @@
</property>
</widget>
</item>
- <item row="1" column="0" colspan="2">
- <widget class="QComboBox" name="vendor"/>
+ <item row="9" column="0">
+ <widget class="QCheckBox" name="createNewTrip">
+ <property name="text">
+ <string>Download into new trip</string>
+ </property>
+ </widget>
</item>
- <item row="2" column="0" colspan="2">
- <widget class="QLabel" name="label_2">
+ <item row="11" column="0">
+ <widget class="QCheckBox" name="dumpToFile">
<property name="text">
- <string>Dive computer</string>
+ <string>Save libdivecomputer dumpfile</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QComboBox" name="product"/>
</item>
+ <item row="6" column="0">
+ <layout class="QGridLayout" name="DCGrid">
+<item row="0" column="0">
+ <widget class="QPushButton" name="DC1">
+ </widget>
+</item>
+<item row="0" column="1">
+ <widget class="QPushButton" name="DC2">
+ </widget>
+</item>
+<item row="1" column="0">
+ <widget class="QPushButton" name="DC3">
+ </widget>
+</item>
+<item row="1" column="1">
+ <widget class="QPushButton" name="DC4">
+ </widget>
+</item>
+</layout>
+ </item>
</layout>
</item>
<item>