diff options
author | Petr Mrázek <peterix@gmail.com> | 2015-02-08 17:56:14 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2015-04-12 20:57:17 +0200 |
commit | 4730f54df7edf4775dfddf45f77c60edd86c32d9 (patch) | |
tree | 22fe05326976cbdadf150c1cfe0710f375e34edf /gui/MainWindow.cpp | |
parent | 7a71ecd8af0454e405b25080a4b266fc99306269 (diff) | |
download | MultiMC-4730f54df7edf4775dfddf45f77c60edd86c32d9.tar MultiMC-4730f54df7edf4775dfddf45f77c60edd86c32d9.tar.gz MultiMC-4730f54df7edf4775dfddf45f77c60edd86c32d9.tar.lz MultiMC-4730f54df7edf4775dfddf45f77c60edd86c32d9.tar.xz MultiMC-4730f54df7edf4775dfddf45f77c60edd86c32d9.zip |
SCRATCH separate the generic updater logic from the application
Diffstat (limited to 'gui/MainWindow.cpp')
-rw-r--r-- | gui/MainWindow.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/gui/MainWindow.cpp b/gui/MainWindow.cpp index 1b76e6af..0b0af7f4 100644 --- a/gui/MainWindow.cpp +++ b/gui/MainWindow.cpp @@ -369,7 +369,7 @@ namespace Ui { #include "logic/auth/flows/AuthenticateTask.h" #include "logic/auth/flows/RefreshTask.h" -#include "logic/updater/DownloadUpdateTask.h" +#include "logic/updater/DownloadTask.h" #include "logic/news/NewsChecker.h" @@ -913,7 +913,7 @@ void MainWindow::updateNewsLabel() } } -void MainWindow::updateAvailable(QString repo, QString versionName, int versionId) +void MainWindow::updateAvailable(GoUpdate::Status status) { UpdateDialog dlg; UpdateAction action = (UpdateAction)dlg.exec(); @@ -923,10 +923,10 @@ void MainWindow::updateAvailable(QString repo, QString versionName, int versionI qDebug() << "Update will be installed later."; break; case UPDATE_NOW: - downloadUpdates(repo, versionId); + downloadUpdates(status); break; case UPDATE_ONEXIT: - downloadUpdates(repo, versionId, true); + downloadUpdates(status, true); break; } } @@ -977,7 +977,7 @@ void MainWindow::notificationsChanged() MMC->settings()->set("ShownNotifications", intListToString(shownNotifications)); } -void MainWindow::downloadUpdates(QString repo, int versionId, bool installOnExit) +void MainWindow::downloadUpdates(GoUpdate::Status status, bool installOnExit) { qDebug() << "Downloading updates."; // TODO: If the user chooses to update on exit, we should download updates in the @@ -985,7 +985,9 @@ void MainWindow::downloadUpdates(QString repo, int versionId, bool installOnExit // Doing so is a bit complicated, because we'd have to make sure it finished downloading // before actually exiting MultiMC. ProgressDialog updateDlg(this); - DownloadUpdateTask updateTask(MMC->root(), repo, versionId, &updateDlg); + status.rootPath = MMC->rootPath; + + GoUpdate::DownloadTask updateTask(status, &updateDlg); // If the task succeeds, install the updates. if (updateDlg.exec(&updateTask)) { @@ -1827,6 +1829,7 @@ void MainWindow::launchInstance(InstancePtr instance, AuthSessionPtr session, console = new ConsoleWindow(proc); connect(console, SIGNAL(isClosing()), this, SLOT(instanceEnded())); + proc->setHeader("MultiMC version: " + BuildConfig.printableVersionString() + "\n\n"); proc->arm(); if (profiler) |