Transmission: update to 2.82
[tomato.git] / release / src / router / transmission / qt / about.cc
blob6ab81a70eae79be812d2780cb9c81d34e5907e6c
1 /*
2 * This file Copyright (C) Mnemosyne LLC
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2
6 * as published by the Free Software Foundation.
8 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
10 * $Id: about.cc 14150 2013-07-27 21:58:14Z jordan $
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>
24 #include <libtransmission/transmission.h>
25 #include <libtransmission/version.h>
27 #include "about.h"
28 #include "hig.h"
29 #include "license.h"
31 AboutDialog :: AboutDialog (QWidget * parent):
32 QDialog (parent, Qt::Dialog),
33 myLicenseDialog (new LicenseDialog (this))
35 setWindowTitle (tr ("About Transmission"));
36 QLabel * l;
37 QVBoxLayout * v = new QVBoxLayout (this);
39 l = new QLabel;
40 l->setPixmap (QPixmap (QString::fromUtf8 (":/icons/transmission-48.png")));
41 l->setAlignment (Qt::AlignCenter);
42 v->addWidget (l);
44 QFont f (font ());
45 f.setWeight (QFont::Bold);
46 f.setPointSize (int (f.pointSize () * 1.2));
47 l = new QLabel (tr ("<big>Transmission %1</big>").arg (QString::fromUtf8 (LONG_VERSION_STRING)));
48 l->setAlignment (Qt::AlignCenter);
49 l->setFont (f);
50 l->setMargin (8);
51 v->addWidget (l);
53 l = new QLabel (tr ("A fast and easy BitTorrent client"));
54 l->setStyleSheet (QString::fromUtf8 ("text-align: center"));
55 l->setAlignment (Qt::AlignCenter);
56 v->addWidget (l);
58 l = new QLabel (tr ("Copyright (c) The Transmission Project"));
59 l->setAlignment (Qt::AlignCenter);
60 v->addWidget (l);
62 l = new QLabel (QString::fromUtf8 ("<a href=\"http://www.transmissionbt.com/\">http://www.transmissionbt.com/</a>"));
63 l->setOpenExternalLinks (true);
64 l->setAlignment (Qt::AlignCenter);
65 v->addWidget (l);
67 v->addSpacing (HIG::PAD_BIG);
69 QPushButton * b;
70 QDialogButtonBox * box = new QDialogButtonBox;
72 b = new QPushButton (tr ("C&redits"), this);
73 box->addButton (b, QDialogButtonBox::ActionRole);
74 connect (b, SIGNAL (clicked ()), this, SLOT (showCredits ()));
76 b = new QPushButton (tr ("&License"), this);
77 box->addButton (b, QDialogButtonBox::ActionRole);
78 connect (b, SIGNAL (clicked ()), myLicenseDialog, SLOT (show ()));
80 box->addButton (QDialogButtonBox::Close);
81 box->setCenterButtons (true);
82 v->addWidget (box);
83 connect (box, SIGNAL (rejected ()), this, SLOT (hide ()));
86 void
87 AboutDialog :: showCredits ()
89 QMessageBox::about (
90 this,
91 tr ("Credits"),
92 QString::fromUtf8 ("Jordan Lee (Backend; Daemon; GTK+; Qt)\n"
93 "Michell Livingston (OS X)\n"));