Skip to content

Commit

Permalink
Remove taskbar progres indicator during download
Browse files Browse the repository at this point in the history
  • Loading branch information
Abestanis committed Oct 9, 2024
1 parent 06d20bd commit 9d2f565
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 39 deletions.
30 changes: 1 addition & 29 deletions src/updatedownloaddialog.cpp
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
#include "updatedownloaddialog.h"
#include "ui_updatedownloaddialog.h"

#ifdef Q_OS_WIN
//# include <QtWinExtras/QWinTaskbarProgress>
#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);
Expand All @@ -20,9 +13,6 @@ UpdateDownloadDialog::UpdateDownloadDialog(QWidget* parent) :
}

UpdateDownloadDialog::~UpdateDownloadDialog() {
#ifdef Q_OS_WIN
// delete taskBarButton;
#endif
delete ui;
actionButton->deleteLater();
}
Expand All @@ -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();
Expand All @@ -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(
Expand All @@ -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 {
Expand All @@ -89,7 +64,4 @@ void UpdateDownloadDialog::onActionPressed() {

void UpdateDownloadDialog::showEvent(QShowEvent* event) {
QDialog::showEvent(event);
#ifdef Q_OS_WIN
// taskBarButton->setWindow(windowHandle());
#endif
}
10 changes: 0 additions & 10 deletions src/updatedownloaddialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
#include <QDialog>
#include <QPushButton>

#ifdef Q_OS_WIN
//# include <QtWinExtras/QWinTaskbarButton>
#endif

namespace Ui {
class UpdateDownloadDialog;
Expand Down Expand Up @@ -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

0 comments on commit 9d2f565

Please sign in to comment.