NOISSUE rework of minecraft log
Now uses a model and a list view instead of text This lets mmc keep track of the contents regardless of whether the instance windows are open This is currently missing a way to select and copy text from the log.
This commit is contained in:
parent
74b4343c43
commit
fc198dd308
8 changed files with 453 additions and 197 deletions
|
@ -167,6 +167,15 @@ bool LaunchTask::abort()
|
|||
return false;
|
||||
}
|
||||
|
||||
shared_qobject_ptr<LogModel> LaunchTask::getLogModel()
|
||||
{
|
||||
if(!m_logModel)
|
||||
{
|
||||
m_logModel.reset(new LogModel());
|
||||
}
|
||||
return m_logModel;
|
||||
}
|
||||
|
||||
void LaunchTask::onLogLines(const QStringList &lines, MessageLevel::Enum defaultLevel)
|
||||
{
|
||||
for (auto & line: lines)
|
||||
|
@ -193,7 +202,8 @@ void LaunchTask::onLogLine(QString line, MessageLevel::Enum level)
|
|||
// censor private user info
|
||||
line = censorPrivateInfo(line);
|
||||
|
||||
emit log(line, level);
|
||||
auto &model = *getLogModel();
|
||||
model.append(level, line);
|
||||
}
|
||||
|
||||
void LaunchTask::emitSucceeded()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue