Vidalia 0.3.1
AboutDialog.cpp
Go to the documentation of this file.
1/*
2** This file is part of Vidalia, and is subject to the license terms in the
3** LICENSE file, found in the top level directory of this distribution. If you
4** did not receive the LICENSE file with this file, you may obtain it from the
5** Vidalia source package distributed by the Vidalia Project at
6** http://www.torproject.org/projects/vidalia.html. No part of Vidalia,
7** including this file, may be copied, modified, propagated, or distributed
8** except according to the terms described in the LICENSE file.
9*/
10
11/*
12** \file AboutDialog.cpp
13** \brief Displays information about Vidalia, Tor, and Qt
14*/
15
16#include "AboutDialog.h"
17#include "LicenseDialog.h"
18#include "Vidalia.h"
19
20#include <QFile>
21#include <QDialog>
22#include <QPushButton>
23
24
25/** Default Constructor. */
26AboutDialog::AboutDialog(QWidget *parent, Qt::WindowFlags flags)
27 : QDialog(parent, Qt::CustomizeWindowHint | Qt::WindowSystemMenuHint)
28{
29 ui.setupUi(this);
30
31 /* Add a "License" button to the button box at the bottom */
32 QPushButton *licenseButton;
33 licenseButton = ui.buttonBox->addButton(tr("License"),
34 QDialogButtonBox::ActionRole);
35
36 /* Get Vidalia's version number */
37 ui.lblVidaliaVersion->setText(QString("Vidalia %1").arg(Vidalia::version()));
38
39 /* Get Tor's version number or hide it if Tor isn't running */
41 QString version = Vidalia::torControl()->getTorVersionString();
42 if (! version.isEmpty())
43 ui.lblTorVersion->setText(QString("Tor %1").arg(version));
44 else
45 ui.lblTorVersion->setVisible(false);
46 } else {
47 ui.lblTorVersion->setVisible(false);
48 }
49
50 /* Get Qt's version number */
51 ui.lblQtVersion->setText(QString("Qt %1").arg(QT_VERSION_STR));
52
53 /* Display the license information dialog when the "License" button
54 * is clicked. */
55 connect(licenseButton, SIGNAL(clicked()),
56 new LicenseDialog(this), SLOT(exec()));
57
58 /* Close this dialog when the "Close" button is clicked */
59 connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
60}
61
stop errmsg connect(const QHostAddress &address, quint16 port)
stop errmsg isConnected()
Ui::AboutDialog ui
Definition: AboutDialog.h:32
AboutDialog(QWidget *parent=0, Qt::WindowFlags flags=0)
Definition: AboutDialog.cpp:26
QString getTorVersionString()
Definition: TorControl.cpp:659
static TorControl * torControl()
Definition: Vidalia.h:76
static QString version()
Definition: Vidalia.h:73