Made main window hide on instace exit
This commit is contained in:
parent
0990a1103c
commit
3fd2d025a1
@ -67,6 +67,7 @@ AppSettings::AppSettings(QObject *parent) :
|
||||
registerSetting(new Setting("PreLaunchCommand", ""));
|
||||
registerSetting(new Setting("PostExitCommand", ""));
|
||||
|
||||
// The cat
|
||||
registerSetting(new Setting("TheCat", false));
|
||||
// Misc
|
||||
registerSetting(new Setting("TheCat", false)); // The Cat
|
||||
registerSetting(new Setting("NoHide", false)); // Shall the main window hide on instance launch
|
||||
}
|
||||
|
@ -11,6 +11,7 @@ ConsoleWindow::ConsoleWindow(MinecraftProcess *mcproc, QWidget *parent) :
|
||||
proc(mcproc)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
connect(mcproc, SIGNAL(ended()), this, SLOT(onEnded()));
|
||||
}
|
||||
|
||||
ConsoleWindow::~ConsoleWindow()
|
||||
@ -92,3 +93,8 @@ void ConsoleWindow::on_btnKillMinecraft_clicked()
|
||||
ui->btnKillMinecraft->setEnabled(true);
|
||||
r_u_sure.close();
|
||||
}
|
||||
|
||||
void ConsoleWindow::onEnded()
|
||||
{
|
||||
ui->btnKillMinecraft->setEnabled(false);
|
||||
}
|
||||
|
@ -49,6 +49,7 @@ public slots:
|
||||
private slots:
|
||||
void on_closeButton_clicked();
|
||||
void on_btnKillMinecraft_clicked();
|
||||
void onEnded();
|
||||
|
||||
protected:
|
||||
void closeEvent(QCloseEvent *);
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user