From 7fb0e9e59e84b98fe2dd2c91973334c4b6e0eb15 Mon Sep 17 00:00:00 2001 From: jme <32236882+notrege@users.noreply.github.com> Date: Sun, 21 Apr 2024 14:18:02 +0100 Subject: [PATCH] Update downloadfromdivecomputer.cpp Changed DDC to DeleteDC and hide set visibility for new Qframe Signed-off-by: jme <32236882+notrege@users.noreply.github.com> --- desktop-widgets/downloadfromdivecomputer.cpp | 24 +++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/desktop-widgets/downloadfromdivecomputer.cpp b/desktop-widgets/downloadfromdivecomputer.cpp index 73880e9e6..a1ae7fd42 100644 --- a/desktop-widgets/downloadfromdivecomputer.cpp +++ b/desktop-widgets/downloadfromdivecomputer.cpp @@ -117,13 +117,15 @@ DownloadFromDCWidget::DownloadFromDCWidget(const QString &filename, QWidget *par #define SETUPDC(num) \ if (!qPrefDiveComputer::vendor##num().isEmpty()) { \ 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()); \ 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 { \ ui.DC##num->setVisible(false); \ - ui.DDC##num->setVisible(false); \ + ui.DCFrame##num->setVisible(false); \ + ui.DeleteDC##num->setVisible(false); \ } void DownloadFromDCWidget::showRememberedDCs() @@ -176,11 +178,11 @@ DCBUTTON(3) DCBUTTON(4) // Delete DC button slots -#define DDCBUTTON(num) \ -void DownloadFromDCWidget::DDC##num##Clicked() \ +#define DELETEDCBUTTON(num) \ +void DownloadFromDCWidget::DeleteDC##num##Clicked() \ { \ ui.DC##num->setVisible(false); \ - ui.DDC##num->setVisible(false); \ + ui.DeleteDC##num->setVisible(false); \ int dc = num; \ switch (dc) { \ case 1: \ @@ -203,13 +205,13 @@ void DownloadFromDCWidget::DDC##num##Clicked() \ qPrefDiveComputer::set_vendor(qPrefDiveComputer::vendor1()); \ qPrefDiveComputer::set_product(qPrefDiveComputer::product1()); \ qPrefDiveComputer::set_device(qPrefDiveComputer::device1()); \ - DownloadFromDCWidget::showRememberedDCs(); \ + DownloadFromDCWidget::showRememberedDCs(); \ } -DDCBUTTON(1) -DDCBUTTON(2) -DDCBUTTON(3) -DDCBUTTON(4) +DELETEDCBUTTON(1) +DELETEDCBUTTON(2) +DELETEDCBUTTON(3) +DELETEDCBUTTON(4) void DownloadFromDCWidget::updateProgressBar() {