diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2018-09-20 14:19:03 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-09-23 11:49:30 -0700 |
commit | e2ee8c57dfd85d26c3697f5c5f0e7f45e462be1e (patch) | |
tree | 6828cd6015055b00d246f56f5da8b6cebbbc4452 /desktop-widgets/downloadfromdivecomputer.cpp | |
parent | 77a5c9ac65d25000a64cf48fb2138c302cb0b116 (diff) | |
download | subsurface-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>
Diffstat (limited to 'desktop-widgets/downloadfromdivecomputer.cpp')
-rw-r--r-- | desktop-widgets/downloadfromdivecomputer.cpp | 13 |
1 files changed, 13 insertions, 0 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); |