GH-1053 base process and launch refactor, part 1
This commit is contained in:
@ -53,7 +53,7 @@ private:
|
||||
BasePage * m_log_page;
|
||||
};
|
||||
|
||||
ConsoleWindow::ConsoleWindow(BaseProcess *process, QWidget *parent)
|
||||
ConsoleWindow::ConsoleWindow(BaseLauncher *process, QWidget *parent)
|
||||
: QMainWindow(parent), m_proc(process)
|
||||
{
|
||||
MultiMCPlatform::fixWM_CLASS(this);
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QSystemTrayIcon>
|
||||
#include "BaseProcess.h"
|
||||
#include "BaseLauncher.h"
|
||||
|
||||
class QPushButton;
|
||||
class PageContainer;
|
||||
@ -26,7 +26,7 @@ class ConsoleWindow : public QMainWindow
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ConsoleWindow(BaseProcess *proc, QWidget *parent = 0);
|
||||
explicit ConsoleWindow(BaseLauncher *proc, QWidget *parent = 0);
|
||||
virtual ~ConsoleWindow();
|
||||
|
||||
/**
|
||||
@ -47,7 +47,7 @@ slots:
|
||||
void onEnded(InstancePtr instance, int code, QProcess::ExitStatus status);
|
||||
void onLaunchFailed(InstancePtr instance);
|
||||
|
||||
// FIXME: add handlers for the other MinecraftProcess signals (pre/post launch command
|
||||
// FIXME: add handlers for the other MinecraftLauncher signals (pre/post launch command
|
||||
// failures)
|
||||
|
||||
void iconActivated(QSystemTrayIcon::ActivationReason);
|
||||
@ -56,7 +56,7 @@ protected:
|
||||
void closeEvent(QCloseEvent *);
|
||||
|
||||
private:
|
||||
BaseProcess *m_proc = nullptr;
|
||||
BaseLauncher *m_proc = nullptr;
|
||||
bool m_mayclose = true;
|
||||
QSystemTrayIcon *m_trayIcon = nullptr;
|
||||
PageContainer *m_container = nullptr;
|
||||
|
@ -378,7 +378,7 @@ namespace Ui {
|
||||
#include "Env.h"
|
||||
|
||||
#include "BaseInstance.h"
|
||||
#include "BaseProcess.h"
|
||||
#include "BaseLauncher.h"
|
||||
#include "java/JavaUtils.h"
|
||||
#include "JavaCommon.h"
|
||||
#include "InstancePageProvider.h"
|
||||
@ -1744,7 +1744,7 @@ void MainWindow::launchInstance(InstancePtr instance, AuthSessionPtr session,
|
||||
return;
|
||||
}
|
||||
|
||||
BaseProcess *proc = instance->prepareForLaunch(session);
|
||||
BaseLauncher *proc = instance->prepareForLaunch(session);
|
||||
if (!proc)
|
||||
return;
|
||||
|
||||
|
@ -30,7 +30,7 @@ class QToolButton;
|
||||
class InstanceProxyModel;
|
||||
class LabeledToolButton;
|
||||
class QLabel;
|
||||
class MinecraftProcess;
|
||||
class MinecraftLauncher;
|
||||
class ConsoleWindow;
|
||||
class BaseProfilerFactory;
|
||||
class GenericPageProvider;
|
||||
@ -196,7 +196,7 @@ private:
|
||||
class GroupView *view;
|
||||
InstanceProxyModel *proxymodel;
|
||||
NetJobPtr skin_download_job;
|
||||
MinecraftProcess *proc;
|
||||
MinecraftLauncher *proc;
|
||||
ConsoleWindow *console;
|
||||
LabeledToolButton *renameButton;
|
||||
QToolButton *changeIconButton;
|
||||
|
@ -7,11 +7,11 @@
|
||||
#include <QScrollBar>
|
||||
#include <QShortcut>
|
||||
|
||||
#include "BaseProcess.h"
|
||||
#include "BaseLauncher.h"
|
||||
#include <settings/Setting.h>
|
||||
#include "GuiUtil.h"
|
||||
|
||||
LogPage::LogPage(BaseProcess *proc, QWidget *parent)
|
||||
LogPage::LogPage(BaseLauncher *proc, QWidget *parent)
|
||||
: QWidget(parent), ui(new Ui::LogPage), m_process(proc)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
@ -148,14 +148,14 @@ void LogPage::write(QString data, MessageLevel::Enum mode)
|
||||
{
|
||||
if (!m_write_active)
|
||||
{
|
||||
if (mode != MessageLevel::PrePost && mode != MessageLevel::MultiMC)
|
||||
if (mode != MessageLevel::MultiMC)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
if(m_stopOnOverflow && m_write_active)
|
||||
{
|
||||
if(mode != MessageLevel::PrePost && mode != MessageLevel::MultiMC)
|
||||
if(mode != MessageLevel::MultiMC)
|
||||
{
|
||||
if(ui->text->blockCount() >= ui->text->maximumBlockCount())
|
||||
{
|
||||
@ -231,11 +231,6 @@ void LogPage::write(QString data, MessageLevel::Enum mode)
|
||||
format.setBackground(QColor("black"));
|
||||
break;
|
||||
}
|
||||
case MessageLevel::PrePost:
|
||||
{
|
||||
format.setForeground(QColor("grey"));
|
||||
break;
|
||||
}
|
||||
case MessageLevel::Info:
|
||||
case MessageLevel::Message:
|
||||
default:
|
||||
|
@ -18,7 +18,7 @@
|
||||
#include <QWidget>
|
||||
|
||||
#include "BaseInstance.h"
|
||||
#include "BaseProcess.h"
|
||||
#include "BaseLauncher.h"
|
||||
#include "BasePage.h"
|
||||
#include <MultiMC.h>
|
||||
|
||||
@ -33,7 +33,7 @@ class LogPage : public QWidget, public BasePage
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit LogPage(BaseProcess *proc, QWidget *parent = 0);
|
||||
explicit LogPage(BaseLauncher *proc, QWidget *parent = 0);
|
||||
virtual ~LogPage();
|
||||
virtual QString displayName() const override
|
||||
{
|
||||
@ -77,7 +77,7 @@ private slots:
|
||||
|
||||
private:
|
||||
Ui::LogPage *ui;
|
||||
BaseProcess *m_process;
|
||||
BaseLauncher *m_process;
|
||||
int m_last_scroll_value = 0;
|
||||
bool m_scroll_active = true;
|
||||
int m_saved_offset = 0;
|
||||
|
Reference in New Issue
Block a user