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 configdialog.h 00024 * \version $Id: configdialog.h 1563 2006-12-26 06:06:04Z edmanm $ 00025 * \brief Contains a series of Vidalia and Tor configuration pages 00026 */ 00027 00028 #ifndef _CONFIGDIALOG_H 00029 #define _CONFIGDIALOG_H 00030 00031 #include <QMainWindow> 00032 #include <QFileDialog> 00033 #include <gui/help/browser/helpbrowser.h> 00034 #include <gui/common/vidaliawindow.h> 00035 00036 #include "generalpage.h" 00037 #include "serverpage.h" 00038 #include "advancedpage.h" 00039 #include "appearancepage.h" 00040 00041 #include "ui_configdialog.h" 00042 00043 class ConfigDialog : public VidaliaWindow 00044 { 00045 Q_OBJECT 00046 00047 public: 00048 /** Config dialog pages. */ 00049 enum Page { 00050 General = 0, /** General configuration page. */ 00051 Server = 1, /** Server configuration page. */ 00052 Appearance = 2, /** Appearance configuration page. */ 00053 Advanced = 3 /** Advanced configuration page. */ 00054 }; 00055 00056 /** Default Constructor */ 00057 ConfigDialog(QWidget *parent = 0); 00058 00059 public slots: 00060 /** Shows the config dialog with focus set to the given page. */ 00061 void showWindow(Page page = General); 00062 00063 private slots: 00064 /** Called when user clicks "Save Settings" */ 00065 void saveChanges(); 00066 /** Called when user clicks "Help" */ 00067 void help(); 00068 00069 private: 00070 /** Loads the current configuration settings */ 00071 void loadSettings(); 00072 /** Creates a new action for a config page. */ 00073 QAction* createPageAction(QIcon img, QString text, QActionGroup *group); 00074 /** Adds a new action to the toolbar. */ 00075 void addAction(QAction *action, const char *slot = 0); 00076 00077 /** Qt Designer generated object */ 00078 Ui::ConfigDialog ui; 00079 }; 00080 00081 #endif 00082