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>
This commit is contained in:
Dirk Hohndel 2018-09-20 14:19:03 -07:00
parent 77a5c9ac65
commit e2ee8c57df
2 changed files with 93 additions and 60 deletions

View file

@ -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);