History

Pull Request fixes

Leonardo Murillo committed 12 years ago

Commit cd9f2fd1 parent 865045a4 files · +36 −43Browse files

Showing the changes to interface/src/ui/UpdateDialog.cpp (1 of 4 files). Show all

Unified · Split

interface/src/ui/UpdateDialog.cpp+10−9
@@ -19,17 +19,18 @@ · 18 unmodified lines
1919 #include "SharedUtil.h"
2020 #include "UpdateDialog.h"
2121
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+
2325 Application* application = Application::getInstance();
2426
2527 QUiLoader updateDialogLoader;
2628
2729 QFile updateDialogUi("resources/ui/updateDialog.ui");
2830 updateDialogUi.open(QFile::ReadOnly);
29− _dialogWidget = updateDialogLoader.load(&updateDialogUi, parent);
30− updateDialogUi.close();
31+ _dialogWidget = updateDialogLoader.load(&updateDialogUi, this);
3132
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. \
3334 Please download and install the most recent release to access the latest features and bug fixes.")
3435 .arg(application->applicationVersion(), latestVersion);
3536
@@ -43,22 +44,22 @@ UpdateDialog::UpdateDialog(QWidget *parent, QString releaseNotes, QString latest · 7 unmodified lines
4344
4445 updateContent->setText(updateRequired);
4546
46− connect(downloadButton, SIGNAL(released()), this, SLOT(handleDownload(QUrl downloadURL)));
47+ connect(downloadButton, SIGNAL(released()), this, SLOT(handleDownload()));
4748 connect(skipButton, SIGNAL(released()), this, SLOT(handleSkip()));
4849 connect(closeButton, SIGNAL(released()), this, SLOT(handleClose()));
4950 _dialogWidget->show();
5051 }
5152
52−void UpdateDialog::handleDownload(QUrl downloadURL) {
53+void UpdateDialog::handleDownload() {
5354 Application* application = Application::getInstance();
54− QDesktopServices::openUrl(downloadURL);
55+ QDesktopServices::openUrl(application->_downloadUrl);
5556 application->quit();
5657 }
5758
5859 void UpdateDialog::handleSkip() {
59− this->_dialogWidget->close();
60+ this->close();
6061 }
6162
6263 void UpdateDialog::handleClose() {
63− this->_dialogWidget->close();
64+ this->close();
6465 }