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

#include <UPNPTestDialog.h>

Inheritance diagram for UPNPTestDialog:

Signals

void help ()
 

Public Member Functions

 UPNPTestDialog (quint16 orPort, quint16 dirPort, QWidget *parent=0)
 

Protected Slots

void setVisible (bool visible)
 
void clicked (QAbstractButton *button)
 
void upnpStateChanged (UPNPControl::UPNPState state)
 
void discoverTimeout ()
 

Protected Member Functions

void startTest ()
 
void testSuccessful ()
 
void testFailed ()
 

Private Attributes

UPNPControl_upnp
 
QTimer _discoverTimer
 
quint16 _oldOrPort
 
quint16 _oldDirPort
 
quint16 _orPort
 
quint16 _dirPort
 
Ui::UPNPTestDialog ui
 

Detailed Description

Definition at line 27 of file UPNPTestDialog.h.

Constructor & Destructor Documentation

UPNPTestDialog::UPNPTestDialog ( quint16  orPort,
quint16  dirPort,
QWidget *  parent = 0 
)

Default constructor. orPort and dirPort specify the ports used to test UPnP port forwarding. The original UPnP state will be restored when the test dialog is closed.

Definition at line 22 of file UPNPTestDialog.cpp.

References _discoverTimer, _oldDirPort, _oldOrPort, _upnp, clicked(), connect(), discoverTimeout(), UPNPControl::discoverTimeout(), UPNPControl::getDesiredState(), UPNPControl::instance(), and ui.

Member Function Documentation

void UPNPTestDialog::clicked ( QAbstractButton *  button)
protectedslot

Called when a user clicks on a button in the dialog's button box. If Retry is clicked, another UPnP test will be conducted. If Close is clicked, then the dialog is closed and the original UPnP state restored.

Definition at line 147 of file UPNPTestDialog.cpp.

References help(), startTest(), and ui.

Referenced by UPNPTestDialog().

void UPNPTestDialog::discoverTimeout ( )
protectedslot

Updates the progress bar to indicate the device discovery portion of the test is still in progress.

Definition at line 98 of file UPNPTestDialog.cpp.

References ui.

Referenced by UPNPTestDialog().

void UPNPTestDialog::help ( )
signal

Emitted when the user clicks the 'Help' button requesting the help topic on port forwarding.

Referenced by clicked().

void UPNPTestDialog::setVisible ( bool  visible)
protectedslot

Shows or hides the dialog based on visible. The UPnP test will be started when the dialog is first shown.

Definition at line 47 of file UPNPTestDialog.cpp.

References _oldDirPort, _oldOrPort, _upnp, UPNPControl::setDesiredState(), and startTest().

void UPNPTestDialog::startTest ( )
protected

Initiates a UPnP test.

Definition at line 59 of file UPNPTestDialog.cpp.

References _dirPort, _orPort, connect(), UPNPControl::instance(), UPNPControl::setDesiredState(), ui, and upnpStateChanged().

Referenced by clicked(), and setVisible().

void UPNPTestDialog::testFailed ( )
protected

Called when the UPnP test fails due to an error. Enables the Close and Retry buttons, allowing the user to either rerun the test or give up.

Definition at line 85 of file UPNPTestDialog.cpp.

References disconnect(), UPNPControl::instance(), and ui.

Referenced by upnpStateChanged().

void UPNPTestDialog::testSuccessful ( )
protected

Called when the UPnP test successfully enables port forwarding. Enables the Close button, allowing the user to exit the test dialog.

Definition at line 73 of file UPNPTestDialog.cpp.

References disconnect(), UPNPControl::instance(), and ui.

Referenced by upnpStateChanged().

void UPNPTestDialog::upnpStateChanged ( UPNPControl::UPNPState  state)
protectedslot

Member Data Documentation

quint16 UPNPTestDialog::_dirPort
private

DirPort used during the test.

Definition at line 82 of file UPNPTestDialog.h.

Referenced by startTest().

QTimer UPNPTestDialog::_discoverTimer
private

Timer used to update the progress bar while during the device discovery portion of the test.

Definition at line 77 of file UPNPTestDialog.h.

Referenced by upnpStateChanged(), and UPNPTestDialog().

quint16 UPNPTestDialog::_oldDirPort
private

Original (pre-test) forwarded DirPort.

Definition at line 80 of file UPNPTestDialog.h.

Referenced by setVisible(), and UPNPTestDialog().

quint16 UPNPTestDialog::_oldOrPort
private

Original (pre-test) forwarded ORPort.

Definition at line 79 of file UPNPTestDialog.h.

Referenced by setVisible(), and UPNPTestDialog().

quint16 UPNPTestDialog::_orPort
private

ORPort used during the test.

Definition at line 81 of file UPNPTestDialog.h.

Referenced by startTest().

UPNPControl* UPNPTestDialog::_upnp
private

Pointer to the UPNPControl singleton instance.

Definition at line 73 of file UPNPTestDialog.h.

Referenced by setVisible(), and UPNPTestDialog().

Ui::UPNPTestDialog UPNPTestDialog::ui
private

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