28 #include <QStringList>
30 #include <QHeaderView>
34 const QTreeWidgetItem *
b)
100 QTreeWidgetItem *item;
101 Qt::SortOrder order = header()->sortIndicatorOrder();
103 if (order == Qt::AscendingOrder)
104 item = takeTopLevelItem(0);
106 item = takeTopLevelItem(topLevelItemCount()-1);
123 QList<QTreeWidgetItem *> items = selectedItems();
130 for (
int i = 0;
i < items.size();
i++) {
133 out.append(event->toString());
142 QList<QTreeWidgetItem *> items;
144 for (
int i = 0;
i < topLevelItemCount();
i++)
145 items.append(topLevelItem(
i));
150 for (
int i = 0;
i < items.size();
i++) {
153 out.append(event->toString());
164 if (! item || ! item->isSelected())
167 QAction *copyAction = menu.addAction(QIcon(
":/images/22x22/edit-copy.png"),
168 tr(
"Copy to Clipboard"));
170 QAction *action = menu.exec(mapToGlobal(pos));
171 if (action == copyAction) {
173 if (! eventText.isEmpty())
174 QApplication::clipboard()->setText(eventText.join(
"\n"));
178 QList<StatusEventItem *>
181 QList<StatusEventItem *> items;
183 for (
int i = 0;
i < topLevelItemCount();
i++) {
188 if (item->
title().contains(text, Qt::CaseInsensitive)
189 || item->
description().contains(text, Qt::CaseInsensitive)) {
192 item->setSelected(
true);
193 }
else if (highlight) {
194 item->setSelected(
false);
202 const QString &title,
203 const QString &description,
204 const QString &helpUrl)
209 QTreeWidgetItem *item;
210 if (header()->sortIndicatorOrder() == Qt::AscendingOrder)
211 item = takeTopLevelItem(0);
213 item = takeTopLevelItem(topLevelItemCount()-1);
228 addTopLevelItem(item);
229 scrollToItem(item, QAbstractItemView::EnsureVisible);
234 const QPixmap &badge)
236 QPixmap out = pixmap;
237 QPainter painter(&out);
238 painter.drawPixmap(pixmap.width() - badge.width(),
239 pixmap.height() - badge.height(),
246 const QString &badge)
253 const QString &badge)
265 ":/images/32x32/dialog-ok-apply.png");
267 tr(
"The Tor Software is Running"),
268 tr(
"You are currently running version \"%1\" of the Tor software.")
277 QString status = tc->
getInfo(
"status/version/current").toString();
278 if (! status.compare(
"old", Qt::CaseInsensitive)
279 || ! status.compare(
"obsolete", Qt::CaseInsensitive)) {
281 }
else if (! status.compare(
"unrecommended", Qt::CaseInsensitive)) {
290 ":/images/32x32/edit-delete.png");
293 tr(
"The Tor Software is not Running"),
294 tr(
"Click \"Start Tor\" in the Vidalia Control Panel to restart the Tor "
295 "software. If Tor exited unexpectedly, select the \"Advanced\" tab "
296 "above for details about any errors encountered."));
303 const QString &version,
304 const QStringList &recommended)
306 Q_UNUSED(recommended);
312 ":/images/32x32/security-medium.png");
315 tr(
"You are currently running version \"%1\" of the Tor software, which "
316 "is no longer recommended. Please upgrade to the most recent version "
317 "of the software, which may contain important security, reliability "
318 "and performance fixes.").arg(version);
321 ":/images/32x32/security-low.png");
324 tr(
"You are currently running version \"%1\" of the Tor software, which "
325 "may no longer work with the current Tor network. Please upgrade "
326 "to the most recent version of the software, which may contain "
327 "important security, reliability and performance fixes.").arg(version);
330 addNotification(icon, tr(
"Your Tor Software is Out-of-date"), description);
337 tr(
"Connected to the Tor Network"),
338 tr(
"We were able to successfully establish a connection to the Tor "
339 "network. You can now configure your applications to use the Internet "
347 ":/images/32x32/script-error.png");
349 tr(
"Tor Software Error"),
350 tr(
"The Tor software encountered an internal bug. Please report the "
351 "following error message to the Tor developers at bugs.torproject.org: "
352 "\"%1\"").arg(description));
358 if (source.startsWith(
"OR:", Qt::CaseInsensitive)) {
362 if (torVersion <= 0x00020113)
365 if (str.startsWith(
"0.2.2.") && torVersion <= 0x00020201)
371 ":/images/32x32/dialog-warning.png");
375 tr(
"Tor has determined that your computer's clock may be set to %1 "
376 "seconds in the past compared to the source \"%2\". If your "
377 "clock is not correct, Tor will not be able to function. Please "
378 "verify your computer displays the correct time.").arg(qAbs(skew))
382 tr(
"Tor has determined that your computer's clock may be set to %1 "
383 "seconds in the future compared to the source \"%2\". If "
384 "your clock is not correct, Tor will not be able to function. Please "
385 "verify your computer displays the correct time.").arg(qAbs(skew))
388 addNotification(icon, tr(
"Your Computer's Clock is Potentially Incorrect"),
400 ":/images/32x32/security-low.png");
403 tr(
"One of the applications on your computer may have attempted to "
404 "make an unencrypted connection through Tor to port %1. Sending "
405 "unencrypted information over the Tor network is dangerous and not "
406 "recommended. For your protection, Tor has automatically closed this "
407 "connection.").arg(port);
410 ":/images/32x32/security-medium.png");
412 tr(
"One of the applications on your computer may have attempted to "
413 "make an unencrypted connection through Tor to port %1. Sending "
414 "unencrypted information over the Tor network is dangerous and not "
415 "recommended.").arg(port);
418 addNotification(icon, tr(
"Potentially Dangerous Connection!"), description);
424 QString title, description;
425 QPixmap icon = QPixmap(
":/images/48x48/applications-internet.png");
430 title = tr(
"Potentially Dangerous Connection!");
432 tr(
"One of your applications established a connection through Tor "
433 "to \"%1\" using a protocol that may leak information about your "
434 "destination. Please ensure you configure your applications to use "
435 "only SOCKS4a or SOCKS5 with remote hostname resolution.")
440 title = tr(
"Unknown SOCKS Protocol");
442 tr(
"One of your applications tried to establish a connection through "
443 "Tor using a protocol that Tor does not understand. Please ensure "
444 "you configure your applications to use only SOCKS4a or SOCKS5 with "
445 "remote hostname resolution.");
449 title = tr(
"Invalid Destination Hostname");
451 tr(
"One of your applications tried to establish a connection through "
452 "Tor to \"%1\", which Tor does not recognize as a valid hostname. "
453 "Please check your application's configuration.").arg(destination);
463 const QString &hostname)
465 QString hostString = hostname.isEmpty() ? QString()
466 : QString(
" (%1)").arg(hostname);
469 tr(
"External IP Address Changed"),
470 tr(
"Tor has determined your relay's public IP address is currently %1%2. "
471 "If that is not correct, please consider setting the 'Address' option "
472 "in your relay's configuration.").arg(ip.toString()).arg(hostString));
479 ":/images/32x32/dialog-warning.png");
481 tr(
"DNS Hijacking Detected"),
482 tr(
"Tor detected that your DNS provider is providing false responses for "
483 "domains that do not exist. Some ISPs and other DNS providers, such as "
484 "OpenDNS, are known to do this in order to display their own search or "
485 "advertising pages."));
492 ":/images/32x32/edit-delete.png");
494 tr(
"DNS Hijacking Detected"),
495 tr(
"Tor detected that your DNS provider is providing false responses for "
496 "well known domains. Since clients rely on Tor network relays to "
497 "provide accurate DNS repsonses, your relay will not be configured as "
506 tr(
"Checking Server Port Reachability"),
507 tr(
"Tor is trying to determine if your relay's server port is reachable "
508 "from the Tor network by connecting to itself at %1:%2. This test "
509 "could take several minutes.").arg(ip.toString()).arg(port));
517 QString title, description;
518 QPixmap icon = QPixmap(
":/images/48x48/network-wired.png");
521 title = tr(
"Server Port Reachability Test Successful!");
523 tr(
"Your relay's server port is reachable from the Tor network!");
526 title = tr(
"Server Port Reachability Test Failed");
528 tr(
"Your relay's server port is not reachable by other Tor clients. This "
529 "can happen if you are behind a router or firewall that requires you "
530 "to set up port forwarding. If %1:%2 is not your correct IP address "
531 "and server port, please check your relay's configuration.")
532 .arg(ip.toString()).arg(port);
543 tr(
"Checking Directory Port Reachability"),
544 tr(
"Tor is trying to determine if your relay's directory port is reachable "
545 "from the Tor network by connecting to itself at %1:%2. This test "
546 "could take several minutes.").arg(ip.toString()).arg(port));
554 QString title, description;
555 QPixmap icon = QPixmap(
":/images/48x48/network-wired.png");
558 title = tr(
"Directory Port Reachability Test Successful!");
560 tr(
"Your relay's directory port is reachable from the Tor network!");
563 title = tr(
"Directory Port Reachability Test Failed");
565 tr(
"Your relay's directory port is not reachable by other Tor clients. "
566 "This can happen if you are behind a router or firewall that requires "
567 "you to set up port forwarding. If %1:%2 is not your correct IP "
568 "address and directory port, please check your relay's configuration.")
569 .arg(ip.toString()).arg(port);
578 const QString &reason)
582 ":/images/32x32/dialog-warning.png");
585 tr(
"Relay Descriptor Rejected"),
586 tr(
"Your relay's descriptor, which enables clients to connect to your "
587 "relay, was rejected by the directory server at %1:%2. The reason "
588 "given was: %3").arg(ip.toString()).arg(port).arg(reason));
604 ":/images/32x32/dialog-ok-apply.png");
607 tr(
"Your Relay is Online"),
608 tr(
"Your relay is now online and available for Tor clients to use. You "
609 "should see an increase in network traffic shown by the Bandwidth "
610 "Graph within a few hours as more clients learn about your relay. "
611 "Thank you for contributing to the Tor network!"));