| 25 | namespace Widgets |
| 26 | { |
| 27 | UpdateProgressDialog::UpdateProgressDialog() |
| 28 | { |
| 29 | progressBar = new QProgressBar(this); |
| 30 | progressBar->setMaximum(0); |
| 31 | progressBar->setMinimum(0); |
| 32 | progressBar->setMinimumWidth(width()); |
| 33 | |
| 34 | information = new QLabel(this); |
| 35 | information->setWordWrap(true); |
| 36 | information->setOpenExternalLinks(true); |
| 37 | |
| 38 | cancelUpdate = new QPushButton(tr("Cancel"), this); |
| 39 | cancelUpdate->setToolTip(tr("Close this dialog and abort the update check")); |
| 40 | |
| 41 | auto *mainLayout = new QVBoxLayout(this); |
| 42 | |
| 43 | mainLayout->addWidget(information); |
| 44 | mainLayout->addWidget(progressBar); |
| 45 | mainLayout->addWidget(cancelUpdate); |
| 46 | |
| 47 | setWindowTitle(tr("Update Checker")); |
| 48 | |
| 49 | setModal(false); |
| 50 | |
| 51 | connect(cancelUpdate, &QPushButton::clicked, this, &UpdateProgressDialog::canceled); |
| 52 | connect(cancelUpdate, &QPushButton::clicked, this, &UpdateProgressDialog::close); |
| 53 | } |
| 54 | |
| 55 | void UpdateProgressDialog::start() |
| 56 | { |