-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlogtext.cpp
35 lines (27 loc) · 929 Bytes
/
logtext.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "logtext.h"
LogText::LogText(QObject *parent) : QObject(parent)
{
}
void LogText::start() {
QStringList args;
args << "-jar" << "configServer.jar";
p.kill();
p.setProcessChannelMode(QProcess::MergedChannels);
p.setProgram(QString("java"));
p.setArguments(args);
QObject::connect(&p, SIGNAL(started()), this, SLOT(started()));
QObject::connect(&p, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(finished(int,QProcess::ExitStatus)));
QObject::connect(&p, SIGNAL(readyRead()), this, SLOT(readyRead()));
p.start(QIODevice::ReadOnly);
}
void LogText::stop(bool restart) {
this->restart = restart;
p.terminate();
m_logText += "</table>";
emit logTextChanged();
}
void LogText::configHasChanged() {
if(running)
m_sText = "<span style=\"color: orange;font-weight: bold;\">running, but config change not used</span>";
emit sTextChanged();
}