]> granicus.if.org Git - transmission/commitdiff
(trunk qt) tweaks to About dialog courtesy W4pp
authorCharles Kerr <charles@transmissionbt.com>
Sun, 26 Apr 2009 19:08:49 +0000 (19:08 +0000)
committerCharles Kerr <charles@transmissionbt.com>
Sun, 26 Apr 2009 19:08:49 +0000 (19:08 +0000)
qt/about.cc
qt/about.h

index 1abebf0770e76118a3caf6b73db56a231937a5b0..30d0ef9528b58e00200b195ebf8ee8307d744632 100644 (file)
 #include <QDialogButtonBox>
 #include <QFont>
 #include <QLabel>
+#include <QMessageBox>
 #include <QPixmap>
+#include <QPushButton>
+#include <QString>
+#include <QTextEdit>
 #include <QVBoxLayout>
 #include <QWidget>
 
 #include <libtransmission/version.h>
 
 #include "about.h"
+#include "hig.h"
 
 AboutDialog :: AboutDialog( QWidget * parent ):
     QDialog( parent, Qt::Dialog )
 {
+    setWindowTitle( tr( "About Transmission" ) );
     QLabel * l;
     QVBoxLayout * v = new QVBoxLayout( this );
-    setWindowTitle( tr( "About Transmission" ) );
 
     l = new QLabel;
     l->setPixmap( QPixmap( ":/icons/transmission-48.png" ) );
@@ -48,7 +53,7 @@ AboutDialog :: AboutDialog( QWidget * parent ):
     l->setAlignment( Qt::AlignCenter );
     v->addWidget( l );
 
-    l = new QLabel( tr( "Copyright 2005-2009, the Transmission project" ) );
+    l = new QLabel( tr( "Copyright 2005-2009 The Transmission Project" ) );
     l->setAlignment( Qt::AlignCenter );
     v->addWidget( l );
 
@@ -57,11 +62,65 @@ AboutDialog :: AboutDialog( QWidget * parent ):
     l->setAlignment( Qt::AlignCenter );
     v->addWidget( l );
 
-    v->addSpacing( 10 );
+    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 );
+    connect( b, SIGNAL(clicked()), this, SLOT(showLicense()) );
+
     box->addButton( QDialogButtonBox::Close );
     box->setCenterButtons( true );
     v->addWidget( box );
     connect( box, SIGNAL(rejected()), this, SLOT(hide()) );
 }
+
+void
+AboutDialog :: showCredits( )
+{
+    QMessageBox::about( this, tr( "Credits" ),
+        "Charles Kerr (Backend; Daemon; GTK+; Qt)\n"
+        "Michell Livingston (Backend; OS X)\n"
+        "Eric Petit (Backend; OS X)" );
+}
+
+void
+AboutDialog :: showLicense( )
+{
+    QMessageBox::about( this, tr( "License" ),
+        "The Transmission binaries and most of its source code is distributed "
+        "license. "
+        "\n\n"
+        "Some files are copyrighted by Charles Kerr and are covered 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 original or derived works not owned by the "
+        "Transmission project. "
+        "\n\n"
+        "Permission is hereby granted, free of charge, to any person obtaining "
+        "a copy of this software and associated documentation files (the "
+        "'Software'), to deal in the Software without restriction, including "
+        "without limitation the rights to use, copy, modify, merge, publish, "
+        "distribute, sublicense, and/or sell copies of the Software, and to "
+        "permit persons to whom the Software is furnished to do so, subject to "
+        "the following conditions: "
+        "\n\n"
+        "The above copyright notice and this permission notice shall be included "
+        "in all copies or substantial portions of the Software. "
+        "\n\n"
+        "THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, "
+        "EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF "
+        "MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. "
+        "IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY "
+        "CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, "
+        "TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE "
+        "SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE." );
+}
+
index c653c69a74691960f797ae624188e577735ed38e..097929ae3920f62b294fd0a3d4680579c716d002 100644 (file)
@@ -22,6 +22,13 @@ class AboutDialog: public QDialog
     public:
         AboutDialog( QWidget * parent = 0 );
         ~AboutDialog( ) { }
+        QWidget * createAboutTab( );
+        QWidget * createAuthorsTab( );
+        QWidget * createLicenseTab( );
+
+    public slots:
+        void showCredits( );
+        void showLicense( );
 
 };