Vidalia
0.2.15
|
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.torproject.org/projects/vidalia.html. No part of Vidalia, 00007 ** including this file, may be copied, modified, propagated, or distributed 00008 ** except according to the terms described in the LICENSE file. 00009 */ 00010 00011 /* 00012 ** \file AdvancedPage.h 00013 ** \brief Advanced Tor and Vidalia configuration options 00014 */ 00015 00016 #ifndef _ADVANCEDPAGE_H 00017 #define _ADVANCEDPAGE_H 00018 00019 #include "ui_AdvancedPage.h" 00020 #include "ConfigPage.h" 00021 #include "TorSettings.h" 00022 00023 #include <QFileDialog> 00024 00025 00026 class AdvancedPage : public ConfigPage 00027 { 00028 Q_OBJECT 00029 00030 public: 00031 /** Default Constructor */ 00032 AdvancedPage(QWidget *parent = 0); 00033 /** Default Destructor */ 00034 ~AdvancedPage(); 00035 /** Saves the changes on this page */ 00036 bool save(QString &errmsg); 00037 /** Loads the settings for this page */ 00038 void load(); 00039 00040 /** Applies the network configuration settings to Tor. Returns true if the 00041 * settings were applied successfully. Otherwise, <b>errmsg</b> is set 00042 * and false is returned. */ 00043 bool apply(QString &errmsg); 00044 /** Reverts the Tor configuration settings to their values at the last 00045 * time they were successfully applied to Tor. */ 00046 void revert(); 00047 /** Returns true if the user has changed their advanced Tor settings since 00048 * the last time they were applied to Tor. */ 00049 bool changedSinceLastApply(); 00050 /** Called when the user changes the UI translation. */ 00051 virtual void retranslateUi(); 00052 00053 signals: 00054 /** Emitted when the user changes torrc file to restart Tor */ 00055 void restartTor(); 00056 00057 private slots: 00058 /** Called when the user selects a different authentication method from the 00059 * combo box. */ 00060 void authMethodChanged(int index); 00061 /** Called when the user clicks "Browse" to choose location of Tor config 00062 * file */ 00063 void browseTorConfig(); 00064 /** Called when the user clicks "Browse" to choose the location of Tor's 00065 * data directory. */ 00066 void browseTorDataDirectory(); 00067 /** Called when the user clicks "Browse" to choose the location of Tor's 00068 * socket path. */ 00069 void browseSocketPath(); 00070 /** Called when the user changes from ControlPort to ControlSocket or 00071 * the other way aroud */ 00072 void toggleControl(bool); 00073 00074 /** Called when the user clicks "Edit current torrc" to edit Tor's config in 00075 * a more advanced way */ 00076 void displayTorrcDialog(); 00077 00078 /** Called when the user checks "Configure ControlPort automatically" */ 00079 void toggleAuto(bool); 00080 00081 private: 00082 /** Returns the authentication method for the given <b>index</b>. */ 00083 TorSettings::AuthenticationMethod indexToAuthMethod(int index); 00084 /** Returns the index in the authentication methods combo box for the given 00085 * authentication <b>method</b>. */ 00086 int authMethodToIndex(TorSettings::AuthenticationMethod method); 00087 00088 #if 0 00089 #if defined(Q_WS_WIN) 00090 /** Installs or removes the Tor service as necessary */ 00091 void setupService(bool useService); 00092 #endif 00093 #endif 00094 00095 /** A TorSettings object used to save/load settings */ 00096 TorSettings* _settings; 00097 /** Qt Designer generated object */ 00098 Ui::AdvancedPage ui; 00099 }; 00100 00101 #endif 00102