Showing the changes to interface/src/ui/UpdateDialog.cpp (1 of 4 files). Show all
Unified · Split
| @@ -19,17 +19,18 @@ · 18 unmodified lines | ||
| 19 | 19 | #include "SharedUtil.h" |
| 20 | 20 | #include "UpdateDialog.h" |
| 21 | 21 | |
| 22 | −UpdateDialog::UpdateDialog(QWidget *parent, QString releaseNotes, QString latestVersion, QUrl downloadURL) : QDialog(parent, Qt::Dialog) { | |
| 22 | +UpdateDialog::UpdateDialog(QWidget *parent, QString releaseNotes, QString latestVersion, QUrl downloadURL) : | |
| 23 | + QDialog(parent, Qt::Dialog) { | |
| 24 | + | |
| 23 | 25 | Application* application = Application::getInstance(); |
| 24 | 26 | |
| 25 | 27 | QUiLoader updateDialogLoader; |
| 26 | 28 | |
| 27 | 29 | QFile updateDialogUi("resources/ui/updateDialog.ui"); |
| 28 | 30 | updateDialogUi.open(QFile::ReadOnly); |
| 29 | − _dialogWidget = updateDialogLoader.load(&updateDialogUi, parent); | |
| 30 | − updateDialogUi.close(); | |
| 31 | + _dialogWidget = updateDialogLoader.load(&updateDialogUi, this); | |
| 31 | 32 | |
| 32 | − const QString updateRequired = QString("You are currently running build %1, the latest build released is %2. \ | |
| 33 | + QString updateRequired = QString("You are currently running build %1, the latest build released is %2. \ | |
| 33 | 34 | Please download and install the most recent release to access the latest features and bug fixes.") |
| 34 | 35 | .arg(application->applicationVersion(), latestVersion); |
| 35 | 36 | |
| @@ -43,22 +44,22 @@ UpdateDialog::UpdateDialog(QWidget *parent, QString releaseNotes, QString latest · 7 unmodified lines | ||
| 43 | 44 | |
| 44 | 45 | updateContent->setText(updateRequired); |
| 45 | 46 | |
| 46 | − connect(downloadButton, SIGNAL(released()), this, SLOT(handleDownload(QUrl downloadURL))); | |
| 47 | + connect(downloadButton, SIGNAL(released()), this, SLOT(handleDownload())); | |
| 47 | 48 | connect(skipButton, SIGNAL(released()), this, SLOT(handleSkip())); |
| 48 | 49 | connect(closeButton, SIGNAL(released()), this, SLOT(handleClose())); |
| 49 | 50 | _dialogWidget->show(); |
| 50 | 51 | } |
| 51 | 52 | |
| 52 | −void UpdateDialog::handleDownload(QUrl downloadURL) { | |
| 53 | +void UpdateDialog::handleDownload() { | |
| 53 | 54 | Application* application = Application::getInstance(); |
| 54 | − QDesktopServices::openUrl(downloadURL); | |
| 55 | + QDesktopServices::openUrl(application->_downloadUrl); | |
| 55 | 56 | application->quit(); |
| 56 | 57 | } |
| 57 | 58 | |
| 58 | 59 | void UpdateDialog::handleSkip() { |
| 59 | − this->_dialogWidget->close(); | |
| 60 | + this->close(); | |
| 60 | 61 | } |
| 61 | 62 | |
| 62 | 63 | void UpdateDialog::handleClose() { |
| 63 | − this->_dialogWidget->close(); | |
| 64 | + this->close(); | |
| 64 | 65 | } |