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 configdialog.h 00013 ** \version $Id: configdialog.h 2504 2008-04-12 18:23:28Z edmanm $ 00014 ** \brief Contains a series of Vidalia and Tor configuration pages 00015 */ 00016 00017 #ifndef _CONFIGDIALOG_H 00018 #define _CONFIGDIALOG_H 00019 00020 #include <QMainWindow> 00021 #include <QFileDialog> 00022 #include <vidaliawindow.h> 00023 00024 #include "generalpage.h" 00025 #include "networkpage.h" 00026 #include "serverpage.h" 00027 #include "advancedpage.h" 00028 #include "appearancepage.h" 00029 #include "servicepage.h" 00030 00031 #include "ui_configdialog.h" 00032 00033 00034 class ConfigDialog : public VidaliaWindow 00035 { 00036 Q_OBJECT 00037 00038 public: 00039 /** Config dialog pages. */ 00040 enum Page { 00041 General = 0, /** General configuration page. */ 00042 Network, /** Network configuration page. */ 00043 Server, /** Server configuration page. */ 00044 Appearance, /** Appearance configuration page. */ 00045 Advanced, /** Advanced configuration page. */ 00046 Service /** Service Configuration page */ 00047 }; 00048 00049 /** Default Constructor */ 00050 ConfigDialog(QWidget *parent = 0); 00051 00052 public slots: 00053 /** Shows the config dialog with focus set to the given page. */ 00054 void showWindow(Page page = General); 00055 00056 private slots: 00057 /** Called when user clicks "Save Settings". Saves their settings to 00058 * Vidalia's configuration file. */ 00059 void saveChanges(); 00060 /** Called after Vidalia has authenticated to Tor and applies any changes 00061 * made since the last time they were applied. */ 00062 void applyChanges(); 00063 /** Sends Tor a SAVECONF to write its configuration to disk. If the 00064 * SAVECONF is successful, then all settings are considered to be 00065 * applied. */ 00066 void saveConf(); 00067 /** Called when a ConfigPage in the dialog requests help on a specific 00068 * <b>topic</b>. */ 00069 void help(const QString &topic); 00070 /** Shows general help information for whichever settings page the user is 00071 * currently viewing. */ 00072 void help(); 00073 00074 private: 00075 /** Loads the current configuration settings */ 00076 void loadSettings(); 00077 /** Creates a new action for a config page. */ 00078 QAction* createPageAction(QIcon img, QString text, QActionGroup *group); 00079 /** Adds a new action to the toolbar. */ 00080 void addAction(QAction *action, const char *slot = 0); 00081 00082 /** Qt Designer generated object */ 00083 Ui::ConfigDialog ui; 00084 }; 00085 00086 #endif 00087