summaryrefslogtreecommitdiffstats
path: root/api/logic/launch
diff options
context:
space:
mode:
Diffstat (limited to 'api/logic/launch')
-rw-r--r--api/logic/launch/LaunchStep.cpp2
-rw-r--r--api/logic/launch/LaunchStep.h2
-rw-r--r--api/logic/launch/LaunchTask.cpp4
-rw-r--r--api/logic/launch/LaunchTask.h2
-rw-r--r--api/logic/launch/LogModel.cpp18
-rw-r--r--api/logic/launch/LogModel.h6
-rw-r--r--api/logic/launch/steps/PostLaunchCommand.cpp2
-rw-r--r--api/logic/launch/steps/PostLaunchCommand.h2
-rw-r--r--api/logic/launch/steps/PreLaunchCommand.cpp2
-rw-r--r--api/logic/launch/steps/PreLaunchCommand.h2
-rw-r--r--api/logic/launch/steps/TextPrint.h2
-rw-r--r--api/logic/launch/steps/Update.cpp6
-rw-r--r--api/logic/launch/steps/Update.h6
13 files changed, 41 insertions, 15 deletions
diff --git a/api/logic/launch/LaunchStep.cpp b/api/logic/launch/LaunchStep.cpp
index 7b6ffc23..01f72a0a 100644
--- a/api/logic/launch/LaunchStep.cpp
+++ b/api/logic/launch/LaunchStep.cpp
@@ -1,4 +1,4 @@
-/* Copyright 2013-2017 MultiMC Contributors
+/* Copyright 2013-2018 MultiMC Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/api/logic/launch/LaunchStep.h b/api/logic/launch/LaunchStep.h
index d645bd6c..80778e34 100644
--- a/api/logic/launch/LaunchStep.h
+++ b/api/logic/launch/LaunchStep.h
@@ -1,4 +1,4 @@
-/* Copyright 2013-2017 MultiMC Contributors
+/* Copyright 2013-2018 MultiMC Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/api/logic/launch/LaunchTask.cpp b/api/logic/launch/LaunchTask.cpp
index 23c28f50..99c16721 100644
--- a/api/logic/launch/LaunchTask.cpp
+++ b/api/logic/launch/LaunchTask.cpp
@@ -1,4 +1,4 @@
-/* Copyright 2013-2017 MultiMC Contributors
+/* Copyright 2013-2018 MultiMC Contributors
*
* Authors: Orochimarufan <orochimarufan.x3@gmail.com>
*
@@ -83,7 +83,7 @@ void LaunchTask::onStepFinished()
}
auto step = m_steps[currentStep];
- if(step->successful())
+ if(step->wasSuccessful())
{
// end?
if(currentStep == m_steps.size() - 1)
diff --git a/api/logic/launch/LaunchTask.h b/api/logic/launch/LaunchTask.h
index 2d95f98f..746d6d19 100644
--- a/api/logic/launch/LaunchTask.h
+++ b/api/logic/launch/LaunchTask.h
@@ -1,4 +1,4 @@
-/* Copyright 2013-2017 MultiMC Contributors
+/* Copyright 2013-2018 MultiMC Contributors
*
* Authors: Orochimarufan <orochimarufan.x3@gmail.com>
*
diff --git a/api/logic/launch/LogModel.cpp b/api/logic/launch/LogModel.cpp
index 042feeab..72b076e9 100644
--- a/api/logic/launch/LogModel.cpp
+++ b/api/logic/launch/LogModel.cpp
@@ -69,6 +69,11 @@ void LogModel::suspend(bool suspend)
m_suspended = suspend;
}
+bool LogModel::suspended()
+{
+ return m_suspended;
+}
+
void LogModel::clear()
{
beginResetModel();
@@ -147,3 +152,16 @@ void LogModel::setOverflowMessage(const QString& overflowMessage)
{
m_overflowMessage = overflowMessage;
}
+
+void LogModel::setLineWrap(bool state)
+{
+ if(m_lineWrap != state)
+ {
+ m_lineWrap = state;
+ }
+}
+
+bool LogModel::wrapLines() const
+{
+ return m_lineWrap;
+}
diff --git a/api/logic/launch/LogModel.h b/api/logic/launch/LogModel.h
index 57cd23b0..e6deac89 100644
--- a/api/logic/launch/LogModel.h
+++ b/api/logic/launch/LogModel.h
@@ -17,7 +17,9 @@ public:
void append(MessageLevel::Enum, QString line);
void clear();
+
void suspend(bool suspend);
+ bool suspended();
QString toPlainText();
@@ -26,6 +28,9 @@ public:
void setStopOnOverflow(bool stop);
void setOverflowMessage(const QString & overflowMessage);
+ void setLineWrap(bool state);
+ bool wrapLines() const;
+
enum Roles
{
LevelRole = Qt::UserRole
@@ -48,6 +53,7 @@ private: /* data */
bool m_stopOnOverflow = false;
QString m_overflowMessage = "OVERFLOW";
bool m_suspended = false;
+ bool m_lineWrap = true;
private:
Q_DISABLE_COPY(LogModel)
diff --git a/api/logic/launch/steps/PostLaunchCommand.cpp b/api/logic/launch/steps/PostLaunchCommand.cpp
index 6c7c963c..bc3b3ffe 100644
--- a/api/logic/launch/steps/PostLaunchCommand.cpp
+++ b/api/logic/launch/steps/PostLaunchCommand.cpp
@@ -1,4 +1,4 @@
-/* Copyright 2013-2017 MultiMC Contributors
+/* Copyright 2013-2018 MultiMC Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/api/logic/launch/steps/PostLaunchCommand.h b/api/logic/launch/steps/PostLaunchCommand.h
index 432867eb..36b3b96f 100644
--- a/api/logic/launch/steps/PostLaunchCommand.h
+++ b/api/logic/launch/steps/PostLaunchCommand.h
@@ -1,4 +1,4 @@
-/* Copyright 2013-2017 MultiMC Contributors
+/* Copyright 2013-2018 MultiMC Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/api/logic/launch/steps/PreLaunchCommand.cpp b/api/logic/launch/steps/PreLaunchCommand.cpp
index 222800a7..7c37d5cb 100644
--- a/api/logic/launch/steps/PreLaunchCommand.cpp
+++ b/api/logic/launch/steps/PreLaunchCommand.cpp
@@ -1,4 +1,4 @@
-/* Copyright 2013-2017 MultiMC Contributors
+/* Copyright 2013-2018 MultiMC Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/api/logic/launch/steps/PreLaunchCommand.h b/api/logic/launch/steps/PreLaunchCommand.h
index f57d2e2f..880cc076 100644
--- a/api/logic/launch/steps/PreLaunchCommand.h
+++ b/api/logic/launch/steps/PreLaunchCommand.h
@@ -1,4 +1,4 @@
-/* Copyright 2013-2017 MultiMC Contributors
+/* Copyright 2013-2018 MultiMC Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/api/logic/launch/steps/TextPrint.h b/api/logic/launch/steps/TextPrint.h
index 63d01412..3e3e06cb 100644
--- a/api/logic/launch/steps/TextPrint.h
+++ b/api/logic/launch/steps/TextPrint.h
@@ -1,4 +1,4 @@
-/* Copyright 2013-2017 MultiMC Contributors
+/* Copyright 2013-2018 MultiMC Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/api/logic/launch/steps/Update.cpp b/api/logic/launch/steps/Update.cpp
index 956230f4..d057febb 100644
--- a/api/logic/launch/steps/Update.cpp
+++ b/api/logic/launch/steps/Update.cpp
@@ -1,4 +1,4 @@
-/* Copyright 2013-2017 MultiMC Contributors
+/* Copyright 2013-2018 MultiMC Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,7 +23,7 @@ void Update::executeTask()
emitFailed(tr("Task aborted."));
return;
}
- m_updateTask.reset(m_parent->instance()->createUpdateTask());
+ m_updateTask.reset(m_parent->instance()->createUpdateTask(m_mode));
if(m_updateTask)
{
connect(m_updateTask.get(), SIGNAL(finished()), this, SLOT(updateFinished()));
@@ -42,7 +42,7 @@ void Update::proceed()
void Update::updateFinished()
{
- if(m_updateTask->successful())
+ if(m_updateTask->wasSuccessful())
{
m_updateTask.reset();
emitSucceeded();
diff --git a/api/logic/launch/steps/Update.h b/api/logic/launch/steps/Update.h
index d855a1db..7a14011a 100644
--- a/api/logic/launch/steps/Update.h
+++ b/api/logic/launch/steps/Update.h
@@ -1,4 +1,4 @@
-/* Copyright 2013-2017 MultiMC Contributors
+/* Copyright 2013-2018 MultiMC Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,13 +19,14 @@
#include <QObjectPtr.h>
#include <LoggedProcess.h>
#include <java/JavaChecker.h>
+#include <net/Mode.h>
// FIXME: stupid. should be defined by the instance type? or even completely abstracted away...
class Update: public LaunchStep
{
Q_OBJECT
public:
- explicit Update(LaunchTask *parent):LaunchStep(parent) {};
+ explicit Update(LaunchTask *parent, Net::Mode mode):LaunchStep(parent), m_mode(mode) {};
virtual ~Update() {};
void executeTask() override;
@@ -40,4 +41,5 @@ private slots:
private:
shared_qobject_ptr<Task> m_updateTask;
bool m_aborted = false;
+ Net::Mode m_mode = Net::Mode::Offline;
};