summaryrefslogtreecommitdiffstats
path: root/src/profileracoonoptions.cpp
blob: b9e310d9dfa4f3c98009ebdd8d94330c27fd7cb8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/***************************************************************************
 *   Copyright (C) 2004 by Christoph Thielecke                             *
 *   crissi99@gmx.de                                                       *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
#include "profileracoonoptions.h"

#include <klineedit.h>
#include <tdelocale.h>
#include <kcombobox.h>
#include <tqcheckbox.h>
#include <tqtooltip.h>
#include <tqlabel.h>
#include "widgetnotifyhelper.h"
#include <iostream>

ProfileRacoonOptions::ProfileRacoonOptions(TQWidget *parent)
		: ProfileRacoonOptionsBase(parent)
{
	WidgetNotifyHelper h;
	h.setupChangedAction(this);
	dialogModified=false;

	TQToolTip::add( RemoteIdTypeCombobox, i18n("<b>Remote ID type</b><br><table>"
	"<tr><td>none:</td><td>No ID</td></tr>"
	"<tr><td>address:</td><td>The type is the IP address. This is the default type if you do not specify an identifier to use</td></tr>"
	"<tr><td>user_fqdn:</td><td>The type is a USER_FTQDN (user fully-qualified domain name)</td></tr>"
	"<tr><td>fqdn:</td><td>The type is a FTQDN (fully-qualified domain name)</td></tr>"
	"<tr><td>keyid (file):</td><td>The type is a KEY_ID, read from the file</td></tr>"
	"<tr><td>keyid:</td><td>The type is a KEY_ID, specified in field</td></tr>"
	"<tr><td>asn1dn:</td><td>The type is an ASN.1 distinguished name. If empty, DN from the Subject field in the certificate will be used"
	"<table>"));

	TQToolTip::add( LocalIdTypeCombobox, i18n("<b>Local ID type</b><br><table>"
	"<tr><td>none:</td><td>No ID</td></tr>"
	"<tr><td>address:</td><td>The type is the IP address. This is the default type if you do not specify an identifier to use</td></tr>"
	"<tr><td>user_fqdn:</td><td>The type is a USER_FTQDN (user fully-qualified domain name)</td></tr>"
	"<tr><td>fqdn:</td><td>The type is a FTQDN (fully-qualified domain name)</td></tr>"
	"<tr><td>keyid (file):</td><td>The type is a KEY_ID, read from the file</td></tr>"
	"<tr><td>keyid:</td><td>The type is a KEY_ID, specified in field</td></tr>"
	"<tr><td>asn1dn:</td><td>The type is an ASN.1 distinguished name. If empty, DN from the Subject field in the certificate will be used"
	"<table>"));


}


ProfileRacoonOptions::~ProfileRacoonOptions()
{}

void ProfileRacoonOptions::localIDTypeToggled(const TQString& text)
{
	if (text == "none")
	{
		LocalIDLineEdit->setDisabled(true);
		LocalIDLabel->setDisabled(true);
	}
	else
	{
		LocalIDLineEdit->setDisabled(false);
		LocalIDLabel->setDisabled(false);
	}
}

void ProfileRacoonOptions::dialogChanged()
{
// 	std::cout << "ProfileRacoonOptions::dialogChanged()" << std::endl;
	dialogModified=true;
}


void ProfileRacoonOptions::remoteIDTypeToggled(const TQString& text)
{
	if (text == "none")
	{
		RemoteIDLineEdit->setDisabled(true);
		RemoteIDLabel->setDisabled(true);
	}
	else
	{
		RemoteIDLineEdit->setDisabled(false);
		RemoteIDLabel->setDisabled(false);
	}
}