From e2ee8c57dfd85d26c3697f5c5f0e7f45e462be1e Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Thu, 20 Sep 2018 14:19:03 -0700 Subject: [PATCH] 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 --- desktop-widgets/downloadfromdivecomputer.cpp | 13 ++ desktop-widgets/downloadfromdivecomputer.ui | 140 +++++++++++-------- 2 files changed, 93 insertions(+), 60 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,10 +46,34 @@ 5 - - + + - Device or mount point + Force download of all dives + + + + + + + Dive computer + + + + + + + + + + Always prefer downloaded dives + + + + + + + Save libdivecomputer logfile @@ -60,6 +84,23 @@ + + + + Choose Bluetooth download mode + + + + + + + Select a remote Bluetooth device. + + + ... + + + @@ -67,67 +108,22 @@ - - - - Force download of all dives - - - - - - - Always prefer downloaded dives - - - - - - - Download into new trip - - - - - - - Save libdivecomputer logfile - - - - - - - ... - - - - - - - Save libdivecomputer dumpfile - - - - + ... - - + + - Choose Bluetooth download mode + Device or mount point - - - - Select a remote Bluetooth device. - + + ... @@ -140,19 +136,43 @@ - - - - - + + - Dive computer + Download into new trip + + + + + + + Save libdivecomputer dumpfile + + + + + + + + + + + + + + + + + + + +