Vidalia
0.3.1
Main Page
Namespaces
Classes
Files
File List
File Members
src
vidalia
config
ConfigPage.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 ConfigPage.h
13
** \brief Pure-virtual class for a configuration page
14
*/
15
16
#ifndef _CONFIGPAGE_H
17
#define _CONFIGPAGE_H
18
19
#include <QWidget>
20
21
22
class
ConfigPage
:
public
QWidget
23
{
24
Q_OBJECT
25
26
public
:
27
/** Default Constructor */
28
ConfigPage
(QWidget *parent = 0,
const
QString
title
= QString())
29
: QWidget(parent),
_title
(
title
) {}
30
31
/** Returns the title of this configuration page. */
32
QString
title
()
const
{
return
_title
; }
33
34
/** Pure virtual method. Subclassed pages load their config settings here. */
35
virtual
void
load
() = 0;
36
/** Pure virtual method. Subclassed pages save their config settings here
37
* and return true if everything was saved successfully. */
38
virtual
bool
save
(QString &errmsg) = 0;
39
40
/** Subclassed pages can overload this method to return true if they
41
* contain settings that have been modified since they were last applied to
42
* Tor. The default implementation always returns false. */
43
virtual
bool
changedSinceLastApply
() {
44
return
false
;
45
}
46
/** Subclassed pages can overload this method to apply any settings to
47
* Tor that have been modified since they were last applied (e.g., the
48
* changes were made while Tor was not running). Returns true if the changes
49
* were applied successfully. */
50
virtual
bool
apply
(QString &errmsg) {
51
Q_UNUSED(errmsg);
52
return
true
;
53
}
54
/** Subclassed pages can overload this method to revert any cancelled
55
* settings. */
56
virtual
void
revert
() {}
57
58
virtual
void
retranslateUi
() {}
59
60
signals:
61
/** Signal emitted when a ConfigPage requests help information on a given
62
* <b>topic</b>. */
63
void
helpRequested
(
const
QString &topic);
64
65
private
:
66
QString
_title
;
/**< Title of this configuration page. */
67
};
68
69
#endif
70
Generated on Mon Jan 14 2013 08:44:27 for Vidalia by
1.8.3