Changeset 8297


Ignore:
Timestamp:
Apr 26, 2009, 7:08:49 PM (12 years ago)
Author:
charles
Message:

(trunk qt) tweaks to About dialog courtesy W4pp

Location:
trunk/qt
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/qt/about.cc

    r8262 r8297  
    1414#include <QFont>
    1515#include <QLabel>
     16#include <QMessageBox>
    1617#include <QPixmap>
     18#include <QPushButton>
     19#include <QString>
     20#include <QTextEdit>
    1721#include <QVBoxLayout>
    1822#include <QWidget>
     
    2226
    2327#include "about.h"
     28#include "hig.h"
    2429
    2530AboutDialog :: AboutDialog( QWidget * parent ):
    2631    QDialog( parent, Qt::Dialog )
    2732{
     33    setWindowTitle( tr( "About Transmission" ) );
    2834    QLabel * l;
    2935    QVBoxLayout * v = new QVBoxLayout( this );
    30     setWindowTitle( tr( "About Transmission" ) );
    3136
    3237    l = new QLabel;
     
    4954    v->addWidget( l );
    5055
    51     l = new QLabel( tr( "Copyright 2005-2009, the Transmission project" ) );
     56    l = new QLabel( tr( "Copyright 2005-2009 The Transmission Project" ) );
    5257    l->setAlignment( Qt::AlignCenter );
    5358    v->addWidget( l );
     
    5863    v->addWidget( l );
    5964
    60     v->addSpacing( 10 );
     65    v->addSpacing( HIG::PAD_BIG );
    6166
     67    QPushButton * b;
    6268    QDialogButtonBox * box = new QDialogButtonBox;
     69
     70    b = new QPushButton( tr( "C&redits" ), this );
     71    box->addButton( b, QDialogButtonBox::ActionRole );
     72    connect( b, SIGNAL(clicked()), this, SLOT(showCredits()) );
     73
     74    b = new QPushButton( tr( "&License" ), this );
     75    box->addButton( b, QDialogButtonBox::ActionRole );
     76    connect( b, SIGNAL(clicked()), this, SLOT(showLicense()) );
     77
    6378    box->addButton( QDialogButtonBox::Close );
    6479    box->setCenterButtons( true );
     
    6681    connect( box, SIGNAL(rejected()), this, SLOT(hide()) );
    6782}
     83
     84void
     85AboutDialog :: showCredits( )
     86{
     87    QMessageBox::about( this, tr( "Credits" ),
     88        "Charles Kerr (Backend; Daemon; GTK+; Qt)\n"
     89        "Michell Livingston (Backend; OS X)\n"
     90        "Eric Petit (Backend; OS X)" );
     91}
     92
     93void
     94AboutDialog :: showLicense( )
     95{
     96    QMessageBox::about( this, tr( "License" ),
     97        "The Transmission binaries and most of its source code is distributed "
     98        "license. "
     99        "\n\n"
     100        "Some files are copyrighted by Charles Kerr and are covered by "
     101        "the GPL version 2.  Works owned by the Transmission project "
     102        "are granted a special exemption to clause 2(b) so that the bulk "
     103        "of its code can remain under the MIT license.  This exemption does "
     104        "not extend to original or derived works not owned by the "
     105        "Transmission project. "
     106        "\n\n"
     107        "Permission is hereby granted, free of charge, to any person obtaining "
     108        "a copy of this software and associated documentation files (the "
     109        "'Software'), to deal in the Software without restriction, including "
     110        "without limitation the rights to use, copy, modify, merge, publish, "
     111        "distribute, sublicense, and/or sell copies of the Software, and to "
     112        "permit persons to whom the Software is furnished to do so, subject to "
     113        "the following conditions: "
     114        "\n\n"
     115        "The above copyright notice and this permission notice shall be included "
     116        "in all copies or substantial portions of the Software. "
     117        "\n\n"
     118        "THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, "
     119        "EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF "
     120        "MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. "
     121        "IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY "
     122        "CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, "
     123        "TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE "
     124        "SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE." );
     125}
     126
  • trunk/qt/about.h

    r8262 r8297  
    2323        AboutDialog( QWidget * parent = 0 );
    2424        ~AboutDialog( ) { }
     25        QWidget * createAboutTab( );
     26        QWidget * createAuthorsTab( );
     27        QWidget * createLicenseTab( );
     28
     29    public slots:
     30        void showCredits( );
     31        void showLicense( );
    2532
    2633};
Note: See TracChangeset for help on using the changeset viewer.