From 34ddfc7ecc2b0450b3d501e65cb4203ac747ed42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Mon, 11 May 2015 22:21:37 +0200 Subject: GH-1053 base process and launch refactor, part 1 --- application/ConsoleWindow.cpp | 2 +- application/ConsoleWindow.h | 8 ++++---- application/MainWindow.cpp | 4 ++-- application/MainWindow.h | 4 ++-- application/pages/LogPage.cpp | 13 ++++--------- application/pages/LogPage.h | 6 +++--- 6 files changed, 16 insertions(+), 21 deletions(-) (limited to 'application') diff --git a/application/ConsoleWindow.cpp b/application/ConsoleWindow.cpp index a96d84a1..6a3cd6b2 100644 --- a/application/ConsoleWindow.cpp +++ b/application/ConsoleWindow.cpp @@ -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); diff --git a/application/ConsoleWindow.h b/application/ConsoleWindow.h index 6e3849c5..a5e9c3a4 100644 --- a/application/ConsoleWindow.h +++ b/application/ConsoleWindow.h @@ -17,7 +17,7 @@ #include #include -#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; diff --git a/application/MainWindow.cpp b/application/MainWindow.cpp index c595f95f..8e43ff0e 100644 --- a/application/MainWindow.cpp +++ b/application/MainWindow.cpp @@ -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; diff --git a/application/MainWindow.h b/application/MainWindow.h index 33a5a4ed..010db55c 100644 --- a/application/MainWindow.h +++ b/application/MainWindow.h @@ -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; diff --git a/application/pages/LogPage.cpp b/application/pages/LogPage.cpp index 3fade26f..0b88193c 100644 --- a/application/pages/LogPage.cpp +++ b/application/pages/LogPage.cpp @@ -7,11 +7,11 @@ #include #include -#include "BaseProcess.h" +#include "BaseLauncher.h" #include #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: diff --git a/application/pages/LogPage.h b/application/pages/LogPage.h index 0cbf3d23..a420a75f 100644 --- a/application/pages/LogPage.h +++ b/application/pages/LogPage.h @@ -18,7 +18,7 @@ #include #include "BaseInstance.h" -#include "BaseProcess.h" +#include "BaseLauncher.h" #include "BasePage.h" #include @@ -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; -- cgit v1.2.3