Skip to content
This repository was archived by the owner on Sep 27, 2024. It is now read-only.

Commit 67a5314

Browse files
authored
Merge pull request #156 from matejak/diagnostics-clear
Added possibility to clear diagnostics dialog.
2 parents 791796e + 23f353a commit 67a5314

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

include/DiagnosticsDialog.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,11 @@ class DiagnosticsDialog : public QDialog
136136
* @brief Copies plain text log to system clipboard, useful for bug reports
137137
*/
138138
void copyToClipboard();
139+
140+
/**
141+
* @brief Clears the diagnostics dialog
142+
*/
143+
void clearDialog();
139144
};
140145

141146

src/DiagnosticsDialog.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ DiagnosticsDialog::DiagnosticsDialog(QWidget* parent):
3333
{
3434
mUI.setupUi(this);
3535

36+
QObject::connect(
37+
mUI.clearDialog, SIGNAL(clicked()),
38+
this, SLOT(clearDialog())
39+
);
40+
3641
QObject::connect(
3742
mUI.clipboardButton, SIGNAL(clicked()),
3843
this, SLOT(copyToClipboard())
@@ -165,4 +170,9 @@ void DiagnosticsDialog::copyToClipboard()
165170
clipboard->setText(fullLog);
166171
}
167172

173+
void DiagnosticsDialog::clearDialog()
174+
{
175+
mUI.messages->clear();
176+
}
177+
168178
DiagnosticsDialog* globalDiagnosticsDialog = NULL;

ui/DiagnosticsDialog.ui

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
3636
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
3737
p, li { white-space: pre-wrap; }
38-
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:monospace; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
39-
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
38+
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'monospace'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
39+
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
4040
</property>
4141
<property name="acceptRichText">
4242
<bool>false</bool>
@@ -55,6 +55,13 @@ p, li { white-space: pre-wrap; }
5555
<property name="margin">
5656
<number>0</number>
5757
</property>
58+
<item>
59+
<widget class="QPushButton" name="clearDialog">
60+
<property name="text">
61+
<string>Clear Messages</string>
62+
</property>
63+
</widget>
64+
</item>
5865
<item>
5966
<spacer name="horizontalSpacer">
6067
<property name="orientation">

0 commit comments

Comments
 (0)