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 advancedpage.h 00024 * \version $Id: advancedpage.h 1843 2007-08-21 04:33:48Z edmanm $ 00025 * \brief Advanced Tor and Vidalia configuration options 00026 */ 00027 00028 #ifndef _ADVANCEDPAGE_H 00029 #define _ADVANCEDPAGE_H 00030 00031 #include <QFileDialog> 00032 #include <config/torsettings.h> 00033 00034 #include "configpage.h" 00035 #include "ui_advancedpage.h" 00036 00037 00038 class AdvancedPage : public ConfigPage 00039 { 00040 Q_OBJECT 00041 00042 public: 00043 /** Default Constructor */ 00044 AdvancedPage(QWidget *parent = 0); 00045 /** Default Destructor */ 00046 ~AdvancedPage(); 00047 /** Saves the changes on this page */ 00048 bool save(QString &errmsg); 00049 /** Loads the settings for this page */ 00050 void load(); 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 defined(Q_WS_WIN) 00071 /** Installs or removes the Tor service as necessary */ 00072 void setupService(bool useService); 00073 #endif 00074 00075 /** A TorSettings object used to save/load settings */ 00076 TorSettings* _settings; 00077 /** Qt Designer generated object */ 00078 Ui::AdvancedPage ui; 00079 }; 00080 00081 #endif 00082