2009-04-09 18:55:47 +00:00
|
|
|
/*
|
2010-08-01 20:36:13 +00:00
|
|
|
* This file Copyright (C) Mnemosyne LLC
|
2009-04-09 18:55:47 +00:00
|
|
|
*
|
2010-08-01 20:36:13 +00:00
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License version 2
|
|
|
|
* as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
2009-04-09 18:55:47 +00:00
|
|
|
*
|
2009-05-31 19:33:48 +00:00
|
|
|
* $Id$
|
2009-04-09 18:55:47 +00:00
|
|
|
*/
|
|
|
|
|
2009-04-21 01:00:17 +00:00
|
|
|
#include <QDialogButtonBox>
|
|
|
|
#include <QFont>
|
|
|
|
#include <QLabel>
|
2009-04-26 19:08:49 +00:00
|
|
|
#include <QMessageBox>
|
2009-04-21 01:00:17 +00:00
|
|
|
#include <QPixmap>
|
2009-04-26 19:08:49 +00:00
|
|
|
#include <QPushButton>
|
|
|
|
#include <QString>
|
|
|
|
#include <QTextEdit>
|
2009-04-21 01:00:17 +00:00
|
|
|
#include <QVBoxLayout>
|
|
|
|
#include <QWidget>
|
2009-04-09 18:55:47 +00:00
|
|
|
|
|
|
|
#include <libtransmission/transmission.h>
|
|
|
|
#include <libtransmission/version.h>
|
|
|
|
|
|
|
|
#include "about.h"
|
2009-04-26 19:08:49 +00:00
|
|
|
#include "hig.h"
|
2009-05-08 18:52:06 +00:00
|
|
|
#include "license.h"
|
2009-04-09 18:55:47 +00:00
|
|
|
|
|
|
|
AboutDialog :: AboutDialog( QWidget * parent ):
|
2009-05-08 18:52:06 +00:00
|
|
|
QDialog( parent, Qt::Dialog ),
|
|
|
|
myLicenseDialog( new LicenseDialog( this ) )
|
2009-04-09 18:55:47 +00:00
|
|
|
{
|
2009-04-26 19:08:49 +00:00
|
|
|
setWindowTitle( tr( "About Transmission" ) );
|
2009-04-21 01:00:17 +00:00
|
|
|
QLabel * l;
|
|
|
|
QVBoxLayout * v = new QVBoxLayout( this );
|
2009-04-09 18:55:47 +00:00
|
|
|
|
2009-04-21 01:00:17 +00:00
|
|
|
l = new QLabel;
|
2011-08-20 05:19:27 +00:00
|
|
|
l->setPixmap( QPixmap( QString::fromAscii( ":/icons/transmission-48.png" ) ) );
|
2009-04-21 01:00:17 +00:00
|
|
|
l->setAlignment( Qt::AlignCenter );
|
|
|
|
v->addWidget( l );
|
2009-04-09 18:55:47 +00:00
|
|
|
|
2009-04-21 01:00:17 +00:00
|
|
|
QFont f( font( ) );
|
|
|
|
f.setWeight( QFont::Bold );
|
|
|
|
f.setPointSize( int( f.pointSize( ) * 1.2 ) );
|
2011-08-20 05:19:27 +00:00
|
|
|
l = new QLabel( tr( "<big>Transmission %1</big>" ).arg( QString::fromAscii( LONG_VERSION_STRING ) ) );
|
2009-04-21 01:00:17 +00:00
|
|
|
l->setAlignment( Qt::AlignCenter );
|
|
|
|
l->setFont( f );
|
|
|
|
l->setMargin( 8 );
|
|
|
|
v->addWidget( l );
|
2009-04-09 18:55:47 +00:00
|
|
|
|
2009-04-21 01:00:17 +00:00
|
|
|
l = new QLabel( tr( "A fast and easy BitTorrent client" ) );
|
2011-08-20 05:19:27 +00:00
|
|
|
l->setStyleSheet( QString::fromAscii( "text-align: center" ) );
|
2009-04-21 01:00:17 +00:00
|
|
|
l->setAlignment( Qt::AlignCenter );
|
|
|
|
v->addWidget( l );
|
|
|
|
|
2010-08-02 16:29:23 +00:00
|
|
|
l = new QLabel( tr( "Copyright (c) The Transmission Project" ) );
|
2009-04-21 01:00:17 +00:00
|
|
|
l->setAlignment( Qt::AlignCenter );
|
|
|
|
v->addWidget( l );
|
|
|
|
|
2011-08-20 05:19:27 +00:00
|
|
|
l = new QLabel( QString::fromAscii( "<a href=\"http://www.transmissionbt.com/\">http://www.transmissionbt.com/</a>" ) );
|
2009-04-21 01:00:17 +00:00
|
|
|
l->setOpenExternalLinks( true );
|
|
|
|
l->setAlignment( Qt::AlignCenter );
|
|
|
|
v->addWidget( l );
|
|
|
|
|
2009-04-26 19:08:49 +00:00
|
|
|
v->addSpacing( HIG::PAD_BIG );
|
2009-04-21 01:00:17 +00:00
|
|
|
|
2009-04-26 19:08:49 +00:00
|
|
|
QPushButton * b;
|
2009-04-21 01:00:17 +00:00
|
|
|
QDialogButtonBox * box = new QDialogButtonBox;
|
2009-04-26 19:08:49 +00:00
|
|
|
|
|
|
|
b = new QPushButton( tr( "C&redits" ), this );
|
|
|
|
box->addButton( b, QDialogButtonBox::ActionRole );
|
|
|
|
connect( b, SIGNAL(clicked()), this, SLOT(showCredits()) );
|
|
|
|
|
|
|
|
b = new QPushButton( tr( "&License" ), this );
|
|
|
|
box->addButton( b, QDialogButtonBox::ActionRole );
|
2009-05-08 18:52:06 +00:00
|
|
|
connect( b, SIGNAL(clicked()), myLicenseDialog, SLOT(show()) );
|
2009-04-26 19:08:49 +00:00
|
|
|
|
2009-04-21 01:00:17 +00:00
|
|
|
box->addButton( QDialogButtonBox::Close );
|
|
|
|
box->setCenterButtons( true );
|
|
|
|
v->addWidget( box );
|
|
|
|
connect( box, SIGNAL(rejected()), this, SLOT(hide()) );
|
2009-04-09 18:55:47 +00:00
|
|
|
}
|
2009-04-26 19:08:49 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
AboutDialog :: showCredits( )
|
|
|
|
{
|
|
|
|
QMessageBox::about( this, tr( "Credits" ),
|
2011-08-20 05:19:27 +00:00
|
|
|
QString::fromAscii( "Jordan Lee (Backend; Daemon; GTK+; Qt)\n"
|
|
|
|
"Michell Livingston (Backend; OS X)\n"
|
|
|
|
"Kevin Glowacz (Web client)" ) );
|
2009-04-26 19:08:49 +00:00
|
|
|
}
|
|
|
|
|