summaryrefslogtreecommitdiffstats
path: root/gui
diff options
context:
space:
mode:
Diffstat (limited to 'gui')
-rw-r--r--gui/mainwindow.cpp20
-rw-r--r--gui/mainwindow.h4
2 files changed, 24 insertions, 0 deletions
diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp
index 5a915e8c..408a61c5 100644
--- a/gui/mainwindow.cpp
+++ b/gui/mainwindow.cpp
@@ -39,6 +39,7 @@
#include "gui/taskdialog.h"
#include "gui/browserdialog.h"
#include "gui/aboutdialog.h"
+#include "gui/consolewindow.h"
#include "kcategorizedview.h"
#include "kcategorydrawer.h"
@@ -49,6 +50,7 @@
#include "logintask.h"
#include <instance.h>
+#include "minecraftprocess.h"
#include "instancemodel.h"
#include "instancedelegate.h"
@@ -276,9 +278,27 @@ void MainWindow::doLogin ( QString inst, const QString& errorMsg )
void MainWindow::onLoginComplete ( QString inst, LoginResponse response )
{
+ // TODO: console
+ console = new ConsoleWindow();
+ auto instance = instList.getInstanceById(inst);
+ if(instance)
+ {
+ proc = new MinecraftProcess(instance, response.username(), response.sessionID());
+
+ console->show();
+ //connect(proc, SIGNAL(ended()), SLOT(onTerminated()));
+ connect(proc, SIGNAL(log(QString,MessageLevel::Enum)), console, SLOT(write(QString,MessageLevel::Enum)));
+ proc->launch();
+ }
+ else
+ {
+
+ }
+ /*
QMessageBox::information ( this, "Login Successful",
QString ( "Logged in as %1 with session ID %2. Instance: %3" ).
arg ( response.username(), response.sessionID(), inst ) );
+ */
}
void MainWindow::onLoginFailed ( QString inst, const QString& errorMsg )
diff --git a/gui/mainwindow.h b/gui/mainwindow.h
index 5d990639..eec09972 100644
--- a/gui/mainwindow.h
+++ b/gui/mainwindow.h
@@ -26,6 +26,8 @@ class InstanceModel;
class InstanceProxyModel;
class KCategorizedView;
class KCategoryDrawer;
+class MinecraftProcess;
+class ConsoleWindow;
namespace Ui
{
@@ -94,6 +96,8 @@ private:
InstanceModel * model;
InstanceProxyModel * proxymodel;
InstanceList instList;
+ MinecraftProcess *proc;
+ ConsoleWindow *console;
};
#endif // MAINWINDOW_H