Fixed onAppendText() and onReplaceLast():
Watch out for special suffixes.
This commit is contained in:
parent
6d43cf4c9f
commit
cdb045b72b
@ -97,7 +97,7 @@ void MainWindow::customEvent(QEvent *event) {
|
|||||||
m_progressValue = progress;
|
m_progressValue = progress;
|
||||||
ui->updateProgress->setValue(progress/10);
|
ui->updateProgress->setValue(progress/10);
|
||||||
QApplication::postEvent(this, new ProgressEvent(this, progress+10));
|
QApplication::postEvent(this, new ProgressEvent(this, progress+10));
|
||||||
QThread::msleep(100);
|
QThread::msleep(150);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -147,9 +147,12 @@ void MainWindow::onQuit() {
|
|||||||
|
|
||||||
void MainWindow::onAppendText(QString text, QString suffix) {
|
void MainWindow::onAppendText(QString text, QString suffix) {
|
||||||
QString editText = ui->updateStatus->toPlainText();
|
QString editText = ui->updateStatus->toPlainText();
|
||||||
if (suffix.size() > 0) {
|
if (!suffix.isNull() && suffix.size() > 0) {
|
||||||
editText += QString("\n").leftJustified(m_width-3, '=');
|
qInfo() << "TEXT" << text << "SUFFIX" << suffix;
|
||||||
editText += " ";
|
if (suffix == Worker::UPDATE_STEP_SUCCESS || suffix == Worker::UPDATE_STEP_FAIL) {
|
||||||
|
editText += QString("\n").leftJustified(m_width-3, '=');
|
||||||
|
editText += " ";
|
||||||
|
}
|
||||||
editText += (QString("\n") + text).leftJustified(m_width - (2 + suffix.size()) ) + suffix;
|
editText += (QString("\n") + text).leftJustified(m_width - (2 + suffix.size()) ) + suffix;
|
||||||
} else {
|
} else {
|
||||||
editText += text.leftJustified(m_width-9);
|
editText += text.leftJustified(m_width-9);
|
||||||
|
Loading…
Reference in New Issue
Block a user