summaryrefslogtreecommitdiffstats
path: root/gui
diff options
context:
space:
mode:
authorrobotbrainify <robotbrainify@gmail.com>2013-12-06 16:24:55 -0500
committerrobotbrainify <robotbrainify@gmail.com>2013-12-06 16:24:55 -0500
commit5ad95134dc521d5eeb85cc37e6681b72b8d62c62 (patch)
tree0d252776e7d21e7cab950a525a9284cd4ba83f72 /gui
parent613699b3626aea750093ab7eaaeccaa28c0e87c6 (diff)
downloadMultiMC-5ad95134dc521d5eeb85cc37e6681b72b8d62c62.tar
MultiMC-5ad95134dc521d5eeb85cc37e6681b72b8d62c62.tar.gz
MultiMC-5ad95134dc521d5eeb85cc37e6681b72b8d62c62.tar.lz
MultiMC-5ad95134dc521d5eeb85cc37e6681b72b8d62c62.tar.xz
MultiMC-5ad95134dc521d5eeb85cc37e6681b72b8d62c62.zip
work on pasting instance logs
blame clang for formatting changes
Diffstat (limited to 'gui')
-rw-r--r--gui/ConsoleWindow.cpp19
-rw-r--r--gui/ConsoleWindow.h2
-rw-r--r--gui/ConsoleWindow.ui7
3 files changed, 28 insertions, 0 deletions
diff --git a/gui/ConsoleWindow.cpp b/gui/ConsoleWindow.cpp
index d0210df6..f08f10de 100644
--- a/gui/ConsoleWindow.cpp
+++ b/gui/ConsoleWindow.cpp
@@ -22,6 +22,9 @@
#include <gui/Platform.h>
#include <gui/dialogs/CustomMessageBox.h>
+#include <gui/dialogs/ProgressDialog.h>
+
+#include "logic/net/PasteUpload.h"
ConsoleWindow::ConsoleWindow(MinecraftProcess *mcproc, QWidget *parent)
: QMainWindow(parent), ui(new Ui::ConsoleWindow), proc(mcproc)
@@ -179,3 +182,19 @@ void ConsoleWindow::onLaunchFailed(BaseInstance *instance)
if(!isVisible())
show();
}
+
+void ConsoleWindow::on_btnPaste_clicked()
+{
+ auto text = ui->text->toPlainText();
+ ProgressDialog dialog(this);
+ PasteUpload* paste=new PasteUpload(this, text);
+ dialog.exec(paste);
+ if(paste->successful())
+ {
+ paste->messageBox()->exec();
+ }
+ else
+ {
+ CustomMessageBox::selectable(this, "Upload failed", paste->failReason(), QMessageBox::Critical)->exec();
+ }
+}
diff --git a/gui/ConsoleWindow.h b/gui/ConsoleWindow.h
index 2d948484..731c616c 100644
--- a/gui/ConsoleWindow.h
+++ b/gui/ConsoleWindow.h
@@ -76,6 +76,8 @@ slots:
// FIXME: add handlers for the other MinecraftProcess signals (pre/post launch command
// failures)
+ void on_btnPaste_clicked();
+
protected:
void closeEvent(QCloseEvent *);
diff --git a/gui/ConsoleWindow.ui b/gui/ConsoleWindow.ui
index ed1b627b..6cb5e93b 100644
--- a/gui/ConsoleWindow.ui
+++ b/gui/ConsoleWindow.ui
@@ -74,6 +74,13 @@
</property>
</widget>
</item>
+ <item>
+ <widget class="QPushButton" name="btnPaste">
+ <property name="text">
+ <string>Upload Log</string>
+ </property>
+ </widget>
+ </item>
</layout>
</item>
</layout>