summaryrefslogtreecommitdiffstats
path: root/api/logic/launch
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2017-02-08 20:01:42 +0100
committerPetr Mrázek <peterix@gmail.com>2017-02-08 20:01:42 +0100
commit8bbaab334c5116be4c180c3eac93c4acc844f4bd (patch)
treeddb2796f0cfe574bec2132e98eff675d2ccccb59 /api/logic/launch
parent155de307bc6ef1a42226831550680110e00dc8c3 (diff)
downloadMultiMC-8bbaab334c5116be4c180c3eac93c4acc844f4bd.tar
MultiMC-8bbaab334c5116be4c180c3eac93c4acc844f4bd.tar.gz
MultiMC-8bbaab334c5116be4c180c3eac93c4acc844f4bd.tar.lz
MultiMC-8bbaab334c5116be4c180c3eac93c4acc844f4bd.tar.xz
MultiMC-8bbaab334c5116be4c180c3eac93c4acc844f4bd.zip
NOISSUE set line limit and overflow behaviour even for hidden console
Diffstat (limited to 'api/logic/launch')
-rw-r--r--api/logic/launch/LaunchTask.cpp6
-rw-r--r--api/logic/launch/LogModel.cpp5
-rw-r--r--api/logic/launch/LogModel.h1
3 files changed, 12 insertions, 0 deletions
diff --git a/api/logic/launch/LaunchTask.cpp b/api/logic/launch/LaunchTask.cpp
index 9df5f85a..23c28f50 100644
--- a/api/logic/launch/LaunchTask.cpp
+++ b/api/logic/launch/LaunchTask.cpp
@@ -209,6 +209,12 @@ shared_qobject_ptr<LogModel> LaunchTask::getLogModel()
if(!m_logModel)
{
m_logModel.reset(new LogModel());
+ m_logModel->setMaxLines(m_instance->getConsoleMaxLines());
+ m_logModel->setStopOnOverflow(m_instance->shouldStopOnConsoleOverflow());
+ // FIXME: should this really be here?
+ m_logModel->setOverflowMessage(tr("MultiMC stopped watching the game log because the log length surpassed %1 lines.\n"
+ "You may have to fix your mods because the game is still logging to files and"
+ " likely wasting harddrive space at an alarming rate!").arg(m_logModel->getMaxLines()));
}
return m_logModel;
}
diff --git a/api/logic/launch/LogModel.cpp b/api/logic/launch/LogModel.cpp
index 579aa654..042feeab 100644
--- a/api/logic/launch/LogModel.cpp
+++ b/api/logic/launch/LogModel.cpp
@@ -133,6 +133,11 @@ void LogModel::setMaxLines(int maxLines)
m_maxLines = maxLines;
}
+int LogModel::getMaxLines()
+{
+ return m_maxLines;
+}
+
void LogModel::setStopOnOverflow(bool stop)
{
m_stopOnOverflow = stop;
diff --git a/api/logic/launch/LogModel.h b/api/logic/launch/LogModel.h
index 558242d8..57cd23b0 100644
--- a/api/logic/launch/LogModel.h
+++ b/api/logic/launch/LogModel.h
@@ -21,6 +21,7 @@ public:
QString toPlainText();
+ int getMaxLines();
void setMaxLines(int maxLines);
void setStopOnOverflow(bool stop);
void setOverflowMessage(const QString & overflowMessage);