diff options
author | Petr Mrázek <peterix@gmail.com> | 2014-02-25 01:52:58 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2014-02-25 01:52:58 +0100 |
commit | acff15562431d5d9e9f091ed7cf912f5fe34a61a (patch) | |
tree | e78502e7eda84696632be9b6539d386b829053b2 /gui/MainWindow.cpp | |
parent | 49dc9695f5204bb80a91214c411bcb1b868ee0db (diff) | |
parent | 9d4e840a6e1a7169a2863fa1ff1812f8fe19e615 (diff) | |
download | MultiMC-acff15562431d5d9e9f091ed7cf912f5fe34a61a.tar MultiMC-acff15562431d5d9e9f091ed7cf912f5fe34a61a.tar.gz MultiMC-acff15562431d5d9e9f091ed7cf912f5fe34a61a.tar.lz MultiMC-acff15562431d5d9e9f091ed7cf912f5fe34a61a.tar.xz MultiMC-acff15562431d5d9e9f091ed7cf912f5fe34a61a.zip |
Merge branch 'feature_screenshots' into integration_json_and_tools
Conflicts:
logic/net/URLConstants.h
Resolve issues with multiple definitions of URL constants by moving them to their own object file.
Diffstat (limited to 'gui/MainWindow.cpp')
-rw-r--r-- | gui/MainWindow.cpp | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/gui/MainWindow.cpp b/gui/MainWindow.cpp index 121c2a73..17d4630b 100644 --- a/gui/MainWindow.cpp +++ b/gui/MainWindow.cpp @@ -44,7 +44,6 @@ #include "gui/Platform.h" - #include "gui/widgets/LabeledToolButton.h" #include "gui/dialogs/SettingsDialog.h" @@ -62,6 +61,7 @@ #include "gui/dialogs/AccountSelectDialog.h" #include "gui/dialogs/UpdateDialog.h" #include "gui/dialogs/EditAccountDialog.h" +#include "gui/dialogs/ScreenshotDialog.h" #include "gui/ConsoleWindow.h" @@ -81,6 +81,7 @@ #include "logic/status/StatusChecker.h" #include "logic/net/URLConstants.h" +#include "logic/net/NetJob.h" #include "logic/BaseInstance.h" #include "logic/InstanceFactory.h" @@ -146,7 +147,6 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi { view = new GroupView(ui->centralWidget); - view->setSelectionMode(QAbstractItemView::SingleSelection); // view->setCategoryDrawer(drawer); // view->setCollapsibleBlocks(true); @@ -1284,6 +1284,7 @@ void MainWindow::launchInstance(BaseInstance *instance, AuthSessionPtr session, console = new ConsoleWindow(proc); connect(console, SIGNAL(isClosing()), this, SLOT(instanceEnded())); + connect(console, &ConsoleWindow::uploadScreenshots, this, &MainWindow::on_actionScreenshots_triggered); proc->setLogin(session); proc->arm(); @@ -1600,3 +1601,25 @@ void MainWindow::checkSetDefaultJava() MMC->settings()->set("JavaPath", QString("java")); } } + +void MainWindow::on_actionScreenshots_triggered() +{ + if (!m_selectedInstance) + return; + ScreenshotList *list = new ScreenshotList(m_selectedInstance); + Task *task = list->load(); + ProgressDialog prog(this); + prog.exec(task); + if (!task->successful()) + { + CustomMessageBox::selectable(this, tr("Failed to load screenshots!"), + task->failReason(), QMessageBox::Warning)->exec(); + return; + } + ScreenshotDialog dialog(list, this); + if (dialog.exec() == ScreenshotDialog::Accepted) + { + CustomMessageBox::selectable(this, tr("Done uploading!"), dialog.message(), + QMessageBox::Information)->exec(); + } +} |