Fix console window (now not a QDialog)
It now opens and coloses as expected, depending on user preferences and the status of the various processes involved. Console window geometry and state are remembered between runs.
This commit is contained in:
@ -15,7 +15,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QDialog>
|
||||
#include <QMainWindow>
|
||||
#include "logic/MinecraftProcess.h"
|
||||
|
||||
namespace Ui
|
||||
@ -23,7 +23,7 @@ namespace Ui
|
||||
class ConsoleWindow;
|
||||
}
|
||||
|
||||
class ConsoleWindow : public QDialog
|
||||
class ConsoleWindow : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@ -38,6 +38,9 @@ public:
|
||||
*/
|
||||
void setMayClose(bool mayclose);
|
||||
|
||||
signals:
|
||||
void isClosing();
|
||||
|
||||
public
|
||||
slots:
|
||||
/**
|
||||
@ -67,13 +70,16 @@ slots:
|
||||
void on_closeButton_clicked();
|
||||
void on_btnKillMinecraft_clicked();
|
||||
void onEnded(BaseInstance *instance, int code, QProcess::ExitStatus status);
|
||||
void onLaunchFailed(BaseInstance *instance);
|
||||
|
||||
// FIXME: add handlers for the other MinecraftProcess signals (pre/post launch command
|
||||
// failures)
|
||||
|
||||
protected:
|
||||
void closeEvent(QCloseEvent *);
|
||||
|
||||
private:
|
||||
Ui::ConsoleWindow *ui;
|
||||
MinecraftProcess *proc;
|
||||
bool m_mayclose;
|
||||
Ui::ConsoleWindow *ui = nullptr;
|
||||
MinecraftProcess *proc = nullptr;
|
||||
bool m_mayclose = true;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user