Vidalia  0.3.1
TorrcDialog.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 TorrcDialog.h
13 ** \brief Torrc Dialog, contains the dialog for displaying and editing the torrc
14 */
15 
16 #ifndef _TORRCDIALOG_H
17 #define _TORRCDIALOG_H
18 
19 #include <QSyntaxHighlighter>
20 
21 class TorHighlighter : public QSyntaxHighlighter {
22  public:
23  /** Default constructor */
24  TorHighlighter(QTextEdit *te) : QSyntaxHighlighter(te) {}
25  /** Default deconstructor */
27  /** Hightlights commented lines and gives some format to
28  * the rest of the lines */
29  void highlightBlock(const QString &text);
30 };
31 
32 #include "ui_TorrcDialog.h"
33 
34 class TorControl;
35 
36 class TorrcDialog : public QDialog
37 {
38  Q_OBJECT
39 
40 public:
41  /** Default constructor */
42  TorrcDialog(QWidget *parent = 0);
43  /** Destructor */
44  ~TorrcDialog();
45 
46 private slots:
47  /** Saves the settings specified to the torrc file
48  * through the SAVECONF control */
49  void saveTorrc();
50 
51 private:
52  void loadToolBar();
53  /** Loads the contents of the torrc file that Tor has loaded */
54  void loadTorrc();
55  /** Parses the options edited and sets them through SETCONF
56  * if they pass the parsing stage */
57  bool parseAndSet(QString *errmsg = 0);
58 
59  Ui::TorrcDialog ui; /**< Qt Designer generated object. */
60  /** TorControl object to comunicate with Tor */
62 
63 };
64 
65 #endif // _TORRCDIALOG_H
TorHighlighter::TorHighlighter
TorHighlighter(QTextEdit *te)
Definition: TorrcDialog.h:24
TorControl
Definition: TorControl.h:49
TorHighlighter::~TorHighlighter
~TorHighlighter()
Definition: TorrcDialog.h:26
TorrcDialog::parseAndSet
bool parseAndSet(QString *errmsg=0)
Definition: TorrcDialog.cpp:88
TorrcDialog::ui
Ui::TorrcDialog ui
Definition: TorrcDialog.h:59
TorrcDialog::loadTorrc
void loadTorrc()
Definition: TorrcDialog.cpp:145
TorrcDialog::TorrcDialog
TorrcDialog(QWidget *parent=0)
Definition: TorrcDialog.cpp:42
TorrcDialog::saveTorrc
void saveTorrc()
Definition: TorrcDialog.cpp:167
TorrcDialog::loadToolBar
void loadToolBar()
Definition: TorrcDialog.cpp:68
TorrcDialog::tc
TorControl * tc
Definition: TorrcDialog.h:61
TorrcDialog
Definition: TorrcDialog.h:36
TorHighlighter::highlightBlock
void highlightBlock(const QString &text)
Definition: TorrcDialog.cpp:25
TorrcDialog::~TorrcDialog
~TorrcDialog()
Definition: TorrcDialog.cpp:62
TorHighlighter
Definition: TorrcDialog.h:21