diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 45cf481d1..47a058c81 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -64,6 +64,7 @@ SET( tomahawkSourcesGui ${tomahawkSourcesGui} tomahawktrayicon.cpp audiocontrols.cpp settingsdialog.cpp + diagnosticsdialog.cpp configdelegatebase.cpp sipconfigdelegate.cpp resolverconfigdelegate.cpp @@ -106,6 +107,7 @@ SET( tomahawkHeadersGui ${tomahawkHeadersGui} tomahawktrayicon.h audiocontrols.h settingsdialog.h + diagnosticsdialog.h configdelegatebase.h resolverconfigdelegate.h sipconfigdelegate.h @@ -117,6 +119,7 @@ SET( tomahawkHeadersGui ${tomahawkHeadersGui} SET( tomahawkUI ${tomahawkUI} tomahawkwindow.ui settingsdialog.ui + diagnosticsdialog.ui stackedsettingsdialog.ui proxydialog.ui diff --git a/src/diagnosticsdialog.cpp b/src/diagnosticsdialog.cpp new file mode 100644 index 000000000..f3277f7ac --- /dev/null +++ b/src/diagnosticsdialog.cpp @@ -0,0 +1,47 @@ +/* === This file is part of Tomahawk Player - === + * + * Copyright 2011, Dominik Schmidt + * + * Tomahawk is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Tomahawk is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Tomahawk. If not, see . + */ + +#include "diagnosticsdialog.h" +#include "ui_diagnosticsdialog.h" + + +#include + +DiagnosticsDialog::DiagnosticsDialog( QWidget *parent ) + : QDialog( parent ) + , ui( new Ui::DiagnosticsDialog ) +{ + ui->setupUi( this ); + + connect( ui->buttonBox, SIGNAL( rejected() ), this, SLOT( reject() ) ); + + ui->logView->setReadOnly(true); + + updateLogView(); +} + +void DiagnosticsDialog::updateLogView() +{ + QString log( + "Tomahawk Diagnostics Log\n\n" + ); + + ui->logView->setPlainText(log); +} + + diff --git a/src/diagnosticsdialog.h b/src/diagnosticsdialog.h new file mode 100644 index 000000000..ab64ab23d --- /dev/null +++ b/src/diagnosticsdialog.h @@ -0,0 +1,44 @@ +/* === This file is part of Tomahawk Player - === + * + * Copyright 2011, Dominik Schmidt + * + * Tomahawk is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Tomahawk is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Tomahawk. If not, see . + */ + +#ifndef DIGANOSTICSDIALOG_H +#define DIAGNOSTICSDIALOG_H + +#include +#include + +namespace Ui +{ + class DiagnosticsDialog; +} + +class DiagnosticsDialog : public QDialog +{ +Q_OBJECT + +public: + explicit DiagnosticsDialog( QWidget* parent = 0 ); + ~DiagnosticsDialog() {}; + +private slots: + void updateLogView(); +private: + Ui::DiagnosticsDialog* ui; +}; + +#endif // DIAGNOSTICSDIALOG_H diff --git a/src/diagnosticsdialog.ui b/src/diagnosticsdialog.ui new file mode 100644 index 000000000..992f96e51 --- /dev/null +++ b/src/diagnosticsdialog.ui @@ -0,0 +1,42 @@ + + + DiagnosticsDialog + + + + 0 + 0 + 621 + 434 + + + + + 0 + 353 + + + + Tomahawk Diagnostics + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Close + + + + + + + + + + diff --git a/src/tomahawkwindow.cpp b/src/tomahawkwindow.cpp index 041989bcf..47e5b8394 100644 --- a/src/tomahawkwindow.cpp +++ b/src/tomahawkwindow.cpp @@ -52,6 +52,7 @@ #include "audiocontrols.h" #include "settingsdialog.h" +#include "diagnosticsdialog.h" #include "tomahawksettings.h" #include "sourcelist.h" #include "transferview.h" @@ -261,6 +262,7 @@ TomahawkWindow::setupSignals() // connect( ui->actionPreferences, SIGNAL( triggered() ), SLOT( showSettingsDialog() ) ); + connect( ui->actionDiagnostics, SIGNAL( triggered() ), SLOT( showDiagnosticsDialog() ) ); connect( ui->actionToggleConnect, SIGNAL( triggered() ), APP->sipHandler(), SLOT( toggleConnect() ) ); // connect( ui->actionAddPeerManually, SIGNAL( triggered() ), SLOT( addPeerManually() ) ); connect( ui->actionRescanCollection, SIGNAL( triggered() ), SLOT( updateCollectionManually() ) ); @@ -349,6 +351,13 @@ TomahawkWindow::showSettingsDialog() win.exec(); } +void TomahawkWindow::showDiagnosticsDialog() +{ + qDebug() << Q_FUNC_INFO; + DiagnosticsDialog win; + win.exec(); +} + void TomahawkWindow::updateCollectionManually() diff --git a/src/tomahawkwindow.h b/src/tomahawkwindow.h index f86a5b54d..730ba47ce 100644 --- a/src/tomahawkwindow.h +++ b/src/tomahawkwindow.h @@ -66,6 +66,7 @@ public slots: void createPlaylist(); void loadSpiff(); void showSettingsDialog(); + void showDiagnosticsDialog(); void updateCollectionManually(); void pluginMenuAdded(QMenu*); void pluginMenuRemoved(QMenu*); diff --git a/src/tomahawkwindow.ui b/src/tomahawkwindow.ui index c4fee4d69..ece2c6407 100644 --- a/src/tomahawkwindow.ui +++ b/src/tomahawkwindow.ui @@ -83,6 +83,8 @@ &Help + + @@ -181,6 +183,11 @@ Meta+Ctrl+Z + + + Diagnostics... + +