Sophie

Sophie

distrib > Mandriva > 2010.2 > i586 > media > contrib-backports > by-pkgid > 9601c7beb4ff23e834bfa171795ed560 > files > 277

vidalia-0.2.9-1mdv2010.1.i586.rpm

<!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: ServerPage.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&nbsp;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&nbsp;List</span></a></li>
      <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
    </ul>
  </div>
  <div class="navpath"><a class="el" href="dir_b47abd1aad201a152869566145babb61.html">src</a>&nbsp;&raquo;&nbsp;<a class="el" href="dir_695ba8f8357372e02d38c40b3c6dbe81.html">vidalia</a>&nbsp;&raquo;&nbsp;<a class="el" href="dir_738aec08306f4b898e01f7a551299457.html">config</a>
  </div>
</div>
<div class="contents">
<h1>ServerPage.h</h1><a href="_server_page_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 you</span>
<a name="l00004"></a>00004 <span class="comment">**  did not receive the LICENSE file with this file, you may obtain it from the</span>
<a name="l00005"></a>00005 <span class="comment">**  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 the</span>
<a name="l00008"></a>00008 <span class="comment">**  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 ServerPage.h</span>
<a name="l00013"></a>00013 <span class="comment">** \version $Id: ServerPage.h 3735 2009-04-28 20:28:01Z edmanm $</span>
<a name="l00014"></a>00014 <span class="comment">** \brief Tor server configuration options</span>
<a name="l00015"></a>00015 <span class="comment">*/</span>
<a name="l00016"></a>00016 
<a name="l00017"></a>00017 <span class="preprocessor">#ifndef _SERVERPAGE_H</span>
<a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#define _SERVERPAGE_H</span>
<a name="l00019"></a>00019 <span class="preprocessor"></span>
<a name="l00020"></a>00020 <span class="preprocessor">#include &quot;ui_ServerPage.h&quot;</span>
<a name="l00021"></a>00021 <span class="preprocessor">#include &quot;<a class="code" href="_config_page_8h.html">ConfigPage.h</a>&quot;</span>
<a name="l00022"></a>00022 <span class="preprocessor">#include &quot;<a class="code" href="_tor_control_8h.html">TorControl.h</a>&quot;</span>
<a name="l00023"></a>00023 <span class="preprocessor">#include &quot;<a class="code" href="_server_settings_8h.html">ServerSettings.h</a>&quot;</span>
<a name="l00024"></a>00024 <span class="preprocessor">#include &quot;<a class="code" href="_exit_policy_8h.html">ExitPolicy.h</a>&quot;</span>
<a name="l00025"></a>00025 <span class="preprocessor">#include &quot;<a class="code" href="_help_browser_8h.html">HelpBrowser.h</a>&quot;</span>
<a name="l00026"></a>00026 
<a name="l00027"></a>00027 <span class="preprocessor">#include &lt;QMessageBox&gt;</span>
<a name="l00028"></a>00028 <span class="preprocessor">#include &lt;QTimer&gt;</span>
<a name="l00029"></a>00029 
<a name="l00030"></a>00030 
<a name="l00031"></a><a class="code" href="class_server_page.html">00031</a> <span class="keyword">class </span><a class="code" href="class_server_page.html">ServerPage</a> : <span class="keyword">public</span> <a class="code" href="class_config_page.html">ConfigPage</a>
<a name="l00032"></a>00032 {
<a name="l00033"></a>00033   Q_OBJECT
<a name="l00034"></a>00034 
<a name="l00035"></a>00035 <span class="keyword">public</span>:<span class="comment"></span>
<a name="l00036"></a>00036 <span class="comment">  /** Default Constructor */</span>
<a name="l00037"></a>00037   <a class="code" href="class_server_page.html#acf3737d1eb3a31da469dae7c3de6ec27">ServerPage</a>(QWidget *parent = 0);<span class="comment"></span>
<a name="l00038"></a>00038 <span class="comment">  /** Default Destructor */</span>
<a name="l00039"></a>00039   <a class="code" href="class_server_page.html#a7e591584832847156a28fe7e57dd6e7b">~ServerPage</a>();<span class="comment"></span>
<a name="l00040"></a>00040 <span class="comment">  /** Saves the changes on this page */</span>
<a name="l00041"></a>00041   <span class="keywordtype">bool</span> <a class="code" href="class_server_page.html#aeeb9e673c4d8e4573b5aeb9fd7379fc7">save</a>(QString &amp;errmsg);<span class="comment"></span>
<a name="l00042"></a>00042 <span class="comment">  /** Loads the settings for this page */</span>
<a name="l00043"></a>00043   <span class="keywordtype">void</span> <a class="code" href="class_server_page.html#a64c873a51083e74d8cbe3ce669540c73">load</a>();
<a name="l00044"></a>00044   <span class="comment"></span>
<a name="l00045"></a>00045 <span class="comment">  /** Applies the server configuration settings to Tor. Returns true if the</span>
<a name="l00046"></a>00046 <span class="comment">   * settings were applied successfully. Otherwise, &lt;b&gt;errmsg&lt;/b&gt; is set and</span>
<a name="l00047"></a>00047 <span class="comment">   * false is returned. */</span>
<a name="l00048"></a>00048   <span class="keywordtype">bool</span> <a class="code" href="class_server_page.html#a3b15d8e8c0f528cc0cc387d01f962d85">apply</a>(QString &amp;errmsg);<span class="comment"></span>
<a name="l00049"></a>00049 <span class="comment">  /** Reverts the server configuration settings to their values at the last</span>
<a name="l00050"></a>00050 <span class="comment">   * time they were successfully applied to Tor. */</span>
<a name="l00051"></a>00051   <span class="keywordtype">void</span> <a class="code" href="class_server_page.html#afda585bae9cca15cebc230ecf901ca0e">revert</a>();<span class="comment"></span>
<a name="l00052"></a>00052 <span class="comment">  /** Returns true if the user has changed their server settings since the</span>
<a name="l00053"></a>00053 <span class="comment">   * last time they were applied to Tor. */</span>
<a name="l00054"></a>00054   <span class="keywordtype">bool</span> <a class="code" href="class_server_page.html#a20508b4f8a6eebbf54de9158e6e0048a">changedSinceLastApply</a>();<span class="comment"></span>
<a name="l00055"></a>00055 <span class="comment">  /** Called when the user changes the UI translation. */</span>
<a name="l00056"></a>00056   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_server_page.html#a517bf48512514bfae205cb046c9aeac8">retranslateUi</a>();
<a name="l00057"></a>00057 
<a name="l00058"></a>00058 <span class="keyword">private</span> slots:<span class="comment"></span>
<a name="l00059"></a>00059 <span class="comment">  /** Called when the user toggles any one of the server mode radio buttons</span>
<a name="l00060"></a>00060 <span class="comment">   * and hides or displays the server configuration tabs appropriately. */</span>
<a name="l00061"></a>00061   <span class="keywordtype">void</span> <a class="code" href="class_server_page.html#aa8df9ab2f3317bbf155e771a8d4adaa1">serverModeChanged</a>(<span class="keywordtype">bool</span> enabled);<span class="comment"></span>
<a name="l00062"></a>00062 <span class="comment">  /** Called when the user clicks the bandwidth help button */</span>
<a name="l00063"></a>00063   <span class="keywordtype">void</span> <a class="code" href="class_server_page.html#a8db7d97f4a27f8a6e17ff5ad7385c1b8">bandwidthHelp</a>();<span class="comment"></span>
<a name="l00064"></a>00064 <span class="comment">  /** Called when the user clicks the exit policy help button */</span>
<a name="l00065"></a>00065   <span class="keywordtype">void</span> <a class="code" href="class_server_page.html#a7b8c634d430402a2a1331888f69e7447">exitPolicyHelp</a>();<span class="comment"></span>
<a name="l00066"></a>00066 <span class="comment">  /** Called when the user selects a new value from the rate combo box */</span>
<a name="l00067"></a>00067   <span class="keywordtype">void</span> <a class="code" href="class_server_page.html#a8ef37a52c25ae4318329b40ab6daf733">rateChanged</a>(<span class="keywordtype">int</span> rate);<span class="comment"></span>
<a name="l00068"></a>00068 <span class="comment">  /** Called when the user edits the max or average bandwidth limits. */</span>
<a name="l00069"></a>00069   <span class="keywordtype">void</span> <a class="code" href="class_server_page.html#a659a8a38243195268590e84f13c707d5">customRateChanged</a>();<span class="comment"></span>
<a name="l00070"></a>00070 <span class="comment">  /** Called when Vidalia has authenticated to Tor. If the user&#39;s Tor is not</span>
<a name="l00071"></a>00071 <span class="comment">   * recent enough, this disables the bridge server option and displays a</span>
<a name="l00072"></a>00072 <span class="comment">   * warning if the user had previously configured Tor as a bridge. */</span>
<a name="l00073"></a>00073   <span class="keywordtype">void</span> <a class="code" href="class_server_page.html#aa12d2801c6de49e0b4d5d48135c06757">onAuthenticated</a>();<span class="comment"></span>
<a name="l00074"></a>00074 <span class="comment">  /** Called when Vidalia disconnects from Tor. This method reenables the</span>
<a name="l00075"></a>00075 <span class="comment">   * bridge server option. */</span>
<a name="l00076"></a>00076   <span class="keywordtype">void</span> <a class="code" href="class_server_page.html#a55b28514b1cfc2be0bb9a442c7eb9f74">onDisconnected</a>();<span class="comment"></span>
<a name="l00077"></a>00077 <span class="comment">  /** Copies the user&#39;s bridge relay identity to the clipboard. */</span>
<a name="l00078"></a>00078   <span class="keywordtype">void</span> <a class="code" href="class_server_page.html#a6ad015af43f14ecc410a10fd07479f82">copyBridgeIdentity</a>();<span class="comment"></span>
<a name="l00079"></a>00079 <span class="comment">  /** Tests automatic port forwarding with UPnP. */</span>
<a name="l00080"></a>00080   <span class="keywordtype">void</span> <a class="code" href="class_server_page.html#afc3d478bc9f564dedb75d63924b67095">testUpnp</a>();<span class="comment"></span>
<a name="l00081"></a>00081 <span class="comment">  /** Called when the user clicks the UPnP test dialog&#39;s help button. */</span>
<a name="l00082"></a>00082   <span class="keywordtype">void</span> <a class="code" href="class_server_page.html#a48a67398373c7215af2a0c69488a4b13">upnpHelp</a>();<span class="comment"></span>
<a name="l00083"></a>00083 <span class="comment">  /** Called when the user clicks on a QLabel containing a hyperlink. */</span>
<a name="l00084"></a>00084   <span class="keywordtype">void</span> <a class="code" href="class_server_page.html#a8c7f91c8dae02d561aa08fb90e2049b6">linkActivated</a>(<span class="keyword">const</span> QString &amp;url);
<a name="l00085"></a>00085 
<a name="l00086"></a>00086 <span class="keyword">private</span>:<span class="comment"></span>
<a name="l00087"></a>00087 <span class="comment">  /** Index values of rate values in the bandwidth limits dropdown box. */</span>
<a name="l00088"></a><a class="code" href="class_server_page.html#a6d56b5ec5bc849551347c6dfc2357a45">00088</a>   <span class="keyword">enum</span> <a class="code" href="class_server_page.html#a6d56b5ec5bc849551347c6dfc2357a45">BwRateIndex</a> {
<a name="l00089"></a><a class="code" href="class_server_page.html#a6d56b5ec5bc849551347c6dfc2357a45a4f691bc4daf1044151c07ee5cbb59120">00089</a>     <a class="code" href="class_server_page.html#a6d56b5ec5bc849551347c6dfc2357a45a4f691bc4daf1044151c07ee5cbb59120">CableDsl256</a> = 0, <span class="comment">/**&lt; Cable/DSL 256 Kbps */</span>
<a name="l00090"></a><a class="code" href="class_server_page.html#a6d56b5ec5bc849551347c6dfc2357a45af307d3e0607492e60de9ce3b2afde50f">00090</a>     <a class="code" href="class_server_page.html#a6d56b5ec5bc849551347c6dfc2357a45af307d3e0607492e60de9ce3b2afde50f">CableDsl512</a>,     <span class="comment">/**&lt; Cable/DSL 512 Kbps */</span>
<a name="l00091"></a><a class="code" href="class_server_page.html#a6d56b5ec5bc849551347c6dfc2357a45a58a0efa40e1f13eaf8e3e31767f0de44">00091</a>     <a class="code" href="class_server_page.html#a6d56b5ec5bc849551347c6dfc2357a45a58a0efa40e1f13eaf8e3e31767f0de44">CableDsl768</a>,     <span class="comment">/**&lt; Cable/DSL 768 Kbps */</span>
<a name="l00092"></a><a class="code" href="class_server_page.html#a6d56b5ec5bc849551347c6dfc2357a45ad222b92f2c5ad13cf92d33cccd7aacbd">00092</a>     <a class="code" href="class_server_page.html#a6d56b5ec5bc849551347c6dfc2357a45ad222b92f2c5ad13cf92d33cccd7aacbd">T1CableDsl1500</a>,  <span class="comment">/**&lt; T1/Cable/DSL 1.5 Mbps */</span>
<a name="l00093"></a><a class="code" href="class_server_page.html#a6d56b5ec5bc849551347c6dfc2357a45aa3031952074541df7fdf6ff282136657">00093</a>     <a class="code" href="class_server_page.html#a6d56b5ec5bc849551347c6dfc2357a45aa3031952074541df7fdf6ff282136657">GreaterThan1500</a>, <span class="comment">/**&lt; &gt; 1.5 Mbps */</span>
<a name="l00094"></a><a class="code" href="class_server_page.html#a6d56b5ec5bc849551347c6dfc2357a45a7840c3030b88100782843bde23f99236">00094</a>     <a class="code" href="class_server_page.html#a6d56b5ec5bc849551347c6dfc2357a45a7840c3030b88100782843bde23f99236">CustomBwLimits</a>   <span class="comment">/**&lt; Custom bandwidth limits */</span>
<a name="l00095"></a>00095   };
<a name="l00096"></a>00096   <span class="comment"></span>
<a name="l00097"></a>00097 <span class="comment">  /** Returns the index of the selected item in lstExitPolicies */</span>
<a name="l00098"></a>00098   <span class="keywordtype">int</span> <a class="code" href="class_server_page.html#ab4b952e729792a185a106531632f2c77">selectedIndex</a>();
<a name="l00099"></a>00099   <span class="comment"></span>
<a name="l00100"></a>00100 <span class="comment">  /** Saves the server&#39;s bandwidth average and burst limits. */</span>
<a name="l00101"></a>00101   <span class="keywordtype">void</span> <a class="code" href="class_server_page.html#ae25862dc3f43b8a5e8489f13a9f71506">saveBandwidthLimits</a>();<span class="comment"></span>
<a name="l00102"></a>00102 <span class="comment">  /** Loads the server&#39;s bandwidth average and burst limits. */</span>
<a name="l00103"></a>00103   <span class="keywordtype">void</span> <a class="code" href="class_server_page.html#a049db9987249e8a52612f6a6423c88af">loadBandwidthLimits</a>();<span class="comment"></span>
<a name="l00104"></a>00104 <span class="comment">  /** Saves the server&#39;s exit policies. */</span>
<a name="l00105"></a>00105   <span class="keywordtype">void</span> <a class="code" href="class_server_page.html#acf550820aafdbd2e646b2f1a2cd1aacb">saveExitPolicies</a>();<span class="comment"></span>
<a name="l00106"></a>00106 <span class="comment">  /** Loads the server&#39;s exit policies. */</span>
<a name="l00107"></a>00107   <span class="keywordtype">void</span> <a class="code" href="class_server_page.html#a380afd741cdd9056823c8a46877e6942">loadExitPolicies</a>();<span class="comment"></span>
<a name="l00108"></a>00108 <span class="comment">  /** Loads the user&#39;s bridge relay identity into the appropriate widgets. If</span>
<a name="l00109"></a>00109 <span class="comment">   *  the user&#39;s bridge is not running, then &quot;Not Running&quot; will be</span>
<a name="l00110"></a>00110 <span class="comment">   *  displayed. Otherwise, either the bridge&#39;s &quot;address:port&quot;, &quot;fingerprint&quot;,</span>
<a name="l00111"></a>00111 <span class="comment">   *  or &quot;address:port fingerprint&quot; will be displayed, depending on whether</span>
<a name="l00112"></a>00112 <span class="comment">   *  our GETCONF and GETINFO commands are successful. */</span>
<a name="l00113"></a>00113   <span class="keywordtype">void</span> <a class="code" href="class_server_page.html#a660966ce2a694177e5db40102791aa21">loadBridgeIdentity</a>();<span class="comment"></span>
<a name="l00114"></a>00114 <span class="comment">  /** Retrieves bridge usage history from Tor, parses and validates it, and</span>
<a name="l00115"></a>00115 <span class="comment">   * then displays it in a new dialog. */</span>
<a name="l00116"></a>00116   <span class="keywordtype">void</span> <a class="code" href="class_server_page.html#a2b1bf5888dd02869409adb8369744508">displayBridgeUsage</a>();
<a name="l00117"></a>00117 <span class="comment"></span>
<a name="l00118"></a>00118 <span class="comment">  /** A ServerSettings object used to get and set information about how a</span>
<a name="l00119"></a>00119 <span class="comment">   * local Tor server is configured. */</span>
<a name="l00120"></a><a class="code" href="class_server_page.html#a4c98f77f7fb8f60cb30fb091cc3eaa1e">00120</a>   <a class="code" href="class_server_settings.html">ServerSettings</a>*  <a class="code" href="class_server_page.html#a4c98f77f7fb8f60cb30fb091cc3eaa1e">_settings</a>;
<a name="l00121"></a>00121 <span class="comment"></span>
<a name="l00122"></a>00122 <span class="comment">  /** Qt Designer generated object */</span>
<a name="l00123"></a><a class="code" href="class_server_page.html#a64bc1b3aa8f7ab42203c163ca953128f">00123</a>   Ui::ServerPage <a class="code" href="class_server_page.html#a64bc1b3aa8f7ab42203c163ca953128f">ui</a>;
<a name="l00124"></a>00124 };
<a name="l00125"></a>00125 
<a name="l00126"></a>00126 <span class="preprocessor">#endif</span>
<a name="l00127"></a>00127 <span class="preprocessor"></span>
</pre></div></div>
<hr class="footer"/><address style="text-align: right;"><small>Generated on Mon Aug 30 22:58:54 2010 for Vidalia by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
</body>
</html>