summaryrefslogtreecommitdiffstats
path: root/api/logic/launch/LaunchTask.h
diff options
context:
space:
mode:
Diffstat (limited to 'api/logic/launch/LaunchTask.h')
-rw-r--r--api/logic/launch/LaunchTask.h134
1 files changed, 67 insertions, 67 deletions
diff --git a/api/logic/launch/LaunchTask.h b/api/logic/launch/LaunchTask.h
index 746d6d19..f5e226b5 100644
--- a/api/logic/launch/LaunchTask.h
+++ b/api/logic/launch/LaunchTask.h
@@ -6,7 +6,7 @@
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -28,98 +28,98 @@
class MULTIMC_LOGIC_EXPORT LaunchTask: public Task
{
- Q_OBJECT
+ Q_OBJECT
protected:
- explicit LaunchTask(InstancePtr instance);
- void init();
+ explicit LaunchTask(InstancePtr instance);
+ void init();
public:
- enum State
- {
- NotStarted,
- Running,
- Waiting,
- Failed,
- Aborted,
- Finished
- };
+ enum State
+ {
+ NotStarted,
+ Running,
+ Waiting,
+ Failed,
+ Aborted,
+ Finished
+ };
public: /* methods */
- static std::shared_ptr<LaunchTask> create(InstancePtr inst);
- virtual ~LaunchTask() {};
+ static std::shared_ptr<LaunchTask> create(InstancePtr inst);
+ virtual ~LaunchTask() {};
- void appendStep(std::shared_ptr<LaunchStep> step);
- void prependStep(std::shared_ptr<LaunchStep> step);
- void setCensorFilter(QMap<QString, QString> filter);
+ void appendStep(std::shared_ptr<LaunchStep> step);
+ void prependStep(std::shared_ptr<LaunchStep> step);
+ void setCensorFilter(QMap<QString, QString> filter);
- InstancePtr instance()
- {
- return m_instance;
- }
+ InstancePtr instance()
+ {
+ return m_instance;
+ }
- void setPid(qint64 pid)
- {
- m_pid = pid;
- }
+ void setPid(qint64 pid)
+ {
+ m_pid = pid;
+ }
- qint64 pid()
- {
- return m_pid;
- }
+ qint64 pid()
+ {
+ return m_pid;
+ }
- /**
- * @brief prepare the process for launch (for multi-stage launch)
- */
- virtual void executeTask() override;
+ /**
+ * @brief prepare the process for launch (for multi-stage launch)
+ */
+ virtual void executeTask() override;
- /**
- * @brief launch the armed instance
- */
- void proceed();
+ /**
+ * @brief launch the armed instance
+ */
+ void proceed();
- /**
- * @brief abort launch
- */
- bool abort() override;
+ /**
+ * @brief abort launch
+ */
+ bool abort() override;
- bool canAbort() const override;
+ bool canAbort() const override;
- shared_qobject_ptr<LogModel> getLogModel();
+ shared_qobject_ptr<LogModel> getLogModel();
public:
- QString substituteVariables(const QString &cmd) const;
- QString censorPrivateInfo(QString in);
+ QString substituteVariables(const QString &cmd) const;
+ QString censorPrivateInfo(QString in);
protected: /* methods */
- virtual void emitFailed(QString reason) override;
- virtual void emitSucceeded() override;
+ virtual void emitFailed(QString reason) override;
+ virtual void emitSucceeded() override;
signals:
- /**
- * @brief emitted when the launch preparations are done
- */
- void readyForLaunch();
+ /**
+ * @brief emitted when the launch preparations are done
+ */
+ void readyForLaunch();
- void requestProgress(Task *task);
+ void requestProgress(Task *task);
- void requestLogging();
+ void requestLogging();
public slots:
- void onLogLines(const QStringList& lines, MessageLevel::Enum defaultLevel = MessageLevel::MultiMC);
- void onLogLine(QString line, MessageLevel::Enum defaultLevel = MessageLevel::MultiMC);
- void onReadyForLaunch();
- void onStepFinished();
- void onProgressReportingRequested();
+ void onLogLines(const QStringList& lines, MessageLevel::Enum defaultLevel = MessageLevel::MultiMC);
+ void onLogLine(QString line, MessageLevel::Enum defaultLevel = MessageLevel::MultiMC);
+ void onReadyForLaunch();
+ void onStepFinished();
+ void onProgressReportingRequested();
private: /*methods */
- void finalizeSteps(bool successful, const QString & error);
+ void finalizeSteps(bool successful, const QString & error);
protected: /* data */
- InstancePtr m_instance;
- shared_qobject_ptr<LogModel> m_logModel;
- QList <std::shared_ptr<LaunchStep>> m_steps;
- QMap<QString, QString> m_censorFilter;
- int currentStep = -1;
- State state = NotStarted;
- qint64 m_pid = -1;
+ InstancePtr m_instance;
+ shared_qobject_ptr<LogModel> m_logModel;
+ QList <std::shared_ptr<LaunchStep>> m_steps;
+ QMap<QString, QString> m_censorFilter;
+ int currentStep = -1;
+ State state = NotStarted;
+ qint64 m_pid = -1;
};