1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-21 08:19:42 +01:00

Add a basic DiagnosticsDialog without actual functionality

This commit is contained in:
Dominik Schmidt 2011-05-05 22:22:16 +02:00
parent 7b43376e61
commit 5a9425a930
7 changed files with 153 additions and 0 deletions

View File

@ -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

47
src/diagnosticsdialog.cpp Normal file
View File

@ -0,0 +1,47 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2011, Dominik Schmidt <dev@dominik-schmidt.de>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include "diagnosticsdialog.h"
#include "ui_diagnosticsdialog.h"
#include <QPlainTextEdit>
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);
}

44
src/diagnosticsdialog.h Normal file
View File

@ -0,0 +1,44 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2011, Dominik Schmidt <dev@dominik-schmidt.de>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#ifndef DIGANOSTICSDIALOG_H
#define DIAGNOSTICSDIALOG_H
#include <QDialog>
#include <QDebug>
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

42
src/diagnosticsdialog.ui Normal file
View File

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DiagnosticsDialog</class>
<widget class="QDialog" name="DiagnosticsDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>621</width>
<height>434</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>353</height>
</size>
</property>
<property name="windowTitle">
<string>Tomahawk Diagnostics</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QTextEdit" name="logView"/>
</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>
</widget>
<resources>
<include location="../resources.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -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()
// <Menu Items>
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()

View File

@ -66,6 +66,7 @@ public slots:
void createPlaylist();
void loadSpiff();
void showSettingsDialog();
void showDiagnosticsDialog();
void updateCollectionManually();
void pluginMenuAdded(QMenu*);
void pluginMenuRemoved(QMenu*);

View File

@ -83,6 +83,8 @@
<property name="title">
<string>&amp;Help</string>
</property>
<addaction name="actionDiagnostics"/>
<addaction name="separator"/>
<addaction name="actionAboutTomahawk"/>
</widget>
<addaction name="menuApp"/>
@ -181,6 +183,11 @@
<string>Meta+Ctrl+Z</string>
</property>
</action>
<action name="actionDiagnostics">
<property name="text">
<string>Diagnostics...</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources/>