diff --git a/src/AboutDialog.cpp b/src/AboutDialog.cpp new file mode 100644 index 000000000..e3222c9c5 --- /dev/null +++ b/src/AboutDialog.cpp @@ -0,0 +1,42 @@ +/* === This file is part of Tomahawk Player - === + * + * Copyright 2010-2012, Leo Franchi + * + * 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 "AboutDialog.h" + +#include "ui_AboutDialog.h" + +#include "utils/tomahawkutils.h" +#include "config.h" + +#include +#include + +AboutDialog::AboutDialog( QWidget* parent ) + : QDialog( parent ) + , m_ui( new Ui::AboutDialog ) +{ + m_ui->setupUi( this ); + + const QString version = TomahawkUtils::appFriendlyVersion(); + QString debugHash; +#ifdef DEBUG_BUILD + debugHash = QString( "
(%1)" ).arg( qApp->applicationVersion() ); +#endif + + m_ui->titleLabel->setText( m_ui->titleLabel->text().arg( version ).arg( debugHash ) ); +} diff --git a/src/AboutDialog.h b/src/AboutDialog.h new file mode 100644 index 000000000..84e6466e1 --- /dev/null +++ b/src/AboutDialog.h @@ -0,0 +1,38 @@ +/* === This file is part of Tomahawk Player - === + * + * Copyright 2010-2012, Leo Franchi + * + * 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 ABOUTDIALOG_H +#define ABOUTDIALOG_H + +#include + +namespace Ui { + class AboutDialog; +} + +class AboutDialog : public QDialog +{ + Q_OBJECT +public: + explicit AboutDialog( QWidget* parent = 0 ); + +private: + Ui::AboutDialog* m_ui; +}; + +#endif // ABOUTDIALOG_H diff --git a/src/AboutDialog.ui b/src/AboutDialog.ui new file mode 100644 index 000000000..ee48ddc21 --- /dev/null +++ b/src/AboutDialog.ui @@ -0,0 +1,190 @@ + + + AboutDialog + + + + 0 + 0 + 428 + 247 + + + + + 0 + 0 + + + + Dialog + + + + 2 + + + + + + + + + + :/data/icons/tomahawk-icon-64x64.png + + + + + + + + + <html><head/><body><p><span style=" font-size:x-large; font-weight:600;">Tomahawk %1%2<br/></span></p></body></html> + + + + + + + Copyright 2010 - 2012 +Christian Muehlhaeuser <muesli@tomahawk-player.org> + +Thanks to: Leo Franchi, Jeff Mitchell, Dominik Schmidt, Jason Herskowitz, +Alejandro Wainzinger, Hugo Lindström, Michael Zanetti, Harald Sitter +and Steve Robertson + + + + + + + + + + + Qt::Vertical + + + + 20 + 19 + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 64 + 64 + + + + + + + :/data/images/spotifycore-logo.png + + + true + + + + + + + + 9 + + + + This product uses SPOTIFY(R) CORE but is not endorsed, certified or otherwise approved in any way by Spotify. Spotify is the registered trade mark of the Spotify Group. + + + true + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Ok + + + + + + + + + + + + buttonBox + accepted() + AboutDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + AboutDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c34e9f487..bdad76d96 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -90,6 +90,7 @@ SET( tomahawkSourcesGui ${tomahawkSourcesGui} AccountFactoryWrapper.cpp AccountFactoryWrapperDelegate.cpp SocialWidget.cpp + AboutDialog.cpp ) IF( WITH_BREAKPAD ) @@ -109,6 +110,7 @@ SET( tomahawkUI ${tomahawkUI} LoadXSPFDialog.ui AccountFactoryWrapper.ui SocialWidget.ui + AboutDialog.ui ) INCLUDE_DIRECTORIES( diff --git a/src/accounts/spotify/SpotifyAccountConfig.ui b/src/accounts/spotify/SpotifyAccountConfig.ui index 95c9ba48e..bee36b9f1 100644 --- a/src/accounts/spotify/SpotifyAccountConfig.ui +++ b/src/accounts/spotify/SpotifyAccountConfig.ui @@ -181,70 +181,6 @@ - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 64 - 64 - - - - - - - :/data/images/spotifycore-logo.png - - - true - - - - - - - - 9 - - - - This product uses SPOTIFY(R) CORE but is not endorsed, certified or otherwise approved in any way by Spotify. Spotify is the registered trade mark of the Spotify Group. - - - true - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - diff --git a/src/tomahawkwindow.cpp b/src/tomahawkwindow.cpp index 89322a5da..fc64c3115 100644 --- a/src/tomahawkwindow.cpp +++ b/src/tomahawkwindow.cpp @@ -73,6 +73,7 @@ #include "jobview/JobStatusModel.h" #include "LoadXSPFDialog.h" #include +#include "AboutDialog.h" using namespace Tomahawk; using namespace Accounts; @@ -741,21 +742,8 @@ TomahawkWindow::setWindowTitle( const QString& title ) void TomahawkWindow::showAboutTomahawk() { - QString head, desc; - -#ifdef DEBUG_BUILD - head = tr( "

Tomahawk %1
(%2)

" ) - .arg( TomahawkUtils::appFriendlyVersion() ) - .arg( qApp->applicationVersion() ); -#else - head = tr( "

Tomahawk %1

" ) - .arg( TomahawkUtils::appFriendlyVersion() ); -#endif - - desc = tr( "Copyright 2010 - 2012
Christian Muehlhaeuser <muesli@tomahawk-player.org>

" - "Thanks to: Leo Franchi, Jeff Mitchell, Dominik Schmidt, Jason Herskowitz, Alejandro Wainzinger, Hugo Lindström, Michael Zanetti, Harald Sitter and Steve Robertson" ); - - QMessageBox::about( this, tr( "About Tomahawk" ), head + desc ); + AboutDialog diag( this ); + diag.exec(); }