summaryrefslogtreecommitdiffstats
path: root/gui/MainWindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gui/MainWindow.cpp')
-rw-r--r--gui/MainWindow.cpp15
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)