|
@@ -4,8 +4,10 @@
|
|
|
|
|
|
#include <QFileDialog>
|
|
|
#include <QPlainTextEdit>
|
|
|
+#include <QHBoxLayout>
|
|
|
#include <QVBoxLayout>
|
|
|
#include <QScrollBar>
|
|
|
+#include <QPushButton>
|
|
|
#include <QFontDatabase>
|
|
|
#include <QFont>
|
|
|
#include <QDialogButtonBox>
|
|
@@ -87,13 +89,21 @@ ScriptLogWindow::ScriptLogWindow() : QWidget(nullptr)
|
|
|
edit->setFont(fixedFont);
|
|
|
edit->setWordWrapMode(QTextOption::NoWrap);
|
|
|
|
|
|
- QDialogButtonBox *buttonBox = new QDialogButtonBox(
|
|
|
- QDialogButtonBox::Close);
|
|
|
- connect(buttonBox, &QDialogButtonBox::rejected, this, &QWidget::hide);
|
|
|
+ QHBoxLayout *buttonLayout = new QHBoxLayout();
|
|
|
+ QPushButton *clearButton = new QPushButton(tr("Clear"));
|
|
|
+ connect(clearButton, &QPushButton::clicked,
|
|
|
+ this, &ScriptLogWindow::ClearWindow);
|
|
|
+ QPushButton *closeButton = new QPushButton(tr("Close"));
|
|
|
+ connect(closeButton, &QPushButton::clicked,
|
|
|
+ this, &QDialog::hide);
|
|
|
+
|
|
|
+ buttonLayout->addStretch();
|
|
|
+ buttonLayout->addWidget(clearButton);
|
|
|
+ buttonLayout->addWidget(closeButton);
|
|
|
|
|
|
QVBoxLayout *layout = new QVBoxLayout();
|
|
|
layout->addWidget(edit);
|
|
|
- layout->addWidget(buttonBox);
|
|
|
+ layout->addLayout(buttonLayout);
|
|
|
|
|
|
setLayout(layout);
|
|
|
scriptLogWidget = edit;
|
|
@@ -156,6 +166,12 @@ void ScriptLogWindow::AddLogMsg(int log_level, QString msg)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+void ScriptLogWindow::ClearWindow()
|
|
|
+{
|
|
|
+ Clear();
|
|
|
+ scriptLogWidget->setPlainText(QString());
|
|
|
+}
|
|
|
+
|
|
|
void ScriptLogWindow::Clear()
|
|
|
{
|
|
|
lines.clear();
|