diff options
author | Petr Mrázek <peterix@gmail.com> | 2015-07-26 17:55:29 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2015-07-26 17:55:29 +0200 |
commit | d8caab515aa641ec901592d40b5d30c6dfd282f5 (patch) | |
tree | 612b322374083309027204b656d4dc0a78780de8 /logic/launch/steps | |
parent | 6310f6569c2630f27ad72dc0a5fef9f9fec5a88c (diff) | |
download | MultiMC-d8caab515aa641ec901592d40b5d30c6dfd282f5.tar MultiMC-d8caab515aa641ec901592d40b5d30c6dfd282f5.tar.gz MultiMC-d8caab515aa641ec901592d40b5d30c6dfd282f5.tar.lz MultiMC-d8caab515aa641ec901592d40b5d30c6dfd282f5.tar.xz MultiMC-d8caab515aa641ec901592d40b5d30c6dfd282f5.zip |
GH-1053 add back update progress dialog
Diffstat (limited to 'logic/launch/steps')
-rw-r--r-- | logic/launch/steps/LaunchMinecraft.cpp (renamed from logic/launch/steps/LaunchCommand.cpp) | 18 | ||||
-rw-r--r-- | logic/launch/steps/LaunchMinecraft.h (renamed from logic/launch/steps/LaunchCommand.h) | 4 | ||||
-rw-r--r-- | logic/launch/steps/Update.cpp | 11 | ||||
-rw-r--r-- | logic/launch/steps/Update.h | 1 |
4 files changed, 21 insertions, 13 deletions
diff --git a/logic/launch/steps/LaunchCommand.cpp b/logic/launch/steps/LaunchMinecraft.cpp index 2cbb3785..f01a584d 100644 --- a/logic/launch/steps/LaunchCommand.cpp +++ b/logic/launch/steps/LaunchMinecraft.cpp @@ -13,18 +13,18 @@ * limitations under the License. */ -#include "LaunchCommand.h" +#include "LaunchMinecraft.h" #include <launch/LaunchTask.h> #include <minecraft/OneSixInstance.h> #include <QStandardPaths> -LaunchCommand::LaunchCommand(LaunchTask *parent) : LaunchStep(parent) +LaunchMinecraft::LaunchMinecraft(LaunchTask *parent) : LaunchStep(parent) { - connect(&m_process, &LoggedProcess::log, this, &LaunchCommand::logLines); - connect(&m_process, &LoggedProcess::stateChanged, this, &LaunchCommand::on_state); + connect(&m_process, &LoggedProcess::log, this, &LaunchMinecraft::logLines); + connect(&m_process, &LoggedProcess::stateChanged, this, &LaunchMinecraft::on_state); } -void LaunchCommand::executeTask() +void LaunchMinecraft::executeTask() { auto instance = m_parent->instance(); std::shared_ptr<MinecraftInstance> minecraftInstance = std::dynamic_pointer_cast<MinecraftInstance>(instance); @@ -58,7 +58,7 @@ void LaunchCommand::executeTask() } } -void LaunchCommand::on_state(LoggedProcess::State state) +void LaunchMinecraft::on_state(LoggedProcess::State state) { switch(state) { @@ -103,12 +103,12 @@ void LaunchCommand::on_state(LoggedProcess::State state) } } -void LaunchCommand::setWorkingDirectory(const QString &wd) +void LaunchMinecraft::setWorkingDirectory(const QString &wd) { m_process.setWorkingDirectory(wd); } -void LaunchCommand::proceed() +void LaunchMinecraft::proceed() { if(mayProceed) { @@ -118,7 +118,7 @@ void LaunchCommand::proceed() } } -bool LaunchCommand::abort() +bool LaunchMinecraft::abort() { if(mayProceed) { diff --git a/logic/launch/steps/LaunchCommand.h b/logic/launch/steps/LaunchMinecraft.h index 4a631054..808ec33b 100644 --- a/logic/launch/steps/LaunchCommand.h +++ b/logic/launch/steps/LaunchMinecraft.h @@ -18,11 +18,11 @@ #include <launch/LaunchStep.h> #include <launch/LoggedProcess.h> -class LaunchCommand: public LaunchStep +class LaunchMinecraft: public LaunchStep { Q_OBJECT public: - explicit LaunchCommand(LaunchTask *parent); + explicit LaunchMinecraft(LaunchTask *parent); virtual void executeTask(); virtual bool abort(); virtual void proceed(); diff --git a/logic/launch/steps/Update.cpp b/logic/launch/steps/Update.cpp index 069b4f41..4901f001 100644 --- a/logic/launch/steps/Update.cpp +++ b/logic/launch/steps/Update.cpp @@ -22,12 +22,19 @@ void Update::executeTask() if(m_updateTask) { connect(m_updateTask.get(), SIGNAL(finished()), this, SLOT(updateFinished())); - m_updateTask->start(); + connect(m_updateTask.get(), &Task::progress, this, &Task::setProgress); + connect(m_updateTask.get(), &Task::status, this, &Task::setStatus); + emit progressReportingRequest(); return; } emitSucceeded(); } +void Update::proceed() +{ + m_updateTask->start(); +} + void Update::updateFinished() { if(m_updateTask->successful()) @@ -40,4 +47,4 @@ void Update::updateFinished() emit logLine(reason, MessageLevel::Fatal); emitFailed(reason); } -}
\ No newline at end of file +} diff --git a/logic/launch/steps/Update.h b/logic/launch/steps/Update.h index 3ad07264..14928253 100644 --- a/logic/launch/steps/Update.h +++ b/logic/launch/steps/Update.h @@ -32,6 +32,7 @@ public: { return false; } + virtual void proceed(); private slots: void updateFinished(); |