diff options
author | Petr Mrázek <peterix@gmail.com> | 2014-07-14 00:57:54 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2014-07-14 00:57:54 +0200 |
commit | 3821569363bdc13c59704c2f37c5de9fee5a21e2 (patch) | |
tree | c30fd938bf3f7076084916a1a0980115341445d6 /gui | |
parent | d8d6f5929b1a0104b31d381a45799849c6d82636 (diff) | |
download | MultiMC-3821569363bdc13c59704c2f37c5de9fee5a21e2.tar MultiMC-3821569363bdc13c59704c2f37c5de9fee5a21e2.tar.gz MultiMC-3821569363bdc13c59704c2f37c5de9fee5a21e2.tar.lz MultiMC-3821569363bdc13c59704c2f37c5de9fee5a21e2.tar.xz MultiMC-3821569363bdc13c59704c2f37c5de9fee5a21e2.zip |
Show changelog even when there are no new updates available.
Diffstat (limited to 'gui')
-rw-r--r-- | gui/MainWindow.cpp | 14 | ||||
-rw-r--r-- | gui/MainWindow.h | 2 | ||||
-rw-r--r-- | gui/dialogs/SettingsDialog.cpp | 2 | ||||
-rw-r--r-- | gui/dialogs/UpdateDialog.cpp | 13 | ||||
-rw-r--r-- | gui/dialogs/UpdateDialog.h | 2 |
5 files changed, 23 insertions, 10 deletions
diff --git a/gui/MainWindow.cpp b/gui/MainWindow.cpp index bee250c4..552f6a2d 100644 --- a/gui/MainWindow.cpp +++ b/gui/MainWindow.cpp @@ -305,12 +305,8 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi auto updater = MMC->updateChecker(); connect(updater.get(), &UpdateChecker::updateAvailable, this, &MainWindow::updateAvailable); - connect(updater.get(), &UpdateChecker::noUpdateFound, [this]() - { - CustomMessageBox::selectable( - this, tr("No update found."), - tr("No MultiMC update was found!\nYou are using the latest version."))->exec(); - }); + connect(updater.get(), &UpdateChecker::noUpdateFound, this, + &MainWindow::updateNotAvailable); // if automatic update checks are allowed, start one. if (MMC->settings()->get("AutoUpdate").toBool()) on_actionCheckUpdate_triggered(); @@ -621,6 +617,12 @@ void MainWindow::updateAvailable(QString repo, QString versionName, int versionI } } +void MainWindow::updateNotAvailable() +{ + UpdateDialog dlg(false); + dlg.exec(); +} + QList<int> stringToIntList(const QString &string) { QStringList split = string.split(',', QString::SkipEmptyParts); diff --git a/gui/MainWindow.h b/gui/MainWindow.h index 182e9c0c..36ef883b 100644 --- a/gui/MainWindow.h +++ b/gui/MainWindow.h @@ -154,6 +154,8 @@ slots: void updateAvailable(QString repo, QString versionName, int versionId); + void updateNotAvailable(); + void notificationsChanged(); void activeAccountChanged(); diff --git a/gui/dialogs/SettingsDialog.cpp b/gui/dialogs/SettingsDialog.cpp index 5108daa2..46368bc1 100644 --- a/gui/dialogs/SettingsDialog.cpp +++ b/gui/dialogs/SettingsDialog.cpp @@ -73,7 +73,7 @@ SettingsDialog::SettingsDialog(QWidget *parent) : QDialog(parent), ui(new Ui::Se } else { - MMC->updateChecker()->updateChanList(); + MMC->updateChecker()->updateChanList(false); } connect(ui->proxyGroup, SIGNAL(buttonClicked(int)), SLOT(proxyChanged(int))); ui->mceditLink->setOpenExternalLinks(true); diff --git a/gui/dialogs/UpdateDialog.cpp b/gui/dialogs/UpdateDialog.cpp index 25cfa853..29d09ead 100644 --- a/gui/dialogs/UpdateDialog.cpp +++ b/gui/dialogs/UpdateDialog.cpp @@ -5,12 +5,21 @@ #include "MultiMC.h" #include <logic/settings/SettingsObject.h> -UpdateDialog::UpdateDialog(QWidget *parent) : QDialog(parent), ui(new Ui::UpdateDialog) +UpdateDialog::UpdateDialog(bool hasUpdate, QWidget *parent) : QDialog(parent), ui(new Ui::UpdateDialog) { MultiMCPlatform::fixWM_CLASS(this); ui->setupUi(this); auto channel = MMC->settings()->get("UpdateChannel").toString(); - ui->label->setText(tr("A new %1 update is available!").arg(channel)); + if(hasUpdate) + { + ui->label->setText(tr("A new %1 update is available!").arg(channel)); + } + else + { + ui->label->setText(tr("No %1 updates found. You are running the latest version.").arg(channel)); + ui->btnUpdateNow->setDisabled(true); + ui->btnUpdateOnExit->setDisabled(true); + } loadChangelog(); } diff --git a/gui/dialogs/UpdateDialog.h b/gui/dialogs/UpdateDialog.h index 970ef42a..b0a4f143 100644 --- a/gui/dialogs/UpdateDialog.h +++ b/gui/dialogs/UpdateDialog.h @@ -36,7 +36,7 @@ class UpdateDialog : public QDialog Q_OBJECT public: - explicit UpdateDialog(QWidget *parent = 0); + explicit UpdateDialog(bool hasUpdate = true, QWidget *parent = 0); ~UpdateDialog(); private: |