Vidalia  0.3.1
AdvancedPage.h
Go to the documentation of this file.
1 /*
2 ** This file is part of Vidalia, and is subject to the license terms in the
3 ** LICENSE file, found in the top level directory of this distribution. If you
4 ** did not receive the LICENSE file with this file, you may obtain it from the
5 ** Vidalia source package distributed by the Vidalia Project at
6 ** http://www.torproject.org/projects/vidalia.html. No part of Vidalia,
7 ** including this file, may be copied, modified, propagated, or distributed
8 ** except according to the terms described in the LICENSE file.
9 */
10 
11 /*
12 ** \file AdvancedPage.h
13 ** \brief Advanced Tor and Vidalia configuration options
14 */
15 
16 #ifndef _ADVANCEDPAGE_H
17 #define _ADVANCEDPAGE_H
18 
19 #include "ui_AdvancedPage.h"
20 #include "ConfigPage.h"
21 #include "TorSettings.h"
22 
23 #include <QFileDialog>
24 
25 
26 class AdvancedPage : public ConfigPage
27 {
28  Q_OBJECT
29 
30 public:
31  /** Default Constructor */
32  AdvancedPage(QWidget *parent = 0);
33  /** Default Destructor */
34  ~AdvancedPage();
35  /** Saves the changes on this page */
36  bool save(QString &errmsg);
37  /** Loads the settings for this page */
38  void load();
39 
40  /** Applies the network configuration settings to Tor. Returns true if the
41  * settings were applied successfully. Otherwise, <b>errmsg</b> is set
42  * and false is returned. */
43  bool apply(QString &errmsg);
44  /** Reverts the Tor configuration settings to their values at the last
45  * time they were successfully applied to Tor. */
46  void revert();
47  /** Returns true if the user has changed their advanced Tor settings since
48  * the last time they were applied to Tor. */
49  bool changedSinceLastApply();
50  /** Called when the user changes the UI translation. */
51  virtual void retranslateUi();
52 
53 signals:
54  /** Emitted when the user changes torrc file to restart Tor */
55  void restartTor();
56 
57 private slots:
58  /** Called when the user selects a different authentication method from the
59  * combo box. */
60  void authMethodChanged(int index);
61  /** Called when the user clicks "Browse" to choose location of Tor config
62  * file */
63  void browseTorConfig();
64  /** Called when the user clicks "Browse" to choose the location of Tor's
65  * data directory. */
67  /** Called when the user clicks "Browse" to choose the location of Tor's
68  * socket path. */
69  void browseSocketPath();
70  /** Called when the user changes from ControlPort to ControlSocket or
71  * the other way aroud */
72  void toggleControl(bool);
73 
74  /** Called when the user clicks "Edit current torrc" to edit Tor's config in
75  * a more advanced way */
76  void displayTorrcDialog();
77 
78  /** Called when the user checks "Configure ControlPort automatically" */
79  void toggleAuto(bool);
80 
81  /** Called when the user checks "Randomly Generate" checkbox */
82  void displayWarning(bool);
83 
84 private:
85  /** Returns the authentication method for the given <b>index</b>. */
87  /** Returns the index in the authentication methods combo box for the given
88  * authentication <b>method</b>. */
90 
91 #if 0
92 #if defined(Q_WS_WIN)
93  /** Installs or removes the Tor service as necessary */
94  void setupService(bool useService);
95 #endif
96 #endif
97 
98  /** A TorSettings object used to save/load settings */
100  /** Qt Designer generated object */
101  Ui::AdvancedPage ui;
102 };
103 
104 #endif
105 
void browseTorDataDirectory()
TorSettings::AuthenticationMethod indexToAuthMethod(int index)
void toggleAuto(bool)
void authMethodChanged(int index)
int authMethodToIndex(TorSettings::AuthenticationMethod method)
bool save(QString &errmsg)
void restartTor()
void displayTorrcDialog()
void browseSocketPath()
AdvancedPage(QWidget *parent=0)
TorSettings * _settings
Definition: AdvancedPage.h:99
void displayWarning(bool)
bool apply(QString &errmsg)
bool changedSinceLastApply()
void browseTorConfig()
Ui::AdvancedPage ui
Definition: AdvancedPage.h:101
virtual void retranslateUi()
void toggleControl(bool)