Vidalia
0.3.1
Main Page
Namespaces
Classes
Files
File List
File Members
src
vidalia
config
ServicePage.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
#ifndef _SERVICEPAGE_H
12
#define _SERVICEPAGE_H
13
14
#include "ui_ServicePage.h"
15
#include "
ConfigPage.h
"
16
#include "
TorSettings.h
"
17
#include "
ServiceSettings.h
"
18
#include "
ExitPolicy.h
"
19
20
#include "
TorControl.h
"
21
22
23
class
ServicePage
:
public
ConfigPage
24
{
25
Q_OBJECT
26
27
public
:
28
/** Default Constructor */
29
ServicePage
(QWidget *parent = 0);
30
/** Default Destructor */
31
~ServicePage
();
32
/** Saves the changes on this page */
33
bool
save
(QString &errmsg);
34
/** Loads the settings for this page */
35
void
load
();
36
/** Initialize the service table */
37
void
initServiceTable
(QMap<int, Service>*
_services
);
38
/** Called when the user changes the UI translation. */
39
virtual
void
retranslateUi
();
40
41
private
slots:
42
/** Called whenever the user clicks on the 'add' button. */
43
void
addService
();
44
/** Called whenever the user clicks on the 'remove' button. */
45
void
removeService
();
46
/** Called whenever the user clicks on the 'copy' button. */
47
void
copyToClipboard
();
48
/** Called whenever the user clicks on the 'browse' button. */
49
void
browseDirectory
();
50
/** Called whenever the user selects a different service. */
51
void
serviceSelectionChanged
();
52
/** Returns a list of services by parsing the configuration string given
53
* by the Tor controller. */
54
QList<Service>
extractSingleServices
(QString conf);
55
/** Returns a Service by parsing the configuration string from Tor and
56
* storing its values into the Service object. */
57
Service
generateService
(QString serviceString);
58
/** Starts all services in <b>services</b>, with Tor. */
59
void
startServicesInTor
(QList<Service> services);
60
/** Returns true if <b>service</b> is published. */
61
bool
isServicePublished
(
Service
service, QList<Service> torServices);
62
/** Returns true if all services have the required minimal configuration. */
63
bool
checkBeforeSaving
(QList<Service> services);
64
/** Called when the user finished editing a cell and checks that only valid
65
* values are set. */
66
void
valueChanged
();
67
68
private
:
69
/** A QMap, mapping from the row number in the table to the service Entity */
70
QMap<int, Service>*
_services
;
71
/** A QList, consisting of all running services before vidalia starts */
72
QMap<QString, Service>*
_torServices
;
73
74
/** Qt Designer generated object */
75
Ui::ServicePage
ui
;
76
};
77
78
#endif
79
Generated on Mon Jan 14 2013 08:44:27 for Vidalia by
1.8.3