serverpage.h

Go to the documentation of this file.
00001 /****************************************************************
00002  *  Vidalia is distributed under the following license:
00003  *
00004  *  Copyright (C) 2006,  Matt Edman, Justin Hipple
00005  *
00006  *  This program is free software; you can redistribute it and/or
00007  *  modify it under the terms of the GNU General Public License
00008  *  as published by the Free Software Foundation; either version 2
00009  *  of the License, or (at your option) any later version.
00010  *
00011  *  This program is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *  GNU General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU General Public License
00017  *  along with this program; if not, write to the Free Software
00018  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, 
00019  *  Boston, MA  02110-1301, USA.
00020  ****************************************************************/
00021 
00022 /** 
00023  * \file serverpage.h
00024  * \version $Id: serverpage.h 1789 2007-06-17 13:04:42Z edmanm $
00025  * \brief Tor server configuration options
00026  */
00027 
00028 #ifndef _SERVERPAGE_H
00029 #define _SERVERPAGE_H
00030 
00031 #include <QMessageBox>
00032 #include <QTimer>
00033 #include <control/torcontrol.h>
00034 #include <config/serversettings.h>
00035 #include <config/exitpolicy.h>
00036 #include <gui/help/browser/helpbrowser.h>
00037 
00038 #include "configpage.h"
00039 #include "ui_serverpage.h"
00040 
00041 
00042 class ServerPage : public ConfigPage
00043 {
00044   Q_OBJECT
00045 
00046 public:
00047   /** Default Constructor */
00048   ServerPage(QWidget *parent = 0);
00049   /** Default Destructor */
00050   ~ServerPage();
00051   /** Saves the changes on this page */
00052   bool save(QString &errmsg);
00053   /** Loads the settings for this page */
00054   void load();
00055 
00056 private slots:
00057   /** Called when the user clicks the bandwidth help button */
00058   void bandwidthHelp();
00059   /** Called when the user clicks the exit policy help button */
00060   void exitPolicyHelp();
00061         /** Called when the user selects a new value from the rate combo box */
00062         void rateChanged(int rate);
00063   /** Called when the user edits the max or average bandwidth limits. */
00064   void customRateChanged();
00065 
00066 private:
00067   /** Index values of rate values in the bandwidth limits dropdown box. */
00068   enum BwRateIndex {
00069     CableDsl256 = 0, /**< Cable/DSL 256 Kbps */
00070     CableDsl512,     /**< Cable/DSL 512 Kbps */
00071     CableDsl768,     /**< Cable/DSL 768 Kbps */
00072     T1CableDsl1500,  /**< T1/Cable/DSL 1.5 Mbps */
00073     GreaterThan1500, /**< > 1.5 Mbps */
00074     CustomBwLimits   /**< Custom bandwidth limits */
00075   };
00076   
00077   /** Returns the index of the selected item in lstExitPolicies */
00078   int selectedIndex();
00079   
00080   /** Saves the server's bandwidth average and burst limits. */
00081   void saveBandwidthLimits();
00082   /** Loads the server's bandwidth average and burst limits. */
00083   void loadBandwidthLimits();
00084   /** Saves the server's exit policies. */
00085   void saveExitPolicies();
00086   /** Loads the server's exit policies. */
00087   void loadExitPolicies();
00088 
00089   /** A TorControl object used to talk to Tor */
00090   TorControl* _torControl;
00091   /** A ServerSettings object used to get and set information about how a
00092    * local Tor server is configured. */
00093   ServerSettings*  _settings;
00094 
00095   /** Qt Designer generated object */
00096   Ui::ServerPage ui;
00097 };
00098 
00099 #endif
00100 

Generated on Wed Sep 5 15:49:28 2007 for Vidalia by  doxygen 1.5.3