40 #include <QTextStream>
43 #include <Carbon/Carbon.h>
46 #define IMG_BWGRAPH ":/images/16x16/utilities-system-monitor.png"
47 #define IMG_CONTROL_PANEL ":/images/16x16/system-run.png"
48 #define IMG_MESSAGELOG ":/images/16x16/format-justify-fill.png"
49 #define IMG_CONFIG ":/images/16x16/preferences-system.png"
50 #define IMG_IDENTITY ":/images/16x16/view-media-artist.png"
51 #define IMG_HELP ":/images/16x16/system-help.png"
52 #define IMG_ABOUT ":/images/16x16/help-about.png"
53 #define IMG_EXIT ":/images/16x16/application-exit.png"
54 #define IMG_NETWORK ":/images/16x16/applications-internet.png"
56 #define IMG_START_TOR_16 ":/images/16x16/media-playback-start.png"
57 #define IMG_STOP_TOR_16 ":/images/16x16/media-playback-stop.png"
58 #define IMG_START_TOR_48 ":/images/48x48/media-playback-start.png"
59 #define IMG_STOP_TOR_48 ":/images/48x48/media-playback-stop.png"
60 #define IMG_TOR_STOPPED_48 ":/images/48x48/tor-off.png"
61 #define IMG_TOR_RUNNING_48 ":/images/48x48/tor-on.png"
62 #define IMG_TOR_STARTING_48 ":/images/48x48/tor-starting.png"
63 #define IMG_TOR_STOPPING_48 ":/images/48x48/tor-stopping.png"
68 #define IMG_TOR_STOPPED ":/images/16x16/tor-off.png"
69 #define IMG_TOR_RUNNING ":/images/16x16/tor-on.png"
70 #define IMG_TOR_STARTING ":/images/16x16/tor-starting.png"
71 #define IMG_TOR_STOPPING ":/images/16x16/tor-stopping.png"
72 #elif defined(Q_WS_MAC)
75 #define IMG_TOR_STOPPED ":/images/128x128/tor-off.png"
76 #define IMG_TOR_RUNNING ":/images/128x128/tor-on.png"
77 #define IMG_TOR_STARTING ":/images/128x128/tor-starting.png"
78 #define IMG_TOR_STOPPING ":/images/128x128/tor-stopping.png"
79 void qt_mac_set_dock_menu(QMenu *menu);
82 #define IMG_TOR_STOPPED ":/images/22x22/tor-off.png"
83 #define IMG_TOR_RUNNING ":/images/22x22/tor-on.png"
84 #define IMG_TOR_STARTING ":/images/22x22/tor-starting.png"
85 #define IMG_TOR_STOPPING ":/images/22x22/tor-stopping.png"
89 #define MIN_NEWIDENTITY_INTERVAL (10*1000)
92 #define STARTUP_PROGRESS_STARTING 0
93 #define STARTUP_PROGRESS_CONNECTING 10
94 #define STARTUP_PROGRESS_AUTHENTICATING 20
95 #define STARTUP_PROGRESS_BOOTSTRAPPING 30
96 #define STARTUP_PROGRESS_CIRCUITBUILD 75
97 #define STARTUP_PROGRESS_MAXIMUM (STARTUP_PROGRESS_BOOTSTRAPPING+100)
145 this, SLOT(
stopped(
int, QProcess::ExitStatus)));
156 QString, QStringList)),
158 QString, QStringList)));
165 connect(
_torControl, SIGNAL(dangerousPort(quint16,
bool)),
179 connect(
_imProcess, SIGNAL(finished(
int, QProcess::ExitStatus)),
195 #if defined(USE_AUTOUPDATE)
197 connect(&_updateTimer, SIGNAL(timeout()),
this, SLOT(checkForUpdates()));
202 this, SLOT(checkForUpdatesWithUi()));
205 connect(&_updateProcess, SIGNAL(downloadProgress(QString,
int,
int)),
206 &_updateProgressDialog, SLOT(setDownloadProgress(QString,
int,
int)));
209 connect(&_updateProcess, SIGNAL(updatesInstalled(
int)),
210 this, SLOT(updatesInstalled(
int)));
211 connect(&_updateProcess, SIGNAL(installUpdatesFailed(QString)),
212 this, SLOT(installUpdatesFailed(QString)));
213 connect(&_updateProgressDialog, SIGNAL(cancelUpdate()),
214 &_updateProcess, SLOT(cancel()));
217 #if defined(USE_MINIUPNPC)
224 if (
ui.chkShowOnStartup->isChecked())
229 #if defined(Q_WS_MAC)
232 ProcessSerialNumber psn = { 0, kCurrentProcess };
233 TransformProcessType(&psn, kProcessTransformToForegroundApplication);
257 if (!QSystemTrayIcon::isSystemTrayAvailable()) {
259 ui.chkShowOnStartup->hide();
272 ui.retranslateUi(
this);
277 ui.lblStartStopTor->setText(tr(
"Start Tor"));
280 ui.lblStartStopTor->setText(tr(
"Starting Tor"));
283 ui.lblStartStopTor->setText(tr(
"Stop Tor"));
293 #if !defined(Q_WS_MAC)
309 if (
vApp->readPasswordFromStdin()) {
310 QTextStream in(stdin);
331 #if defined(USE_AUTOUPDATE)
341 _updateTimer.start(5*60*1000);
349 QDateTime now = QDateTime::currentDateTime().toUTC();
351 vInfo(
"Last checked for software updates at %1. Will check again at %2.")
352 .arg(lastCheckedAt.toLocalTime().toString(
"dd-MM-yyyy hh:mm:ss"))
353 .arg(nextCheckAt.toLocalTime().toString(
"dd-MM-yyyy hh:mm:ss"));
354 _updateTimer.start((nextCheckAt.toTime_t() - now.toTime_t()) * 1000);
365 vNotice(
"Cleaning up before exiting.");
387 QObject::disconnect(
_browserProcess, SIGNAL(finished(
int, QProcess::ExitStatus)), 0, 0);
388 QObject::disconnect(
_imProcess, SIGNAL(finished(
int, QProcess::ExitStatus)), 0, 0);
394 #if defined(Q_OS_WIN)
442 connect(
ui.lblBandwidthGraph, SIGNAL(clicked()),
448 connect(
ui.lblMessageLog, SIGNAL(clicked()),
450 connect(
ui.lblMessageLog, SIGNAL(clicked()),
452 connect(
ui.lblMessageLog, SIGNAL(clicked()),
453 ui.lblMessageLog, SLOT(disableFlashing()));
458 connect(
ui.lblViewNetwork, SIGNAL(clicked()),
472 connect(
ui.lblHelpBrowser, SIGNAL(clicked()),
this, SLOT(
showHelpDialog()));
478 #if !defined(Q_WS_MAC)
505 connect(&
_trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
508 #if defined(Q_WS_MAC)
510 qt_mac_set_dock_menu(menu);
519 QMenu *menu =
new QMenu(
this);
521 menu->addSeparator();
526 menu->addSeparator();
529 #if !defined(Q_WS_MAC)
535 menu->addSeparator();
547 #if defined(Q_WS_MAC)
573 QMenu *fileMenu =
_menuBar->addMenu(
"File");
577 QMenu *torMenu =
_menuBar->addMenu(tr(
"Tor"));
579 torMenu->addSeparator();
582 QMenu *viewMenu =
_menuBar->addMenu(tr(
"View"));
584 viewMenu->addSeparator();
589 QMenu *helpMenu =
_menuBar->addMenu(tr(
"Help"));
600 #if defined(Q_WS_MAC)
602 QApplication::setWindowIcon(QPixmap(iconFile));
617 if (reason == QSystemTrayIcon::DoubleClick)
629 if(QDir(browserDirectory).isRelative())
630 browserDirectory = QDir(QDir::toNativeSeparators(QCoreApplication::applicationDirPath()
631 +
"/" + browserDirectory)).canonicalPath();
634 QString browserExecutable = QDir::toNativeSeparators(browserDirectory +
"/" + settings.
getBrowserExecutable());
646 QString profileDir = QDir(browserDirectory +
"/" + profileDirectory).canonicalPath();
650 QDir browserDirObj = QDir(browserDirectory);
653 if (!browserDirObj.exists(profileDirectory)) {
654 browserDirObj.mkdir(profileDirectory);
655 copy_dir(QDir(browserDirectory +
"/" + defaultProfileDirectory).canonicalPath(),
656 QDir(browserDirectory +
"/" + profileDirectory).canonicalPath());
660 if (!browserDirObj.exists(pluginsDirectory)) {
661 browserDirObj.mkdir(pluginsDirectory);
662 copy_dir(QDir(browserDirectory +
"/" + defaultPluginsDirectory).canonicalPath(),
663 QDir(browserDirectory +
"/" + pluginsDirectory).canonicalPath());
667 QStringList commandLine;
669 commandLine <<
"-no-remote";
670 commandLine <<
"-profile";
671 commandLine << profileDir;
701 if (!subprocess.isEmpty())
719 bool browserDone = (browserExecutable.isEmpty()
720 && browserDirectory.isEmpty())
725 if (browserDone && imDone) {
726 if (browserDirectory.isEmpty()) {
731 QTimer *browserWatcher =
new QTimer(
this);
733 browserWatcher->start(2000);
744 #if defined(Q_OS_WIN)
754 if (procList.isEmpty()) {
759 QHashIterator<qint64, QString>
i(procList);
760 while (i.hasNext()) {
762 if (i.value().toLower() == browserDirectoryFilename) {
782 tr(
"Vidalia was unable to start the configured web browser"),
795 tr(
"Vidalia was unable to start the configured IM client"),
817 tr(
"Vidalia was unable to start the configured proxy server"),
833 description = tr(
"Connecting to a relay directory");
837 description = tr(
"Establishing an encrypted directory connection");
840 description = tr(
"Retrieving network status");
843 description = tr(
"Loading network status");
846 description = tr(
"Loading authority certificates");
849 description = tr(
"Requesting relay information");
852 description = tr(
"Loading relay information");
855 description = tr(
"Connecting to the Tor network");
859 description = tr(
"Establishing a Tor circuit");
862 description = tr(
"Connected to the Tor network!");
873 reason = tr(
"miscellaneous");
876 reason = tr(
"identity mismatch");
882 reason = tr(
"connection refused");
885 reason = tr(
"connection timeout");
888 reason = tr(
"read/write error");
891 reason = tr(
"no route to host");
894 reason = tr(
"insufficient resources");
897 reason = tr(
"unknown");
899 description += tr(
" failed (%1)").arg(reason);
909 QString statusText, actionText;
910 QString trayIconFile, statusIconFile;
913 vNotice(
"Tor status changed from '%1' to '%2'.")
918 statusText = tr(
"Tor is not running");
919 actionText = tr(
"Start Tor");
925 ui.lblStartStopTor->setEnabled(
true);
926 ui.lblStartStopTor->setText(actionText);
928 ui.lblStartStopTor->setStatusTip(actionText);
933 QObject::disconnect(
ui.lblStartStopTor, SIGNAL(clicked()),
this, 0);
935 connect(
ui.lblStartStopTor, SIGNAL(clicked()),
this, SLOT(
start()));
939 statusText = tr(
"Your relay is shutting down.\n"
940 "Click 'Stop' again to stop your relay now.");
942 statusText = tr(
"Tor is shutting down");
947 ui.lblStartStopTor->setStatusTip(tr(
"Stop Tor Now"));
948 }
else if (status ==
Started) {
949 actionText = tr(
"Stop Tor");
953 ui.lblStartStopTor->setEnabled(
true);
954 ui.lblStartStopTor->setText(actionText);
956 ui.lblStartStopTor->setStatusTip(actionText);
961 QObject::disconnect(
ui.lblStartStopTor, SIGNAL(clicked()),
this, 0);
963 connect(
ui.lblStartStopTor, SIGNAL(clicked()),
this, SLOT(
stop()));
965 statusText = tr(
"Starting the Tor software");
969 ui.lblStartStopTor->setText(tr(
"Starting Tor"));
970 ui.lblStartStopTor->setEnabled(
false);
971 ui.lblStartStopTor->setStatusTip(statusText);
975 statusText = tr(
"Connected to the Tor network!");
982 if (!trayIconFile.isEmpty()) {
986 if (!statusIconFile.isEmpty())
987 ui.lblTorStatusImg->setPixmap(QPixmap(statusIconFile));
988 if (!statusText.isEmpty()) {
990 ui.lblTorStatus->setText(statusText);
1011 ui.lblTorStatus->setVisible(
false);
1012 ui.lblTorStatusImg->setVisible(
false);
1013 repaint(
ui.grpStatus->rect());
1014 ui.lblStartupProgress->setVisible(
true);
1015 ui.progressBar->setVisible(
true);
1017 ui.lblStartupProgress->setVisible(
false);
1018 ui.progressBar->setVisible(
false);
1019 repaint(
ui.grpStatus->rect());
1020 ui.lblTorStatus->setVisible(
true);
1021 ui.lblTorStatusImg->setVisible(
true);
1029 const QString &description)
1031 ui.progressBar->setValue(progressValue);
1032 ui.lblStartupProgress->setText(description);
1049 vWarn(
"Disabling ControlPort autoconfiguration. DataDirectory is empty!");
1068 QString torrc = settings.
getTorrc();
1069 QFileInfo torrcInfo(torrc);
1071 if(QDir(torrcInfo.filePath()).isRelative()) {
1072 torrc = QCoreApplication::applicationDirPath() +
"/" + torrc;
1074 QFileInfo newTorrcInfo(torrc);
1075 if(!newTorrcInfo.exists() and torrcInfo.exists()) {
1076 torrc = QDir(QCoreApplication::applicationDirPath()).relativeFilePath(torrcInfo.absoluteFilePath());
1077 vWarn(
"Automigrating configuration for Torrc:\nOld path: %1\nNew path: %2")
1078 .arg(newTorrcInfo.filePath())
1081 torrc = QCoreApplication::applicationDirPath() +
"/" + torrc;
1087 vNotice(tr(
"Bootstrapping torrc from %1 to %2")
1088 .arg(boottorrc).arg(torrc));
1089 if(QFileInfo(boottorrc).exists()) {
1090 if(QFile::copy(boottorrc, torrc)) {
1097 if (!torrc.isEmpty()) {
1098 if (!QFileInfo(torrc).exists())
1100 args <<
"-f" << torrc;
1105 QFileInfo dataDirectoryInfo(dataDirectory);
1107 if(not dataDirectory.isEmpty() and QDir(dataDirectory).isRelative()) {
1108 dataDirectory = QCoreApplication::applicationDirPath() +
"/" + dataDirectory;
1110 QFileInfo newDataDirectoryInfo(dataDirectory);
1111 if(!newDataDirectoryInfo.exists() and dataDirectoryInfo.exists()) {
1112 dataDirectory = QDir(QCoreApplication::applicationDirPath()).relativeFilePath(dataDirectoryInfo.absoluteFilePath());
1113 vWarn(
"Automigrating configuration for DataDirectory:\nOld path: %1\nNew path: %2")
1114 .arg(newDataDirectoryInfo.absoluteFilePath())
1115 .arg(dataDirectory);
1117 dataDirectory = QCoreApplication::applicationDirPath() +
"/" + dataDirectory;
1121 QString expDataDirectory = QDir(
expand_filename(dataDirectory)).canonicalPath();
1122 if (!dataDirectory.isEmpty())
1123 args <<
"DataDirectory" << expDataDirectory;
1128 if(QDir(dataDirectory).isRelative())
1129 dataDirectory = QCoreApplication::applicationDirPath() +
"/" + dataDirectory;
1131 QString relativePortConf = QDir(QDir::currentPath())
1132 .relativeFilePath(QString(
"%1/port.conf").arg(dataDirectory));
1134 #if defined(Q_WS_WIN)
1136 if(QDir(torPath).isRelative())
1137 torPath = QCoreApplication::applicationDirPath() +
"/" + torPath;
1138 relativePortConf = QDir(torPath).relativeFilePath(QString(
"%1/port.conf").arg(dataDirectory));
1140 QString portconf = QString(
"%1/port.conf").arg(expDataDirectory);
1141 if(!QFile::remove(portconf))
1142 vWarn(QString(
"Unable to remove %1, may be it didn't existed.").arg(portconf));
1144 args <<
"ControlPort" <<
"auto";
1145 args <<
"SocksPort" <<
"auto";
1146 args <<
"ControlPortWriteToFile" << relativePortConf;
1151 args <<
"ControlPort" << QString::number(controlPort);
1155 args <<
"ControlSocket" << path;
1158 args <<
"__OwningControllerProcess" << QString::number(QCoreApplication::applicationPid());
1163 if (!
vApp->readPasswordFromStdin()) {
1172 args <<
"HashedControlPassword"
1176 args <<
"CookieAuthentication" <<
"1";
1179 args <<
"CookieAuthentication" <<
"0";
1189 QFileInfo torExecutableInfo(torExecutable);
1191 if(QDir(torExecutableInfo.filePath()).isRelative()) {
1192 torExecutable = QCoreApplication::applicationDirPath() +
"/" + torExecutable;
1194 QFileInfo newTorExecutableInfo(torExecutable);
1195 if(!newTorExecutableInfo.exists() and torExecutableInfo.exists()) {
1196 torExecutable = QDir(QCoreApplication::applicationDirPath()).relativeFilePath(torExecutableInfo.absoluteFilePath());
1197 vWarn(
"Automigrating configuration for TorExecutable:\nOld path: %1\nNew path: %2")
1198 .arg(newTorExecutableInfo.filePath())
1199 .arg(torExecutable);
1201 torExecutable = QCoreApplication::applicationDirPath() +
"/" + torExecutable;
1231 tr(
"Vidalia was unable to start Tor. Check your settings "
1232 "to ensure the correct name and location of your Tor "
1233 "executable is specified."),
1267 if(QDir(dataDirectory).isRelative())
1268 dataDirectory = QCoreApplication::applicationDirPath() +
"/" + dataDirectory;
1270 QFile file(QString(
"%1/port.conf").arg(QDir(
expand_filename(dataDirectory)).canonicalPath()));
1271 int tries = 0, maxtries = 5;
1272 while((!file.open(QIODevice::ReadOnly | QIODevice::Text)) and
1273 (tries++ < maxtries)) {
1274 vWarn(QString(
"This is try number: %1.").arg(tries));
1275 #if defined(Q_WS_WIN)
1282 if(tries >= maxtries) {
1283 vWarn(
"Couldn't read port.conf file");
1285 connectFailed(tr(
"Vidalia can't find out how to talk to Tor because it can't access this file: %1\n\nHere's the last error message:\n%2")
1286 .arg(file.fileName())
1287 .arg(file.errorString()));
1289 vWarn(
"Tor isn't running!");
1290 connectFailed(tr(
"It seems Tor has stopped running since Vidalia started it.\n\nSee the Advanced Message Log for more information."));
1296 QTextStream in(&file);
1298 QString line = in.readLine();
1299 QStringList parts = line.split(
"=");
1300 if(parts.size() != 2)
return;
1301 if(parts[0].trimmed() !=
"PORT")
return;
1303 QStringList addrPort = parts[1].split(
":");
1304 if(addrPort.size() != 2)
return;
1306 QHostAddress addr(addrPort.at(0));
1331 tr(
"Connection Error"),
p(errmsg),
1364 tr(
"You are currently running a relay. "
1365 "Terminating your relay will interrupt any "
1366 "open connections from clients.\n\n"
1367 "Would you like to shutdown gracefully and "
1368 "give clients time to find a new relay?"),
1391 p(tr(
"Vidalia was unable to stop the Tor software."))
1421 if (exitStatus == QProcess::CrashExit || exitCode != 0) {
1423 tr(
"Vidalia detected that the Tor software exited "
1425 "Please check the message log for recent "
1426 "warning or error messages."),
1469 ui.lblNewIdentity->setEnabled(
false);
1485 tr(
"Authenticating to Tor"));
1491 if (authMethods.contains(
"COOKIE"))
1493 else if (authMethods.contains(
"HASHEDPASSWORD"))
1495 else if (authMethods.contains(
"NULL"))
1502 while (cookie.isEmpty()) {
1505 tr(
"Cookie Authentication Required"),
1506 p(tr(
"The Tor software requires Vidalia to send the "
1507 "contents of an authentication cookie, but Vidalia "
1508 "was unable to find one."))
1509 +
p(tr(
"Would you like to browse for the file "
1510 "'control_auth_cookie' yourself?")),
1516 QString cookieDir = QFileDialog::getOpenFileName(
this,
1517 tr(
"Data Directory"),
1519 tr(
"Control Cookie (control_auth_cookie)"));
1520 if (cookieDir.isEmpty())
1522 cookieDir = QFileInfo(cookieDir).absolutePath();
1525 if(cookie.size() != 32) {
1526 vWarn(QString(
"Cookie length has to be exactly 32 bytes long. Found %1 bytes")
1527 .arg(cookie.size()));
1530 vNotice(
"Authenticating using 'cookie' authentication.");
1534 vNotice(
"Authenticating using 'hashed password' authentication.");
1542 vNotice(
"Authenticating using 'null' authentication.");
1546 vWarn(
"Cancelling control authentication attempt.");
1567 tr(
"Connecting to the Tor network"));
1572 ui.lblNewIdentity->setEnabled(
true);
1577 p(tr(
"Vidalia was unable to register for some events. "
1578 "Many of Vidalia's features may be unavailable."))
1610 vWarn(
"Authentication failed: %1").arg(errmsg);
1613 if (errmsg.contains(
"Password did not match")) {
1620 #if defined(Q_OS_WIN32)
1622 foreach (qint64 pid, procs.keys()) {
1623 if (! procs.value(pid).compare(
"tor.exe", Qt::CaseInsensitive)) {
1633 int ret = dlg.exec();
1634 if (ret == QDialogButtonBox::Ok) {
1646 }
else if (ret == QDialogButtonBox::Reset) {
1649 tr(
"Password Reset Failed"),
1650 p(tr(
"Vidalia tried to reset Tor's control password, but was not "
1651 "able to restart the Tor software. Please check your Task "
1652 "Manager to ensure there are no other Tor processes running.")),
1661 tr(
"Authentication Error"),
1662 p(tr(
"Vidalia was unable to authenticate to the Tor software. "
1663 "(%1)").arg(errmsg)) +
1664 p(tr(
"Please check your control port authentication "
1691 QStringList pathList;
1693 if (!cookiePath.isEmpty()) {
1694 pathList << cookiePath;
1699 if (!dataDir.isEmpty())
1700 pathList << dataDir;
1702 #if defined(Q_WS_WIN)
1710 foreach (QString path, pathList) {
1711 QString cookieFile = QFileInfo(path).isFile() ?
1712 path : path +
"/control_auth_cookie";
1713 vDebug(
"Checking for authentication cookie in '%1'").arg(cookieFile);
1714 if (!QFileInfo(cookieFile).exists())
1717 authCookie.setFileName(cookieFile);
1718 if (authCookie.open(QIODevice::ReadOnly)) {
1719 vInfo(
"Reading authentication cookie from '%1'").arg(cookieFile);
1720 return authCookie.readAll();
1722 vWarn(
"Couldn't open cookie file '%1': %2")
1723 .arg(cookieFile).arg(authCookie.errorString());
1726 vWarn(
"Couldn't find a readable authentication cookie.");
1727 return QByteArray();
1736 tr(
"Connected to the Tor network!"));
1739 #if defined(USE_AUTOUPDATE)
1745 _updateTimer.stop();
1762 if (!status.compare(
"old", Qt::CaseInsensitive)
1763 || !status.compare(
"unrecommended", Qt::CaseInsensitive)
1764 || !status.compare(
"obsolete", Qt::CaseInsensitive)) {
1774 const QString ¤t,
1775 const QStringList &recommended)
1778 Q_UNUSED(recommended);
1790 static bool alreadyWarned =
false;
1792 if (!alreadyWarned) {
1793 #if !defined(USE_AUTOUPDATE)
1794 QString website =
"https://www.torproject.org/";
1795 # if QT_VERSION >= 0x040200
1796 website = QString(
"<a href=\"%1\">%1</a>").arg(website);
1800 p(tr(
"The currently installed version of Tor is out of date or no longer "
1801 "recommended. Please visit the Tor website to download the latest "
1802 "version.")) +
p(tr(
"Tor website: %1").arg(website)),
1806 tr(
"Tor Update Available"),
1807 p(tr(
"The currently installed version of Tor is out of date "
1808 "or no longer recommended."))
1809 +
p(tr(
"Would you like to check if a newer package is "
1810 "available for installation?")),
1815 checkForUpdatesWithUi();
1817 alreadyWarned =
true;
1831 static QMessageBox *dlg = 0;
1837 QString application;
1840 application = tr(
"(probably Telnet)");
1846 application = tr(
"(probably an email client)");
1853 QString text = tr(
"One of your applications %1 appears to be making a "
1854 "potentially unencrypted and unsafe connection to port %2.")
1855 .arg(application).arg(port);
1857 QString extraText =
p(tr(
"Anything sent over this connection could be "
1858 "monitored. Please check your application's "
1859 "configuration and use only encrypted protocols, "
1860 "such as SSL, if possible."));
1862 extraText.append(
p(tr(
"Tor has automatically closed your connection in "
1863 "order to protect your anonymity.")));
1866 dlg =
new QMessageBox(QMessageBox::Warning,
1867 tr(
"Potentially Unsafe Connection"), text,
1868 QMessageBox::Ok | QMessageBox::Ignore);
1869 dlg->setInformativeText(extraText);
1870 dlg->setDefaultButton(QMessageBox::Ok);
1871 dlg->setEscapeButton(QMessageBox::Ok);
1873 int ret = dlg->exec();
1874 if (ret == QMessageBox::Ignore) {
1877 QStringList portList;
1878 QList<quint16> ports;
1882 idx = ports.indexOf(port);
1884 ports.removeAt(idx);
1887 foreach (quint16 port, ports) {
1888 portList << QString::number(port);
1890 tc->
setConf(
"WarnPlaintextPorts", portList.join(
","));
1895 idx = ports.indexOf(port);
1897 ports.removeAt(idx);
1900 foreach (quint16 port, ports) {
1901 portList << QString::number(port);
1903 tc->
setConf(
"RejectPlaintextPorts", portList.join(
","));
1962 QString title = tr(
"New Identity");
1963 QString message = tr(
"All subsequent connections will "
1964 "appear to be different than your "
1965 "old connections.");
1969 ui.lblNewIdentity->setEnabled(
false);
1973 if (QSystemTrayIcon::supportsMessages())
1974 _trayIcon.showMessage(title, message, QSystemTrayIcon::Information);
1991 ui.lblNewIdentity->setEnabled(
true);
2002 case Unset:
return "Unset";
2004 case Stopped:
return "Stopped";
2006 case Started:
return "Started";
2015 #if defined(USE_MINIUPNPC)
2029 tr(
"Port Forwarding Failed"),
2030 p(tr(
"Vidalia was unable to configure automatic port forwarding."))
2031 +
p(UPNPControl::Instance()->errorString()),
2037 #if defined(USE_AUTOUPDATE)
2041 MainWindow::checkForUpdatesWithUi()
2043 checkForUpdates(
true);
2049 MainWindow::checkForUpdates(
bool showProgress)
2053 if (_updateProcess.isRunning()) {
2058 _updateProgressDialog.show();
2065 _updateProcess.setSocksPort(0);
2070 _updateProgressDialog.show();
2088 MainWindow::checkForUpdatesFailed(
const QString &errmsg)
2090 if (_updateProgressDialog.isVisible()) {
2091 _updateProgressDialog.hide();
2102 vInfo(
"%1 software update(s) available").arg(packageList.size());
2103 if (packageList.size() > 0) {
2106 switch (dlg.exec()) {
2112 _updateProgressDialog.hide();
2116 if (_updateProgressDialog.isVisible()) {
2117 _updateProgressDialog.hide();
2119 tr(
"There are no new Tor software packages "
2120 "available for your computer at this time."),
2132 _updateProgressDialog.show();
2135 _restartTorAfterUpgrade =
true;
2139 _restartTorAfterUpgrade =
false;
2141 _updateProcess.installUpdates(bi);
2147 MainWindow::updatesInstalled(
int numUpdates)
2150 _updateProgressDialog.show();
2152 if (_restartTorAfterUpgrade)
2159 MainWindow::installUpdatesFailed(
const QString &errmsg)
2161 _updateProgressDialog.hide();
2164 p(tr(
"Vidalia was unable to install your software updates."))
2165 +
p(tr(
"The following error occurred:"))
2169 if (_restartTorAfterUpgrade)
2178 QStringList env = QProcess::systemEnvironment();
2180 env <<
"MOZ_NO_REMOTE=1";
2183 QString errmsg, socks;
2189 QStringList addrPort = socks.split(
":");
2190 if(addrPort.size() != 2)
return env;
2192 QHostAddress addr(addrPort.at(0));
2193 quint16 port = addrPort.at(1).toInt();
2195 env << QString(
"TOR_SOCKS_HOST=%1").arg(addr.toString());
2196 env << QString(
"TOR_SOCKS_PORT=%1").arg(port);
2198 vInfo(QString(
"Using automatic ControlPort and SocksPort configuration:\n"
2199 " ControlPort=%1\n SocksPort=%2\n Host=%3\n Configuration file:%4")
2202 .arg(addrPort.at(0))
2207 env << QString(
"TOR_CONTROL_PASSWD=%1").arg(QString(
_controlPassword.toAscii().toHex()));
2225 ui.lblMessageLog->enableFlashing();
2227 ui.lblMessageLog->disableFlashing();