mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-05 21:57:41 +02:00
DiagnosticsDialog: add update and copy-to-clipboard button
This commit is contained in:
@@ -23,6 +23,10 @@
|
|||||||
|
|
||||||
#include <QTextEdit>
|
#include <QTextEdit>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include <QDialogButtonBox>
|
||||||
|
#include <QPushButton>
|
||||||
|
#include <QApplication>
|
||||||
|
#include <QClipboard>
|
||||||
|
|
||||||
DiagnosticsDialog::DiagnosticsDialog( QWidget *parent )
|
DiagnosticsDialog::DiagnosticsDialog( QWidget *parent )
|
||||||
: QDialog( parent )
|
: QDialog( parent )
|
||||||
@@ -30,10 +34,10 @@ DiagnosticsDialog::DiagnosticsDialog( QWidget *parent )
|
|||||||
{
|
{
|
||||||
ui->setupUi( this );
|
ui->setupUi( this );
|
||||||
|
|
||||||
|
connect( ui->updateButton, SIGNAL( clicked() ), this, SLOT( updateLogView() ) );
|
||||||
|
connect( ui->clipboardButton, SIGNAL( clicked() ), this, SLOT( copyToClipboard() ) );
|
||||||
connect( ui->buttonBox, SIGNAL( rejected() ), this, SLOT( reject() ) );
|
connect( ui->buttonBox, SIGNAL( rejected() ), this, SLOT( reject() ) );
|
||||||
|
|
||||||
ui->logView->setReadOnly(true);
|
|
||||||
|
|
||||||
updateLogView();
|
updateLogView();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,3 +87,9 @@ void DiagnosticsDialog::updateLogView()
|
|||||||
|
|
||||||
ui->logView->setPlainText(log);
|
ui->logView->setPlainText(log);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DiagnosticsDialog::copyToClipboard()
|
||||||
|
{
|
||||||
|
QApplication::clipboard()->setText( ui->logView->toPlainText() );
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -37,6 +37,8 @@ public:
|
|||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void updateLogView();
|
void updateLogView();
|
||||||
|
void copyToClipboard();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::DiagnosticsDialog* ui;
|
Ui::DiagnosticsDialog* ui;
|
||||||
};
|
};
|
||||||
|
@@ -21,17 +21,39 @@
|
|||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QTextEdit" name="logView"/>
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QTextEdit" name="logView"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QDialogButtonBox" name="buttonBox">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<property name="orientation">
|
<item>
|
||||||
<enum>Qt::Horizontal</enum>
|
<widget class="QPushButton" name="updateButton">
|
||||||
</property>
|
<property name="text">
|
||||||
<property name="standardButtons">
|
<string>Update</string>
|
||||||
<set>QDialogButtonBox::Close</set>
|
</property>
|
||||||
</property>
|
</widget>
|
||||||
</widget>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="clipboardButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>Copy to Clipboard</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="standardButtons">
|
||||||
|
<set>QDialogButtonBox::Close</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
Reference in New Issue
Block a user