summaryrefslogtreecommitdiffstats
path: root/gui/ConsoleWindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gui/ConsoleWindow.cpp')
-rw-r--r--gui/ConsoleWindow.cpp19
1 files changed, 19 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();
+ }
+}