work on pasting instance logs

blame clang for formatting changes
This commit is contained in:
robotbrainify
2013-12-06 16:24:55 -05:00
parent 613699b362
commit 5ad95134dc
6 changed files with 254 additions and 110 deletions

View File

@ -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();
}
}

View File

@ -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 *);

View File

@ -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>