configdialog.h

Go to the documentation of this file.
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 1238 2006-09-25 17:50:57Z 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   /** Called when this dialog is to be displayed */
00061   void show();
00062   /** Shows the config dialog with focus set to the given page. */
00063   void show(Page page);
00064 
00065 private slots:
00066   /** Called when user clicks "Cancel" */
00067   void cancelChanges();
00068   /** Called when user clicks "Save Settings" */
00069   void saveChanges();
00070   /** Called when user clicks "Help" */
00071   void help();
00072 
00073 private:
00074   /** Loads the current configuration settings */
00075   void loadSettings();
00076   /** Creates a new action for a config page. */
00077   QAction* createPageAction(QIcon img, QString text, QActionGroup *group);
00078   /** Adds a new action to the toolbar. */
00079   void addAction(QAction *action, const char *slot = 0);
00080 
00081   /** Qt Designer generated object */
00082   Ui::ConfigDialog ui;
00083 };
00084 
00085 #endif
00086 

Generated on Mon Oct 23 20:08:15 2006 for Vidalia by  doxygen 1.5.0