advancedpage.h

Go to the documentation of this file.
00001 /*
00002 **  This file is part of Vidalia, and is subject to the license terms in the
00003 **  LICENSE file, found in the top level directory of this distribution. If you
00004 **  did not receive the LICENSE file with this file, you may obtain it from the
00005 **  Vidalia source package distributed by the Vidalia Project at
00006 **  http://www.vidalia-project.net/. No part of Vidalia, including this file,
00007 **  may be copied, modified, propagated, or distributed except according to the
00008 **  terms described in the LICENSE file.
00009 */
00010 
00011 /*
00012 ** \file advancedpage.h
00013 ** \version $Id: advancedpage.h 2598 2008-05-25 21:19:18Z edmanm $
00014 ** \brief Advanced Tor and Vidalia configuration options
00015 */
00016 
00017 #ifndef _ADVANCEDPAGE_H
00018 #define _ADVANCEDPAGE_H
00019 
00020 #include <QFileDialog>
00021 #include <config/torsettings.h>
00022 
00023 #include "configpage.h"
00024 #include "ui_advancedpage.h"
00025 
00026 
00027 class AdvancedPage : public ConfigPage 
00028 {
00029   Q_OBJECT
00030 
00031 public:
00032   /** Default Constructor */
00033   AdvancedPage(QWidget *parent = 0);
00034   /** Default Destructor */
00035   ~AdvancedPage();
00036   /** Saves the changes on this page */
00037   bool save(QString &errmsg);
00038   /** Loads the settings for this page */
00039   void load();
00040  
00041   /** Applies the network configuration settings to Tor. Returns true if the
00042    * settings were applied successfully. Otherwise, <b>errmsg</b> is set
00043    * and false is returned. */
00044   bool apply(QString &errmsg);
00045   /** Reverts the Tor configuration settings to their values at the last
00046    * time they were successfully applied to Tor. */
00047   void revert();
00048   /** Returns true if the user has changed their advanced Tor settings since
00049    * the last time they were applied to Tor. */
00050   bool changedSinceLastApply();
00051 
00052 private slots:
00053   /** Called when the user selects a different authentication method from the
00054    * combo box. */
00055   void authMethodChanged(int index);
00056   /** Called when the user clicks "Browse" to choose location of Tor config 
00057    * file */
00058   void browseTorConfig();
00059   /** Called when the user clicks "Browse" to choose the location of Tor's
00060    * data directory. */
00061   void browseTorDataDirectory();
00062 
00063 private:
00064   /** Returns the authentication method for the given <b>index</b>. */
00065   TorSettings::AuthenticationMethod indexToAuthMethod(int index);
00066   /** Returns the index in the authentication methods combo box for the given
00067    * authentication <b>method</b>. */
00068   int authMethodToIndex(TorSettings::AuthenticationMethod method);
00069  
00070 #if 0 
00071 #if defined(Q_WS_WIN)
00072   /** Installs or removes the Tor service as necessary */
00073   void setupService(bool useService);
00074 #endif
00075 #endif
00076 
00077   /** A TorSettings object used to save/load settings */
00078   TorSettings* _settings;
00079   /** Qt Designer generated object */
00080   Ui::AdvancedPage ui;
00081 };
00082 
00083 #endif
00084 

Generated on Wed Nov 26 21:02:42 2008 for Vidalia by  doxygen 1.5.7.1