• R/O
  • HTTP
  • SSH
  • HTTPS

LameXP: Commit

LameXP development repository


Commit MetaInfo

Revision3073ceb312f3cc290655d20c2c82791592205985 (tree)
Time2020-09-06 05:04:00
AuthorLoRd_MuldeR <mulder2@gmx....>
CommiterLoRd_MuldeR

Log Message

Small improvement to UpdateDialog.

Change Summary

Incremental Difference

--- a/src/Config.h
+++ b/src/Config.h
@@ -35,7 +35,7 @@
3535 #define VER_LAMEXP_MINOR_LO 9
3636 #define VER_LAMEXP_TYPE Beta
3737 #define VER_LAMEXP_PATCH 2
38-#define VER_LAMEXP_BUILD 2278
38+#define VER_LAMEXP_BUILD 2279
3939 #define VER_LAMEXP_CONFG 2188
4040
4141 ///////////////////////////////////////////////////////////////////////////////
--- a/src/Dialog_MainWindow.cpp
+++ b/src/Dialog_MainWindow.cpp
@@ -937,8 +937,9 @@ void MainWindow::addFolder(const QString &path, bool recursive, bool delayed, QS
937937 /*
938938 * Check for updates
939939 */
940-bool MainWindow::checkForUpdates(void)
940+bool MainWindow::checkForUpdates(bool &haveNewVersion)
941941 {
942+ haveNewVersion = false;
942943 bool bReadyToInstall = false;
943944
944945 UpdateDialog *updateDialog = new UpdateDialog(m_settings, this);
@@ -948,6 +949,7 @@ bool MainWindow::checkForUpdates(void)
948949 {
949950 SHOW_CORNER_WIDGET(false);
950951 m_settings->autoUpdateLastCheck(QDate::currentDate().toString(Qt::ISODate));
952+ haveNewVersion = updateDialog->haveNewVersion();
951953 bReadyToInstall = updateDialog->updateReadyToInstall();
952954 }
953955
@@ -1513,14 +1515,22 @@ void MainWindow::windowShown(void)
15131515 {
15141516 if(MUtils::OS::current_date() >= lamexp_version_expires())
15151517 {
1516- qWarning("Binary has expired !!!");
1518+ qWarning("Binary expired !!!");
15171519 PLAY_SOUND_OPTIONAL("whammy", false);
1520+ bool haveNewVersion = true;
15181521 if(QMessageBox::warning(this, tr("LameXP - Expired"), NOBREAK(QString("%1<br>%2").arg(tr("This demo (pre-release) version of LameXP has expired at %1.").arg(lamexp_version_expires().toString(Qt::ISODate)), tr("LameXP is free software and release versions won't expire."))), tr("Check for Updates"), tr("Exit Program")) == 0)
15191522 {
1520- checkForUpdates();
1523+ if (checkForUpdates(haveNewVersion))
1524+ {
1525+ QApplication::quit();
1526+ return;
1527+ }
1528+ }
1529+ if(haveNewVersion)
1530+ {
1531+ QApplication::quit();
1532+ return;
15211533 }
1522- QApplication::quit();
1523- return;
15241534 }
15251535 }
15261536
@@ -1546,7 +1556,8 @@ void MainWindow::windowShown(void)
15461556 switch(ret)
15471557 {
15481558 case 0:
1549- if(checkForUpdates())
1559+ bool haveNewVersion;
1560+ if(checkForUpdates(haveNewVersion))
15501561 {
15511562 QApplication::quit();
15521563 return;
@@ -1572,7 +1583,8 @@ void MainWindow::windowShown(void)
15721583 {
15731584 if(QMessageBox::information(this, tr("Update Reminder"), NOBREAK(lastUpdateCheck.isValid() ? tr("Your last update check was more than 14 days ago. Check for updates now?") : tr("Your did not check for LameXP updates yet. Check for updates now?")), tr("Check for Updates"), tr("Postpone")) == 0)
15741585 {
1575- if(checkForUpdates())
1586+ bool haveNewVersion;
1587+ if(checkForUpdates(haveNewVersion))
15761588 {
15771589 QApplication::quit();
15781590 return;
@@ -2266,7 +2278,8 @@ void MainWindow::checkForBetaUpdatesActionTriggered(bool checked)
22662278
22672279 if(checkUpdatesNow)
22682280 {
2269- if(checkForUpdates())
2281+ bool haveNewVersion;
2282+ if(checkForUpdates(haveNewVersion))
22702283 {
22712284 QApplication::quit();
22722285 }
@@ -2369,7 +2382,8 @@ void MainWindow::checkUpdatesActionActivated(void)
23692382 ABORT_IF_BUSY;
23702383 WidgetHideHelper hiderHelper(m_dropBox.data());
23712384
2372- if(checkForUpdates())
2385+ bool haveNewVersion;
2386+ if(checkForUpdates(haveNewVersion))
23732387 {
23742388 QApplication::quit();
23752389 }
--- a/src/Dialog_MainWindow.h
+++ b/src/Dialog_MainWindow.h
@@ -208,7 +208,7 @@ private:
208208
209209 void addFiles(const QStringList &files);
210210 void addFolder(const QString &path, bool recursive = false, bool delayed = false, QString filter = QString());
211- bool checkForUpdates(void);
211+ bool MainWindow::checkForUpdates(bool &haveNewVersion);
212212 void initializeTranslation(void);
213213 void refreshFavorites(void);
214214 void openDocumentLink(QAction *const action);
--- a/src/Dialog_Update.cpp
+++ b/src/Dialog_Update.cpp
@@ -79,6 +79,7 @@ UpdateDialog::UpdateDialog(const SettingsModel *const settings, QWidget *parent)
7979 m_logFile(new QStringList()),
8080 m_betaUpdates(settings ? (settings->autoUpdateCheckBeta() || lamexp_version_demo()) : lamexp_version_demo()),
8181 m_success(false),
82+ m_haveNewVersion(false),
8283 m_firstShow(true),
8384 m_updateReadyToInstall(false),
8485 m_updaterProcess(NULL),
@@ -357,9 +358,9 @@ void UpdateDialog::threadFinished(void)
357358 }
358359 else
359360 {
360- const bool bHaveUpdate = (m_thread->getUpdateStatus() == MUtils::UpdateChecker::UpdateStatus_CompletedUpdateAvailable);
361- ui->installButton->setEnabled(bHaveUpdate);
362- MUtils::Sound::beep(bHaveUpdate ? MUtils::Sound::BEEP_NFO : MUtils::Sound::BEEP_WRN);
361+ const bool bHaveNewVersion = (m_thread->getUpdateStatus() == MUtils::UpdateChecker::UpdateStatus_CompletedUpdateAvailable);
362+ ui->installButton->setEnabled(bHaveNewVersion);
363+ MUtils::Sound::beep(bHaveNewVersion ? MUtils::Sound::BEEP_NFO : MUtils::Sound::BEEP_WRN);
363364
364365 if(const MUtils::UpdateCheckerInfo *const updateInfo = m_thread->getUpdateInfo())
365366 {
@@ -369,6 +370,7 @@ void UpdateDialog::threadFinished(void)
369370 }
370371
371372 m_success = true;
373+ m_haveNewVersion = bHaveNewVersion;
372374 }
373375
374376 ui->retryButton->setVisible(!bSuccess);
--- a/src/Dialog_Update.h
+++ b/src/Dialog_Update.h
@@ -51,6 +51,7 @@ public:
5151
5252 bool getSuccess(void) { return m_success; }
5353 bool updateReadyToInstall(void) { return m_updateReadyToInstall; }
54+ bool haveNewVersion(void) { return m_haveNewVersion; }
5455
5556 private slots:
5657 void updateInit(void);
@@ -90,6 +91,7 @@ private:
9091 unsigned long m_updaterProcess;
9192
9293 bool m_success;
94+ bool m_haveNewVersion;
9395 bool m_updateReadyToInstall;
9496 bool m_firstShow;
9597
Show on old repository browser