From 2985bf302753b88118f99be91d2afa6211d68b36 Mon Sep 17 00:00:00 2001 From: Abestanis Date: Wed, 9 Oct 2024 23:52:26 +0200 Subject: [PATCH] Remove taskbar progres indicator during download --- src/updatedownloaddialog.cpp | 30 +----------------------------- src/updatedownloaddialog.h | 10 ---------- 2 files changed, 1 insertion(+), 39 deletions(-) diff --git a/src/updatedownloaddialog.cpp b/src/updatedownloaddialog.cpp index 40475204..417055d2 100644 --- a/src/updatedownloaddialog.cpp +++ b/src/updatedownloaddialog.cpp @@ -1,16 +1,9 @@ #include "updatedownloaddialog.h" #include "ui_updatedownloaddialog.h" -#ifdef Q_OS_WIN -//# include -#endif - UpdateDownloadDialog::UpdateDownloadDialog(QWidget* parent) : QDialog(parent), ui(new Ui::UpdateDownloadDialog) { -#ifdef Q_OS_WIN -// taskBarButton = new QWinTaskbarButton(this); -#endif ui->setupUi(this); actionButton = new QPushButton(tr("Background"), this); ui->buttonBox->addButton(actionButton, QDialogButtonBox::ButtonRole::ActionRole); @@ -20,9 +13,6 @@ UpdateDownloadDialog::UpdateDownloadDialog(QWidget* parent) : } UpdateDownloadDialog::~UpdateDownloadDialog() { -#ifdef Q_OS_WIN -// delete taskBarButton; -#endif delete ui; actionButton->deleteLater(); } @@ -33,20 +23,12 @@ void UpdateDownloadDialog::reset() { ui->label->setText(tr("Downloading Birdtray installer...")); ui->progressBar->setValue(0); ui->progressBar->show(); -#ifdef Q_OS_WIN -// taskBarButton->progress()->reset(); -// taskBarButton->progress()->show(); -#endif } void UpdateDownloadDialog::onDownloadComplete() { downloadCompleted = true; ui->progressBar->hide(); -#ifdef Q_OS_WIN -// taskBarButton->progress()->setRange(0, 100); -// taskBarButton->progress()->setValue(100); -#endif - actionButton->setText( QCoreApplication::translate("UpdateDialog", "Update and restart")); + actionButton->setText(QCoreApplication::translate("UpdateDialog", "Update and restart")); ui->label->setText(tr("Download finished. Restart and update Birdtray?")); show(); raise(); @@ -57,9 +39,6 @@ void UpdateDownloadDialog::onDownloadProgress(qint64 bytesReceived, qint64 bytes if (bytesTotal <= 0) { ui->label->setText(tr("Downloading Birdtray installer...")); ui->progressBar->setRange(0, 0); -#ifdef Q_OS_WIN -// taskBarButton->progress()->setRange(0, 0); -#endif return; } ui->label->setText( @@ -69,10 +48,6 @@ void UpdateDownloadDialog::onDownloadProgress(qint64 bytesReceived, qint64 bytes int percent = qRound((bytesReceived / (double) bytesTotal) * 100.0); ui->progressBar->setRange(0, 100); ui->progressBar->setValue(percent); -#ifdef Q_OS_WIN -// taskBarButton->progress()->setRange(0, 100); -// taskBarButton->progress()->setValue(percent); -#endif } bool UpdateDownloadDialog::wasCanceled() const { @@ -89,7 +64,4 @@ void UpdateDownloadDialog::onActionPressed() { void UpdateDownloadDialog::showEvent(QShowEvent* event) { QDialog::showEvent(event); -#ifdef Q_OS_WIN -// taskBarButton->setWindow(windowHandle()); -#endif } diff --git a/src/updatedownloaddialog.h b/src/updatedownloaddialog.h index 298ef2e6..b1ce6148 100644 --- a/src/updatedownloaddialog.h +++ b/src/updatedownloaddialog.h @@ -4,9 +4,6 @@ #include #include -#ifdef Q_OS_WIN -//# include -#endif namespace Ui { class UpdateDownloadDialog; @@ -71,13 +68,6 @@ private Q_SLOTS: * The first action button. */ QPushButton* actionButton; - -#ifdef Q_OS_WIN - /** - * The windows task-bar button. - */ -// QWinTaskbarButton* taskBarButton = nullptr; -#endif }; #endif // UPDATE_DOWNLOAD_DIALOG_H