From e2ee8c57dfd85d26c3697f5c5f0e7f45e462be1e Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Thu, 20 Sep 2018 14:19:03 -0700 Subject: 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 | 110 ++++++++++++++++----------- 2 files changed, 78 insertions(+), 45 deletions(-) (limited to 'desktop-widgets') 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 @@ 5 - - + + - Device or mount point - - - - - - - true + Force download of all dives - - + + - ... + Dive computer - - - - Force download of all dives - - + + - + Always prefer downloaded dives - - + + - Download into new trip + Save libdivecomputer logfile - - + + + + true + + + + + - Save libdivecomputer logfile + Choose Bluetooth download mode - - + + + + Select a remote Bluetooth device. + ... - - + + - Save libdivecomputer dumpfile + ... - + ... - - + + - Choose Bluetooth download mode + Device or mount point - - - - Select a remote Bluetooth device. - + + ... @@ -140,19 +136,43 @@ - - + + + + Download into new trip + + - - + + - Dive computer + Save libdivecomputer dumpfile + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3-70-g09d2