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 | #include "SharedUtil.h" | 19 | #include "SharedUtil.h" |
| 20 | #include "UpdateDialog.h" | 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 | Application* application = Application::getInstance(); | 25 | Application* application = Application::getInstance(); |
| 24 | 26 | ||
| 25 | QUiLoader updateDialogLoader; | 27 | QUiLoader updateDialogLoader; |
| 26 | 28 | ||
| 27 | QFile updateDialogUi("resources/ui/updateDialog.ui"); | 29 | QFile updateDialogUi("resources/ui/updateDialog.ui"); |
| 28 | updateDialogUi.open(QFile::ReadOnly); | 30 | updateDialogUi.open(QFile::ReadOnly); |
| 29 | _dialogWidget = updateDialogLoader.load(&updateDialogUi, parent); | 31 | _dialogWidget = updateDialogLoader.load(&updateDialogUi, this); |
| 30 | updateDialogUi.close(); | ||
| 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 | Please download and install the most recent release to access the latest features and bug fixes.") | 34 | Please download and install the most recent release to access the latest features and bug fixes.") |
| 34 | .arg(application->applicationVersion(), latestVersion); | 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 | updateContent->setText(updateRequired); | 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 | connect(skipButton, SIGNAL(released()), this, SLOT(handleSkip())); | 48 | connect(skipButton, SIGNAL(released()), this, SLOT(handleSkip())); |
| 48 | connect(closeButton, SIGNAL(released()), this, SLOT(handleClose())); | 49 | connect(closeButton, SIGNAL(released()), this, SLOT(handleClose())); |
| 49 | _dialogWidget->show(); | 50 | _dialogWidget->show(); |
| 50 | } | 51 | } |
| 51 | 52 | ||
| 52 | void UpdateDialog::handleDownload(QUrl downloadURL) { | 53 | void UpdateDialog::handleDownload() { |
| 53 | Application* application = Application::getInstance(); | 54 | Application* application = Application::getInstance(); |
| 54 | QDesktopServices::openUrl(downloadURL); | 55 | QDesktopServices::openUrl(application->_downloadUrl); |
| 55 | application->quit(); | 56 | application->quit(); |
| 56 | } | 57 | } |
| 57 | 58 | ||
| 58 | void UpdateDialog::handleSkip() { | 59 | void UpdateDialog::handleSkip() { |
| 59 | this->_dialogWidget->close(); | 60 | this->close(); |
| 60 | } | 61 | } |
| 61 | 62 | ||
| 62 | void UpdateDialog::handleClose() { | 63 | void UpdateDialog::handleClose() { |
| 63 | this->_dialogWidget->close(); | 64 | this->close(); |
| 64 | } | 65 | } |