diff options
author | Stiepen22 <stiepen22@gmx.de> | 2013-09-06 23:52:17 +0200 |
---|---|---|
committer | Stiepen22 <stiepen22@gmx.de> | 2013-09-06 23:52:17 +0200 |
commit | 3fd2d025a1aa0bbc72ac69a34828ef5942255143 (patch) | |
tree | 4bc8470aa985f1687d77638e3cab982fa73224b2 /gui | |
parent | 0990a1103c7eafd099e3ef9650f542eb34a6a818 (diff) | |
download | MultiMC-3fd2d025a1aa0bbc72ac69a34828ef5942255143.tar MultiMC-3fd2d025a1aa0bbc72ac69a34828ef5942255143.tar.gz MultiMC-3fd2d025a1aa0bbc72ac69a34828ef5942255143.tar.lz MultiMC-3fd2d025a1aa0bbc72ac69a34828ef5942255143.tar.xz MultiMC-3fd2d025a1aa0bbc72ac69a34828ef5942255143.zip |
Made main window hide on instace exit
Diffstat (limited to 'gui')
-rw-r--r-- | gui/consolewindow.cpp | 8 | ||||
-rw-r--r-- | gui/consolewindow.h | 1 | ||||
-rw-r--r-- | gui/mainwindow.cpp | 17 | ||||
-rw-r--r-- | gui/mainwindow.h | 3 |
4 files changed, 28 insertions, 1 deletions
diff --git a/gui/consolewindow.cpp b/gui/consolewindow.cpp index f2bc662a..f95d2742 100644 --- a/gui/consolewindow.cpp +++ b/gui/consolewindow.cpp @@ -11,6 +11,7 @@ ConsoleWindow::ConsoleWindow(MinecraftProcess *mcproc, QWidget *parent) : proc(mcproc) { ui->setupUi(this); + connect(mcproc, SIGNAL(ended()), this, SLOT(onEnded())); } ConsoleWindow::~ConsoleWindow() @@ -91,4 +92,9 @@ void ConsoleWindow::on_btnKillMinecraft_clicked() else ui->btnKillMinecraft->setEnabled(true); r_u_sure.close(); -}
\ No newline at end of file +} + +void ConsoleWindow::onEnded() +{ + ui->btnKillMinecraft->setEnabled(false); +} diff --git a/gui/consolewindow.h b/gui/consolewindow.h index d4485a45..6a6c9e50 100644 --- a/gui/consolewindow.h +++ b/gui/consolewindow.h @@ -49,6 +49,7 @@ public slots: private slots: void on_closeButton_clicked(); void on_btnKillMinecraft_clicked(); + void onEnded(); protected: void closeEvent(QCloseEvent *); diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index 7d1e1510..82ae41d9 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -541,10 +541,21 @@ void MainWindow::launchInstance(BaseInstance *instance, LoginResponse response) if(!proc) return; + // Prepare GUI: If it shall stay open disable the required parts + if (globalSettings->get("NoHide").toBool()) + { + ui->actionLaunchInstance->setEnabled(false); + } + else + { + this->hide(); + } + console = new ConsoleWindow(proc); console->show(); connect(proc, SIGNAL(log(QString, MessageLevel::Enum)), console, SLOT(write(QString, MessageLevel::Enum))); + connect(proc, SIGNAL(ended()), this, SLOT(instanceEnded())); proc->launch(); } @@ -673,3 +684,9 @@ void MainWindow::on_actionEditInstNotes_triggered() linst->setNotes(noteedit.getText()); } } + +void MainWindow::instanceEnded() +{ + this->show(); + ui->actionLaunchInstance->setEnabled(m_selectedInstance); +} diff --git a/gui/mainwindow.h b/gui/mainwindow.h index 42f118b1..e8a6cbcf 100644 --- a/gui/mainwindow.h +++ b/gui/mainwindow.h @@ -111,6 +111,8 @@ private slots: void on_actionChangeInstLWJGLVersion_triggered(); + void instanceEnded(); + void on_actionInstanceSettings_triggered(); public slots: @@ -128,6 +130,7 @@ protected: bool eventFilter(QObject *obj, QEvent *ev); void setCatBackground(bool enabled); private: + Ui::MainWindow *ui; KCategoryDrawer * drawer; KCategorizedView * view; |