1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-25 01:03:01 +00:00
transmission/qt/about.cc

95 lines
2.7 KiB
C++
Raw Normal View History

2009-04-09 18:55:47 +00:00
/*
2010-01-04 21:00:47 +00:00
* This file Copyright (C) 2009-2010 Mnemosyne LLC
2009-04-09 18:55:47 +00:00
*
* This file is licensed by the GPL version 2. Works owned by the
* Transmission project are granted a special exemption to clause 2(b)
* so that the bulk of its code can remain under the MIT license.
* This exemption does not extend to derived works not owned by
* the Transmission project.
*
* $Id$
2009-04-09 18:55:47 +00:00
*/
#include <QDialogButtonBox>
#include <QFont>
#include <QLabel>
#include <QMessageBox>
#include <QPixmap>
#include <QPushButton>
#include <QString>
#include <QTextEdit>
#include <QVBoxLayout>
#include <QWidget>
2009-04-09 18:55:47 +00:00
#include <libtransmission/transmission.h>
#include <libtransmission/version.h>
#include "about.h"
#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
{
setWindowTitle( tr( "About Transmission" ) );
QLabel * l;
QVBoxLayout * v = new QVBoxLayout( this );
2009-04-09 18:55:47 +00:00
l = new QLabel;
l->setPixmap( QPixmap( ":/icons/transmission-48.png" ) );
l->setAlignment( Qt::AlignCenter );
v->addWidget( l );
2009-04-09 18:55:47 +00:00
QFont f( font( ) );
f.setWeight( QFont::Bold );
f.setPointSize( int( f.pointSize( ) * 1.2 ) );
l = new QLabel( "<big>Transmission " LONG_VERSION_STRING "</big>" );
l->setAlignment( Qt::AlignCenter );
l->setFont( f );
l->setMargin( 8 );
v->addWidget( l );
2009-04-09 18:55:47 +00:00
l = new QLabel( tr( "A fast and easy BitTorrent client" ) );
l->setStyleSheet( "text-align: center" );
l->setAlignment( Qt::AlignCenter );
v->addWidget( l );
l = new QLabel( tr( "Copyright 2005-2009 The Transmission Project" ) );
l->setAlignment( Qt::AlignCenter );
v->addWidget( l );
l = new QLabel( "<a href=\"http://www.transmissionbt.com/\">http://www.transmissionbt.com/</a>" );
l->setOpenExternalLinks( true );
l->setAlignment( Qt::AlignCenter );
v->addWidget( l );
v->addSpacing( HIG::PAD_BIG );
QPushButton * b;
QDialogButtonBox * box = new QDialogButtonBox;
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()) );
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
}
void
AboutDialog :: showCredits( )
{
QMessageBox::about( this, tr( "Credits" ),
"Charles Kerr (Backend; Daemon; GTK+; Qt)\n"
"Michell Livingston (Backend; OS X)\n"
"Kevin Glowacz (Web client)" );
}