diff options
author | Petr Mrázek <peterix@gmail.com> | 2015-07-05 01:54:30 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2015-07-05 01:54:30 +0200 |
commit | 7f1320390c55e408a4b0081b2606eab3892a8148 (patch) | |
tree | e08183b17e551e6807939c5ad2932ae68e14f49b /logic/BaseLauncher.h | |
parent | 526a511f455234152ca9b5bc8c60d3c82cbfa417 (diff) | |
download | MultiMC-7f1320390c55e408a4b0081b2606eab3892a8148.tar MultiMC-7f1320390c55e408a4b0081b2606eab3892a8148.tar.gz MultiMC-7f1320390c55e408a4b0081b2606eab3892a8148.tar.lz MultiMC-7f1320390c55e408a4b0081b2606eab3892a8148.tar.xz MultiMC-7f1320390c55e408a4b0081b2606eab3892a8148.zip |
GH-1053 move launch process UI to a separate class
Diffstat (limited to 'logic/BaseLauncher.h')
-rw-r--r-- | logic/BaseLauncher.h | 47 |
1 files changed, 18 insertions, 29 deletions
diff --git a/logic/BaseLauncher.h b/logic/BaseLauncher.h index 076d664b..e233e4fd 100644 --- a/logic/BaseLauncher.h +++ b/logic/BaseLauncher.h @@ -26,8 +26,13 @@ #include "QObjectPtr.h" #include "tasks/Task.h" +class ProcessTask +{ + +}; + class BaseProfilerFactory; -class BaseLauncher: public Task, public std::enable_shared_from_this<BaseLauncher> +class BaseLauncher: public Task { Q_OBJECT protected: @@ -102,6 +107,8 @@ protected: /* methods */ void updateInstance(); void makeReady(); void postLaunch(); + virtual void emitFailed(QString reason); + virtual void emitSucceeded(); QString substituteVariables(const QString &cmd) const; void initializeEnvironment(); @@ -113,34 +120,9 @@ protected: /* methods */ signals: /** - * @brief emitted when the Process immediately fails to run - */ - void launch_failed(InstancePtr); - - /** - * @brief emitted when the PreLaunchCommand fails - */ - void prelaunch_failed(InstancePtr, int code, QProcess::ExitStatus status); - - /** - * @brief emitted when the instance update fails - */ - void update_failed(InstancePtr); - - /** - * @brief emitted when the PostLaunchCommand fails - */ - void postlaunch_failed(InstancePtr, int code, QProcess::ExitStatus status); - - /** - * @brief emitted when the process has finished and the PostLaunchCommand was run - */ - void ended(InstancePtr, int code, QProcess::ExitStatus status); - - /** * @brief emitted when the launch preparations are done */ - void readyForLaunch(std::shared_ptr<BaseLauncher> launcher); + void readyForLaunch(); /** * @brief emitted when we want to log something @@ -158,7 +140,7 @@ protected slots: void on_state(LoggedProcess::State state); void on_post_state(LoggedProcess::State state); - void checkJavaFinished(JavaCheckResult result); + protected: InstancePtr m_instance; @@ -172,15 +154,22 @@ protected: bool killed = false; QString m_header; +/** + * java check step + */ +protected slots: + void checkJavaFinished(JavaCheckResult result); + +protected: // for java checker and launch QString m_javaPath; qlonglong m_javaUnixTime; + std::shared_ptr<JavaChecker> m_JavaChecker; protected: /* HACK: MINECRAFT: split! */ AuthSessionPtr m_session; QString launchScript; QString m_nativeFolder; - std::shared_ptr<JavaChecker> m_JavaChecker; std::shared_ptr<Task> m_updateTask; protected: /* HACK: MINECRAFT: split! */ |