Vidalia  0.3.1
Public Member Functions | Protected Member Functions | Private Slots | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
StatusEventWidget Class Reference

#include <StatusEventWidget.h>

Inheritance diagram for StatusEventWidget:

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
 

Detailed Description

Definition at line 32 of file StatusEventWidget.h.

Constructor & Destructor Documentation

StatusEventWidget::StatusEventWidget ( QWidget *  parent = 0)

Member Function Documentation

QPixmap StatusEventWidget::addBadgeToPixmap ( const QPixmap &  pixmap,
const QPixmap &  badge 
)
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().

QPixmap StatusEventWidget::addBadgeToPixmap ( const QString &  pixmap,
const QString &  badge 
)
staticprivate

Overloaded method provided for convenience. Constructs QPixmap objects from the Qt resource URLs pixmap and badge.

See also
addBadgeToPixmap(QPixmap, QPixmap)

Definition at line 252 of file StatusEventWidget.cpp.

References addBadgeToPixmap().

QPixmap StatusEventWidget::addBadgeToPixmap ( const QPixmap &  pixmap,
const QString &  badge 
)
staticprivate

Overloaded method provided for convenience. Constructs a QPixmap object for the Qt resource URL badge, and applies it to pixmap.

See also
addBadgeToPixmap(QPixmap, QPixmap)

Definition at line 245 of file StatusEventWidget.cpp.

References addBadgeToPixmap().

void StatusEventWidget::addNotification ( const QPixmap &  icon,
const QString &  title,
const QString &  description,
const QString &  helpUrl = QString() 
)
private
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().

void StatusEventWidget::authenticated ( )
privateslot
void StatusEventWidget::bug ( const QString &  reason)
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().

void StatusEventWidget::checkingDirPortReachability ( const QHostAddress &  ip,
quint16  port 
)
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().

void StatusEventWidget::checkingOrPortReachability ( const QHostAddress &  ip,
quint16  port 
)
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().

void StatusEventWidget::circuitEstablished ( )
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().

void StatusEventWidget::clockSkewed ( int  skew,
const QString &  source 
)
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().

void StatusEventWidget::customContextMenuRequested ( const QPoint &  pos)
privateslot

Copies the text for all selected event items to the system clipboard.

See also
selectedEvents()

Definition at line 159 of file StatusEventWidget.cpp.

References selectedEvents().

Referenced by StatusEventWidget().

void StatusEventWidget::dangerousPort ( quint16  port,
bool  rejected 
)
privateslot

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().

void StatusEventWidget::dangerousTorVersion ( tc::TorVersionStatus  reason,
const QString &  version,
const QStringList &  recommended 
)
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().

void StatusEventWidget::dirPortReachabilityFinished ( const QHostAddress &  ip,
quint16  port,
bool  reachable 
)
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().

void StatusEventWidget::disconnected ( )
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().

void StatusEventWidget::dnsHijacked ( )
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().

void StatusEventWidget::dnsUseless ( )
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().

void StatusEventWidget::externalAddressChanged ( const QHostAddress &  ip,
const QString &  hostname 
)
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().

void StatusEventWidget::orPortReachabilityFinished ( const QHostAddress &  ip,
quint16  port,
bool  reachable 
)
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().

void StatusEventWidget::retranslateUi ( )
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().

void StatusEventWidget::serverDescriptorAccepted ( const QHostAddress &  ip,
quint16  port 
)
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().

void StatusEventWidget::serverDescriptorRejected ( const QHostAddress &  ip,
quint16  port,
const QString &  reason 
)
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().

void StatusEventWidget::socksError ( tc::SocksError  type,
const QString &  destination 
)
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().

Member Data Documentation

int StatusEventWidget::_maximumItemCount
private

Maximum number of event notifications contained in the StatusEventWidget at any given time.

See also
setMaximumItemCount()

Definition at line 222 of file StatusEventWidget.h.

Referenced by maximumItemCount(), and setMaximumItemCount().

bool StatusEventWidget::_squelchDescriptorAcceptedEvent
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().


The documentation for this class was generated from the following files: