~ubuntu-branches/ubuntu/maverick/transmission/maverick

« back to all changes in this revision

Viewing changes to qt/about.cc

  • Committer: Bazaar Package Importer
  • Author(s): Krzysztof Klimonda
  • Date: 2009-05-22 21:57:30 UTC
  • mfrom: (1.2.2 upstream)
  • mto: (2.1.18 sid) (1.3.8 upstream)
  • mto: This revision was merged to the branch mainline in revision 36.
  • Revision ID: james.westby@ubuntu.com-20090522215730-ly5kgv5aw9ig2u82
Tags: upstream-1.61
ImportĀ upstreamĀ versionĀ 1.61

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * This file Copyright (C) 2009 Charles Kerr <charles@transmissionbt.com>
 
3
 *
 
4
 * This file is licensed by the GPL version 2.  Works owned by the
 
5
 * Transmission project are granted a special exemption to clause 2(b)
 
6
 * so that the bulk of its code can remain under the MIT license.
 
7
 * This exemption does not extend to derived works not owned by
 
8
 * the Transmission project.
 
9
 *
 
10
 * $Id:$
 
11
 */
 
12
 
 
13
#include <QDialogButtonBox>
 
14
#include <QFont>
 
15
#include <QLabel>
 
16
#include <QMessageBox>
 
17
#include <QPixmap>
 
18
#include <QPushButton>
 
19
#include <QString>
 
20
#include <QTextEdit>
 
21
#include <QVBoxLayout>
 
22
#include <QWidget>
 
23
 
 
24
#include <libtransmission/transmission.h>
 
25
#include <libtransmission/version.h>
 
26
 
 
27
#include "about.h"
 
28
#include "hig.h"
 
29
#include "license.h"
 
30
 
 
31
AboutDialog :: AboutDialog( QWidget * parent ):
 
32
    QDialog( parent, Qt::Dialog ),
 
33
    myLicenseDialog( new LicenseDialog( this ) )
 
34
{
 
35
    setWindowTitle( tr( "About Transmission" ) );
 
36
    QLabel * l;
 
37
    QVBoxLayout * v = new QVBoxLayout( this );
 
38
 
 
39
    l = new QLabel;
 
40
    l->setPixmap( QPixmap( ":/icons/transmission-48.png" ) );
 
41
    l->setAlignment( Qt::AlignCenter );
 
42
    v->addWidget( l );
 
43
 
 
44
    QFont f( font( ) );
 
45
    f.setWeight( QFont::Bold );
 
46
    f.setPointSize( int( f.pointSize( ) * 1.2 ) );
 
47
    l = new QLabel( "<big>Transmission " LONG_VERSION_STRING "</big>" );
 
48
    l->setAlignment( Qt::AlignCenter );
 
49
    l->setFont( f );
 
50
    l->setMargin( 8 );
 
51
    v->addWidget( l );
 
52
 
 
53
    l = new QLabel( tr( "A fast and easy BitTorrent client" ) );
 
54
    l->setStyleSheet( "text-align: center" );
 
55
    l->setAlignment( Qt::AlignCenter );
 
56
    v->addWidget( l );
 
57
 
 
58
    l = new QLabel( tr( "Copyright 2005-2009 The Transmission Project" ) );
 
59
    l->setAlignment( Qt::AlignCenter );
 
60
    v->addWidget( l );
 
61
 
 
62
    l = new QLabel( "<a href=\"http://www.transmissionbt.com/\">http://www.transmissionbt.com/</a>" );
 
63
    l->setOpenExternalLinks( true );
 
64
    l->setAlignment( Qt::AlignCenter );
 
65
    v->addWidget( l );
 
66
 
 
67
    v->addSpacing( HIG::PAD_BIG );
 
68
 
 
69
    QPushButton * b;
 
70
    QDialogButtonBox * box = new QDialogButtonBox;
 
71
 
 
72
    b = new QPushButton( tr( "C&redits" ), this );
 
73
    box->addButton( b, QDialogButtonBox::ActionRole );
 
74
    connect( b, SIGNAL(clicked()), this, SLOT(showCredits()) );
 
75
 
 
76
    b = new QPushButton( tr( "&License" ), this );
 
77
    box->addButton( b, QDialogButtonBox::ActionRole );
 
78
    connect( b, SIGNAL(clicked()), myLicenseDialog, SLOT(show()) );
 
79
 
 
80
    box->addButton( QDialogButtonBox::Close );
 
81
    box->setCenterButtons( true );
 
82
    v->addWidget( box );
 
83
    connect( box, SIGNAL(rejected()), this, SLOT(hide()) );
 
84
}
 
85
 
 
86
void
 
87
AboutDialog :: showCredits( )
 
88
{
 
89
    QMessageBox::about( this, tr( "Credits" ),
 
90
        "Charles Kerr (Backend; Daemon; GTK+; Qt)\n"
 
91
        "Michell Livingston (Backend; OS X)\n"
 
92
        "Eric Petit (Backend; OS X)" );
 
93
}
 
94