00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #include <QFile>
00029 #include <vidalia.h>
00030 #include "aboutdialog.h"
00031
00032
00033
00034 AboutDialog::AboutDialog(QWidget *parent, Qt::WFlags flags)
00035 : VidaliaWindow("AboutDialog", parent, flags)
00036 {
00037 ui.setupUi(this);
00038 #if defined(Q_WS_WIN)
00039 setShortcut("Esc", SLOT(close()));
00040 #else
00041 setShortcut("Ctrl+W", SLOT(close()));
00042 #endif
00043
00044
00045 _torControl = Vidalia::torControl();
00046
00047
00048 ui.lblVidaliaVersion->setText(Vidalia::version());
00049
00050
00051 ui.lblQtVersion->setText(QT_VERSION_STR);
00052
00053
00054 loadLicense();
00055 }
00056
00057
00058 void
00059 AboutDialog::loadLicense()
00060 {
00061 QFile licenseFile(":/docs/short_license.txt");
00062 licenseFile.open(QFile::ReadOnly);
00063 ui.txtLicense->setPlainText(licenseFile.readAll());
00064 licenseFile.close();
00065 }
00066
00067
00068 void
00069 AboutDialog::showWindow()
00070 {
00071
00072 if (_torControl->isRunning()) {
00073 QString version = _torControl->getTorVersionString();
00074 if (version.isEmpty()) {
00075 version = tr("<Unavailable>");
00076 }
00077 ui.lblTorVersion->setText(version);
00078 } else {
00079 ui.lblTorVersion->setText(tr("<Not Running>"));
00080 }
00081 VidaliaWindow::showWindow();
00082 }
00083