Added some better debug output in the slots concerned with the text edit
of the main window ("update status"). Use insertPlainText() when adding to the text edit to simplify code.
This commit is contained in:
parent
18378afdc5
commit
9c213d0a97
@ -329,7 +329,8 @@ void MainWindow::onQuit() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::scrollDownTextEdit() {
|
void MainWindow::scrollDownTextEdit() {
|
||||||
qCritical() << "ON REPLACE LAST CALLED AT" << QDateTime::currentDateTime().toString(Qt::ISODateWithMs);
|
Utils::printInfoMsg(QString("SCROLL-DOWN-TEXT_EDIT CALLED AT ")
|
||||||
|
+ QDateTime::currentDateTime().toString(Qt::ISODateWithMs));
|
||||||
|
|
||||||
ui->updateStatus->setEnabled(true);
|
ui->updateStatus->setEnabled(true);
|
||||||
|
|
||||||
@ -340,30 +341,37 @@ void MainWindow::scrollDownTextEdit() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::onAppendText(QString text, QString suffix) {
|
void MainWindow::onAppendText(QString text, QString suffix) {
|
||||||
qCritical() << "ON APPEND CALLED AT" << QDateTime::currentDateTime().toString(Qt::ISODateWithMs);
|
Utils::printInfoMsg(QString("ON APPEND CALLED AT ")
|
||||||
|
+ QDateTime::currentDateTime().toString(Qt::ISODateWithMs));
|
||||||
|
|
||||||
QString editText = ui->updateStatus->toPlainText();
|
QString editText = ui->updateStatus->toPlainText();
|
||||||
if (!suffix.isNull() && suffix.size() > 0) {
|
if (!suffix.isNull() && suffix.size() > 0) {
|
||||||
//qInfo() << "TEXT" << text << "SUFFIX" << suffix;
|
//qInfo() << "TEXT" << text << "SUFFIX" << suffix;
|
||||||
if (suffix == Worker::UPDATE_STEP_SUCCESS || suffix == Worker::UPDATE_STEP_FAIL) {
|
if (suffix == Worker::UPDATE_STEP_SUCCESS || suffix == Worker::UPDATE_STEP_FAIL) {
|
||||||
editText += QString("\n").leftJustified(m_width-3, '=');
|
ui->updateStatus->insertPlainText(QString("\n").leftJustified(m_width-3, '=') + " ");
|
||||||
editText += " ";
|
// editText += QString("\n").leftJustified(m_width-3, '=');
|
||||||
|
// editText += " ";
|
||||||
}
|
}
|
||||||
QString const &add = (QString("\n") + text).leftJustified(m_width - (2 + suffix.size())) + suffix;
|
QString const &add = (QString("\n") + text).leftJustified(m_width - (2 + suffix.size())) + suffix;
|
||||||
editText += add;
|
ui->updateStatus->insertPlainText(add);
|
||||||
|
// editText += add;
|
||||||
} else {
|
} else {
|
||||||
QString const &add = text.leftJustified(m_width-9);
|
QString const &add = text.leftJustified(m_width-9);
|
||||||
editText += add;
|
ui->updateStatus->insertPlainText(add);
|
||||||
|
//editText += add;
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils::printLineEditInfo(editText.split('\n', QString::SplitBehavior::SkipEmptyParts));
|
// debug
|
||||||
ui->updateStatus->setText(editText.trimmed());
|
// QString editText = ui->updateStatus->toPlainText();
|
||||||
|
// Utils::printLineEditInfo(editText.split('\n', QString::SplitBehavior::SkipEmptyParts));
|
||||||
|
// ui->updateStatus->setText(editText.trimmed());
|
||||||
|
|
||||||
scrollDownTextEdit();
|
scrollDownTextEdit();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::onReplaceLast(QStringList newTextLines, QString suffix) {
|
void MainWindow::onReplaceLast(QStringList newTextLines, QString suffix) {
|
||||||
qCritical() << "ON REPLACE LAST CALLED AT" << QDateTime::currentDateTime().toString(Qt::ISODateWithMs);
|
Utils::printInfoMsg(QString("ON REPLACE LAST (LIST) CALLED AT ")
|
||||||
|
+ QDateTime::currentDateTime().toString(Qt::ISODateWithMs));
|
||||||
|
|
||||||
int const s = newTextLines.size();
|
int const s = newTextLines.size();
|
||||||
if (s > 0) {
|
if (s > 0) {
|
||||||
@ -397,7 +405,8 @@ void MainWindow::onReplaceLast(QStringList newTextLines, QString suffix) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::onReplaceLast(QString text, QString suffix) {
|
void MainWindow::onReplaceLast(QString text, QString suffix) {
|
||||||
qCritical() << "ON REPLACE LAST CALLED AT" << QDateTime::currentDateTime().toString(Qt::ISODateWithMs);
|
Utils::printInfoMsg(QString("ON REPLACE LAST (TEXT) CALLED AT ")
|
||||||
|
+ QDateTime::currentDateTime().toString(Qt::ISODateWithMs));
|
||||||
|
|
||||||
QString editText = ui->updateStatus->toPlainText();
|
QString editText = ui->updateStatus->toPlainText();
|
||||||
QStringList lines = editText.split('\n', QString::SplitBehavior::SkipEmptyParts);
|
QStringList lines = editText.split('\n', QString::SplitBehavior::SkipEmptyParts);
|
||||||
|
Loading…
Reference in New Issue
Block a user