Vidalia
0.3.1
|
#include <StatusEventWidget.h>
Public Member Functions | |
StatusEventWidget (QWidget *parent=0) | |
void | setMaximumItemCount (int maximumItemCount) |
int | maximumItemCount () const |
QStringList | selectedEvents () const |
QStringList | allEvents () const |
QList< StatusEventItem * > | find (const QString &text, bool highlight=true) |
Protected Member Functions | |
virtual void | retranslateUi () |
Private Slots | |
void | customContextMenuRequested (const QPoint &pos) |
void | authenticated () |
void | disconnected () |
void | dangerousTorVersion (tc::TorVersionStatus reason, const QString &version, const QStringList &recommended) |
void | circuitEstablished () |
void | bug (const QString &reason) |
void | clockSkewed (int skew, const QString &source) |
void | dangerousPort (quint16 port, bool rejected) |
void | socksError (tc::SocksError type, const QString &destination) |
void | externalAddressChanged (const QHostAddress &ip, const QString &hostname) |
void | dnsHijacked () |
void | dnsUseless () |
void | checkingOrPortReachability (const QHostAddress &ip, quint16 port) |
void | orPortReachabilityFinished (const QHostAddress &ip, quint16 port, bool reachable) |
void | checkingDirPortReachability (const QHostAddress &ip, quint16 port) |
void | dirPortReachabilityFinished (const QHostAddress &ip, quint16 port, bool reachable) |
void | serverDescriptorRejected (const QHostAddress &ip, quint16 port, const QString &reason) |
void | serverDescriptorAccepted (const QHostAddress &ip, quint16 port) |
Private Member Functions | |
void | addNotification (const QPixmap &icon, const QString &title, const QString &description, const QString &helpUrl=QString()) |
Static Private Member Functions | |
static QPixmap | addBadgeToPixmap (const QPixmap &pixmap, const QPixmap &badge) |
static QPixmap | addBadgeToPixmap (const QString &pixmap, const QString &badge) |
static QPixmap | addBadgeToPixmap (const QPixmap &pixmap, const QString &badge) |
Private Attributes | |
int | _maximumItemCount |
bool | _squelchDescriptorAcceptedEvent |
Definition at line 32 of file StatusEventWidget.h.
StatusEventWidget::StatusEventWidget | ( | QWidget * | parent = 0 | ) |
Default constructor.
Definition at line 39 of file StatusEventWidget.cpp.
References authenticated(), bug(), checkingDirPortReachability(), checkingOrPortReachability(), circuitEstablished(), TorEvents::ClientStatus, clockSkewed(), connect(), customContextMenuRequested(), dangerousPort(), dangerousTorVersion(), dirPortReachabilityFinished(), disconnected(), dnsHijacked(), dnsUseless(), externalAddressChanged(), TorEvents::GeneralStatus, orPortReachabilityFinished(), serverDescriptorAccepted(), serverDescriptorRejected(), TorEvents::ServerStatus, TorControl::setEvent(), socksError(), and Vidalia::torControl().
|
staticprivate |
Creates a new QPixmap using pixmap as the main image and overlays badge in the lower-right corner of the image.
Definition at line 233 of file StatusEventWidget.cpp.
Referenced by addBadgeToPixmap(), authenticated(), bug(), clockSkewed(), dangerousPort(), dangerousTorVersion(), dirPortReachabilityFinished(), disconnected(), dnsHijacked(), dnsUseless(), orPortReachabilityFinished(), serverDescriptorAccepted(), serverDescriptorRejected(), and socksError().
|
staticprivate |
Overloaded method provided for convenience. Constructs QPixmap objects from the Qt resource URLs pixmap and badge.
Definition at line 252 of file StatusEventWidget.cpp.
References addBadgeToPixmap().
|
staticprivate |
Overloaded method provided for convenience. Constructs a QPixmap object for the Qt resource URL badge, and applies it to pixmap.
Definition at line 245 of file StatusEventWidget.cpp.
References addBadgeToPixmap().
|
private |
Adds a new status event notification item to the widget. The item will be drawn using the specified icon, short event title, and a longer detailed description. If helpUrl is not empty, the item will also have a clickable question mark icon in the corner.
Definition at line 201 of file StatusEventWidget.cpp.
References maximumItemCount(), StatusEventItem::setDescription(), StatusEventItem::setHelpUrl(), StatusEventItem::setIcon(), StatusEventItem::setTimestamp(), StatusEventItem::setTitle(), StatusEventItem::setToolTip(), and string_wrap().
Referenced by authenticated(), bug(), checkingDirPortReachability(), checkingOrPortReachability(), circuitEstablished(), clockSkewed(), dangerousPort(), dangerousTorVersion(), dirPortReachabilityFinished(), disconnected(), dnsHijacked(), dnsUseless(), externalAddressChanged(), orPortReachabilityFinished(), serverDescriptorAccepted(), serverDescriptorRejected(), and socksError().
QStringList StatusEventWidget::allEvents | ( | ) | const |
Returns a QStringList of all current status events formatted as human-readable text. Each item in the returned QStringList represents a single status event.
Definition at line 139 of file StatusEventWidget.cpp.
References compareStatusEventItems(), and i().
|
privateslot |
Called when the control socket is connected and authenticated.
Definition at line 259 of file StatusEventWidget.cpp.
References addBadgeToPixmap(), addNotification(), circuitEstablished(), dangerousTorVersion(), TorControl::getInfo(), TorControl::getTorVersionString(), TorControl::isCircuitEstablished(), tc::ObsoleteTorVersion, Vidalia::torControl(), and tc::UnrecommendedTorVersion.
Referenced by StatusEventWidget().
|
privateslot |
Emitted when Tor has encountered an internal bug. reason is Tor's description of the bug.
Definition at line 344 of file StatusEventWidget.cpp.
References addBadgeToPixmap(), and addNotification().
Referenced by StatusEventWidget().
|
privateslot |
Indicates Tor has started testing the reachability of its directory port using the IP address ip and port port.
Definition at line 539 of file StatusEventWidget.cpp.
References addNotification().
Referenced by StatusEventWidget().
|
privateslot |
Indicates Tor has started testing the reachability of its OR port using the IP address ip and port port.
Definition at line 502 of file StatusEventWidget.cpp.
References addNotification().
Referenced by StatusEventWidget().
|
privateslot |
Indicates Tor has been able to successfully establish one or more circuits.
Definition at line 334 of file StatusEventWidget.cpp.
References addNotification().
Referenced by authenticated(), and StatusEventWidget().
|
privateslot |
Indicates that Tor has determined the client's clock is potentially skewed by skew seconds relative to source.
Definition at line 356 of file StatusEventWidget.cpp.
References addBadgeToPixmap(), addNotification(), TorControl::getTorVersion(), TorControl::getTorVersionString(), quint32, and Vidalia::torControl().
Referenced by StatusEventWidget().
|
privateslot |
Copies the text for all selected event items to the system clipboard.
Definition at line 159 of file StatusEventWidget.cpp.
References selectedEvents().
Referenced by StatusEventWidget().
Called when the user attempts to establish a connection to some destination on port port, which is a port known to use plaintext connections (as determined by Tor's WarnPlaintextPorts and RejectPlaintextPorts torrc options). rejected indicates whether Tor rejected the connection or permitted it to connect anyway.
Definition at line 393 of file StatusEventWidget.cpp.
References addBadgeToPixmap(), and addNotification().
Referenced by StatusEventWidget().
|
privateslot |
Indicates that Tor has decided the user's Tor software version is no longer recommended for some reason. recommended is a list of Tor software versions that are considered current.
Definition at line 302 of file StatusEventWidget.cpp.
References addBadgeToPixmap(), addNotification(), tc::ObsoleteTorVersion, and tc::UnrecommendedTorVersion.
Referenced by authenticated(), and StatusEventWidget().
|
privateslot |
Tor has completed testing the reachability of its directory port using the IP address ip and port port. If the user's directory port was reachable, reachable will be set to true.
Definition at line 550 of file StatusEventWidget.cpp.
References addBadgeToPixmap(), and addNotification().
Referenced by StatusEventWidget().
|
privateslot |
Called when the controller has disconnected from Tor
Definition at line 287 of file StatusEventWidget.cpp.
References _squelchDescriptorAcceptedEvent, addBadgeToPixmap(), and addNotification().
Referenced by StatusEventWidget().
|
privateslot |
Called when Tor determines that the user's DNS provider is providing an address for non-existent domains when it should really be saying "NXDOMAIN".
Definition at line 476 of file StatusEventWidget.cpp.
References addBadgeToPixmap(), and addNotification().
Referenced by StatusEventWidget().
|
privateslot |
Called when Tor determines that the user's DNS provider is providing a hijacked address even for well-known websites.
Definition at line 489 of file StatusEventWidget.cpp.
References addBadgeToPixmap(), and addNotification().
Referenced by StatusEventWidget().
|
privateslot |
Called when Tor decides the client's external IP address has changed to ip. If hostname is non-empty, Tor obtained the new value for ip by resolving hostname.
Definition at line 462 of file StatusEventWidget.cpp.
References addNotification().
Referenced by StatusEventWidget().
QList< StatusEventItem * > StatusEventWidget::find | ( | const QString & | text, |
bool | highlight = true |
||
) |
Searches the list of current status event items for any items that contain text in either the event title or description. Searching is done case-insensitively. If highlight is true, any previously selected items will be deselected and the matching items will be highlighted. Returns a (possibly empty) list of matching items.
Definition at line 179 of file StatusEventWidget.cpp.
References StatusEventItem::description(), i(), and StatusEventItem::title().
int StatusEventWidget::maximumItemCount | ( | ) | const |
Returns the maximum number of status items that can be displayed in this StatusEventWidget.
Definition at line 113 of file StatusEventWidget.cpp.
References _maximumItemCount.
Referenced by addNotification(), and setMaximumItemCount().
|
privateslot |
Tor has completed testing the reachability of its OR port using the IP address ip and port port. If the user's OR port was reachable, reachable will be set to true.
Definition at line 513 of file StatusEventWidget.cpp.
References addBadgeToPixmap(), and addNotification().
Referenced by StatusEventWidget().
|
protectedvirtual |
Called when the user has changed the UI display language in Vidalia indicating all the displayed text widgets need to be updated to display their value in the newly chosen language.
Definition at line 84 of file StatusEventWidget.cpp.
QStringList StatusEventWidget::selectedEvents | ( | ) | const |
Returns a QStringList of the currently selected status events formatted as human-readable text. Each item in the returned QStringList represents a single status event.
Definition at line 119 of file StatusEventWidget.cpp.
References compareStatusEventItems(), and i().
Referenced by customContextMenuRequested().
|
privateslot |
Emitted when the directory authority with IP address ip and port port accepted the user's server descriptor.
Definition at line 592 of file StatusEventWidget.cpp.
References _squelchDescriptorAcceptedEvent, addBadgeToPixmap(), and addNotification().
Referenced by StatusEventWidget().
|
privateslot |
Called when the directory authority with IP address ip and port port rejected the user's server descriptor. reason describes why the descriptor was rejected (e.g., malformed, skewed clock, etc.).
Definition at line 576 of file StatusEventWidget.cpp.
References addBadgeToPixmap(), and addNotification().
Referenced by StatusEventWidget().
void StatusEventWidget::setMaximumItemCount | ( | int | maximumItemCount | ) |
Sets the maximum number of status event items displayed to maximumItemCount. If the current number of items displayed exceeds maximumItemCount, the oldest items will be removed until topLevelItemCount() is equal to the new limit.
Definition at line 96 of file StatusEventWidget.cpp.
References _maximumItemCount, and maximumItemCount().
|
privateslot |
Called when Tor detects a problem with a SOCKS connection from the user, such as a bad hostname, dangerous SOCKS protocol type, or a bad hostname. type indicates the type of error encountered and destination (if non-empty) specifies the attempted connection destination address or hostname.
Definition at line 422 of file StatusEventWidget.cpp.
References addBadgeToPixmap(), addNotification(), tc::BadSocksHostnameError, tc::DangerousSocksTypeError, and tc::UnknownSocksProtocolError.
Referenced by StatusEventWidget().
|
private |
Maximum number of event notifications contained in the StatusEventWidget at any given time.
Definition at line 222 of file StatusEventWidget.h.
Referenced by maximumItemCount(), and setMaximumItemCount().
|
private |
Tor sends a ACCEPTED_SERVER_DESCRIPTOR event every time it manages to upload the user's relay's descriptor to a directory authority. So we squelch any such events after the first to avoid blasting the user with "Hey, your relay is working!" messages.
Definition at line 229 of file StatusEventWidget.h.
Referenced by disconnected(), and serverDescriptorAccepted().