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 3735 2009-04-28 20:28:01Z edmanm $
00014 ** \brief Advanced Tor and Vidalia configuration options
00015 */
00016 
00017 #ifndef _ADVANCEDPAGE_H
00018 #define _ADVANCEDPAGE_H
00019 
00020 #include "ui_AdvancedPage.h"
00021 #include "ConfigPage.h"
00022 #include "TorSettings.h"
00023 
00024 #include <QFileDialog>
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   /** Called when the user changes the UI translation. */
00052   virtual void retranslateUi();
00053 
00054 private slots:
00055   /** Called when the user selects a different authentication method from the
00056    * combo box. */
00057   void authMethodChanged(int index);
00058   /** Called when the user clicks "Browse" to choose location of Tor config 
00059    * file */
00060   void browseTorConfig();
00061   /** Called when the user clicks "Browse" to choose the location of Tor's
00062    * data directory. */
00063   void browseTorDataDirectory();
00064 
00065 private:
00066   /** Returns the authentication method for the given <b>index</b>. */
00067   TorSettings::AuthenticationMethod indexToAuthMethod(int index);
00068   /** Returns the index in the authentication methods combo box for the given
00069    * authentication <b>method</b>. */
00070   int authMethodToIndex(TorSettings::AuthenticationMethod method);
00071  
00072 #if 0 
00073 #if defined(Q_WS_WIN)
00074   /** Installs or removes the Tor service as necessary */
00075   void setupService(bool useService);
00076 #endif
00077 #endif
00078 
00079   /** A TorSettings object used to save/load settings */
00080   TorSettings* _settings;
00081   /** Qt Designer generated object */
00082   Ui::AdvancedPage ui;
00083 };
00084 
00085 #endif
00086 
Generated on Mon Aug 30 22:58:54 2010 for Vidalia by  doxygen 1.6.3