<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>Vidalia: UPNPTestDialog.h Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.6.3 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> <li><a href="dirs.html"><span>Directories</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>File Members</span></a></li> </ul> </div> <div class="navpath"><a class="el" href="dir_b47abd1aad201a152869566145babb61.html">src</a> » <a class="el" href="dir_695ba8f8357372e02d38c40b3c6dbe81.html">vidalia</a> » <a class="el" href="dir_738aec08306f4b898e01f7a551299457.html">config</a> </div> </div> <div class="contents"> <h1>UPNPTestDialog.h</h1><a href="_u_p_n_p_test_dialog_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> <a name="l00002"></a>00002 <span class="comment">** This file is part of Vidalia, and is subject to the license terms in the</span> <a name="l00003"></a>00003 <span class="comment">** LICENSE file, found in the top level directory of this distribution. If </span> <a name="l00004"></a>00004 <span class="comment">** you did not receive the LICENSE file with this file, you may obtain it</span> <a name="l00005"></a>00005 <span class="comment">** from the Vidalia source package distributed by the Vidalia Project at</span> <a name="l00006"></a>00006 <span class="comment">** http://www.vidalia-project.net/. No part of Vidalia, including this file,</span> <a name="l00007"></a>00007 <span class="comment">** may be copied, modified, propagated, or distributed except according to</span> <a name="l00008"></a>00008 <span class="comment">** the terms described in the LICENSE file.</span> <a name="l00009"></a>00009 <span class="comment">*/</span> <a name="l00010"></a>00010 <a name="l00011"></a>00011 <span class="comment">/* </span> <a name="l00012"></a>00012 <span class="comment">** \file UPNPTestDialog.h</span> <a name="l00013"></a>00013 <span class="comment">** \version $Id: UPNPTestDialog.h 3735 2009-04-28 20:28:01Z edmanm $</span> <a name="l00014"></a>00014 <span class="comment">** \brief Dialog that displays the progress of a UPnP configuration test</span> <a name="l00015"></a>00015 <span class="comment">*/</span> <a name="l00016"></a>00016 <a name="l00017"></a>00017 <span class="preprocessor">#ifndef _UPNPTESTDIALOG_H</span> <a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#define _UPNPTESTDIALOG_H</span> <a name="l00019"></a>00019 <span class="preprocessor"></span> <a name="l00020"></a>00020 <span class="preprocessor">#include "ui_UPNPTestDialog.h"</span> <a name="l00021"></a>00021 <span class="preprocessor">#include "<a class="code" href="_u_p_n_p_control_8h.html">UPNPControl.h</a>"</span> <a name="l00022"></a>00022 <a name="l00023"></a>00023 <span class="preprocessor">#include <QDialog></span> <a name="l00024"></a>00024 <span class="preprocessor">#include <QAbstractButton></span> <a name="l00025"></a>00025 <span class="preprocessor">#include <QTimer></span> <a name="l00026"></a>00026 <a name="l00027"></a>00027 <a name="l00028"></a><a class="code" href="class_u_p_n_p_test_dialog.html">00028</a> <span class="keyword">class </span><a class="code" href="class_u_p_n_p_test_dialog.html">UPNPTestDialog</a> : <span class="keyword">public</span> QDialog <a name="l00029"></a>00029 { <a name="l00030"></a>00030 Q_OBJECT <a name="l00031"></a>00031 <a name="l00032"></a>00032 <span class="keyword">public</span>:<span class="comment"></span> <a name="l00033"></a>00033 <span class="comment"> /** Default constructor. <b>orPort</b> and <b>dirPort</b> specify the ports</span> <a name="l00034"></a>00034 <span class="comment"> * used to test UPnP port forwarding. The original UPnP state will be</span> <a name="l00035"></a>00035 <span class="comment"> * restored when the test dialog is closed. */</span> <a name="l00036"></a>00036 <a class="code" href="class_u_p_n_p_test_dialog.html#ad5ccc3534f0a8d88c7386a484c8ce28e">UPNPTestDialog</a>(quint16 orPort, quint16 dirPort, QWidget *parent = 0); <a name="l00037"></a>00037 <a name="l00038"></a>00038 signals:<span class="comment"></span> <a name="l00039"></a>00039 <span class="comment"> /** Emitted when the user clicks the 'Help' button requesting the help topic</span> <a name="l00040"></a>00040 <span class="comment"> * on port forwarding. */</span> <a name="l00041"></a>00041 <span class="keywordtype">void</span> <a class="code" href="class_u_p_n_p_test_dialog.html#a7da7ba5c63f46d80b9622270bd43b9d2">help</a>(); <a name="l00042"></a>00042 <a name="l00043"></a>00043 <span class="keyword">protected</span> slots:<span class="comment"></span> <a name="l00044"></a>00044 <span class="comment"> /** Shows or hides the dialog based on <b>visible</b>. The UPnP test will be</span> <a name="l00045"></a>00045 <span class="comment"> * started when the dialog is first shown. */</span> <a name="l00046"></a>00046 <span class="keywordtype">void</span> <a class="code" href="class_u_p_n_p_test_dialog.html#a8c33fc8a09311e6257761632546f1619">setVisible</a>(<span class="keywordtype">bool</span> visible); <a name="l00047"></a>00047 <span class="comment"></span> <a name="l00048"></a>00048 <span class="comment"> /** Called when a user clicks on a button in the dialog's button box. If</span> <a name="l00049"></a>00049 <span class="comment"> * Retry is clicked, another UPnP test will be conducted. If Close is clicked,</span> <a name="l00050"></a>00050 <span class="comment"> * then the dialog is closed and the original UPnP state restored. */</span> <a name="l00051"></a>00051 <span class="keywordtype">void</span> <a class="code" href="class_u_p_n_p_test_dialog.html#acadefc1a90f6cd4161837fd96d97848b">clicked</a>(QAbstractButton *button); <a name="l00052"></a>00052 <span class="comment"></span> <a name="l00053"></a>00053 <span class="comment"> /** Updates the test UI based on the UPnP <b>state</b>. */</span> <a name="l00054"></a>00054 <span class="keywordtype">void</span> <a class="code" href="class_u_p_n_p_test_dialog.html#a2b3cb2d5201d4be1419131b80d85d472">upnpStateChanged</a>(<a class="code" href="class_u_p_n_p_control.html#acd04a19f042494f03791de43c9db7396">UPNPControl::UPNPState</a> state); <a name="l00055"></a>00055 <span class="comment"></span> <a name="l00056"></a>00056 <span class="comment"> /** Updates the progress bar to indicate the device discovery portion of the</span> <a name="l00057"></a>00057 <span class="comment"> * test is still in progress. */</span> <a name="l00058"></a>00058 <span class="keywordtype">void</span> <a class="code" href="class_u_p_n_p_test_dialog.html#a2a5a5a5179c2e99237680568ea610691">discoverTimeout</a>(); <a name="l00059"></a>00059 <a name="l00060"></a>00060 <span class="keyword">protected</span>:<span class="comment"></span> <a name="l00061"></a>00061 <span class="comment"> /** Initiates a UPnP test. */</span> <a name="l00062"></a>00062 <span class="keywordtype">void</span> <a class="code" href="class_u_p_n_p_test_dialog.html#a42242a0d4435e96f309498f132f175a8">startTest</a>(); <a name="l00063"></a>00063 <span class="comment"></span> <a name="l00064"></a>00064 <span class="comment"> /** Called when the UPnP test successfully enables port forwarding. Enables</span> <a name="l00065"></a>00065 <span class="comment"> * the Close button, allowing the user to exit the test dialog. */</span> <a name="l00066"></a>00066 <span class="keywordtype">void</span> <a class="code" href="class_u_p_n_p_test_dialog.html#ac67b917db4db23cf28beba1e0c59d3f7">testSuccessful</a>(); <a name="l00067"></a>00067 <span class="comment"></span> <a name="l00068"></a>00068 <span class="comment"> /** Called when the UPnP test fails due to an error. Enables the Close and</span> <a name="l00069"></a>00069 <span class="comment"> * Retry buttons, allowing the user to either rerun the test or give up. */</span> <a name="l00070"></a>00070 <span class="keywordtype">void</span> <a class="code" href="class_u_p_n_p_test_dialog.html#a13d7f4e8fd6fea36fea351fc6fca36ee">testFailed</a>(); <a name="l00071"></a>00071 <a name="l00072"></a>00072 <span class="keyword">private</span>:<span class="comment"></span> <a name="l00073"></a>00073 <span class="comment"> /** Pointer to the UPNPControl singleton instance. */</span> <a name="l00074"></a><a class="code" href="class_u_p_n_p_test_dialog.html#aad4af5d056cd9adab0b5ba2544def2fb">00074</a> <a class="code" href="class_u_p_n_p_control.html">UPNPControl</a> *<a class="code" href="class_u_p_n_p_test_dialog.html#aad4af5d056cd9adab0b5ba2544def2fb">_upnp</a>; <a name="l00075"></a>00075 <span class="comment"></span> <a name="l00076"></a>00076 <span class="comment"> /** Timer used to update the progress bar while during the device discovery</span> <a name="l00077"></a>00077 <span class="comment"> * portion of the test. */</span> <a name="l00078"></a><a class="code" href="class_u_p_n_p_test_dialog.html#acd90737cc2308b6ba5104b22ad20f89d">00078</a> QTimer <a class="code" href="class_u_p_n_p_test_dialog.html#acd90737cc2308b6ba5104b22ad20f89d">_discoverTimer</a>; <a name="l00079"></a>00079 <a name="l00080"></a><a class="code" href="class_u_p_n_p_test_dialog.html#aedafdf61bedfe7d12a00334857fe7fb8">00080</a> quint16 <a class="code" href="class_u_p_n_p_test_dialog.html#aedafdf61bedfe7d12a00334857fe7fb8">_oldOrPort</a>; <span class="comment">/**< Original (pre-test) forwarded ORPort. */</span> <a name="l00081"></a><a class="code" href="class_u_p_n_p_test_dialog.html#a0af4f4c7796d92fe460f8de8c2b8f7d5">00081</a> quint16 <a class="code" href="class_u_p_n_p_test_dialog.html#a0af4f4c7796d92fe460f8de8c2b8f7d5">_oldDirPort</a>; <span class="comment">/**< Original (pre-test) forwarded DirPort. */</span> <a name="l00082"></a><a class="code" href="class_u_p_n_p_test_dialog.html#a59bc5c0b8bd9c55504665d06b237e596">00082</a> quint16 <a class="code" href="class_u_p_n_p_test_dialog.html#a59bc5c0b8bd9c55504665d06b237e596">_orPort</a>; <span class="comment">/**< ORPort used during the test. */</span> <a name="l00083"></a><a class="code" href="class_u_p_n_p_test_dialog.html#a5f87002799a18016e67621891ab62522">00083</a> quint16 <a class="code" href="class_u_p_n_p_test_dialog.html#a5f87002799a18016e67621891ab62522">_dirPort</a>; <span class="comment">/**< DirPort used during the test. */</span> <a name="l00084"></a>00084 <a name="l00085"></a><a class="code" href="class_u_p_n_p_test_dialog.html#a5509e2766a5ca35b14f3e963ca53c1b4">00085</a> Ui::UPNPTestDialog <a class="code" href="class_u_p_n_p_test_dialog.html#a5509e2766a5ca35b14f3e963ca53c1b4">ui</a>; <a name="l00086"></a>00086 }; <a name="l00087"></a>00087 <a name="l00088"></a>00088 <span class="preprocessor">#endif</span> <a name="l00089"></a>00089 <span class="preprocessor"></span> </pre></div></div> <hr class="footer"/><address style="text-align: right;"><small>Generated on Mon Aug 30 22:58:55 2010 for Vidalia by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address> </body> </html>