diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 3cbd590914..8377514d8f 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -4418,13 +4418,14 @@ void Application::parseVersionXml(QNetworkReply *reply) { } if (!shouldSkipVersion(latestVersion) && applicationVersion() != latestVersion) { - updateDialog = new UpdateDialog(_glWidget, releaseNotes); + updateDialog = new UpdateDialog(_glWidget, releaseNotes, latestVersion, downloadURL); } } QFile *Application::loadSkipFile() { QString fileName = QStandardPaths::writableLocation(QStandardPaths::DataLocation); fileName.append(QString("/hifi.skipversion")); + qDebug("###### FILENAME %s \n", fileName.toStdString().c_str()); QFile *file = new QFile(fileName); file->open(QIODevice::ReadWrite); return file; @@ -4435,7 +4436,7 @@ bool Application::shouldSkipVersion(QString latestVersion) { QByteArray skipFileContents = skipFile->readAll(); QString *skipVersion = new QString(skipFileContents); skipFile->close(); - if (*skipVersion == latestVersion || applicationVersion() == "0.1") { + if (*skipVersion == latestVersion /*|| applicationVersion() == "0.1"*/) { return true; } return false; diff --git a/interface/src/Application.h b/interface/src/Application.h index b992748224..ce9f2bbaae 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -250,6 +250,8 @@ private slots: void restoreMirrorView(); void shrinkMirrorView(); void resetSensors(); + + void parseVersionXml(QNetworkReply *reply); private: void resetCamerasOnResizeGL(Camera& camera, int width, int height); @@ -497,13 +499,11 @@ private: QString getLocalVoxelCacheFileName(); void updateLocalOctreeCache(bool firstTime = false); - QFile *loadSkipFile(); + QFile* loadSkipFile(); void checkVersion(); void displayUpdateDialog(); bool shouldSkipVersion(QString latestVersion); void skipVersion(QString latestVersion); - - void parseVersionXml(QNetworkReply *reply); }; #endif /* defined(__interface__Application__) */ diff --git a/interface/src/ui/UpdateDialog.cpp b/interface/src/ui/UpdateDialog.cpp index 256183682b..5c4ac2c8fc 100644 --- a/interface/src/ui/UpdateDialog.cpp +++ b/interface/src/ui/UpdateDialog.cpp @@ -23,7 +23,7 @@ UpdateDialog::UpdateDialog(QWidget *parent, QString releaseNotes, QString latest QFile updateDialogUi("resources/ui/updateDialog.ui"); updateDialogUi.open(QFile::ReadOnly); - dialogWidget = updateDialogLoader.load(&updateDialogUi, parent); + _dialogWidget = updateDialogLoader.load(&updateDialogUi, parent); updateDialogUi.close(); const QString updateRequired = QString("You are currently running build %1, the latest build released is %2. \ @@ -33,17 +33,17 @@ UpdateDialog::UpdateDialog(QWidget *parent, QString releaseNotes, QString latest setAttribute(Qt::WA_DeleteOnClose); - QPushButton *downloadButton = dialogWidget->findChild("downloadButton"); - QPushButton *skipButton = dialogWidget->findChild("skipButton"); - QPushButton *closeButton = dialogWidget->findChild("closeButton"); - QLabel *updateContent = dialogWidget->findChild("updateContent"); + QPushButton* downloadButton = _dialogWidget->findChild("downloadButton"); + QPushButton* skipButton = _dialogWidget->findChild("skipButton"); + QPushButton* closeButton = _dialogWidget->findChild("closeButton"); + QLabel* updateContent = _dialogWidget->findChild("updateContent"); updateContent->setText(updateRequired); connect(downloadButton, SIGNAL(released()), this, SLOT(handleDownload(QUrl downloadURL))); connect(skipButton, SIGNAL(released()), this, SLOT(handleSkip())); connect(closeButton, SIGNAL(released()), this, SLOT(handleClose())); - dialogWidget->show(); + _dialogWidget->show(); } void UpdateDialog::handleDownload(QUrl downloadURL) { @@ -53,6 +53,7 @@ void UpdateDialog::handleDownload(QUrl downloadURL) { } void UpdateDialog::handleSkip() { + this->close(); } diff --git a/interface/src/ui/UpdateDialog.h b/interface/src/ui/UpdateDialog.h index f91424c656..dd15cd7efb 100644 --- a/interface/src/ui/UpdateDialog.h +++ b/interface/src/ui/UpdateDialog.h @@ -22,10 +22,9 @@ class UpdateDialog : public QDialog { public: UpdateDialog(QWidget*, QString releaseNotes, QString latestVersion, QUrl downloadURL); - ~UpdateDialog(); private: - QWidget *dialogWidget; + QWidget* _dialogWidget; private slots: void handleDownload(QUrl downloadURL);