Vidalia  0.2.17
GeneralPage.h
Go to the documentation of this file.
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 GeneralPage.h
00013 ** \brief General Tor and Vidalia configuration options
00014 */
00015 
00016 #ifndef _GENERALPAGE_H
00017 #define _GENERALPAGE_H
00018 
00019 #include "ui_GeneralPage.h"
00020 #include "ConfigPage.h"
00021 #include "VidaliaSettings.h"
00022 #include "TorSettings.h"
00023 
00024 #include <QFileDialog>
00025 
00026 
00027 class GeneralPage : public ConfigPage
00028 {
00029   Q_OBJECT
00030 
00031 public:
00032   /** Default Constructor */
00033   GeneralPage(QWidget *parent = 0);
00034   /** Default Destructor */
00035   ~GeneralPage();
00036   /** Saves the changes on this page */
00037   bool save(QString &errmsg);
00038   /** Loads the settings for this page */
00039   void load();
00040   /** Called when the user changes the UI translation. */
00041   virtual void retranslateUi();
00042 
00043 signals:
00044   /** Emitted when the user clicks the "Check Now" button. */
00045   void checkForUpdates();
00046 
00047 private slots:
00048   /** Open a QFileDialog to browse for a Tor executable file. */
00049   void browseTorExecutable();
00050   /** Open a QFileDialog to browse for a proxy executable file. */
00051   void browseProxyExecutable();
00052   /** Initiate an immediate check for software updates. */
00053   void updateNow();
00054 
00055 private:
00056   /** Displays a file dialog allowing the user to browse for an executable
00057    * file. <b>caption</b> will be displayed in the dialog's title bar and <b>
00058    * file</b>, if specified, is the default file selected in the dialog. */
00059   QString browseExecutable(const QString &caption,
00060                            const QString &file = QString());
00061 
00062   /** A VidaliaSettings object used for saving/loading vidalia settings */
00063   VidaliaSettings *_vidaliaSettings;
00064   /** A TorSettings ovject used for saving/loading tor settings */
00065   TorSettings *_torSettings;
00066   /** Qt Designer generated object */
00067   Ui::GeneralPage ui;
00068 };
00069 
00070 #endif
00071