Update downloadfromdivecomputer.cpp

Changed DDC<n> to DeleteDC<n> and hide set visibility for new Qframe

Signed-off-by: jme <32236882+notrege@users.noreply.github.com>
This commit is contained in:
jme 2024-04-21 14:18:02 +01:00 committed by Michael Keller
parent d59bd1831a
commit 7fb0e9e59e

View file

@ -117,13 +117,15 @@ DownloadFromDCWidget::DownloadFromDCWidget(const QString &filename, QWidget *par
#define SETUPDC(num) \ #define SETUPDC(num) \
if (!qPrefDiveComputer::vendor##num().isEmpty()) { \ if (!qPrefDiveComputer::vendor##num().isEmpty()) { \
ui.DC##num->setVisible(true); \ ui.DC##num->setVisible(true); \
ui.DDC##num->setVisible(true); \ ui.DCFrame##num->setVisible(true); \
ui.DeleteDC##num->setVisible(true); \
ui.DC##num->setText(qPrefDiveComputer::vendor##num() + " - " + qPrefDiveComputer::product##num()); \ ui.DC##num->setText(qPrefDiveComputer::vendor##num() + " - " + qPrefDiveComputer::product##num()); \
connect(ui.DC##num, &QPushButton::clicked, this, &DownloadFromDCWidget::DC##num##Clicked, Qt::UniqueConnection); \ connect(ui.DC##num, &QPushButton::clicked, this, &DownloadFromDCWidget::DC##num##Clicked, Qt::UniqueConnection); \
connect(ui.DDC##num, &QPushButton::clicked, this, &DownloadFromDCWidget::DDC##num##Clicked, Qt::UniqueConnection); \ connect(ui.DeleteDC##num, &QPushButton::clicked, this, &DownloadFromDCWidget::DeleteDC##num##Clicked, Qt::UniqueConnection); \
} else { \ } else { \
ui.DC##num->setVisible(false); \ ui.DC##num->setVisible(false); \
ui.DDC##num->setVisible(false); \ ui.DCFrame##num->setVisible(false); \
ui.DeleteDC##num->setVisible(false); \
} }
void DownloadFromDCWidget::showRememberedDCs() void DownloadFromDCWidget::showRememberedDCs()
@ -176,11 +178,11 @@ DCBUTTON(3)
DCBUTTON(4) DCBUTTON(4)
// Delete DC button slots // Delete DC button slots
#define DDCBUTTON(num) \ #define DELETEDCBUTTON(num) \
void DownloadFromDCWidget::DDC##num##Clicked() \ void DownloadFromDCWidget::DeleteDC##num##Clicked() \
{ \ { \
ui.DC##num->setVisible(false); \ ui.DC##num->setVisible(false); \
ui.DDC##num->setVisible(false); \ ui.DeleteDC##num->setVisible(false); \
int dc = num; \ int dc = num; \
switch (dc) { \ switch (dc) { \
case 1: \ case 1: \
@ -206,10 +208,10 @@ void DownloadFromDCWidget::DDC##num##Clicked() \
DownloadFromDCWidget::showRememberedDCs(); \ DownloadFromDCWidget::showRememberedDCs(); \
} }
DDCBUTTON(1) DELETEDCBUTTON(1)
DDCBUTTON(2) DELETEDCBUTTON(2)
DDCBUTTON(3) DELETEDCBUTTON(3)
DDCBUTTON(4) DELETEDCBUTTON(4)
void DownloadFromDCWidget::updateProgressBar() void DownloadFromDCWidget::updateProgressBar()
{ {