~ubuntu-branches/ubuntu/vivid/kvpnc/vivid-proposed

« back to all changes in this revision

Viewing changes to src/newprofilewizard.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Mark Purcell
  • Date: 2009-04-23 09:18:50 UTC
  • mfrom: (1.1.10 upstream) (8.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20090423091850-hweeg0jo64t0jx52
Tags: 0.9.1-1
* New upstream release (KDE4 is here)
* Add Build-Depends cmake and pkg-kde-tools
* Remove obsolete debian/patches
* Refresh debian/patches:
  - 10_su-to-root_usage.diff
  - 13_add_kuser_issuperuser.diff
* Cleanup debian/rules - simple under KDE4
* Update debian/watch for KDE4 version
* Update debian/copyright - use versionned licenses
* Update Section field - move to utils
* Remove obsolete dependencies: kdebase-bin, gksu, sux and modutils
* Update debian/kvpnc.{manpages,1}

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
//BEGIN INCLUDES
21
21
 
22
22
#include <klocale.h>
23
 
#include <qlabel.h>
24
 
#include <qhbox.h>
25
 
#include <qvbox.h>
26
 
#include <qpushbutton.h>
27
 
#include <qradiobutton.h>
28
 
#include <qcheckbox.h>
 
23
#include <QtGui/qlabel.h>
 
24
#include <Qt3Support/q3hbox.h>
 
25
#include <Qt3Support/q3vbox.h>
 
26
#include <Qt3Support/Q3HBoxLayout>
 
27
#include <QtGui/qpushbutton.h>
 
28
#include <QtGui/qradiobutton.h>
 
29
#include <QtGui/qcheckbox.h>
 
30
//Added by qt3to4:
 
31
#include <QPixmap>
29
32
#include <klineedit.h>
30
 
#include <qlineedit.h>
 
33
#include <QtGui/qlineedit.h>
31
34
#include <kmessagebox.h>
32
35
#include <kcombobox.h>
33
36
#include <kurlrequester.h>
34
37
#include <knuminput.h>
35
 
#include <kpassdlg.h>
36
 
#include <qspinbox.h>
37
 
#include <qcursor.h>
38
 
#include <qbuttongroup.h>
 
38
#include <kpassworddialog.h>
 
39
#include <QtGui/qspinbox.h>
 
40
#include <QtGui/qcursor.h>
 
41
#include <Qt3Support/q3buttongroup.h>
39
42
#include <iostream>
40
43
 
41
 
#include <kstddirs.h>
 
44
#include <kstandarddirs.h>
42
45
#include <kinputdialog.h>
 
46
#include <kvbox.h>
43
47
 
44
48
#include "kvpncconfig.h"
45
49
#include "networkinterface.h"
48
52
#include "utils.h"
49
53
//END INCLUDES
50
54
 
51
 
NewProfileWizard::NewProfileWizard ( KVpncConfig* GlobalConfig )
 
55
NewProfileWizard::NewProfileWizard ( KVpncConfig* GlobalConfig ) : Q3Wizard()
52
56
{
53
57
        this->GlobalConfig = GlobalConfig;
54
58
 
56
60
        setCaption ( i18n ( "Add new profile..." ) );
57
61
        //setMinimumSize( 400,300);
58
62
 
59
 
        SetupPixmap = new QPixmap ( locate ( "data", "kvpnc/newprofilewizard.png" ) );
 
63
        SetupPixmap = new QPixmap ( KStandardDirs::locate ( "data", "kvpnc/newprofilewizard.png" ) );
 
64
        SetupPixmapFinal = new QPixmap ( KStandardDirs::locate ( "data", "kvpnc/newprofilewizard_final.png" ) );
60
65
 
61
66
        // currently static for new profile
62
67
        VpnAccountData::ConnectionType ConnType = VpnAccountData::ConnectionType ( VpnAccountData::other );
91
96
        refuse128BitEncryption = false;
92
97
        allowStatefulMode = false;
93
98
        requireMppe = true;
94
 
        refuseEap = false;
95
99
        useNoBsdComp = true;
96
100
        useNoDeflate = true;
97
101
        savePsk = false;
100
104
        enterdatamanually = false;
101
105
        importOK = false;
102
106
 
103
 
        currentpage = 0;
104
 
        previouspage = 0;
105
107
 
106
108
        profileData = new VpnAccountData ( ConnType, Name );
107
109
        profileData->setGateway ( Gateway );
155
157
        if ( newProfileCreated && profileData->getAuthType() == VpnAccountData::cert )
156
158
                {}
157
159
 
158
 
        QWizard::accept();
 
160
        Q3Wizard::accept();
159
161
}
160
162
 
161
163
void NewProfileWizard::reject()
162
164
{
163
165
        finished = false;
164
 
        QWizard::reject();
 
166
        Q3Wizard::reject();
165
167
}
166
168
 
167
169
void NewProfileWizard::setupPages()
168
170
{
169
171
 
170
172
        // setup start page
171
 
        page1 = new QHBox ( 0 );
 
173
        startpage = new Q3HBox ( 0 );
172
174
        //      page1->setSpacing(8);
173
 
        QLabel *setupPixmapContent1 = new QLabel ( page1 );
 
175
        QLabel *setupPixmapContent1 = new QLabel ( startpage );
174
176
        setupPixmapContent1->setPixmap ( *SetupPixmap );
175
177
        setupPixmapContent1->resize ( setupPixmapContent1->sizeHint() );
176
 
        newprofilewizardstartcontent = new NewProfileWizardStart ( page1 );
177
 
        newprofilewizardstartcontent->resize ( newprofilewizardstartcontent->sizeHint() );
178
 
        page1->sizeHint();
179
 
        addPage ( page1, "<b>" + i18n ( "Welcome" ) + "</b>" );
 
178
        newprofilewizardstartcontent = new NewProfileWizardStart  (startpage);
 
179
//      newprofilewizardstartcontent->resize ( newprofilewizardstartcontent->sizeHint() );
 
180
        startpage->sizeHint();
 
181
        addPage ( startpage, "<b>" + i18n ( "Welcome" ) + "</b>" );
180
182
 
181
183
        // type selection
182
 
        newprofilewizardtypeselectionpage = new QHBox ( 0 );
 
184
        newprofilewizardtypeselectionpage = new Q3HBox ( 0 );
183
185
        //      newprofilewizardtypeselectionpage->setSpacing(8);
184
186
        QLabel *setupPixmapContent2 = new QLabel ( newprofilewizardtypeselectionpage );
185
187
        setupPixmapContent2->setPixmap ( *SetupPixmap );
186
188
        setupPixmapContent2->resize ( setupPixmapContent2->sizeHint() );
187
 
        newprofilewizardtypeselectionpagecontent = new NewProfileWizardTypeSelection ( newprofilewizardtypeselectionpage );
188
 
        newprofilewizardtypeselectionpagecontent->FreeswanRadioButton->setText ( i18n ( "IPSec (%1)" ).arg ( "FreeS/WAN/Openswan/strongSwan" ) );
189
 
        newprofilewizardtypeselectionpagecontent->L2tpFreeswanRadioButton->setText ( i18n ( "L2TP over IPSec (%1)" ).arg ( "FreeS/WAN/Openswan/strongSwan" ) );
190
 
        newprofilewizardtypeselectionpage->sizeHint();
 
189
        newprofilewizardtypeselectionpagecontent = new NewProfileWizardTypeSelection  (newprofilewizardtypeselectionpage);
 
190
        newprofilewizardtypeselectionpagecontent->FreeswanRadioButton->setText ( i18n ( "IPSec (%1)", QString("FreeS/WAN/Openswan/strongSwan" )) );
 
191
        newprofilewizardtypeselectionpagecontent->L2tpFreeswanRadioButton->setText ( i18n ( "L2TP over IPSec (%1)" , QString("FreeS/WAN/Openswan/strongSwan" )) );
 
192
//      newprofilewizardtypeselectionpage->sizeHint();
191
193
        addPage ( newprofilewizardtypeselectionpage, "<b>" + i18n ( "Type selection" ) + "</b>" );
192
194
 
193
195
        // cisco
194
 
        newprofilewizardciscoselectionpage = new QHBox ( 0 );
 
196
        newprofilewizardciscoselectionpage = new Q3HBox ( 0 );
195
197
        //      newprofilewizardciscoselectionpage->setSpacing(8);
196
198
        QLabel *setupPixmapContent3 = new QLabel ( newprofilewizardciscoselectionpage );
197
199
        setupPixmapContent3->setPixmap ( *SetupPixmap );
198
200
        setupPixmapContent3->resize ( setupPixmapContent3->sizeHint() );
199
 
        newprofilewizardciscoselectionpagecontent = new NewProfileWizardCiscoSelection ( newprofilewizardciscoselectionpage );
200
 
        newprofilewizardciscoselectionpage->sizeHint();
 
201
        newprofilewizardciscoselectionpagecontent = new NewProfileWizardCiscoSelection ( newprofilewizardciscoselectionpage);
 
202
//      newprofilewizardciscoselectionpage->sizeHint();
201
203
 
202
 
        newprofilewizardciscomanuallypage = new QHBox ( 0 );
 
204
        newprofilewizardciscomanuallypage = new Q3HBox ( 0 );
203
205
        //      newprofilewizardciscomanuallypage->setSpacing(8);
204
206
        QLabel *setupPixmapContent4 = new QLabel ( newprofilewizardciscomanuallypage );
205
207
        setupPixmapContent4->setPixmap ( *SetupPixmap );
206
208
        setupPixmapContent4->resize ( setupPixmapContent4->sizeHint() );
207
 
        newprofilewizardciscomanuallypagecontent = new NewProfileWizardCiscoManually ( newprofilewizardciscomanuallypage );
208
 
        newprofilewizardciscomanuallypage->sizeHint();
 
209
        newprofilewizardciscomanuallypagecontent = new NewProfileWizardCiscoManually (newprofilewizardciscomanuallypage  );
 
210
//      newprofilewizardciscomanuallypage->sizeHint();
 
211
        connect ( newprofilewizardciscomanuallypagecontent->GroupPasswordLineEdit , SIGNAL ( textChanged ( const QString& ) ), this, SLOT ( pskToggled ( const QString& ) ) );
209
212
 
210
213
        // racoon
211
 
        newprofilewizardracoonpage = new QHBox ( 0 );
 
214
        newprofilewizardracoonpage = new Q3HBox ( 0 );
212
215
        //      newprofilewizardracoonpage->setSpacing(8);
213
216
        QLabel *setupPixmapContent5 = new QLabel ( newprofilewizardracoonpage );
214
217
        setupPixmapContent5->setPixmap ( *SetupPixmap );
215
218
        setupPixmapContent5->resize ( setupPixmapContent5->sizeHint() );
216
 
        newprofilewizardracoonpagecontent = new NewProfileWizardRacoon ( newprofilewizardracoonpage );
 
219
        newprofilewizardracoonpagecontent = new NewProfileWizardRacoon (  newprofilewizardracoonpage);
217
220
        newprofilewizardracoonpagecontent->ExchangeModeComboBox->insertItem ( "main", 0 );
218
221
        newprofilewizardracoonpagecontent->ExchangeModeComboBox->insertItem ( "aggressive", 1 );
219
222
        newprofilewizardracoonpagecontent->ExchangeModeComboBox->insertItem ( "base", 2 );
240
243
        newprofilewizardracoonpagecontent->LocalIdTypeCombobox->insertItem ( "keyid" );
241
244
        newprofilewizardracoonpagecontent->LocalIdTypeCombobox->insertItem ( "user_fqdn" );
242
245
 
 
246
        newprofilewizardracoonpagecontent->RemoteIdTypeCombobox->insertItem ( "asn1dn" );
 
247
        newprofilewizardracoonpagecontent->RemoteIdTypeCombobox->insertItem ( "address" );
 
248
        newprofilewizardracoonpagecontent->RemoteIdTypeCombobox->insertItem ( "fqdn" );
 
249
        newprofilewizardracoonpagecontent->RemoteIdTypeCombobox->insertItem ( "keyid" );
 
250
        newprofilewizardracoonpagecontent->RemoteIdTypeCombobox->insertItem ( "user_fqdn" );
 
251
 
 
252
        newprofilewizardracoonpagecontent->PerfectForwardSecurityCheckbox->setChecked(true);
 
253
        newprofilewizardracoonpagecontent->PerfectForwardSecrecyCombobox->setCurrentText("modp2048");
 
254
 
 
255
 
 
256
 
243
257
        connect ( newprofilewizardracoonpagecontent->LocalIdTypeCombobox, SIGNAL ( highlighted ( const QString& ) ), this, SLOT ( localIDTypeToggled ( const QString& ) ) );
244
 
 
245
 
        QStringList KernelCrypto = Utils ( GlobalConfig ).getKernelCrypto();
246
 
 
247
 
        //FIXME why this is not in kernel crypto list???
248
 
        newprofilewizardracoonpagecontent->EncryptionAlgorithmComboBox->insertItem ( "3des" );
249
 
 
250
 
        //      newprofilewizardracoonpagecontent->EncryptionAlgorithmComboBox->insertItem("des" );
251
 
        //      newprofilewizardracoonpagecontent->EncryptionAlgorithmComboBox->insertItem("des_iv64" );
252
 
        //      newprofilewizardracoonpagecontent->EncryptionAlgorithmComboBox->insertItem("des_iv32" );
253
 
        //      newprofilewizardracoonpagecontent->EncryptionAlgorithmComboBox->insertItem("rc5" );
254
 
        //      newprofilewizardracoonpagecontent->EncryptionAlgorithmComboBox->insertItem("rc4" );
255
 
        //      newprofilewizardracoonpagecontent->EncryptionAlgorithmComboBox->insertItem("idea" );
256
 
        //      newprofilewizardracoonpagecontent->EncryptionAlgorithmComboBox->insertItem("3idea" );
257
 
        //      newprofilewizardracoonpagecontent->EncryptionAlgorithmComboBox->insertItem("cast128" );
258
 
        //      newprofilewizardracoonpagecontent->EncryptionAlgorithmComboBox->insertItem("blowfish" );
259
 
        //      newprofilewizardracoonpagecontent->EncryptionAlgorithmComboBox->insertItem("null_enc" );
260
 
        //      newprofilewizardracoonpagecontent->EncryptionAlgorithmComboBox->insertItem("twofish" );
261
 
        //      newprofilewizardracoonpagecontent->EncryptionAlgorithmComboBox->insertItem("rijndael" );
262
 
        //      newprofilewizardracoonpagecontent->EncryptionAlgorithmComboBox->insertItem("aes" );
263
 
 
264
 
        for ( QStringList::Iterator it = KernelCrypto.begin(); it != KernelCrypto.end(); ++it )
265
 
        {
266
 
                newprofilewizardracoonpagecontent->EncryptionAlgorithmComboBox->insertItem ( *it );
267
 
        }
268
 
 
269
 
 
270
 
        newprofilewizardracoonpagecontent->AuthenticationAlgorithmComboBox->insertItem ( "des" );
271
 
        newprofilewizardracoonpagecontent->AuthenticationAlgorithmComboBox->insertItem ( "3des" );
272
 
        newprofilewizardracoonpagecontent->AuthenticationAlgorithmComboBox->insertItem ( "des_iv64" );
273
 
        newprofilewizardracoonpagecontent->AuthenticationAlgorithmComboBox->insertItem ( "des_iv32" );
274
 
        newprofilewizardracoonpagecontent->AuthenticationAlgorithmComboBox->insertItem ( "hmac_md5" );
275
 
        newprofilewizardracoonpagecontent->AuthenticationAlgorithmComboBox->insertItem ( "hmac_sha1" );
276
 
        newprofilewizardracoonpagecontent->AuthenticationAlgorithmComboBox->insertItem ( "hmac_sha256" );
277
 
        newprofilewizardracoonpagecontent->AuthenticationAlgorithmComboBox->insertItem ( "hmac_sha384" );
278
 
        newprofilewizardracoonpagecontent->AuthenticationAlgorithmComboBox->insertItem ( "hmac_sha512" );
279
 
        newprofilewizardracoonpagecontent->AuthenticationAlgorithmComboBox->insertItem ( "non_auth" );
 
258
        connect ( newprofilewizardracoonpagecontent->RemoteIdTypeCombobox, SIGNAL ( highlighted ( const QString& ) ), this, SLOT ( remoteIDTypeToggled ( const QString& ) ) );
 
259
        connect ( newprofilewizardracoonpagecontent->IkeGroupCheckbox, SIGNAL ( toggled ( bool ) ), this, SLOT ( ikeGroupToggled ( bool ) ) );
 
260
        connect ( newprofilewizardracoonpagecontent->UseXauthCheckBox, SIGNAL(toggled(bool)),this, SLOT(useXauthRacoonToggled(bool)));
 
261
 
 
262
Utils::IpsecAlgos KernelCrypto = Utils ( GlobalConfig ).getKernelCrypto();
 
263
 
 
264
        // man racoon.conf
 
265
        newprofilewizardracoonpagecontent->EncryptionAlgorithmComboBox->insertItem("des" );
 
266
        newprofilewizardracoonpagecontent->EncryptionAlgorithmComboBox->insertItem("3des" );
 
267
        newprofilewizardracoonpagecontent->EncryptionAlgorithmComboBox->insertItem("blowfish" );
 
268
        newprofilewizardracoonpagecontent->EncryptionAlgorithmComboBox->insertItem("cast128" );
 
269
        newprofilewizardracoonpagecontent->EncryptionAlgorithmComboBox->insertItem("aes" );
 
270
        newprofilewizardracoonpagecontent->EncryptionAlgorithmComboBox->insertItem("camellia" );
 
271
 
 
272
        // man racoon.conf
 
273
        newprofilewizardracoonpagecontent->HashAlgoComboBox->insertItem( "md5" );
 
274
        newprofilewizardracoonpagecontent->HashAlgoComboBox->insertItem( "sha1" );
 
275
        newprofilewizardracoonpagecontent->HashAlgoComboBox->insertItem( "sha256" );
 
276
        newprofilewizardracoonpagecontent->HashAlgoComboBox->insertItem( "sha384" );
 
277
        newprofilewizardracoonpagecontent->HashAlgoComboBox->insertItem( "sha512" );
 
278
 
 
279
 
 
280
 
 
281
 
 
282
//      // phase 2 encr algos from kernel
 
283
//      for ( QStringList::Iterator it = KernelCrypto.IpsecEspEncryptionAlgorithms.begin(); it != KernelCrypto.IpsecEspEncryptionAlgorithms.end(); ++it )
 
284
//      {
 
285
//              newprofilewizardracoonpagecontent->EncryptionAlgorithm2ComboBox->insertItem ( *it );
 
286
//      }
 
287
//
 
288
//      // phase 2 auth algos from kernel
 
289
//      for ( QStringList::Iterator it = KernelCrypto.IpsecEspAuthenticationAlgorithms.begin(); it != KernelCrypto.IpsecEspAuthenticationAlgorithms.end(); ++it )
 
290
//      {
 
291
//              newprofilewizardracoonpagecontent->AuthenticationAlgorithm2ComboBox->insertItem ( *it );
 
292
//      }
 
293
 
 
294
        // vpn mit linux book
 
295
        newprofilewizardracoonpagecontent->EncryptionAlgorithm2ComboBox->insertItem("des" );
 
296
        newprofilewizardracoonpagecontent->EncryptionAlgorithm2ComboBox->insertItem("3des" );
 
297
        newprofilewizardracoonpagecontent->EncryptionAlgorithm2ComboBox->insertItem("des_iv64" );
 
298
        newprofilewizardracoonpagecontent->EncryptionAlgorithm2ComboBox->insertItem("des_iv32" );
 
299
        newprofilewizardracoonpagecontent->EncryptionAlgorithm2ComboBox->insertItem("rc5" );
 
300
        newprofilewizardracoonpagecontent->EncryptionAlgorithm2ComboBox->insertItem("rc4" );
 
301
        newprofilewizardracoonpagecontent->EncryptionAlgorithm2ComboBox->insertItem("idea" );
 
302
        newprofilewizardracoonpagecontent->EncryptionAlgorithm2ComboBox->insertItem("3idea" );
 
303
        newprofilewizardracoonpagecontent->EncryptionAlgorithm2ComboBox->insertItem("cast128" );
 
304
        newprofilewizardracoonpagecontent->EncryptionAlgorithm2ComboBox->insertItem("blowfish" );
 
305
        newprofilewizardracoonpagecontent->EncryptionAlgorithm2ComboBox->insertItem("null_enc" );
 
306
        newprofilewizardracoonpagecontent->EncryptionAlgorithm2ComboBox->insertItem("twofish" );
 
307
        newprofilewizardracoonpagecontent->EncryptionAlgorithm2ComboBox->insertItem("rijndael" );
 
308
        newprofilewizardracoonpagecontent->EncryptionAlgorithm2ComboBox->insertItem("aes" );
 
309
 
 
310
        newprofilewizardracoonpagecontent->AuthenticationAlgorithm2ComboBox->insertItem( "des" );
 
311
        newprofilewizardracoonpagecontent->AuthenticationAlgorithm2ComboBox->insertItem( "3des" );
 
312
        newprofilewizardracoonpagecontent->AuthenticationAlgorithm2ComboBox->insertItem( "des_iv64" );
 
313
        newprofilewizardracoonpagecontent->AuthenticationAlgorithm2ComboBox->insertItem( "des_iv32" );
 
314
        newprofilewizardracoonpagecontent->AuthenticationAlgorithm2ComboBox->insertItem( "hmac_md5" );
 
315
        newprofilewizardracoonpagecontent->AuthenticationAlgorithm2ComboBox->insertItem( "hmac_sha1" );
 
316
        newprofilewizardracoonpagecontent->AuthenticationAlgorithm2ComboBox->insertItem( "hmac_sha256" );
 
317
        newprofilewizardracoonpagecontent->AuthenticationAlgorithm2ComboBox->insertItem( "hmac_sha384" );
 
318
        newprofilewizardracoonpagecontent->AuthenticationAlgorithm2ComboBox->insertItem( "hmac_sha512" );
 
319
        newprofilewizardracoonpagecontent->AuthenticationAlgorithm2ComboBox->insertItem( "non_auth" );
280
320
 
281
321
 
282
322
        // FIXME save not implemented yet
286
326
        newprofilewizardracoonpage->sizeHint();
287
327
 
288
328
        //freeswan
289
 
        newprofilewizardfreeswanpage = new QHBox ( 0 );
 
329
        newprofilewizardfreeswanselectionpage = new Q3HBox ( 0 );
 
330
        //      newprofilewizardfreeswanselectionpage->setSpacing(8);
 
331
        QLabel *setupPixmapContent711 = new QLabel ( newprofilewizardfreeswanselectionpage );
 
332
        setupPixmapContent711->setPixmap ( *SetupPixmap );
 
333
        setupPixmapContent711->resize ( setupPixmapContent711->sizeHint() );
 
334
        newprofilewizardfreeswanselectionpagecontent     = new NewProfileWizardOpenvpnSelection ( newprofilewizardfreeswanselectionpage );
 
335
        newprofilewizardfreeswanselectionpagecontent->OpenvpnImportRadioButton->setText(i18n("Import &Ipsec config file"));
 
336
        newprofilewizardfreeswanselectionpage->sizeHint();
 
337
 
 
338
        newprofilewizardfreeswanpage = new Q3HBox ( 0 );
290
339
        //      newprofilewizardfreeswanpage->setSpacing(8);
291
340
        QLabel *setupPixmapContent6 = new QLabel ( newprofilewizardfreeswanpage );
292
341
        setupPixmapContent6->setPixmap ( *SetupPixmap );
293
342
        setupPixmapContent6->resize ( setupPixmapContent6->sizeHint() );
 
343
        newprofilewizardfreeswanpagecontent = new NewProfileWizardFreeswan ( newprofilewizardfreeswanpage);
 
344
        newprofilewizardfreeswanpage->sizeHint();
 
345
 
 
346
        //freeswan
 
347
        newprofilewizardfreeswanpage = new Q3HBox ( 0 );
 
348
        //      newprofilewizardfreeswanpage->setSpacing(8);
 
349
        QLabel *setupPixmapContent66 = new QLabel ( newprofilewizardfreeswanpage );
 
350
        setupPixmapContent66->setPixmap ( *SetupPixmap );
 
351
        setupPixmapContent66->resize ( setupPixmapContent66->sizeHint() );
294
352
        newprofilewizardfreeswanpagecontent = new NewProfileWizardFreeswan ( newprofilewizardfreeswanpage );
 
353
 
 
354
        newprofilewizardfreeswanpagecontent->LocalIdTypeCombobox->insertItem ( "asn1dn" );
 
355
        newprofilewizardfreeswanpagecontent->LocalIdTypeCombobox->insertItem ( "address" );
 
356
        newprofilewizardfreeswanpagecontent->LocalIdTypeCombobox->insertItem ( "fqdn" );
 
357
        newprofilewizardfreeswanpagecontent->LocalIdTypeCombobox->insertItem ( "keyid" );
 
358
        newprofilewizardfreeswanpagecontent->LocalIdTypeCombobox->insertItem ( "user_fqdn" );
 
359
 
 
360
        newprofilewizardfreeswanpagecontent->IpsecVpnModeCombobox->insertItem( "transport" );
 
361
        newprofilewizardfreeswanpagecontent->IpsecVpnModeCombobox->insertItem( "tunnel" );
 
362
 
 
363
        newprofilewizardfreeswanpagecontent->IpsecVpnModeCombobox->QComboBox::setCurrentItem(1);
 
364
        newprofilewizardfreeswanpagecontent->DisableOpportunisticEncryptionCheckBox->setChecked(true);
 
365
        newprofilewizardfreeswanpagecontent->UseModeConfigCheckBox->hide();
 
366
 
 
367
 
 
368
        connect ( newprofilewizardfreeswanpagecontent->LocalIdTypeCombobox, SIGNAL ( highlighted ( const QString& ) ), this, SLOT ( localIDTypeIpsecToggled ( const QString& ) ) );
 
369
 
 
370
        connect( newprofilewizardfreeswanpagecontent->UseCustomEspCheckBox, SIGNAL( toggled(bool) ), this, SLOT( useEspToogled(bool) ) );
 
371
        connect( newprofilewizardfreeswanpagecontent->UseCustomIkeCheckBox, SIGNAL( toggled(bool) ), this, SLOT( useIkeToggled(bool) ) );
 
372
        connect( newprofilewizardfreeswanpagecontent->UseLeftNextHopCheckBox, SIGNAL( toggled(bool) ), this, SLOT( useLeftNextHopToggled(bool) ) );
 
373
        connect( newprofilewizardfreeswanpagecontent->UseRightNextHopCheckBox, SIGNAL( toggled(bool) ), this, SLOT( useRightNextHopToggled(bool) ) );
 
374
        connect( newprofilewizardfreeswanpagecontent->LocalIdTypeCombobox, SIGNAL( activated(const QString&) ), this, SLOT( localIDTypeIpsecToggled(const QString&) ) );
 
375
        connect (newprofilewizardfreeswanpagecontent->UseXauthCheckBox, SIGNAL(toggled(bool)),this, SLOT(useXauthFreeswanToggled(bool)));
 
376
 
295
377
        newprofilewizardfreeswanpage->sizeHint();
296
378
 
297
379
        // openvpn
298
 
        newprofilewizardopenvpnselectionpage = new QHBox ( 0 );
 
380
        newprofilewizardopenvpnselectionpage = new Q3HBox ( 0 );
299
381
        //      newprofilewizardopenvpnselectionpage->setSpacing(8);
300
382
        QLabel *setupPixmapContent7 = new QLabel ( newprofilewizardopenvpnselectionpage );
301
383
        setupPixmapContent7->setPixmap ( *SetupPixmap );
302
384
        setupPixmapContent7->resize ( setupPixmapContent7->sizeHint() );
303
 
        newprofilewizardopenvpnselectionpagecontent = new NewProfileWizardOpenvpnSelection ( newprofilewizardopenvpnselectionpage );
 
385
        newprofilewizardopenvpnselectionpagecontent = new NewProfileWizardOpenvpnSelection (newprofilewizardopenvpnselectionpage  );
304
386
        newprofilewizardopenvpnselectionpage->sizeHint();
305
387
 
306
 
        newprofilewizardopenvpnauthpage = new QHBox ( 0 );
 
388
        newprofilewizardopenvpnauthpage = new Q3HBox ( 0 );
307
389
        //      newprofilewizardopenvpnauthpage->setSpacing(8);
308
390
        QLabel *setupPixmapContent71 = new QLabel ( newprofilewizardopenvpnauthpage );
309
391
        setupPixmapContent71->setPixmap ( *SetupPixmap );
313
395
        connect ( newprofilewizardopenvpnauthpagecontent->AuthWithUsernameAndPasswordCheckBox, SIGNAL ( toggled ( bool ) ), this, SLOT ( authenticateWithUsernameAndPasswordToggled ( bool ) ) );
314
396
        connect ( newprofilewizardopenvpnauthpagecontent->UseAuthenticationAlgorithmCheckBox, SIGNAL ( toggled ( bool ) ), this, SLOT ( useAuthenticationAlgorithmToggled ( bool ) ) );
315
397
 
316
 
        newprofilewizardopenvpnpage = new QHBox ( 0 );
 
398
        newprofilewizardopenvpnpage = new Q3HBox ( 0 );
317
399
        //      newprofilewizardopenvpnpage->setSpacing(8);
318
400
        QLabel *setupPixmapContent8 = new QLabel ( newprofilewizardopenvpnpage );
319
401
        setupPixmapContent8->setPixmap ( *SetupPixmap );
356
438
        }
357
439
 
358
440
        // pptp
359
 
        newprofilewizardpptppage = new QHBox ( 0 );
 
441
        newprofilewizardpptppage = new Q3HBox ( 0 );
360
442
        //      newprofilewizardpptppage->setSpacing(8);
361
443
        QLabel *setupPixmapContent9 = new QLabel ( newprofilewizardpptppage );
362
444
        setupPixmapContent9->setPixmap ( *SetupPixmap );
363
445
        setupPixmapContent9->resize ( setupPixmapContent9->sizeHint() );
364
 
        newprofilewizardpptppagecontent = new NewProfileWizardPptp ( newprofilewizardpptppage );
 
446
        newprofilewizardpptppagecontent = new NewProfileWizardPptp(newprofilewizardpptppage);
365
447
        newprofilewizardpptppage->sizeHint();
366
448
        newprofilewizardpptppagecontent->DnsServerLineedit->setEnabled ( false );
367
 
        newprofilewizardpptppagecontent->Refuse40BitEncryptionCheckbox->setChecked ( profileData->getRefuse40BitEncryption() );
368
 
        newprofilewizardpptppagecontent->Refuse40BitEncryptionCheckbox->setChecked ( profileData->getRefuse128BitEncryption() );
369
 
        newprofilewizardpptppagecontent->RequireMppeCheckbox->setChecked ( profileData->getRequireMppe() );
370
 
        newprofilewizardpptppagecontent->AllowStatefulModeCheckbox->setChecked ( profileData->getAllowStatefulMode() );
371
 
        newprofilewizardpptppagecontent->UseNoMPPECompressionCheckbox->setChecked ( profileData->getDisableMPPEComp() );
372
 
        newprofilewizardpptppagecontent->UseNoDeflateCheckbox->setChecked ( profileData->getUseNoDeflate() );
 
449
        newprofilewizardpptppagecontent->RequireMppeCheckbox->setChecked( profileData->getRequireMppe() );
 
450
        newprofilewizardpptppagecontent->Refuse128BitEncryptionCheckbox->setChecked( profileData->getRefuse128BitEncryption() );
 
451
        newprofilewizardpptppagecontent->Refuse40BitEncryptionCheckbox->setChecked( profileData->getRefuse40BitEncryption() );
 
452
        newprofilewizardpptppagecontent->UseNoMPPECompressionCheckbox->setChecked( profileData->getDisableMPPEComp() );
 
453
        newprofilewizardpptppagecontent->GetDnsFromPeerCheckbox->setChecked( profileData->getUseGetDnsFromPeer() );
 
454
        newprofilewizardpptppagecontent->DnsServerCheckbox->setChecked( profileData->getUseDnsUpdate() );
 
455
        newprofilewizardpptppagecontent->DnsServerCheckbox->setChecked( profileData->getUseDnsServer() );
 
456
        newprofilewizardpptppagecontent->DnsServerLineedit->setText( profileData->getDnsServer() );
 
457
        newprofilewizardpptppagecontent->UseNoBsdCompCheckbox->setChecked( profileData->getUseNoBsdComp() );
 
458
        newprofilewizardpptppagecontent->UseNoDeflateCheckbox->setChecked( profileData->getUseNoDeflate() );
 
459
        newprofilewizardpptppagecontent->AllowStatefulModeCheckbox->setChecked( profileData->getAllowStatefulMode() );
 
460
        newprofilewizardpptppagecontent->UseNoIpDefaultCheckbox->setChecked( profileData->getUseNoIpDefault() );
 
461
        newprofilewizardpptppagecontent->DisableCcpCheckbox->setChecked( profileData->getDisableCcp() );
 
462
        newprofilewizardpptppagecontent->DisableHeaderCompressionCheckbox->setChecked(profileData->getDisableHeaderCompression());
 
463
        newprofilewizardpptppagecontent->DisableMagicNumberNegotiationCheckbox->setChecked(profileData->getDisableMagicNumberNegotiation());
 
464
        newprofilewizardpptppagecontent->DisableIpxCheckbox->setChecked(profileData->getDisableIpx());
 
465
        newprofilewizardpptppagecontent->DisableAdressControlCompressionCheckbox->setChecked(profileData->getDisableAdressControlCompression());
 
466
        newprofilewizardpptppagecontent->DisableProtocolFieldCompressionCheckbox->setChecked(profileData->getDisableProtocolFieldCompression());
 
467
 
373
468
 
374
469
        newprofilewizardpptppagecontent->AuthMethodComboBox->insertItem ( "chap" );
375
470
        newprofilewizardpptppagecontent->AuthMethodComboBox->insertItem ( "pap" );
 
471
        newprofilewizardpptppagecontent->AuthMethodComboBox->insertItem ( "mschap" );
 
472
        newprofilewizardpptppagecontent->AuthMethodComboBox->insertItem ( "mschap-v2" );
 
473
 
 
474
        connect( newprofilewizardpptppagecontent->DnsServerCheckbox, SIGNAL( toggled(bool) ), this, SLOT( useDnsServerToggled(bool) ) );
 
475
        connect( newprofilewizardpptppagecontent->UseSearchDomainInResolvConfCheckbox, SIGNAL( toggled(bool) ), this, SLOT( useSearchDomainInResolvConfToggled(bool) ) );
376
476
 
377
477
        // vtun
378
 
        newprofilewizardvtunpage = new QHBox ( 0 );
 
478
        newprofilewizardvtunpage = new Q3HBox ( 0 );
379
479
        //      newprofilewizardvtunpage->setSpacing(8);
380
480
        QLabel *setupPixmapContent19 = new QLabel ( newprofilewizardvtunpage );
381
481
        setupPixmapContent19->setPixmap ( *SetupPixmap );
384
484
        newprofilewizardvtunpage->sizeHint();
385
485
        connect ( newprofilewizardvtunpagecontent->PortCheckbox, SIGNAL ( toggled ( bool ) ), this, SLOT ( usePortToggled ( bool ) ) );
386
486
 
387
 
        newprofilewizardauthselectionpage = new QHBox ( 0 );
 
487
        // ssh
 
488
        newprofilewizardsshpage = new Q3HBox ( 0 );
 
489
        //      newprofilewizardsshpage->setSpacing(8);
 
490
        QLabel *setupPixmapContent191 = new QLabel ( newprofilewizardsshpage );
 
491
        setupPixmapContent191->setPixmap ( *SetupPixmap );
 
492
        setupPixmapContent191->resize ( setupPixmapContent191->sizeHint() );
 
493
        newprofilewizardsshpagecontent = new ProfileSshOptions ( newprofilewizardsshpage );
 
494
        newprofilewizardsshpage->sizeHint();
 
495
 
 
496
        QString Home= QString(getenv("HOME"));
 
497
        if (!Home.isEmpty())
 
498
        {
 
499
                QDir dir( Home+"/.ssh" );
 
500
                QStringList KeyFiles = dir.entryList( "*" );
 
501
                
 
502
                //if (GlobalConfig->KvpncDebugLevel > 2)
 
503
                //{
 
504
                //      GlobalConfig->appendLogEntry(i18n("SSH files: %1", QString(KeyFiles.join(","))),GlobalConfig->debug);
 
505
                //}
 
506
                
 
507
                if (KeyFiles.size() > 1)
 
508
                {
 
509
                        for ( QStringList::Iterator it = KeyFiles.begin(); it != KeyFiles.end(); ++it )
 
510
                        {
 
511
                                QString item = QString(*it);
 
512
                                if (GlobalConfig->KvpncDebugLevel > 2)
 
513
                                {
 
514
                                        //GlobalConfig->appendLogEntry(i18n("processing entry: %1", QString(item),GlobalConfig->debug);
 
515
                                }
 
516
                                if (!item.contains (".pub", false)  && !item.contains ("authorized_keys", false)  && !item.contains ("known_hosts", false) && !item.contains (".", false) && !item.contains ("..", false) && !item.contains ("config", false) )
 
517
                                {
 
518
                                        if (GlobalConfig->KvpncDebugLevel > 2)
 
519
                                        {
 
520
                                                GlobalConfig->appendLogEntry(i18n("SSH key found: %1", QString(*it)),GlobalConfig->debug);
 
521
                                        }
 
522
                                                newprofilewizardsshpagecontent->SshKeyComboBox->insertItem(*it);
 
523
                                }
 
524
                        }
 
525
                }
 
526
        }
 
527
 
 
528
 
 
529
        newprofilewizardauthselectionpage = new Q3HBox ( 0 );
388
530
        //      newprofilewizardauthselectionpage->setSpacing(8);
389
531
        QLabel *setupPixmapContent81 = new QLabel ( newprofilewizardauthselectionpage );
390
532
        setupPixmapContent81->setPixmap ( *SetupPixmap );
392
534
        newprofilewizardauthselectioncontent = new NewProfileWizardAuthSelection ( newprofilewizardauthselectionpage );
393
535
        newprofilewizardauthselectionpage->sizeHint();
394
536
        newprofilewizardauthselectioncontent->CertificateRadioButton->setChecked ( true );
 
537
        newprofilewizardauthselectioncontent->HybridRadioButton->hide ();
395
538
 
396
539
 
397
540
        // virtual ip
398
 
        newprofilewizardvirtualipaddresspage = new QHBox ( 0 );
 
541
        newprofilewizardvirtualipaddresspage = new Q3HBox ( 0 );
399
542
        QLabel *setupPixmapContent_virtualip = new QLabel ( newprofilewizardvirtualipaddresspage );
400
543
        setupPixmapContent_virtualip->setPixmap ( *SetupPixmap );
401
544
        setupPixmapContent_virtualip->resize ( setupPixmapContent_virtualip->sizeHint() );
404
547
        insertPage ( newprofilewizardvirtualipaddresspage, "<b>" + i18n ( "Virtual IP address options" ) + "</b>",-1 );
405
548
        connect ( profilenetworkvirtualipoptionscontent->UseVirtualIPCheckBox, SIGNAL ( toggled ( bool ) ), this, SLOT ( useVirtualIpAddressToggled ( bool ) ) );
406
549
 
407
 
 
408
550
        // psk
409
 
        newprofilewizardpskpage = new QHBox ( 0 );
 
551
        newprofilewizardpskpage = new Q3HBox ( 0 );
410
552
        //      newprofilewizardpskpage->setSpacing(8);
411
553
        QLabel *setupPixmapContent72 = new QLabel ( newprofilewizardpskpage );
412
554
        setupPixmapContent72->setPixmap ( *SetupPixmap );
417
559
        connect ( newprofilewizardpskcontent->PskInFileCheckBox , SIGNAL ( toggled ( bool ) ), this, SLOT ( pskIsInFileToggled ( bool ) ) );
418
560
        connect ( newprofilewizardpskcontent->PSKLineEdit , SIGNAL ( textChanged ( const QString & ) ), this, SLOT ( pskInputToggled ( const QString& ) ) );
419
561
 
420
 
        newprofilewizardp12certselectionpage = new QHBox ( 0 );
 
562
        newprofilewizardp12certselectionpage = new Q3HBox ( 0 );
421
563
        //      newprofilewizardp12certselectionpage->setSpacing(8);
422
564
        QLabel *setupPixmapContent74 = new QLabel ( newprofilewizardp12certselectionpage );
423
565
        setupPixmapContent74->setPixmap ( *SetupPixmap );
427
569
        connect ( newprofilewizardp12certselectioncontent->UseSmartcardCheckBox, SIGNAL ( toggled ( bool ) ), this, SLOT ( useSmartcardOnCertFormateToggled ( bool ) ) );
428
570
 
429
571
        // cert
430
 
        newprofilewizardcertpage = new QHBox ( 0 );
 
572
        newprofilewizardcertpage = new Q3HBox ( 0 );
431
573
        //      newprofilewizardcertpage->setSpacing(8);
432
574
        QLabel *setupPixmapContent73 = new QLabel ( newprofilewizardcertpage );
433
575
        setupPixmapContent73->setPixmap ( *SetupPixmap );
442
584
        connect ( newprofilewizardcertcontent->DetectPkcs11IdPushButton, SIGNAL ( clicked() ), this, SLOT ( detectPkcs11Ids() ) );
443
585
        newprofilewizardcertcontent->Pkcs11SlotTypeComboBox->setEnabled ( false );
444
586
        newprofilewizardcertcontent->Pkcs11SlotTypeLabel->setEnabled ( false );
445
 
        newprofilewizardcertcontent->Pkcs11ProvidersURLRequester->setURL ( QString ( "/usr/local/lib/libetpkcs11.so" ) );
 
587
        newprofilewizardcertcontent->Pkcs11ProvidersURLRequester->setUrl ( KUrl ( "/usr/local/lib/libetpkcs11.so" ) );
446
588
 
447
589
 
448
590
        // user
449
 
        newprofilewizarduserpage = new QHBox ( 0 );
 
591
        newprofilewizarduserpage = new Q3HBox ( 0 );
450
592
        //      newprofilewizarduserpage->setSpacing(8);
451
593
        QLabel *setupPixmapContent75 = new QLabel ( newprofilewizarduserpage );
452
594
        setupPixmapContent75->setPixmap ( *SetupPixmap );
463
605
 
464
606
 
465
607
        // network
466
 
        newprofilewizardnetworkpage = new QHBox ( 0 );
 
608
        newprofilewizardnetworkpage = new Q3HBox ( 0 );
467
609
        //      newprofilewizardnetworkpage->setSpacing(8);
468
610
        QLabel *setupPixmapContent76 = new QLabel ( newprofilewizardnetworkpage );
469
611
        setupPixmapContent76->setPixmap ( *SetupPixmap );
482
624
        newprofilewizardnetworkcontent->MruSpinbox->hide();
483
625
        newprofilewizardnetworkcontent->MruCheckbox->hide();
484
626
 
485
 
        connect ( newprofilewizardnetworkcontent->MtuCheckbox, SIGNAL ( toggled ( bool ) ), this, SLOT ( mtuToggled ( bool ) ) );
486
 
        connect ( newprofilewizardnetworkcontent->MtuCheckbox, SIGNAL ( toggled ( bool ) ), this, SLOT ( mtuToggled ( bool ) ) );
 
627
        newprofilewizardnetworkcontent->TunnelDeviceTypeLabel->hide();
 
628
        newprofilewizardnetworkcontent->TunnelDeviceTypeComboBox->hide();
 
629
 
 
630
        newprofilewizardnetworkcontent->TunnelDeviceTypeComboBox->insertItem("tun");
 
631
        newprofilewizardnetworkcontent->TunnelDeviceTypeComboBox->insertItem("tap");
 
632
 
 
633
        connect ( newprofilewizardnetworkcontent->MtuCheckbox, SIGNAL ( toggled ( bool ) ), this, SLOT ( mtuToggled ( bool ) ) );
 
634
        connect ( newprofilewizardnetworkcontent->MtuCheckbox, SIGNAL ( toggled ( bool ) ), this, SLOT ( mtuToggled ( bool ) ) );
 
635
        connect ( newprofilewizardnetworkcontent->UseRemoteNetworkCheckBox, SIGNAL ( toggled ( bool ) ) , this, SLOT( useRemoteNetworkToggled (bool )));
 
636
        connect ( newprofilewizardnetworkcontent->TunnelDeviceTypeComboBox, SIGNAL(activated ( const QString & )),this, SLOT(tunnelDeviceTypeChanged(const QString& )));
 
637
 
 
638
        // network routes
 
639
        newprofilewizardnetworkroutepage = new Q3HBox ( 0 );
 
640
        //      newprofilewizardnetworkroutepage->setSpacing(8);
 
641
        QLabel *setupPixmapContent761 = new QLabel ( newprofilewizardnetworkroutepage );
 
642
        setupPixmapContent761->setPixmap ( *SetupPixmap );
 
643
        setupPixmapContent761->resize ( setupPixmapContent761->sizeHint() );
 
644
        newprofilewizardnetworkroutecontent = new ProfileNetworkRouteOptions ( newprofilewizardnetworkroutepage );
 
645
        newprofilewizardnetworkroutepage->sizeHint();
 
646
 
 
647
        connect(newprofilewizardnetworkroutecontent->DefaultRouteComboBox, SIGNAL(activated(const QString&)), this, SLOT(defaultRouteToggled(const QString&)));
 
648
 
 
649
        newprofilewizardnetworkroutecontent->DefaultRouteComboBox->QComboBox::setCurrentItem(1);
 
650
 
487
651
 
488
652
        // nat
489
 
        newprofilewizardnatpage = new QHBox ( 0 );
 
653
        newprofilewizardnatpage = new Q3HBox ( 0 );
490
654
        //      newprofilewizardnatpage->setSpacing(8);
491
655
        QLabel *setupPixmapContent77 = new QLabel ( newprofilewizardnatpage );
492
656
        setupPixmapContent77->setPixmap ( *SetupPixmap );
499
663
 
500
664
 
501
665
        // connectionstatuscheck
502
 
        newprofilewizardconnectionstatuscheckpage = new QHBox ( 0 );
 
666
        newprofilewizardconnectionstatuscheckpage = new Q3HBox ( 0 );
503
667
        //      newprofilewizardconnectionstatuscheckpage->setSpacing(8);
504
668
        QLabel *setupPixmapContent79 = new QLabel ( newprofilewizardconnectionstatuscheckpage );
505
669
        setupPixmapContent79->setPixmap ( *SetupPixmap );
511
675
        connect ( newprofilewizardconnectionstatuscheckcontent->UseConnectionStatusCheckCheckBox, SIGNAL ( toggled ( bool ) ), this, SLOT ( connectionStatusCheckToggled ( bool ) ) );
512
676
 
513
677
        // connectoptions
514
 
        newprofilewizardconnectoptionspage = new QHBox ( 0 );
 
678
        newprofilewizardconnectoptionspage = new Q3HBox ( 0 );
515
679
 
516
680
        //      newprofilewizardconnectoptionspage->setSpacing(8);
517
681
        QLabel *setupPixmapContent80 = new QLabel ( newprofilewizardconnectoptionspage );
524
688
        insertPage ( newprofilewizardconnectoptionspage, "<b>" + i18n ( "Connect options" ) + "</b>", -1 );
525
689
 
526
690
        // general
527
 
        newprofilewizardgeneralpage = new QHBox ( 0 );
 
691
        newprofilewizardgeneralpage = new Q3HBox ( 0 );
528
692
        //      newprofilewizardgeneralpage->setSpacing(8);
529
693
        QLabel *setupPixmapContent78 = new QLabel ( newprofilewizardgeneralpage );
530
694
        setupPixmapContent78->setPixmap ( *SetupPixmap );
534
698
        insertPage ( newprofilewizardgeneralpage, "<b>" + i18n ( "General settings" ) + "</b>", -1 );
535
699
 
536
700
        // setup end page
537
 
        endpage = new QHBox ( 0 );
 
701
        endpage = new Q3HBox ( 0 );
538
702
        //      endpage->setSpacing(8);
539
703
        QLabel *setupPixmapContent11 = new QLabel ( endpage );
540
 
        setupPixmapContent11->setPixmap ( *SetupPixmap );
 
704
        setupPixmapContent11->setPixmap ( *SetupPixmapFinal );
541
705
        setupPixmapContent11->resize ( setupPixmapContent11->sizeHint() );
542
706
        QLabel *endpagecontent = new QLabel ( endpage );
543
707
        endpagecontent->setMargin ( 11 );
553
717
        bool ok = true;
554
718
        QString msg = i18n ( "Please fill in all fields!" );
555
719
 
556
 
        if ( currentpage == page1 )
 
720
        if ( currentpage == startpage )
557
721
        {
558
722
                // nothing here
559
723
        }
597
761
                                        if ( it->getName() == Name )
598
762
                                        {
599
763
                                                //account->setName( QString( account->getName() + "_2" ) );
600
 
                                                //                              KMessageBox::information ( this, i18n( "Profile name exists!\n It will be renamed to \"%1\"." ).arg( account->getName() ), i18n( "Name exist, renamed" ) );
 
764
                                                //                              KMessageBox::information ( this, i18n( "Profile name exists!\n It will be renamed to \"%1\"." , QString( account->getName() )), i18n( "Name exist, renamed" ) );
601
765
                                                KMessageBox::error ( this, i18n ( "Profile name exists!" ), i18n ( "Name Exists" ) );
602
766
 
603
767
                                                QString newName = KInputDialog::getText ( i18n ( "New Name" ), i18n ( "New name for profile:" ), QString ( Name += "_2" ), &ok );
618
782
                                profileData->setName ( Name );
619
783
 
620
784
                                if ( GlobalConfig->KvpncDebugLevel > 0 )
621
 
                                        GlobalConfig->appendLogEntry ( i18n ( "Profile name: %1" ).arg ( profileData->getName() ), KVpncConfig::debug );
 
785
                                        GlobalConfig->appendLogEntry ( i18n ( "Profile name: %1" , QString(profileData->getName() )), KVpncConfig::debug );
622
786
 
623
787
                                newProfileCreated = TRUE;
624
788
                        }
638
802
                {
639
803
                        profileData->setGateway ( newprofilewizardgeneralpagecontent->gatewayLineEdit->text() );
640
804
                        if ( GlobalConfig->KvpncDebugLevel > 0 )
641
 
                                GlobalConfig->appendLogEntry ( i18n ( "Gateway: %1" ).arg ( newprofilewizardgeneralpagecontent->gatewayLineEdit->text() ), KVpncConfig::debug );
 
805
                                GlobalConfig->appendLogEntry ( i18n ( "Gateway: %1" , newprofilewizardgeneralpagecontent->gatewayLineEdit->text() ), KVpncConfig::debug );
642
806
                }
643
807
                profileData->setDescription ( newprofilewizardgeneralpagecontent->DescriptionLineEdit->text() );
644
808
                if ( GlobalConfig->KvpncDebugLevel > 0 )
645
 
                        GlobalConfig->appendLogEntry ( i18n ( "Description: %1" ).arg ( newprofilewizardgeneralpagecontent->DescriptionLineEdit->text() ), KVpncConfig::debug );
 
809
                        GlobalConfig->appendLogEntry ( i18n ( "Description: %1" , newprofilewizardgeneralpagecontent->DescriptionLineEdit->text() ), KVpncConfig::debug );
646
810
        }
647
811
        else if ( currentpage == newprofilewizardtypeselectionpage )
648
812
        {
653
817
                        removePage ( newprofilewizardpskpage );
654
818
                        removePage ( newprofilewizardp12certselectionpage );
655
819
                        removePage ( newprofilewizardfreeswanpage );
 
820
                        removePage ( newprofilewizardfreeswanselectionpage );
656
821
                        removePage ( newprofilewizardracoonpage );
657
822
                        removePage ( newprofilewizardopenvpnpage );
658
823
                        removePage ( newprofilewizardopenvpnselectionpage );
659
824
                        removePage ( newprofilewizardpptppage );
660
825
                        removePage ( newprofilewizardvirtualipaddresspage );
661
 
                        newprofilewizardnetworkcontent->LabelRemoteNetwork->hide();
662
 
                        newprofilewizardnetworkcontent->RemoteNetMaskComboBox->hide();
663
 
                        newprofilewizardnetworkcontent->RemoteNetAddrLineEdit->hide();
664
 
                        newprofilewizardnetworkcontent->RemoteNetDividetextLabel->hide();
665
 
                        newprofilewizardp12certselectioncontent->UseSmartcardCheckBox->hide();
 
826
                        newprofilewizardnetworkcontent->RemoteNetworkGroupBox->hide();
 
827
//                      newprofilewizardnetworkcontent->LabelRemoteNetwork->hide();
 
828
//                      newprofilewizardnetworkcontent->RemoteNetMaskComboBox->hide();
 
829
//                      newprofilewizardnetworkcontent->RemoteNetAddrLineEdit->hide();
 
830
//                      newprofilewizardnetworkcontent->RemoteNetDividetextLabel->hide();
 
831
//                      newprofilewizardp12certselectioncontent->UseSmartcardCheckBox->hide();
666
832
 
667
833
                        newprofilewizarduserpagecontent ->NtDomainNameCheckbox->show();
668
834
                        newprofilewizarduserpagecontent ->NtDomainNameLineedit->show();
670
836
                        insertPage ( newprofilewizardciscoselectionpage, "<b>" + i18n ( "Cisco selection" ) + "</b>", indexOf ( currentpage ) + 1 );
671
837
 
672
838
                        if ( GlobalConfig->KvpncDebugLevel > 0 )
673
 
                                GlobalConfig->appendLogEntry ( i18n ( "Selected type: %1" ).arg ( "Cisco (free)" ), KVpncConfig::debug );
 
839
                                GlobalConfig->appendLogEntry ( i18n ( "Selected type: %1" ,QString ( "Cisco (free)" ) ), KVpncConfig::debug );
674
840
                }
675
841
                else if ( newprofilewizardtypeselectionpagecontent->CiscoVpncRadioButton->isChecked() )
676
842
                {
679
845
                        removePage ( newprofilewizardpskpage );
680
846
                        removePage ( newprofilewizardp12certselectionpage );
681
847
                        removePage ( newprofilewizardfreeswanpage );
 
848
                        removePage ( newprofilewizardfreeswanselectionpage );
682
849
                        removePage ( newprofilewizardracoonpage );
683
850
                        removePage ( newprofilewizardopenvpnpage );
684
851
                        removePage ( newprofilewizardopenvpnselectionpage );
697
864
 
698
865
 
699
866
                        if ( GlobalConfig->KvpncDebugLevel > 0 )
700
 
                                GlobalConfig->appendLogEntry ( i18n ( "Selected type: %1" ).arg ( "Cisco (propritary)" ), KVpncConfig::debug );
 
867
                                GlobalConfig->appendLogEntry ( i18n ( "Selected type: %1" ,QString ( "Cisco (propritary)" ) ), KVpncConfig::debug );
701
868
                }
702
869
                else if ( newprofilewizardtypeselectionpagecontent->FreeswanRadioButton->isChecked() )
703
870
                {
709
876
                        removePage ( newprofilewizardpptppage );
710
877
                        removePage ( newprofilewizardvirtualipaddresspage );
711
878
 
712
 
                        insertPage ( newprofilewizardracoonpage, "<b>" + i18n ( "FreeSWAN/OpenSWAN settings" ) + "</b>", indexOf ( currentpage ) + 1 );
713
 
 
714
 
                        newprofilewizardracoonpagecontent->ExchangeModeComboBox->insertItem ( "main", 0 );
715
 
                        newprofilewizardracoonpagecontent->ExchangeModeComboBox->insertItem ( "aggressive", 1 );
716
 
                        newprofilewizardracoonpagecontent->ExchangeModeComboBox->setCurrentItem ( 0 ); // main
717
 
                        newprofilewizardracoonpagecontent->ExchangeModeComboBox->setEnabled ( true );
718
 
 
719
 
                        newprofilewizardracoonpagecontent->HashAlgoComboBox->hide();
720
 
                        newprofilewizardracoonpagecontent->HashAlgoTextLabel->hide();
721
 
                        newprofilewizardracoonpagecontent->UseModeConfigCheckBox->hide();
722
 
                        newprofilewizardracoonpagecontent->AuthenticationAlgorithmComboBox->hide();
723
 
                        newprofilewizardracoonpagecontent->EncryptionAlgorithmComboBox->hide();
724
 
                        newprofilewizardracoonpagecontent->DHGroupComboBox->hide();
725
 
 
726
 
                        newprofilewizardcertcontent->certpathURLRequester->setURL ( "/etc/ipsec.d/cacerts" );
 
879
                        insertPage ( newprofilewizardfreeswanpage, "<b>" + i18n ( "FreeSWAN/OpenSWAN settings" ) + "</b>", indexOf ( currentpage ) + 1 );
 
880
 
 
881
                        newprofilewizardfreeswanpagecontent->ExchangeModeComboBox->insertItem ( "main", 0 );
 
882
                        newprofilewizardfreeswanpagecontent->ExchangeModeComboBox->insertItem ( "aggressive", 1 );
 
883
                        newprofilewizardfreeswanpagecontent->ExchangeModeComboBox->setCurrentItem ( 0 ); // main
 
884
                        newprofilewizardfreeswanpagecontent->ExchangeModeComboBox->setEnabled ( true );
 
885
 
 
886
                        newprofilewizardfreeswanpagecontent->IpsecVpnModeCombobox->QComboBox::setCurrentItem(1); // tunnel
 
887
 
 
888
                        newprofilewizardcertcontent->certpathURLRequester->setUrl ( KUrl("/etc/ipsec.d/cacerts") );
727
889
                        newprofilewizardcertcontent->Pkcs11IdTypeComboBox->setEnabled ( false );
728
890
                        newprofilewizardcertcontent->Pkcs11IdTypeComboBox->setCurrentText ( i18n ( "ID" ) );
729
891
 
730
 
                        profileData->setIkeGroup ( "modp2048" ); // default for windows?!
731
 
                        profileData->setAuthenticationAlgorithm ( "hmac_md5" ); // default for windows?!
732
 
                        profileData->setHashAlgo ( "sha1" ); // default for windows?!
733
 
 
734
 
 
735
 
                        newprofilewizardracoonpagecontent->InfoLabel->setText ( i18n ( "Please enter %1 specific settings:" ).arg ( "FreeS/WAN/Openswan/strongSwan" ) );
736
 
 
737
 
                        insertPage ( newprofilewizardauthselectionpage, i18n ( "Authentication settings" ), indexOf ( currentpage ) + 1 );
738
 
                        insertPage ( newprofilewizardnetworkpage, "<b>" + i18n ( "Network settings" ) + "</b>", indexOf ( currentpage ) + 2 );
 
892
//                      profileData->setIkeGroup ( "modp2048" ); // default for windows?!
 
893
//                      profileData->setAuthenticationAlgorithm ( "hmac_md5" ); // default for windows?!
 
894
//                      profileData->setHashAlgo ( "sha1" ); // default for windows?!
 
895
 
 
896
 
 
897
//                      newprofilewizardfreeswanpagecontent->InfoLabel->setText ( i18n ( "Please enter %1 specific settings:", QString("FreeS/WAN/Openswan/strongSwan" )) );
 
898
                        insertPage ( newprofilewizardfreeswanselectionpage, "<b>" + i18n ( "IPSec selection" ) + "</b>", indexOf ( currentpage ) + 1 );
 
899
 
739
900
 
740
901
                        if ( GlobalConfig->KvpncDebugLevel > 0 )
741
 
                                GlobalConfig->appendLogEntry ( i18n ( "Selected type: %1" ).arg ( "FreeS/WAN/Openswan/strongSwan" ), KVpncConfig::debug );
 
902
                                GlobalConfig->appendLogEntry ( i18n ( "Selected type: %1" , QString( "FreeS/WAN/Openswan/strongSwan" ) ), KVpncConfig::debug );
742
903
                }
743
904
                else if ( newprofilewizardtypeselectionpagecontent->RacoonRadioButton->isChecked() )
744
905
                {
745
906
                        profileData->setConnectionType ( VpnAccountData::racoon );
746
907
                        removePage ( newprofilewizardciscoselectionpage );
747
908
                        removePage ( newprofilewizardciscomanuallypage );
 
909
                        removePage ( newprofilewizardfreeswanpage );
 
910
                        removePage ( newprofilewizardfreeswanselectionpage );
748
911
                        removePage ( newprofilewizardopenvpnpage );
749
912
                        removePage ( newprofilewizardopenvpnselectionpage );
750
913
                        removePage ( newprofilewizardpptppage );
751
914
                        removePage ( newprofilewizardvirtualipaddresspage );
752
915
 
753
 
                        newprofilewizardracoonpagecontent->FreeswanGroupBox->hide();
754
916
 
755
 
                        profileData->setIkeGroup ( "modp2048" ); // default for windows?!
756
 
                        profileData->setHashAlgo ( "sha1" ); // default for windows?!
757
 
                        profileData->setAuthenticationAlgorithm ( "hmac_md5" );
 
917
//                      profileData->setIkeGroup ( "modp2048" ); // default for windows?!
 
918
//                      profileData->setHashAlgo ( "sha1" ); // default for windows?!
 
919
//                      profileData->setAuthenticationAlgorithm ( "hmac_md5" );
758
920
 
759
921
                        profileData->setUseMailAddressAsIdentifier ( false );
760
922
 
761
 
                        newprofilewizardracoonpagecontent->DHGroupComboBox->setCurrentText ( profileData->getIkeGroup() );
762
 
                        newprofilewizardracoonpagecontent->AuthenticationAlgorithmComboBox->setCurrentText ( profileData->getAuthenticationAlgorithm() );
763
 
                        newprofilewizardracoonpagecontent->EncryptionAlgorithmComboBox->setCurrentText ( profileData->getEncryptionAlgorithm() );
 
923
//                      newprofilewizardracoonpagecontent->DHGroupComboBox->setCurrentText ( profileData->getIkeGroup() );
 
924
//                      newprofilewizardracoonpagecontent->AuthenticationAlgorithmComboBox->setCurrentText ( profileData->getAuthenticationAlgorithm() );
 
925
//                      newprofilewizardracoonpagecontent->EncryptionAlgorithmComboBox->setCurrentText ( profileData->getEncryptionAlgorithm() );
 
926
 
 
927
        Utils::IpsecAlgos KernelCrypto = Utils ( GlobalConfig ).getKernelCrypto();
 
928
 
 
929
                        // man racoon.conf
 
930
        newprofilewizardracoonpagecontent->EncryptionAlgorithmComboBox->insertItem("des" );
 
931
                        newprofilewizardracoonpagecontent->EncryptionAlgorithmComboBox->insertItem("3des" );
 
932
                        newprofilewizardracoonpagecontent->EncryptionAlgorithmComboBox->insertItem("blowfish" );
 
933
        newprofilewizardracoonpagecontent->EncryptionAlgorithmComboBox->insertItem("cast128" );
 
934
        newprofilewizardracoonpagecontent->EncryptionAlgorithmComboBox->insertItem("aes" );
 
935
                        newprofilewizardracoonpagecontent->EncryptionAlgorithmComboBox->insertItem("camellia" );
 
936
 
 
937
                        newprofilewizardracoonpagecontent->EncryptionAlgorithmComboBox->setCurrentText("3des");
 
938
 
 
939
                        // man racoon.conf
 
940
        newprofilewizardracoonpagecontent->HashAlgoComboBox->insertItem( "md5" );
 
941
        newprofilewizardracoonpagecontent->HashAlgoComboBox->insertItem( "sha1" );
 
942
        newprofilewizardracoonpagecontent->HashAlgoComboBox->insertItem( "sha256" );
 
943
        newprofilewizardracoonpagecontent->HashAlgoComboBox->insertItem( "sha384" );
 
944
        newprofilewizardracoonpagecontent->HashAlgoComboBox->insertItem( "sha512" );
 
945
 
 
946
                        newprofilewizardracoonpagecontent->HashAlgoComboBox->setCurrentText("md5");
 
947
                        
 
948
                        // vpn mit linux book
 
949
                        newprofilewizardracoonpagecontent->EncryptionAlgorithm2ComboBox->insertItem("des" );
 
950
                        newprofilewizardracoonpagecontent->EncryptionAlgorithm2ComboBox->insertItem("3des" );
 
951
                        newprofilewizardracoonpagecontent->EncryptionAlgorithm2ComboBox->insertItem("des_iv64" );
 
952
                        newprofilewizardracoonpagecontent->EncryptionAlgorithm2ComboBox->insertItem("des_iv32" );
 
953
                        newprofilewizardracoonpagecontent->EncryptionAlgorithm2ComboBox->insertItem("rc5" );
 
954
                        newprofilewizardracoonpagecontent->EncryptionAlgorithm2ComboBox->insertItem("rc4" );
 
955
                        newprofilewizardracoonpagecontent->EncryptionAlgorithm2ComboBox->insertItem("idea" );
 
956
                        newprofilewizardracoonpagecontent->EncryptionAlgorithm2ComboBox->insertItem("3idea" );
 
957
                        newprofilewizardracoonpagecontent->EncryptionAlgorithm2ComboBox->insertItem("cast128" );
 
958
                        newprofilewizardracoonpagecontent->EncryptionAlgorithm2ComboBox->insertItem("blowfish" );
 
959
                        newprofilewizardracoonpagecontent->EncryptionAlgorithm2ComboBox->insertItem("null_enc" );
 
960
                        newprofilewizardracoonpagecontent->EncryptionAlgorithm2ComboBox->insertItem("twofish" );
 
961
                        newprofilewizardracoonpagecontent->EncryptionAlgorithm2ComboBox->insertItem("rijndael" );
 
962
                        newprofilewizardracoonpagecontent->EncryptionAlgorithm2ComboBox->insertItem("aes" );
 
963
 
 
964
                        newprofilewizardracoonpagecontent->EncryptionAlgorithm2ComboBox->setCurrentText("3des");
 
965
 
 
966
        newprofilewizardracoonpagecontent->AuthenticationAlgorithm2ComboBox->insertItem( "des" );
 
967
        newprofilewizardracoonpagecontent->AuthenticationAlgorithm2ComboBox->insertItem( "3des" );
 
968
        newprofilewizardracoonpagecontent->AuthenticationAlgorithm2ComboBox->insertItem( "des_iv64" );
 
969
        newprofilewizardracoonpagecontent->AuthenticationAlgorithm2ComboBox->insertItem( "des_iv32" );
 
970
        newprofilewizardracoonpagecontent->AuthenticationAlgorithm2ComboBox->insertItem( "hmac_md5" );
 
971
        newprofilewizardracoonpagecontent->AuthenticationAlgorithm2ComboBox->insertItem( "hmac_sha1" );
 
972
        newprofilewizardracoonpagecontent->AuthenticationAlgorithm2ComboBox->insertItem( "hmac_sha256" );
 
973
        newprofilewizardracoonpagecontent->AuthenticationAlgorithm2ComboBox->insertItem( "hmac_sha384" );
 
974
        newprofilewizardracoonpagecontent->AuthenticationAlgorithm2ComboBox->insertItem( "hmac_sha512" );
 
975
        newprofilewizardracoonpagecontent->AuthenticationAlgorithm2ComboBox->insertItem( "non_auth" );
 
976
 
 
977
                        newprofilewizardracoonpagecontent->AuthenticationAlgorithm2ComboBox->setCurrentText( "hmac_md5" );
 
978
 
 
979
        for ( QStringList::Iterator it = KernelCrypto.IpsecEspEncryptionAlgorithms.begin(); it != KernelCrypto.IpsecEspEncryptionAlgorithms.end(); ++it )
 
980
        {
 
981
                newprofilewizardracoonpagecontent->EncryptionAlgorithm2ComboBox->insertItem ( *it );
 
982
        }
764
983
 
765
984
                        newprofilewizardcertcontent->UseSmartcardCheckBox->hide();
766
985
                        newprofilewizardcertcontent->SmartcardGroupBox->hide();
767
986
                        newprofilewizardp12certselectioncontent->UseSmartcardCheckBox->hide();
768
987
 
769
 
                        insertPage ( newprofilewizardracoonpage, "<b>" + i18n ( "Racoon settings" ) + "</b>", indexOf ( currentpage ) + 1 );
770
 
                        insertPage ( newprofilewizardauthselectionpage, i18n ( "Authentication settings" ), indexOf ( currentpage ) + 2 );
771
 
                        insertPage ( newprofilewizardnetworkpage, "<b>" + i18n ( "Network settings" ) + "</b>", indexOf ( currentpage ) + 3 );
 
988
 
 
989
                        insertPage ( newprofilewizardauthselectionpage, i18n ( "Authentication settings" ), indexOf ( currentpage ) + 1 );
 
990
                        insertPage ( newprofilewizardracoonpage, "<b>" + i18n ( "Racoon settings" ) + "</b>", indexOf ( currentpage ) + 2 );
 
991
 
 
992
                        newprofilewizardauthselectioncontent->HybridRadioButton->show();
 
993
 
772
994
 
773
995
                        if ( GlobalConfig->KvpncDebugLevel > 0 )
774
 
                                GlobalConfig->appendLogEntry ( i18n ( "Selected type: %1" ).arg ( "Racoon" ), KVpncConfig::debug );
 
996
                                GlobalConfig->appendLogEntry ( i18n ( "Selected type: %1" ,QString ( "Racoon" ) ), KVpncConfig::debug );
775
997
                }
776
998
                else if ( newprofilewizardtypeselectionpagecontent->L2tpRacoonRadioButton->isChecked() )
777
999
                {
778
1000
                        profileData->setConnectionType ( VpnAccountData::l2tpd_racoon );
779
1001
                        removePage ( newprofilewizardciscoselectionpage );
780
1002
                        removePage ( newprofilewizardciscomanuallypage );
 
1003
                        removePage ( newprofilewizardfreeswanpage );
 
1004
                        removePage ( newprofilewizardfreeswanselectionpage );
781
1005
                        removePage ( newprofilewizardopenvpnpage );
782
1006
                        removePage ( newprofilewizardopenvpnselectionpage );
783
1007
                        removePage ( newprofilewizardpptppage );
786
1010
 
787
1011
                        profileData->setUseMailAddressAsIdentifier ( false );
788
1012
 
789
 
                        profileData->setIkeGroup ( "modp2048" ); // default for windows?!
790
 
                        profileData->setHashAlgo ( "sha1" ); // default for windows?!
791
 
                        profileData->setAuthenticationAlgorithm ( "hmac_md5" ); // default for windows?!
792
 
 
793
 
                        newprofilewizardracoonpagecontent->DHGroupComboBox->setCurrentText ( profileData->getIkeGroup() );
794
 
                        newprofilewizardracoonpagecontent->AuthenticationAlgorithmComboBox->setCurrentText ( profileData->getAuthenticationAlgorithm() );
795
 
                        newprofilewizardracoonpagecontent->EncryptionAlgorithmComboBox->setCurrentText ( profileData->getEncryptionAlgorithm() );
796
 
 
 
1013
//                      profileData->setIkeGroup ( "modp2048" ); // default for windows?!
 
1014
//                      profileData->setHashAlgo ( "sha1" ); // default for windows?!
 
1015
//                      profileData->setAuthenticationAlgorithm ( "hmac_md5" ); // default for windows?
 
1016
 
 
1017
        Utils::IpsecAlgos KernelCrypto = Utils ( GlobalConfig ).getKernelCrypto();
 
1018
 
 
1019
        //FIXME why this is not in kernel crypto list???
 
1020
//      newprofilewizardracoonpagecontent->EncryptionAlgorithmComboBox->insertItem ( "3des" );
 
1021
 
 
1022
        newprofilewizardracoonpagecontent->EncryptionAlgorithmComboBox->insertItem("des" );
 
1023
        newprofilewizardracoonpagecontent->EncryptionAlgorithmComboBox->insertItem("des_iv64" );
 
1024
        newprofilewizardracoonpagecontent->EncryptionAlgorithmComboBox->insertItem("des_iv32" );
 
1025
        newprofilewizardracoonpagecontent->EncryptionAlgorithmComboBox->insertItem("rc5" );
 
1026
        newprofilewizardracoonpagecontent->EncryptionAlgorithmComboBox->insertItem("rc4" );
 
1027
        newprofilewizardracoonpagecontent->EncryptionAlgorithmComboBox->insertItem("idea" );
 
1028
        newprofilewizardracoonpagecontent->EncryptionAlgorithmComboBox->insertItem("3idea" );
 
1029
        newprofilewizardracoonpagecontent->EncryptionAlgorithmComboBox->insertItem("cast128" );
 
1030
        newprofilewizardracoonpagecontent->EncryptionAlgorithmComboBox->insertItem("blowfish" );
 
1031
        newprofilewizardracoonpagecontent->EncryptionAlgorithmComboBox->insertItem("null_enc" );
 
1032
        newprofilewizardracoonpagecontent->EncryptionAlgorithmComboBox->insertItem("twofish" );
 
1033
        newprofilewizardracoonpagecontent->EncryptionAlgorithmComboBox->insertItem("rijndael" );
 
1034
        newprofilewizardracoonpagecontent->EncryptionAlgorithmComboBox->insertItem("aes" );
 
1035
 
 
1036
        newprofilewizardracoonpagecontent->HashAlgoComboBox->insertItem( "md5" );
 
1037
        newprofilewizardracoonpagecontent->HashAlgoComboBox->insertItem( "sha1" );
 
1038
        newprofilewizardracoonpagecontent->HashAlgoComboBox->insertItem( "sha256" );
 
1039
        newprofilewizardracoonpagecontent->HashAlgoComboBox->insertItem( "sha384" );
 
1040
        newprofilewizardracoonpagecontent->HashAlgoComboBox->insertItem( "sha512" );
 
1041
 
 
1042
        newprofilewizardracoonpagecontent->AuthenticationAlgorithm2ComboBox->insertItem( "des" );
 
1043
        newprofilewizardracoonpagecontent->AuthenticationAlgorithm2ComboBox->insertItem( "3des" );
 
1044
        newprofilewizardracoonpagecontent->AuthenticationAlgorithm2ComboBox->insertItem( "des_iv64" );
 
1045
        newprofilewizardracoonpagecontent->AuthenticationAlgorithm2ComboBox->insertItem( "des_iv32" );
 
1046
        newprofilewizardracoonpagecontent->AuthenticationAlgorithm2ComboBox->insertItem( "hmac_md5" );
 
1047
        newprofilewizardracoonpagecontent->AuthenticationAlgorithm2ComboBox->insertItem( "hmac_sha1" );
 
1048
        newprofilewizardracoonpagecontent->AuthenticationAlgorithm2ComboBox->insertItem( "hmac_sha256" );
 
1049
        newprofilewizardracoonpagecontent->AuthenticationAlgorithm2ComboBox->insertItem( "hmac_sha384" );
 
1050
        newprofilewizardracoonpagecontent->AuthenticationAlgorithm2ComboBox->insertItem( "hmac_sha512" );
 
1051
        newprofilewizardracoonpagecontent->AuthenticationAlgorithm2ComboBox->insertItem( "non_auth" );
 
1052
 
 
1053
//      for ( QStringList::Iterator it = KernelCrypto.IpsecIkeEncryptionAlgorithms.begin(); it !=  KernelCrypto.IpsecIkeEncryptionAlgorithms.end(); ++it )
 
1054
//      {
 
1055
//              newprofilewizardracoonpagecontent->EncryptionAlgorithmComboBox->insertItem ( *it );
 
1056
//      }
 
1057
//
 
1058
//      for ( QStringList::Iterator it = KernelCrypto.IpsecIkeHashAlgorithms.begin(); it != KernelCrypto.IpsecIkeHashAlgorithms.end(); ++it )
 
1059
//      {
 
1060
//              newprofilewizardracoonpagecontent->HashAlgoComboBox->insertItem ( *it );
 
1061
//      }
 
1062
 
 
1063
        for ( QStringList::Iterator it = KernelCrypto.IpsecEspEncryptionAlgorithms.begin(); it != KernelCrypto.IpsecEspEncryptionAlgorithms.end(); ++it )
 
1064
        {
 
1065
                newprofilewizardracoonpagecontent->EncryptionAlgorithm2ComboBox->insertItem ( *it );
 
1066
        }
 
1067
 
 
1068
//      for ( QStringList::Iterator it = KernelCrypto.IpsecEspAuthenticationAlgorithms.begin(); it != KernelCrypto.IpsecEspAuthenticationAlgorithms.end(); ++it )
 
1069
//      {
 
1070
//              newprofilewizardracoonpagecontent->AuthenticationAlgorithm2ComboBox->insertItem ( *it );
 
1071
//      }
797
1072
                        insertPage ( newprofilewizardracoonpage, "<b>" + i18n ( "Racoon settings" ) + "</b>", indexOf ( currentpage ) + 1 );
798
1073
                        insertPage ( newprofilewizardauthselectionpage, i18n ( "Authentication settings" ), indexOf ( currentpage ) + 2 );
799
1074
                        insertPage ( newprofilewizarduserpage, "<b>" + i18n ( "User settings" ) + "</b>", indexOf ( currentpage ) + 3 );
807
1082
                        newprofilewizardcertcontent->UseSmartcardCheckBox->hide();
808
1083
                        newprofilewizardcertcontent->SmartcardGroupBox->hide();
809
1084
                        newprofilewizardp12certselectioncontent->UseSmartcardCheckBox->hide();
810
 
                        newprofilewizardcertcontent->certpathURLRequester->setURL ( "/etc/racoon/" );
 
1085
                        newprofilewizardcertcontent->certpathURLRequester->setUrl ( KUrl("/etc/racoon/") );
811
1086
 
812
1087
                        if ( GlobalConfig->KvpncDebugLevel > 0 )
813
 
                                GlobalConfig->appendLogEntry ( i18n ( "Selected type: %1" ).arg ( "L2TP (racoon)" ), KVpncConfig::debug );
 
1088
                                GlobalConfig->appendLogEntry ( i18n ( "Selected type: %1" ,QString ( "L2TP (racoon)" ) ), KVpncConfig::debug );
814
1089
                }
815
1090
                else if ( newprofilewizardtypeselectionpagecontent->L2tpFreeswanRadioButton->isChecked() )
816
1091
                {
825
1100
 
826
1101
                        profileData->setUseMailAddressAsIdentifier ( false );
827
1102
 
828
 
                        profileData->setIkeGroup ( "modp2048" ); // default for windows?!
829
 
                        profileData->setHashAlgo ( "sha1" ); // default for windows?!
830
 
                        profileData->setAuthenticationAlgorithm ( "hmac_md5" ); // default for windows?!
831
 
                        profileData->setPkcs11IdType ( "id" ); // Why it must be id???
832
 
 
833
 
                        insertPage ( newprofilewizardracoonpage, "<b>" + i18n ( "%1 settings" ).arg ( "FreeSWAN/Openswan/strongSwan" ) + "</b>", indexOf ( currentpage ) + 1 );
834
 
                        insertPage ( newprofilewizarduserpage, "<b>" + i18n ( "User settings" ) + "</b>", indexOf ( currentpage ) + 1 );
835
 
 
836
 
                        newprofilewizardracoonpagecontent->ExchangeModeComboBox->insertItem ( "main", 0 );
837
 
                        newprofilewizardracoonpagecontent->ExchangeModeComboBox->insertItem ( "aggressive", 1 );
838
 
                        newprofilewizardracoonpagecontent->ExchangeModeComboBox->setCurrentItem ( 0 ); // main
839
 
                        newprofilewizardracoonpagecontent->ExchangeModeComboBox->setEnabled ( true );
840
 
 
841
 
                        newprofilewizardracoonpagecontent->HashAlgoComboBox->hide();
842
 
                        newprofilewizardracoonpagecontent->HashAlgoTextLabel->hide();
843
 
                        newprofilewizardracoonpagecontent->UseModeConfigCheckBox->hide();
844
 
                        newprofilewizardracoonpagecontent->AuthenticationAlgorithmComboBox->hide();
845
 
                        newprofilewizardracoonpagecontent->EncryptionAlgorithmComboBox->hide();
846
 
                        newprofilewizardracoonpagecontent->DHGroupComboBox->hide();
 
1103
                        newprofilewizardfreeswanpagecontent->ExchangeModeComboBox->insertItem ( "main", 0 );
 
1104
                        newprofilewizardfreeswanpagecontent->ExchangeModeComboBox->insertItem ( "aggressive", 1 );
 
1105
                        newprofilewizardfreeswanpagecontent->ExchangeModeComboBox->setCurrentItem ( 0 ); // main
 
1106
                        newprofilewizardfreeswanpagecontent->ExchangeModeComboBox->setEnabled ( true );
 
1107
                        newprofilewizardfreeswanpagecontent->IpsecVpnModeCombobox->QComboBox::setCurrentItem(1); // transport
 
1108
                        newprofilewizardfreeswanpagecontent->IpsecVpnModeCombobox->setEnabled(false);
 
1109
 
 
1110
 
847
1111
                        newprofilewizarduserpagecontent ->NtDomainNameCheckbox->show();
848
1112
                        newprofilewizarduserpagecontent ->NtDomainNameLineedit->show();
849
1113
                        newprofilewizardcertcontent->Pkcs11IdTypeComboBox->setEnabled ( false );
850
1114
                        newprofilewizardcertcontent->Pkcs11IdTypeComboBox->setCurrentText ( i18n ( "ID" ) );
851
1115
                        newprofilewizardauthselectioncontent->CertificateRadioButton->setText ( i18n ( "&Certificate/Smartcard" ) );
852
 
                        newprofilewizardcertcontent->certpathURLRequester->setURL ( "/etc/ipsec.d/cacerts" );
853
 
 
854
 
                        profileData->setIkeGroup ( "modp2048" ); // default for windows?!
855
 
                        profileData->setAuthenticationAlgorithm ( "hmac_md5" ); // default for windows?!
856
 
                        profileData->setHashAlgo ( "sha1" ); // default for windows?!
857
 
 
858
 
 
859
 
                        newprofilewizardracoonpagecontent->InfoLabel->setText ( i18n ( "Please enter %1 specific settings:" ).arg ( "FreeS/WAN/Openswan/strongSwan" ) );
860
 
 
861
 
                        insertPage ( newprofilewizardauthselectionpage, i18n ( "Authentication settings" ), indexOf ( currentpage ) + 1 );
 
1116
                        newprofilewizardcertcontent->certpathURLRequester->setUrl ( KUrl("/etc/ipsec.d/cacerts") );
 
1117
 
 
1118
//                      newprofilewizardfreeswanpagecontent->InfoLabel->setText ( i18n ( "Please enter %1 specific settings:", QString( "FreeS/WAN/Openswan/strongSwan" ) ));
 
1119
 
 
1120
                        insertPage ( newprofilewizardfreeswanselectionpage, "<b>" + i18n ( "IPSec selection" ) + "</b>", indexOf ( currentpage ) + 1 );
862
1121
 
863
1122
                        if ( GlobalConfig->KvpncDebugLevel > 0 )
864
 
                                GlobalConfig->appendLogEntry ( i18n ( "Selected type: %1" ).arg ( "L2TP (OpenS/WAN)" ), KVpncConfig::debug );
 
1123
                                GlobalConfig->appendLogEntry ( i18n ( "Selected type: %1" , QString( "L2TP (OpenS/WAN)" ) ), KVpncConfig::debug );
865
1124
                }
866
1125
                else if ( newprofilewizardtypeselectionpagecontent->OpenvpnRadioButton->isChecked() )
867
1126
                {
877
1136
                        removePage ( newprofilewizardciscomanuallypage );
878
1137
                        removePage ( newprofilewizardracoonpage );
879
1138
                        removePage ( newprofilewizardpptppage );
 
1139
                        removePage ( newprofilewizardfreeswanpage );
 
1140
                        removePage ( newprofilewizardfreeswanselectionpage );
880
1141
                        newprofilewizardnetworkcontent->LabelRemoteNetwork->hide();
881
1142
                        newprofilewizardnetworkcontent->RemoteNetMaskComboBox->hide();
882
1143
                        newprofilewizardnetworkcontent->RemoteNetAddrLineEdit->hide();
886
1147
                        newprofilewizardcertcontent->SmartcardGroupBox->show();
887
1148
                        newprofilewizardp12certselectioncontent->UseSmartcardCheckBox->show();
888
1149
                        newprofilewizardauthselectioncontent->CertificateRadioButton->setText ( i18n ( "&Certificate/Smartcard" ) );
889
 
                        newprofilewizardcertcontent->certpathURLRequester->setURL ( "/etc/openvpn" );
 
1150
                        newprofilewizardcertcontent->certpathURLRequester->setUrl ( KUrl("/etc/openvpn") );
890
1151
 
891
1152
                        insertPage ( newprofilewizardopenvpnauthpage, "<b>" + i18n ( "OpenVPN authentication settings" ) + "</b>", indexOf ( currentpage ) + 1 );
892
1153
 
893
1154
                        connect ( newprofilewizardopenvpnauthpagecontent->AuthWithUsernameAndPasswordCheckBox, SIGNAL ( toggled ( bool ) ), this, SLOT ( authenticateWithUsernameAndPasswordToggled ( bool ) ) );
894
1155
                        newprofilewizardopenvpnauthpagecontent->UserdefiniedDigestComboBox->setCurrentText ( "SHA1" );
 
1156
 
 
1157
 
895
1158
                        insertPage ( newprofilewizardopenvpnselectionpage, "<b>" + i18n ( "OpenVPN selection" ) + "</b>", indexOf ( currentpage ) + 1 );
896
1159
 
897
1160
                        if ( GlobalConfig->KvpncDebugLevel > 0 )
898
 
                                GlobalConfig->appendLogEntry ( i18n ( "Selected type: %1" ).arg ( "OpenVPN" ), KVpncConfig::debug );
 
1161
                                GlobalConfig->appendLogEntry ( i18n ( "Selected type: %1" ,QString ( "OpenVPN" ) ), KVpncConfig::debug );
899
1162
                }
900
1163
                else if ( newprofilewizardtypeselectionpagecontent->PptpRadioButton->isChecked() )
901
1164
                {
902
1165
                        profileData->setConnectionType ( VpnAccountData::pptp );
903
1166
                        profileData->setUseMtu ( true );
904
1167
                        profileData->setUseMru ( true );
905
 
                        profileData->setMtu ( 1492 );
906
 
                        profileData->setMru ( 1492 );
 
1168
                        profileData->setMtu ( 1200 );
 
1169
                        profileData->setMru ( 1200 );
907
1170
                        newprofilewizardnetworkcontent->MtuSpinbox->show();
908
1171
                        newprofilewizardnetworkcontent->MtuCheckbox->show();
909
1172
                        newprofilewizardnetworkcontent->MruSpinbox->show();
920
1183
                        removePage ( newprofilewizardpskpage );
921
1184
                        removePage ( newprofilewizardp12certselectionpage );
922
1185
                        removePage ( newprofilewizardfreeswanpage );
 
1186
                        removePage ( newprofilewizardfreeswanselectionpage );
923
1187
                        removePage ( newprofilewizardracoonpage );
924
1188
                        removePage ( newprofilewizardopenvpnpage );
925
1189
                        removePage ( newprofilewizardopenvpnselectionpage );
926
1190
                        insertPage ( newprofilewizardpptppage, "<b>" + i18n ( "PPTP settings" ) + "</b>", indexOf ( currentpage ) + 1 );
927
1191
                        insertPage ( newprofilewizardnetworkpage, "<b>" + i18n ( "Network settings" ) + "</b>", indexOf ( currentpage ) + 2 );
 
1192
                        insertPage ( newprofilewizardnetworkroutepage, "<b>" + i18n ( "Network routes" ) + "</b>", indexOf ( currentpage ) + 3 );
928
1193
 
929
1194
                        newprofilewizarduserpagecontent ->NtDomainNameCheckbox->show();
930
1195
                        newprofilewizarduserpagecontent ->NtDomainNameLineedit->show();
931
1196
                        newprofilewizardcertcontent->UseSmartcardCheckBox->hide();
932
1197
                        newprofilewizardcertcontent->SmartcardGroupBox->hide();
933
1198
 
 
1199
 
934
1200
                        if ( GlobalConfig->KvpncDebugLevel > 0 )
935
 
                                GlobalConfig->appendLogEntry ( i18n ( "Selected type: %1" ).arg ( "PPTP" ), KVpncConfig::debug );
 
1201
                                GlobalConfig->appendLogEntry ( i18n ( "Selected type: %1" ,QString ( "PPTP" ) ), KVpncConfig::debug );
936
1202
                }
937
1203
                else if ( newprofilewizardtypeselectionpagecontent->VtunRadioButton->isChecked() )
938
1204
                {
948
1214
                        removePage ( newprofilewizardciscomanuallypage );
949
1215
                        removePage ( newprofilewizardracoonpage );
950
1216
                        removePage ( newprofilewizardpptppage );
 
1217
                        removePage ( newprofilewizardfreeswanpage );
 
1218
                        removePage ( newprofilewizardfreeswanselectionpage );
951
1219
                        removePage ( newprofilewizardopenvpnpage );
952
1220
                        newprofilewizardnetworkcontent->LabelRemoteNetwork->hide();
953
1221
                        newprofilewizardnetworkcontent->RemoteNetMaskComboBox->hide();
954
1222
                        newprofilewizardnetworkcontent->RemoteNetAddrLineEdit->hide();
955
1223
                        newprofilewizardnetworkcontent->RemoteNetDividetextLabel->hide();
956
1224
 
 
1225
 
957
1226
                        insertPage ( newprofilewizardvtunpage, "<b>" + i18n ( "Vtun options" ) + "</b>",2 );
958
 
 
959
 
 
960
 
                        if ( GlobalConfig->KvpncDebugLevel > 0 )
961
 
                                GlobalConfig->appendLogEntry ( i18n ( "Selected type: %1" ).arg ( "Vtun" ), KVpncConfig::debug );
962
 
                }
 
1227
                        insertPage ( newprofilewizardnetworkpage, "<b>" + i18n ( "Network settings" ) + "</b>", indexOf ( currentpage ) + 3 );
 
1228
                        insertPage ( newprofilewizardnetworkroutepage, "<b>" + i18n ( "Network routes" ) + "</b>", indexOf ( currentpage ) + 4 );
 
1229
 
 
1230
 
 
1231
                        if ( GlobalConfig->KvpncDebugLevel > 0 )
 
1232
                                GlobalConfig->appendLogEntry ( i18n ( "Selected type: %1" , QString( "Vtun" )), KVpncConfig::debug );
 
1233
                }
 
1234
                else if ( newprofilewizardtypeselectionpagecontent->SshRadioButton->isChecked() )
 
1235
                {
 
1236
                        profileData->setConnectionType ( VpnAccountData::ssh );
 
1237
                        profileData->setRemotePort ( 22 );
 
1238
                        profileData->setUseSmartcard ( false );
 
1239
                        profileData->setTunnelDeviceType("tun");
 
1240
                        removePage ( newprofilewizardvtunpage);
 
1241
                        removePage ( newprofilewizardciscoselectionpage );
 
1242
                        removePage ( newprofilewizardciscomanuallypage );
 
1243
                        removePage ( newprofilewizardracoonpage );
 
1244
                        removePage ( newprofilewizardpptppage );
 
1245
                        removePage ( newprofilewizardfreeswanpage );
 
1246
                        removePage ( newprofilewizardfreeswanselectionpage );
 
1247
                        removePage ( newprofilewizardopenvpnpage );
 
1248
                        newprofilewizardnetworkcontent->LabelRemoteNetwork->hide();
 
1249
                        newprofilewizardnetworkcontent->RemoteNetMaskComboBox->hide();
 
1250
                        newprofilewizardnetworkcontent->RemoteNetAddrLineEdit->hide();
 
1251
                        newprofilewizardnetworkcontent->RemoteNetDividetextLabel->hide();
 
1252
 
 
1253
                        profilenetworkvirtualipoptionscontent->SourceIpgroupBox->hide();
 
1254
                        
 
1255
                        newprofilewizardnetworkcontent->LabelRemoteNetwork->hide();
 
1256
                        newprofilewizardnetworkcontent->RemoteNetMaskComboBox->hide();
 
1257
                        newprofilewizardnetworkcontent->RemoteNetAddrLineEdit->hide();
 
1258
                        newprofilewizardnetworkcontent->RemoteNetDividetextLabel->hide();
 
1259
                        newprofilewizardnetworkcontent->UseRemoteNetworkCheckBox->hide();
 
1260
                        newprofilewizardnetworkcontent->RemoteNetworkGroupBox->hide();
 
1261
 
 
1262
                        newprofilewizardnetworkcontent->TunnelDeviceTypeLabel->show();
 
1263
                        newprofilewizardnetworkcontent->TunnelDeviceTypeComboBox->show();
 
1264
                        newprofilewizardnetworkcontent->TunnelDeviceTypeLabel->setEnabled(true);
 
1265
                        newprofilewizardnetworkcontent->TunnelDeviceTypeComboBox->setEnabled(true);
 
1266
                        
 
1267
 
 
1268
                        profilenetworkvirtualipoptionscontent->UseVirtualIPCheckBox->setChecked(true);
 
1269
                        newprofilewizarduserpagecontent->UsernameLineEdit->setText("root");
 
1270
        
 
1271
                        insertPage ( newprofilewizarduserpage, "<b>" + i18n ( "User settings" ) + "</b>", indexOf ( currentpage ) + 1 );
 
1272
                        insertPage ( newprofilewizardsshpage, "<b>" + i18n ( "SSH options" ) + "</b>",2 );
 
1273
                        insertPage ( newprofilewizardnetworkpage, "<b>" + i18n ( "Network settings" ) + "</b>", indexOf ( currentpage ) + 3 );
 
1274
                        insertPage ( newprofilewizardnetworkroutepage, "<b>" + i18n ( "Network routes" ) + "</b>", indexOf ( currentpage ) + 4 );
 
1275
 
 
1276
                        if ( GlobalConfig->KvpncDebugLevel > 0 )
 
1277
                                GlobalConfig->appendLogEntry ( i18n ( "Selected type: %1" , QString( "SSH" )), KVpncConfig::debug );
 
1278
                }
 
1279
 
 
1280
 
963
1281
                QString type = ""; // visible name
964
1282
                QString bin = "";  // executable name
965
1283
                if ( profileData->getConnectionType() == VpnAccountData::cisco )
1002
1320
                        type = "vtun";
1003
1321
                        bin = "vtund";
1004
1322
                }
 
1323
                else if ( profileData->getConnectionType() == VpnAccountData::ssh )
 
1324
                {
 
1325
                        type = "ssh";
 
1326
                        bin = "ssh";
 
1327
                }
1005
1328
                else
1006
1329
                {
1007
1330
                        type = "other";
1009
1332
                }
1010
1333
 
1011
1334
                ToolInfo *it = 0;
1012
 
                //std::cout << "Tool (bin): " << bin << std::endl;
1013
1335
 
1014
1336
                if ( !GlobalConfig->ToolList->isEmpty() )
1015
1337
                {
1016
1338
                        if ( type != "pptp" )
1017
1339
                        {
1018
 
                                it = Utils ( GlobalConfig ).getToolInfo ( GlobalConfig, bin );
 
1340
                                it = Utils ( GlobalConfig ).getToolInfo( bin );
1019
1341
                                if ( it != 0 )
1020
1342
                                {
1021
1343
                                        if ( it->PathToExec.section ( '/', -1 ) == bin )
1022
1344
                                        {
1023
1345
                                                if ( GlobalConfig->KvpncDebugLevel > 0 )
1024
 
                                                        GlobalConfig->appendLogEntry ( i18n ( "The required daemon (%1) is available, you will be able to use this connection." ).arg ( bin ), KVpncConfig::info );
 
1346
                                                        GlobalConfig->appendLogEntry ( i18n ( "The required daemon (%1) is available, you will be able to use this connection." , bin ), KVpncConfig::info );
1025
1347
                                                daemonavailable = true;
1026
1348
                                        }
1027
1349
                                        else
1028
1350
                                        {
1029
 
                                                KMessageBox::information ( this, i18n ( "The required daemon (%1) isn't available, you will not be able to use this connection until the daemon is not installed." ).arg ( bin ) );
 
1351
                                        GlobalConfig->appendLogEntry (QString("Tool (path): ")+it->PathToExec, GlobalConfig->debug);
 
1352
                                        GlobalConfig->appendLogEntry (QString("Tool (exe): ")+ it->PathToExec.section ( '/', -1 ), GlobalConfig->debug);
 
1353
 
 
1354
 
 
1355
                                                KMessageBox::information ( this, i18n ( "The required daemon (%1) isn't available, you will not be able to use this connection until the daemon is not installed." , bin ) );
1030
1356
                                                if ( GlobalConfig->KvpncDebugLevel > 0 )
1031
 
                                                        GlobalConfig->appendLogEntry ( i18n ( "The required daemon (%1) isn't available, you will not be able to use this connection until the daemon is not installed." ).arg ( bin ), KVpncConfig::error );
 
1357
                                                        GlobalConfig->appendLogEntry ( i18n ( "The required daemon (%1) isn't available, you will not be able to use this connection until the daemon is not installed." , bin ), KVpncConfig::error );
1032
1358
                                                daemonavailable = false;
1033
1359
                                                removePage ( newprofilewizardconnectoptionspage );
1034
1360
                                        }
1041
1367
 
1042
1368
                                        if ( realversion.find ( "1.", 0, -1 ) > -1 )
1043
1369
                                        {
1044
 
                                                KMessageBox::information ( this, i18n ( "The required version (%1) of FreeSWAN/OpenSWAN was not found. You will not be able to use the Agressive Mode. It will be used the Main Mode." ).arg ( "2" ) );
 
1370
                                                KMessageBox::information ( this, i18n ( "The required version (%1) of FreeSWAN/OpenSWAN was not found. You will not be able to use the Agressive Mode. It will be used the Main Mode." , QString( "2" ) ) );
1045
1371
                                                if ( GlobalConfig->KvpncDebugLevel > 0 )
1046
 
                                                        GlobalConfig->appendLogEntry ( i18n ( "The required version (%1) of FreeSWAN/OpenSWAN was not found. You will not be able to use the Agressive Mode. It will be used the Main Mode." ).arg ( "2" ).arg ( bin ), KVpncConfig::error );
 
1372
                                                        GlobalConfig->appendLogEntry ( i18n ( "The required version (%1) of FreeSWAN/OpenSWAN was not found. You will not be able to use the Agressive Mode. It will be used the Main Mode." , QString( "2" ), bin ), KVpncConfig::error );
1047
1373
                                        }
1048
1374
                                }
1049
1375
                        }
1050
1376
                        else
1051
1377
                        {
1052
1378
                                bool pppd_and_pptp_available = false;
1053
 
                                it = Utils ( GlobalConfig ).getToolInfo ( GlobalConfig, "pppd" );
 
1379
                                it = Utils ( GlobalConfig ).getToolInfo( "pppd" );
1054
1380
                                if ( it->PathToExec.section ( '/', -1 ) == "pppd" )
1055
1381
                                {
1056
 
                                        it = Utils ( GlobalConfig ).getToolInfo ( GlobalConfig, "pptp" );
 
1382
                                        it = Utils ( GlobalConfig ).getToolInfo( "pptp" );
1057
1383
                                        if ( it->PathToExec.section ( '/', -1 ) == "pptp" )
1058
1384
                                                pppd_and_pptp_available = true;
1059
1385
                                }
1062
1388
                                        // programs are installed
1063
1389
                                        daemonavailable = true;
1064
1390
                                        if ( GlobalConfig->KvpncDebugLevel > 0 )
1065
 
                                                GlobalConfig->appendLogEntry ( i18n ( "The required daemons (%1 and %2) are available." ).arg ( "pppd" ).arg ( "pptp" ), KVpncConfig::info );
 
1391
                                                GlobalConfig->appendLogEntry ( i18n ( "The required daemons (%1 and %2) are available." ,QString ( "pppd" ), QString( "pptp" ) ), KVpncConfig::info );
1066
1392
                                }
1067
1393
                                else
1068
1394
                                {
1069
 
                                        KMessageBox::information ( this, i18n ( "The required daemons (%1 and %2) aren't available, you will not be able to use this connection until the daemons are not installed." ).arg ( "pppd" ).arg ( "pptpd" ) );
1070
 
                                        GlobalConfig->appendLogEntry ( i18n ( "The required daemons (%1 and %2) are not available, connect will be disabled." ).arg ( "pppd" ).arg ( "pptpd" ), KVpncConfig::error );
 
1395
                                        KMessageBox::information ( this, i18n ( "The required daemons (%1 and %2) aren't available, you will not be able to use this connection until the daemons are not installed." ,QString ( "pppd" ), QString( "pptpd" ) ) );
 
1396
                                        GlobalConfig->appendLogEntry ( i18n ( "The required daemons (%1 and %2) are not available, connect will be disabled." ,QString ( "pppd" ), QString( "pptpd" ) ), KVpncConfig::error );
1071
1397
                                        daemonavailable = false;
1072
1398
                                        removePage ( newprofilewizardconnectoptionspage );
1073
1399
                                }
1112
1438
                                insertPage ( newprofilewizarduserpage, "<b>" + i18n ( "User settings" ) + "</b>", indexOf ( currentpage ) + 1 );
1113
1439
                                insertPage ( newprofilewizardciscomanuallypage, "<b>" + i18n ( "Cisco settings" ) + "</b>", indexOf ( currentpage ) + 2 );
1114
1440
                                insertPage ( newprofilewizardnetworkpage, "<b>" + i18n ( "Network settings" ) + "</b>", indexOf ( currentpage ) + 3 );
 
1441
                                insertPage ( newprofilewizardnetworkroutepage, "<b>" + i18n ( "Network routes" ) + "</b>", indexOf ( currentpage ) + 4 );
1115
1442
                        }
1116
1443
                        if ( profileData->getConnectionType() == VpnAccountData::ciscoorig )
1117
1444
                        {
1121
1448
                                insertPage ( newprofilewizardauthselectionpage, "<b>"+ i18n ( "Authentication settings" ) +"</b>",  indexOf ( currentpage ) + 1 );
1122
1449
                                insertPage ( newprofilewizarduserpage, "<b>" + i18n ( "User settings" ) + "</b>", indexOf ( currentpage ) + 2 );
1123
1450
                                insertPage ( newprofilewizardnetworkpage, "<b>" + i18n ( "Network settings" ) + "</b>", indexOf ( currentpage ) + 4 );
 
1451
                                insertPage ( newprofilewizardnetworkroutepage, "<b>" + i18n ( "Network routes" ) + "</b>", indexOf ( currentpage ) + 5 );
1124
1452
 
1125
1453
                                newprofilewizardauthselectioncontent->PskRadioButton->setChecked(true);
1126
1454
                        }
1138
1466
                }
1139
1467
                profileData->setGateway ( newprofilewizardciscomanuallypagecontent->IDLineEdit->text() );
1140
1468
                if ( GlobalConfig->KvpncDebugLevel > 0 )
1141
 
                        GlobalConfig->appendLogEntry ( i18n ( "Cisco IPSec ID: %1" ).arg ( newprofilewizardciscomanuallypagecontent->IDLineEdit->text() ), KVpncConfig::debug );
 
1469
                        GlobalConfig->appendLogEntry ( i18n ( "Cisco IPSec ID: %1" , newprofilewizardciscomanuallypagecontent->IDLineEdit->text() ), KVpncConfig::debug );
1142
1470
 
1143
1471
                profileData->setAllowEmptyGroupPassword ( newprofilewizardciscomanuallypagecontent->AllowEmptyGroupPasswordCheckBox->isChecked() );
1144
1472
                if ( GlobalConfig->KvpncDebugLevel > 0 )
1158
1486
//              else
1159
1487
                profileData->setPreSharedKey ( newprofilewizardciscomanuallypagecontent->GroupPasswordLineEdit->text() );
1160
1488
 
 
1489
                profileData->setSavePsk ( newprofilewizardciscomanuallypagecontent->CheckSavePsk->isChecked() );
 
1490
 
1161
1491
                profileData->setID ( newprofilewizardciscomanuallypagecontent->IDLineEdit->text() );
1162
1492
                profileData->setAllowEmptyGroupPassword ( newprofilewizardciscomanuallypagecontent->AllowEmptyGroupPasswordCheckBox->isChecked() );
1163
1493
 
 
1494
                profileData->setUseDpdIdleTimeout(true);
 
1495
                if (profileData->getConnectionType() == VpnAccountData::cisco )
 
1496
                        profileData->setDpdIdleTimeout(300);
 
1497
                if (profileData->getConnectionType() == VpnAccountData::ciscoorig )
 
1498
                        profileData->setDpdIdleTimeout(90);
 
1499
 
1164
1500
                insertPage ( newprofilewizarduserpage, "<b>" + i18n ( "User settings" ) + "</b>", indexOf ( currentpage ) + 1 );
1165
 
                insertPage ( newprofilewizardnatpage, "<b>" + i18n ( "NAT settings" ) + "</b>", indexOf ( currentpage ) + 2 );
 
1501
                insertPage ( newprofilewizardnetworkpage, "<b>" + i18n ( "Network settings" ) + "</b>", indexOf ( currentpage ) + 2 );
 
1502
                insertPage ( newprofilewizardnatpage, "<b>" + i18n ( "NAT settings" ) + "</b>", indexOf ( currentpage ) + 3 );
 
1503
                insertPage ( newprofilewizardnetworkroutepage, "<b>" + i18n ( "Network routes" ) + "</b>", indexOf ( currentpage ) + 4 );
1166
1504
 
1167
1505
        }
1168
1506
        else if ( currentpage == newprofilewizardfreeswanpage )
1169
 
        {}
 
1507
        {
 
1508
                msg = i18n ( "These fields must be filled in:\n" );
 
1509
                profileData->setUseModeConfig ( newprofilewizardfreeswanpagecontent->UseModeConfigCheckBox->isChecked() );
 
1510
                if ( GlobalConfig->KvpncDebugLevel > 0 )
 
1511
                {
 
1512
                        if ( newprofilewizardfreeswanpagecontent->UseModeConfigCheckBox->isChecked() )
 
1513
                                GlobalConfig->appendLogEntry ( i18n ( "Use Mode Config: %1" , i18n ( "yes" ) ), KVpncConfig::debug );
 
1514
                        else
 
1515
                                GlobalConfig->appendLogEntry ( i18n ( "Use Mode Config: %1" , i18n ( "no" ) ), KVpncConfig::debug );
 
1516
                }
 
1517
 
 
1518
                profileData->setExchangeMode ( newprofilewizardfreeswanpagecontent->ExchangeModeComboBox->currentText() );
 
1519
                if ( GlobalConfig->KvpncDebugLevel > 0 )
 
1520
                        GlobalConfig->appendLogEntry ( i18n ( "Exchange mode (%1): %2" ,QString( "ipsec" ), newprofilewizardfreeswanpagecontent->ExchangeModeComboBox->currentText() ), KVpncConfig::debug );
 
1521
 
 
1522
                profileData->setLeftNextHop ( newprofilewizardfreeswanpagecontent->LeftNextHopLineEdit->text() ); //TODO check valid IP
 
1523
                profileData->setRightNextHop ( newprofilewizardfreeswanpagecontent->RightNextHopLineEdit->text( ) ); //TODO check valid IP
 
1524
                profileData->setDisableOpportunisticEncryption ( newprofilewizardfreeswanpagecontent->DisableOpportunisticEncryptionCheckBox->isChecked( ) );
 
1525
 
 
1526
                // xauth
 
1527
                if (newprofilewizardfreeswanpagecontent->UseXauthCheckBox->isChecked())
 
1528
                {
 
1529
                        profileData->setAuthWithUsernameAndPassword(true);
 
1530
                }
 
1531
                else
 
1532
                {
 
1533
                        profileData->setAuthWithUsernameAndPassword(false);
 
1534
                }
 
1535
 
 
1536
                if ( GlobalConfig->KvpncDebugLevel > 0 )
 
1537
                {
 
1538
                        if ( newprofilewizardfreeswanpagecontent->DisableOpportunisticEncryptionCheckBox->isChecked() )
 
1539
                            GlobalConfig->appendLogEntry ( i18n ( "Disable opportunistic encryption: %1" , i18n ( "yes" ) ), KVpncConfig::debug );
 
1540
                        else
 
1541
                                GlobalConfig->appendLogEntry ( i18n ( "Disable opportunistic encryption: %1" , i18n ( "no" ) ), KVpncConfig::debug );
 
1542
                        GlobalConfig->appendLogEntry ( i18n ( "Right next hop: %1" , newprofilewizardfreeswanpagecontent->RightNextHopLineEdit->text() ), KVpncConfig::debug );
 
1543
                        GlobalConfig->appendLogEntry ( i18n ( "Left next hop: %1" , newprofilewizardfreeswanpagecontent->LeftNextHopLineEdit->text() ), KVpncConfig::debug );
 
1544
                        GlobalConfig->appendLogEntry ( i18n ( "Use PFS: %1" , profileData->getPerfectForwardSecrety() ), KVpncConfig::debug );
 
1545
 
 
1546
                }
 
1547
 
 
1548
                profileData->setExchangeMode ( newprofilewizardfreeswanpagecontent->ExchangeModeComboBox->currentText() );
 
1549
 
 
1550
                if (newprofilewizardfreeswanpagecontent->UseXauthCheckBox->isChecked())
 
1551
                {
 
1552
                        if ( newprofilewizardfreeswanpagecontent->LocalIDLineEdit->text().isEmpty() )
 
1553
                        {
 
1554
                                ok = false;
 
1555
                                msg += "- " + i18n ( "Local ID  (Group ID)" ) + "\n";
 
1556
                                GlobalConfig->appendLogEntry ( i18n ( "Local ID (Group ID)  is empty!" ), GlobalConfig->error );
 
1557
                        }
 
1558
                        profileData->setUseSpecialLocalID(true);
 
1559
                }
 
1560
 
 
1561
                profileData->setLocalIDType ( newprofilewizardfreeswanpagecontent->LocalIdTypeCombobox->currentText() );
 
1562
 
 
1563
                if ( GlobalConfig->KvpncDebugLevel > 0 )
 
1564
                        GlobalConfig->appendLogEntry ( i18n ( "Type of local ID: %1" , newprofilewizardfreeswanpagecontent->LocalIdTypeCombobox->currentText() ), KVpncConfig::debug );
 
1565
 
 
1566
                profileData->setSpecialLocalID ( newprofilewizardfreeswanpagecontent->LocalIDLineEdit->text() );
 
1567
                if ( GlobalConfig->KvpncDebugLevel > 0 )
 
1568
                        GlobalConfig->appendLogEntry ( i18n ( "Local ID value: %1" , newprofilewizardfreeswanpagecontent->LocalIDLineEdit->text() ), KVpncConfig::debug );
 
1569
 
 
1570
                                // ike + esp
 
1571
                                QStringList IkeList;
 
1572
                                QStringList EspList;
 
1573
 
 
1574
                                if (newprofilewizardfreeswanpagecontent->IkeAes256Sha1CheckBox->isChecked())
 
1575
                                        IkeList.append("aes256-sha1");
 
1576
                                if (newprofilewizardfreeswanpagecontent->IkeAes128Sha1CheckBox->isChecked())
 
1577
                                        IkeList.append("aes128-sha1");
 
1578
                                if (newprofilewizardfreeswanpagecontent->IkeDesSha1Modp2048CheckBox->isChecked())
 
1579
                                        IkeList.append("3des-sha1-modp2048");
 
1580
                                if (newprofilewizardfreeswanpagecontent->IkeDesMd5CheckBox->isChecked())
 
1581
                                        IkeList.append("3des-md5");
 
1582
                                if (newprofilewizardfreeswanpagecontent->IkeDesSha1CheckBox->isChecked())
 
1583
                                        IkeList.append("3des-sha1");
 
1584
 
 
1585
                                if (!newprofilewizardfreeswanpagecontent->OtherIkeLineEdit->text().isEmpty())
 
1586
                                        IkeList.append(newprofilewizardfreeswanpagecontent->OtherIkeLineEdit->text());
 
1587
 
 
1588
                                if (newprofilewizardfreeswanpagecontent->Esp3desMd5CheckBox->isChecked())
 
1589
                                        EspList.append("3des-md5");
 
1590
                                if (newprofilewizardfreeswanpagecontent->EspDesSha1CheckBox->isChecked())
 
1591
                                        EspList.append("3des-sha1");
 
1592
                                if (newprofilewizardfreeswanpagecontent->EspAes128Sha1CheckBox->isChecked())
 
1593
                                        EspList.append( "aes128-sha1");
 
1594
                                if (newprofilewizardfreeswanpagecontent->EspAes256Sha1CheckBox->isChecked())
 
1595
                                        EspList.append( "aes256-sha1");
 
1596
 
 
1597
                                if (!newprofilewizardfreeswanpagecontent->OtherEspLineEdit->text().isEmpty())
 
1598
                                        EspList.append(newprofilewizardfreeswanpagecontent->OtherEspLineEdit->text());
 
1599
 
 
1600
//                              for ( QStringList::Iterator ikeit = IkeList.begin(); ikeit != IkeList.end(); ++ikeit )
 
1601
//                                      std::cout << "ike: " << *ikeit << ":" << std::endl;
 
1602
 
 
1603
//                              for ( QStringList::Iterator espit = EspList.begin(); espit != EspList.end(); ++espit )
 
1604
//                                      std::cout << "esp: " << *espit << ":" << std::endl;
 
1605
 
 
1606
                                if(newprofilewizardfreeswanpagecontent->UseCustomEspCheckBox->isChecked() && !EspList.isEmpty())
 
1607
                                {
 
1608
                                        profileData->setUseCustomEsp(true);
 
1609
                                        if ( GlobalConfig->KvpncDebugLevel > 0 )
 
1610
                                                GlobalConfig->appendLogEntry ( i18n ( "Use custom %1: %2" , i18n("ESP") , i18n("yes")), KVpncConfig::debug );
 
1611
 
 
1612
                                        profileData->setIpsecEsp(EspList.join(","));
 
1613
 
 
1614
                                        if ( GlobalConfig->KvpncDebugLevel > 0 )
 
1615
                                                GlobalConfig->appendLogEntry ( i18n ( "ESP settings: %1" , EspList.join(",") ), KVpncConfig::debug );
 
1616
 
 
1617
                                }
 
1618
                                else if(newprofilewizardfreeswanpagecontent->UseCustomEspCheckBox->isChecked() && EspList.isEmpty())
 
1619
                                {
 
1620
                                        ok = false;
 
1621
                                        msg += "- " + i18n ( "Use custom ESP checked but none selected!" ) + "\n";
 
1622
                                        GlobalConfig->appendLogEntry ( i18n ( "Use custom ESP checked but none selected!" ), GlobalConfig->error );
 
1623
                                }
 
1624
                                else if(!newprofilewizardfreeswanpagecontent->UseCustomEspCheckBox->isChecked())
 
1625
                                {
 
1626
                                        profileData->setUseCustomEsp(false);
 
1627
                                        if ( GlobalConfig->KvpncDebugLevel > 0 )
 
1628
                                                GlobalConfig->appendLogEntry ( i18n ( "Use custom %1: %2" , i18n("ESP") , i18n("no")), KVpncConfig::debug );
 
1629
                                }
 
1630
 
 
1631
                                if(newprofilewizardfreeswanpagecontent->UseCustomIkeCheckBox->isChecked() && !IkeList.isEmpty())
 
1632
                                {
 
1633
                                        profileData->setUseCustomIke(true);
 
1634
                                        if ( GlobalConfig->KvpncDebugLevel > 0 )
 
1635
                                                GlobalConfig->appendLogEntry ( i18n ( "Use custom %1: %2" , i18n("IKE") , i18n("yes")), KVpncConfig::debug );
 
1636
 
 
1637
                                        profileData->setIpsecIke(IkeList.join(","));
 
1638
 
 
1639
                                        if ( GlobalConfig->KvpncDebugLevel > 0 )
 
1640
                                                GlobalConfig->appendLogEntry ( i18n ( "IKE settings: %1" , IkeList.join(",") ), KVpncConfig::debug );
 
1641
 
 
1642
                                }
 
1643
                                else if(newprofilewizardfreeswanpagecontent->UseCustomIkeCheckBox->isChecked() && IkeList.isEmpty())
 
1644
                                {
 
1645
                                        ok = false;
 
1646
                                        msg += "- " + i18n ( "Use custom IKE checked but none selected!" ) + "\n";
 
1647
                                        GlobalConfig->appendLogEntry ( i18n ( "Use custom IKE checked but none selected!" ), GlobalConfig->error );
 
1648
                                }
 
1649
                                else if (!newprofilewizardfreeswanpagecontent->UseCustomIkeCheckBox->isChecked())
 
1650
                                {
 
1651
                                        profileData->setUseCustomIke(false);
 
1652
                                        if ( GlobalConfig->KvpncDebugLevel > 0 )
 
1653
                                                GlobalConfig->appendLogEntry ( i18n ( "Use custom %1: %2" , QString( i18n("IKE") ),i18n("false")), KVpncConfig::debug );
 
1654
                                }
 
1655
 
 
1656
                        if (ok)
 
1657
                        {
 
1658
                                if (newprofilewizardfreeswanpagecontent->UseXauthCheckBox->isChecked())
 
1659
                                {
 
1660
                                        if (GlobalConfig->KvpncDebugLevel > 1)
 
1661
                                                GlobalConfig->appendLogEntry ( i18n ( "Authenticate with username and password: %1" , QString( i18n ( "yes" ) )), KVpncConfig::debug );
 
1662
                                        profileData->setAuthWithUsernameAndPassword(true);
 
1663
                                        
 
1664
                                        insertPage ( newprofilewizarduserpage, "<b>" + i18n ( "User settings" ) + "</b>", indexOf ( currentpage ) + 1 );
 
1665
                                        insertPage ( newprofilewizardnetworkpage, "<b>" + i18n ( "Network settings" ) + "</b>", indexOf ( currentpage ) + 2 );
 
1666
                                        insertPage ( newprofilewizardnatpage, "<b>" + i18n ( "NAT settings" ) + "</b>", indexOf ( currentpage ) + 3 );
 
1667
                                        insertPage ( newprofilewizardnetworkroutepage, "<b>" + i18n ( "Network routes" ) + "</b>", indexOf ( currentpage ) + 4 );
 
1668
                                }
 
1669
                                else
 
1670
                                {
 
1671
                                        if (GlobalConfig->KvpncDebugLevel > 1)
 
1672
                                                GlobalConfig->appendLogEntry ( i18n ( "Authenticate with username and password: %1" , QString( i18n ( "no" ) )), KVpncConfig::debug );
 
1673
 
 
1674
                        insertPage ( newprofilewizardnetworkpage, "<b>" + i18n ( "Network settings" ) + "</b>", indexOf ( currentpage ) + 1 );
 
1675
                        insertPage ( newprofilewizardnatpage, "<b>" + i18n ( "NAT settings" ) + "</b>", indexOf ( currentpage ) + 2 );
 
1676
                        insertPage ( newprofilewizardnetworkroutepage, "<b>" + i18n ( "Network routes" ) + "</b>", indexOf ( currentpage ) + 3 );
 
1677
                                }
 
1678
                        }
 
1679
 
 
1680
        }
 
1681
        else if ( currentpage == newprofilewizardfreeswanselectionpage )
 
1682
        {
 
1683
                if ( newprofilewizardfreeswanselectionpagecontent->OpenvpnImportRadioButton->isChecked() )
 
1684
                {
 
1685
                        enterdatamanually = false;
 
1686
                        removePage ( newprofilewizardfreeswanpage );
 
1687
                        if ( GlobalConfig->KvpncDebugLevel > 0 )
 
1688
                                GlobalConfig->appendLogEntry ( i18n ( "IPSec selection: import profile file" ), KVpncConfig::debug );
 
1689
 
 
1690
                        //                      removePage ( newprofilewizardgeneralpage );
 
1691
//                      removePage ( newprofilewizardvirtualipaddresspage );
 
1692
 
 
1693
                        if ( importProfile ( VpnAccountData::freeswan ) == true )
 
1694
                        {
 
1695
                                newProfileCreated = true;
 
1696
                                newprofilewizardgeneralpagecontent->NameLineEdit->setText ( profileData->getName() );
 
1697
                                newprofilewizardgeneralpagecontent->gatewayLineEdit->setText ( profileData->getGateway() );
 
1698
                                newprofilewizardgeneralpagecontent->DescriptionLineEdit->setText ( profileData->getDescription() );
 
1699
 
 
1700
                        }
 
1701
                        else
 
1702
                        {
 
1703
                                newProfileCreated = false;
 
1704
                                ok = false;
 
1705
                        }
 
1706
                }
 
1707
                else
 
1708
                {
 
1709
                        enterdatamanually = true;
 
1710
                        insertPage ( newprofilewizardfreeswanpage, "<b>" + i18n ( "IPSec settings" ) + "</b>", indexOf ( currentpage ) + 1 );
 
1711
                        insertPage ( newprofilewizardauthselectionpage, i18n ( "Authentication settings" ), indexOf ( currentpage ) + 1 );
 
1712
                        if ( GlobalConfig->KvpncDebugLevel > 0 )
 
1713
                                GlobalConfig->appendLogEntry ( i18n ( "IPSec selection: enter data manually" ), KVpncConfig::debug );
 
1714
                }
 
1715
 
 
1716
        }
1170
1717
        else if ( currentpage == newprofilewizardracoonpage )
1171
1718
        {
1172
1719
                if ( newprofilewizardracoonpagecontent->HashAlgoComboBox->currentText() == "SHA1" )
1179
1726
                }
1180
1727
 
1181
1728
                if ( GlobalConfig->KvpncDebugLevel > 0 )
1182
 
                        GlobalConfig->appendLogEntry ( i18n ( "Hash algorithm (%1): %2" ).arg ( "racoon" ).arg ( profileData->getHashAlgo() ), KVpncConfig::debug );
 
1729
                        GlobalConfig->appendLogEntry ( i18n ( "Hash algorithm (%1): %2" , QString( "racoon" ), profileData->getHashAlgo() ), KVpncConfig::debug );
1183
1730
 
1184
1731
                if ( newprofilewizardtypeselectionpagecontent->RacoonRadioButton->isChecked() )
1185
1732
                {
1187
1734
                        if ( GlobalConfig->KvpncDebugLevel > 0 )
1188
1735
                        {
1189
1736
                                if ( newprofilewizardracoonpagecontent->UseModeConfigCheckBox->isChecked() )
1190
 
                                        GlobalConfig->appendLogEntry ( i18n ( "Use Mode Config: %1" ).arg ( i18n ( "yes" ) ), KVpncConfig::debug );
 
1737
                                    GlobalConfig->appendLogEntry ( i18n ( "Use Mode Config: %1", i18n ( "yes" ) ), KVpncConfig::debug );
1191
1738
                                else
1192
 
                                        GlobalConfig->appendLogEntry ( i18n ( "Use Mode Config: %1" ).arg ( i18n ( "no" ) ), KVpncConfig::debug );
 
1739
                                        GlobalConfig->appendLogEntry ( i18n ( "Use Mode Config: %1" , i18n ( "no" ) ), KVpncConfig::debug );
1193
1740
                        }
1194
1741
                }
1195
1742
 
1196
1743
                profileData->setExchangeMode ( newprofilewizardracoonpagecontent->ExchangeModeComboBox->currentText() );
1197
1744
                if ( GlobalConfig->KvpncDebugLevel > 0 )
1198
 
                        GlobalConfig->appendLogEntry ( i18n ( "Exchange mode (%1): %2" ).arg ( "racoon" ).arg ( newprofilewizardracoonpagecontent->ExchangeModeComboBox->currentText() ), KVpncConfig::debug );
 
1745
                        GlobalConfig->appendLogEntry ( i18n ( "Exchange mode (%1): %2" , QString( "racoon" ), newprofilewizardracoonpagecontent->ExchangeModeComboBox->currentText() ), KVpncConfig::debug );
1199
1746
 
1200
1747
                profileData->setIkeGroup ( newprofilewizardracoonpagecontent->DHGroupComboBox->currentText() );
1201
1748
                if ( GlobalConfig->KvpncDebugLevel > 0 )
1202
 
                        GlobalConfig->appendLogEntry ( i18n ( "DH group (%1): %2" ).arg ( "racoon" ).arg ( newprofilewizardracoonpagecontent->DHGroupComboBox->currentText() ), KVpncConfig::debug );
1203
 
 
1204
 
                profileData->setExchangeMode ( newprofilewizardracoonpagecontent->AuthenticationAlgorithmComboBox->currentText() );
1205
 
                if ( GlobalConfig->KvpncDebugLevel > 0 )
1206
 
                        GlobalConfig->appendLogEntry ( i18n ( "Authentication algorithm (%1): %2" ).arg ( "racoon" ).arg ( newprofilewizardracoonpagecontent->AuthenticationAlgorithmComboBox->currentText() ), KVpncConfig::debug );
1207
 
 
1208
 
                profileData->setExchangeMode ( newprofilewizardracoonpagecontent->EncryptionAlgorithmComboBox->currentText() );
1209
 
                if ( GlobalConfig->KvpncDebugLevel > 0 )
1210
 
                        GlobalConfig->appendLogEntry ( i18n ( "Encryption algorithm (%1): %2" ).arg ( "racoon" ).arg ( newprofilewizardracoonpagecontent->EncryptionAlgorithmComboBox->currentText() ), KVpncConfig::debug );
1211
 
 
1212
 
                if ( newprofilewizardtypeselectionpagecontent->FreeswanRadioButton->isChecked() )
1213
 
                {
1214
 
                        profileData->setLeftNextHop ( newprofilewizardracoonpagecontent->LeftNextHopLineEdit->text() ); //TODO check valid IP
1215
 
                        profileData->setRightNextHop ( newprofilewizardracoonpagecontent->RightNextHopLineEdit->text( ) ); //TODO check valid IP
1216
 
                        profileData->setDisableOpportunisticEncryption ( newprofilewizardracoonpagecontent->DisableOpportunisticEncryptionCheckBox->isChecked( ) );
1217
 
 
1218
 
                        if ( GlobalConfig->KvpncDebugLevel > 0 )
1219
 
                        {
1220
 
                                if ( newprofilewizardracoonpagecontent->DisableOpportunisticEncryptionCheckBox->isChecked() )
1221
 
                                        GlobalConfig->appendLogEntry ( i18n ( "Disable opportunistic encryption: %1" ).arg ( i18n ( "yes" ) ).arg ( newprofilewizardracoonpagecontent->HashAlgoComboBox->currentText() ), KVpncConfig::debug );
1222
 
                                else
1223
 
                                        GlobalConfig->appendLogEntry ( i18n ( "Disable opportunistic encryption: %1" ).arg ( i18n ( "no" ) ).arg ( newprofilewizardracoonpagecontent->HashAlgoComboBox->currentText() ), KVpncConfig::debug );
1224
 
                                GlobalConfig->appendLogEntry ( i18n ( "Right next hop: %1" ).arg ( newprofilewizardracoonpagecontent->RightNextHopLineEdit->text() ), KVpncConfig::debug );
1225
 
                                GlobalConfig->appendLogEntry ( i18n ( "Left next hop: %1" ).arg ( newprofilewizardracoonpagecontent->LeftNextHopLineEdit->text() ), KVpncConfig::debug );
1226
 
                                GlobalConfig->appendLogEntry ( i18n ( "Disable PFS: %1" ).arg ( profileData->getPerfectForwardSecrety() ), KVpncConfig::debug );
1227
 
                        }
1228
 
                }
1229
 
 
1230
 
                profileData->setExchangeMode ( newprofilewizardracoonpagecontent->ExchangeModeComboBox->currentText() );
1231
 
 
1232
 
                if ( GlobalConfig->KvpncDebugLevel > 0 )
1233
 
                        GlobalConfig->appendLogEntry ( i18n ( "Exchange Mode: %1" ).arg ( newprofilewizardracoonpagecontent->ExchangeModeComboBox->currentText() ), KVpncConfig::debug );
 
1749
                        GlobalConfig->appendLogEntry ( i18n ( "DH group (%1): %2" , QString( "racoon" ), newprofilewizardracoonpagecontent->DHGroupComboBox->currentText() ), KVpncConfig::debug );
 
1750
 
 
1751
                profileData->setAuthenticationAlgorithm( newprofilewizardracoonpagecontent->AuthenticationAlgorithm2ComboBox->currentText() );
 
1752
                if ( GlobalConfig->KvpncDebugLevel > 0 )
 
1753
                        GlobalConfig->appendLogEntry ( i18n ( "Authentication algorithm (%1) (phase 2): %2" , QString( "racoon" ), newprofilewizardracoonpagecontent->AuthenticationAlgorithm2ComboBox->currentText() ),KVpncConfig::debug );
 
1754
 
 
1755
                        profileData->setIpsecIke(newprofilewizardracoonpagecontent->EncryptionAlgorithmComboBox->currentText());
 
1756
                        profileData->setUseAuthenticationAlgorithm(true);
 
1757
                if ( GlobalConfig->KvpncDebugLevel > 0 )
 
1758
                                GlobalConfig->appendLogEntry ( i18n ( "Encryption algorithm (%1) (phase 1): %2" , QString("racoon" ), newprofilewizardracoonpagecontent->EncryptionAlgorithmComboBox->currentText() ), KVpncConfig::debug );
1234
1759
 
1235
1760
                profileData->setLocalIDType ( newprofilewizardracoonpagecontent->LocalIdTypeCombobox->currentText() );
1236
1761
 
1237
1762
                if ( GlobalConfig->KvpncDebugLevel > 0 )
1238
 
                        GlobalConfig->appendLogEntry ( i18n ( "Type of local ID: %1" ).arg ( newprofilewizardracoonpagecontent->LocalIdTypeCombobox->currentText() ), KVpncConfig::debug );
 
1763
                        GlobalConfig->appendLogEntry ( i18n ( "Type of local ID: %1", QString(newprofilewizardracoonpagecontent->LocalIdTypeCombobox->currentText() )), KVpncConfig::debug );
1239
1764
 
1240
1765
                profileData->setSpecialLocalID ( newprofilewizardracoonpagecontent->LocalIDLineEdit->text() );
1241
 
                if ( GlobalConfig->KvpncDebugLevel > 0 )
1242
 
                        GlobalConfig->appendLogEntry ( i18n ( "Local ID value: %1" ).arg ( newprofilewizardracoonpagecontent->LocalIDLineEdit->text() ), KVpncConfig::debug );
1243
 
 
1244
 
 
1245
 
                insertPage ( newprofilewizardnatpage, "<b>" + i18n ( "NAT settings" ) + "</b>", indexOf ( currentpage ) + 1 );
 
1766
                        if ( GlobalConfig->KvpncDebugLevel > 0 )
 
1767
                        GlobalConfig->appendLogEntry ( i18n ( "Local ID value: %1" , QString( newprofilewizardracoonpagecontent->LocalIDLineEdit->text() )), KVpncConfig::debug );
 
1768
 
 
1769
                if ( GlobalConfig->KvpncDebugLevel > 0 )
 
1770
                        GlobalConfig->appendLogEntry ( i18n ( "Type of remote ID: %1", QString(newprofilewizardracoonpagecontent->RemoteIdTypeCombobox->currentText() )), KVpncConfig::debug );
 
1771
 
 
1772
                profileData->setSpecialLocalID ( newprofilewizardracoonpagecontent->RemoteIDLineEdit->text() );
 
1773
                if ( GlobalConfig->KvpncDebugLevel > 0 )
 
1774
                        GlobalConfig->appendLogEntry ( i18n ( "Remote ID value: %1" , QString(newprofilewizardracoonpagecontent->RemoteIDLineEdit->text() )), KVpncConfig::debug );
 
1775
 
 
1776
 
 
1777
                if (newprofilewizardracoonpagecontent->UseXauthCheckBox->isChecked())
 
1778
                {
 
1779
                        profileData->setAuthWithUsernameAndPassword(true);
 
1780
                        if ( GlobalConfig->KvpncDebugLevel > 1 )
 
1781
                                GlobalConfig->appendLogEntry ( i18n ( "Authenticate with username and password: %1", QString( i18n ( "yes" ) )), KVpncConfig::debug );
 
1782
                        insertPage ( newprofilewizarduserpage, "<b>" + i18n ( "User settings" ) + "</b>", indexOf ( currentpage ) + 1 );
 
1783
                        insertPage ( newprofilewizardnetworkpage, "<b>" + i18n ( "Network settings" ) + "</b>", indexOf ( currentpage ) + 2 );
 
1784
                        insertPage ( newprofilewizardnatpage, "<b>" + i18n ( "NAT settings" ) + "</b>", indexOf ( currentpage ) + 3 );
 
1785
                        insertPage ( newprofilewizardnetworkroutepage, "<b>" + i18n ( "Network routes" ) + "</b>", indexOf ( currentpage ) +4 );
 
1786
 
 
1787
                }
 
1788
                else
 
1789
                {
 
1790
                        if ( GlobalConfig->KvpncDebugLevel > 1 )
 
1791
                                GlobalConfig->appendLogEntry ( i18n ( "Authenticate with username and password: %1" , QString( i18n ( "no" ) )), KVpncConfig::debug );
 
1792
                insertPage ( newprofilewizardnetworkpage, "<b>" + i18n ( "Network settings" ) + "</b>", indexOf ( currentpage ) + 1 );
 
1793
                insertPage ( newprofilewizardnatpage, "<b>" + i18n ( "NAT settings" ) + "</b>", indexOf ( currentpage ) + 2 );
 
1794
                insertPage ( newprofilewizardnetworkroutepage, "<b>" + i18n ( "Network routes" ) + "</b>", indexOf ( currentpage ) +3 );
 
1795
                }
1246
1796
        }
1247
1797
        else if ( currentpage == newprofilewizardopenvpnpage )
1248
1798
        {
1249
1799
                msg = i18n ( "These fields must be filled in:\n" );
1250
1800
                profileData->setTunnelDeviceType ( newprofilewizardopenvpnpagecontent->TunnelDeviceTypeComboBox->currentText() );
1251
1801
                if ( GlobalConfig->KvpncDebugLevel > 0 )
1252
 
                        GlobalConfig->appendLogEntry ( i18n ( "Tunnel device type (%1): %2" ).arg ( "OpenVPN" ).arg ( newprofilewizardopenvpnpagecontent->TunnelDeviceTypeComboBox->currentText() ), KVpncConfig::debug );
 
1802
                        GlobalConfig->appendLogEntry ( i18n ( "Tunnel device type (%1): %2", QString("OpenVPN" ), newprofilewizardopenvpnpagecontent->TunnelDeviceTypeComboBox->currentText() ), KVpncConfig::debug );
1253
1803
 
1254
1804
                if ( newprofilewizardopenvpnpagecontent->NsCertTypeComboBox->currentText() == "client" )
1255
1805
                        profileData->setNsCertType ( "client" );
1260
1810
 
1261
1811
                insertPage ( newprofilewizardauthselectionpage, "<b>" + i18n ( "Authentication settings" ) + "</b>", indexOf ( currentpage ) + 1 );
1262
1812
                insertPage ( newprofilewizardnetworkpage, "<b>" + i18n ( "Network settings" ) + "</b>", indexOf ( currentpage ) + 2 );
1263
 
                insertPage ( newprofilewizardnatpage, "<b>" + i18n ( "NAT settings" ) + "</b>", indexOf ( currentpage ) + 3 );
 
1813
                insertPage ( newprofilewizardnetworkroutepage, "<b>" + i18n ( "Network routes" ) + "</b>", indexOf ( currentpage ) + 3 );
 
1814
                insertPage ( newprofilewizardnatpage, "<b>" + i18n ( "NAT settings" ) + "</b>", indexOf ( currentpage ) + 4 );
1264
1815
 
1265
1816
                profileData->setUserdefiniedCipher ( newprofilewizardopenvpnpagecontent->UserdefiniedCipherComboBox->currentText() );
1266
1817
                profileData->setUseUserdefiniedCipher ( newprofilewizardopenvpnpagecontent->UseUserdefiniedCipherCheckBox->isChecked() );
1267
1818
 
1268
 
                profileData->setUserdefinedPort ( newprofilewizardopenvpnpagecontent->UserdefinedPortSpinBox->value() );
1269
 
                profileData->setUseUserdefinedPort ( newprofilewizardopenvpnpagecontent->UseUserdefinedPortCheckBox->isChecked() );
 
1819
                profileData->setRemotePort ( newprofilewizardopenvpnpagecontent->UserdefinedPortSpinBox->value() );
 
1820
                profileData->setUseRemotePort ( newprofilewizardopenvpnpagecontent->UseUserdefinedPortCheckBox->isChecked() );
1270
1821
 
1271
1822
                if ( newprofilewizardopenvpnpagecontent->UseTlsAuthCheckBox->isChecked() )
1272
1823
                {
1273
 
                        if ( newprofilewizardopenvpnpagecontent->TlsAuthURLRequester->url().isEmpty() )
 
1824
                        if ( newprofilewizardopenvpnpagecontent->TlsAuthURLRequester->url().prettyUrl().isEmpty() )
1274
1825
                        {
1275
1826
                                ok = false;
1276
1827
                                msg += i18n ( "TLS auth file" ) + "\n";
1278
1829
                        else
1279
1830
                        {
1280
1831
                                profileData->setUseTlsAuth ( true );
1281
 
                                profileData->setTlsAuthFile ( newprofilewizardopenvpnpagecontent->TlsAuthURLRequester->url() );
 
1832
                                profileData->setTlsAuthFile ( newprofilewizardopenvpnpagecontent->TlsAuthURLRequester->url().prettyUrl() );
1282
1833
                        }
1283
1834
                }
1284
1835
 
1336
1887
                                profileData->getConnectionType() == VpnAccountData::l2tpd_freeswan || profileData->getConnectionType() == VpnAccountData::l2tpd_racoon )
1337
1888
                        {
1338
1889
                                newprofilewizardpskcontent->PSKLineEdit->setEnabled ( true );
 
1890
                                newprofilewizardfreeswanpagecontent->UseXauthCheckBox->setEnabled ( true );
 
1891
                                newprofilewizardracoonpagecontent->UseXauthCheckBox->setEnabled ( true );
1339
1892
                        }
1340
1893
 
1341
1894
                        else if ( profileData->getConnectionType() == VpnAccountData::openvpn )
1352
1905
                        if ( GlobalConfig->KvpncDebugLevel > 0 )
1353
1906
                                GlobalConfig->appendLogEntry ( i18n ( "Auth selection: use PSK" ), KVpncConfig::debug );
1354
1907
                }
1355
 
                else
 
1908
                if ( newprofilewizardauthselectioncontent->CertificateRadioButton->isChecked() )
1356
1909
                {
1357
1910
                        useCert = true;
1358
1911
                        profileData->setAuthType ( VpnAccountData::cert );
1372
1925
                                newprofilewizardcertcontent->LabelCertificate->setEnabled ( true );
1373
1926
                                newprofilewizardcertcontent->certpathURLRequester->setEnabled ( true );
1374
1927
                                newprofilewizardcertcontent->LabelCertificatePath->setEnabled ( true );
 
1928
 
 
1929
                                newprofilewizardfreeswanpagecontent->UseXauthCheckBox->setEnabled ( false );
 
1930
                                newprofilewizardracoonpagecontent->UseXauthCheckBox->setEnabled ( false );
1375
1931
                        }
1376
1932
 
1377
1933
                        else if ( profileData->getConnectionType() == VpnAccountData::openvpn )
1421
1977
                                newprofilewizardcertcontent->privkeypathURLRequester->hide();
1422
1978
                                newprofilewizardcertcontent->LabelCaCertificatePath->hide();
1423
1979
                                newprofilewizardcertcontent->CertificateGroupBox->resize(newprofilewizardcertcontent->CertificateGroupBox->sizeHint());
1424
 
                                
 
1980
 
1425
1981
 
1426
1982
                                insertPage ( newprofilewizardcertpage, "<b>" + i18n ( "Certificate settings" ) + "</b>", indexOf ( currentpage ) + 1 );
1427
 
                                
1428
 
                                
 
1983
 
 
1984
 
1429
1985
//                              newprofilewizardciscomanuallypagecontent->AllowEmptyGroupPasswordCheckBox->hide();
1430
1986
//                              newprofilewizardciscomanuallypagecontent->LabelPsk->hide();
1431
1987
//                              newprofilewizardciscomanuallypagecontent->GroupPasswordLineEdit->hide();
1445
2001
                                newprofilewizardcertcontent->x509certComboBox->show();
1446
2002
                                newprofilewizardcertcontent->x509certComboBox->sizeHint();
1447
2003
                                newprofilewizardcertcontent->x509certComboBox->setCurrentItem(0);
1448
 
                                
 
2004
 
1449
2005
                        }
1450
2006
 
1451
2007
                        if ( GlobalConfig->KvpncDebugLevel > 0 )
1452
2008
                                GlobalConfig->appendLogEntry ( i18n ( "Auth selection: use certificate" ), KVpncConfig::debug );
1453
2009
                }
 
2010
                if ( newprofilewizardauthselectioncontent->HybridRadioButton->isChecked() )
 
2011
                {
 
2012
                        useCert = false;
 
2013
 
 
2014
                        profileData->setAuthType ( VpnAccountData::hybrid );
 
2015
                        insertPage ( newprofilewizardcertpage, "<b>" + i18n ( "Certificate settings" ) + "</b>", indexOf ( currentpage ) + 1 );
 
2016
 
 
2017
                        // racoon or freeswan
 
2018
                        if ( profileData->getConnectionType() == VpnAccountData::racoon  || profileData->getConnectionType() == VpnAccountData::l2tpd_racoon )
 
2019
                        {
 
2020
                                newprofilewizardpskcontent->PSKLineEdit->setEnabled ( true );
 
2021
                                newprofilewizardfreeswanpagecontent->UseXauthCheckBox->setEnabled ( true );
 
2022
                                newprofilewizardracoonpagecontent->UseXauthCheckBox->setEnabled ( true );
 
2023
 
 
2024
                                newprofilewizardcertpage->setEnabled(true);
 
2025
                                newprofilewizardcertcontent->x509certComboBox->setEnabled(false);
 
2026
                                newprofilewizardcertcontent->x509certURLRequester->setEnabled(false);
 
2027
                                newprofilewizardcertcontent->CaCertpathURLRequester->setEnabled(true);
 
2028
                                newprofilewizardcertcontent->certpathURLRequester->setUrl(KUrl("/etc/racoon/certs"));
 
2029
                                newprofilewizardcertcontent->LabelCertificate->setEnabled(false);
 
2030
                                newprofilewizardcertcontent->LabelPrivateKeyPath->setEnabled(false);
 
2031
                                newprofilewizardcertcontent->LabelPrivateKeyPassword->setEnabled(false);
 
2032
                                newprofilewizardcertcontent->SpecialServerCertificateURLRequester->setEnabled(false);
 
2033
                                newprofilewizardcertcontent->PrivkeyPasswordEdit->setEnabled(false);
 
2034
                                newprofilewizardcertcontent->RemoteIDLineEdit->setEnabled(false);
 
2035
                                newprofilewizardcertcontent->UseSpecialRemoteIDcheckBox->setEnabled(false);
 
2036
                                newprofilewizardcertcontent->UseSpecialServerCertificateCheckBox->setEnabled(false);
 
2037
                                newprofilewizardcertcontent->privkeypathURLRequester->setEnabled(false);
 
2038
                                newprofilewizardpskcontent->setEnabled(false);
 
2039
 
 
2040
 
 
2041
                        }
 
2042
                        else if ( profileData->getConnectionType() == VpnAccountData::ciscoorig )
 
2043
                        {
 
2044
                                insertPage ( newprofilewizardciscomanuallypage, "<b>" + i18n ( "Cisco settings" ) + "</b>", indexOf ( currentpage ) + 1 );
 
2045
                                removePage( newprofilewizardpskpage);
 
2046
                        }
 
2047
                        if ( GlobalConfig->KvpncDebugLevel > 0 )
 
2048
                                GlobalConfig->appendLogEntry ( i18n ( "Auth selection: use Hybrid" ), KVpncConfig::debug );
 
2049
                }
1454
2050
        }
1455
2051
        else if ( currentpage == newprofilewizardp12certselectionpage )
1456
2052
        {
1565
2161
                if ( newprofilewizardopenvpnauthpagecontent->UseAuthenticationAlgorithmCheckBox->isChecked() )
1566
2162
                {
1567
2163
                        if ( GlobalConfig->KvpncDebugLevel > 0 )
1568
 
                                GlobalConfig->appendLogEntry ( i18n ( "OpenVPN auth: use special authentication algorithm: %1" ).arg ( newprofilewizardopenvpnauthpagecontent->UserdefiniedDigestComboBox->currentText() ), KVpncConfig::debug );
 
2164
                                GlobalConfig->appendLogEntry ( i18n ( "OpenVPN auth: use special authentication algorithm: %1" , newprofilewizardopenvpnauthpagecontent->UserdefiniedDigestComboBox->currentText() ), KVpncConfig::debug );
1569
2165
                        profileData->setUseAuthenticationAlgorithm ( true );
1570
2166
                        profileData->setAuthenticationAlgorithm ( newprofilewizardopenvpnauthpagecontent->UserdefiniedDigestComboBox->currentText() );
1571
2167
                }
1578
2174
 
1579
2175
                profileData->setAuthenticationAlgorithm ( newprofilewizardopenvpnauthpagecontent->UserdefiniedDigestComboBox->currentText() );
1580
2176
                if ( GlobalConfig->KvpncDebugLevel > 0 )
1581
 
                        GlobalConfig->appendLogEntry ( i18n ( "OpenVPN auth: use authentication method: %1" ).arg ( profileData->getAuthenticationAlgorithm() ), KVpncConfig::debug );
 
2177
                        GlobalConfig->appendLogEntry ( i18n ( "OpenVPN auth: use authentication method: %1" , profileData->getAuthenticationAlgorithm() ), KVpncConfig::debug );
1582
2178
 
1583
2179
 
1584
2180
        }
1586
2182
        {
1587
2183
 
1588
2184
                msg = i18n ( "These fields must be filled in:\n" );
1589
 
 
1590
 
                profileData->setRefuseEap ( newprofilewizardpptppagecontent->RefuseEapCheckbox->isChecked() );
1591
 
                profileData->setRequireMppe ( newprofilewizardpptppagecontent->RequireMppeCheckbox->isChecked() );
1592
 
                profileData->setRefuse128BitEncryption ( newprofilewizardpptppagecontent->Refuse128BitEncryptionCheckbox->isChecked() );
1593
 
                profileData->setRefuse40BitEncryption ( newprofilewizardpptppagecontent->Refuse40BitEncryptionCheckbox->isChecked() );
1594
 
                profileData->setDisableMPPEComp ( newprofilewizardpptppagecontent->UseNoMPPECompressionCheckbox->isChecked() );
1595
 
                profileData->setUseGetDnsFromPeer ( newprofilewizardpptppagecontent->GetDnsFromPeerCheckbox->isChecked() );
1596
 
                profileData->setUseDnsServer ( newprofilewizardpptppagecontent->DnsServerCheckbox->isChecked() );
1597
 
                profileData->setDnsServer ( newprofilewizardpptppagecontent->DnsServerLineedit->text() );
1598
 
                profileData->setUseNoBsdComp ( newprofilewizardpptppagecontent->UseNoBsdCompCheckbox->isChecked() );
1599
 
                profileData->setUseNoDeflate ( newprofilewizardpptppagecontent->UseNoDeflateCheckbox->isChecked() );
1600
 
 
1601
 
                profileData->setAllowStatefulMode ( newprofilewizardpptppagecontent->AllowStatefulModeCheckbox->isChecked() );
1602
 
                profileData->setUseNoIpDefault ( newprofilewizardpptppagecontent->UseNoIpDefaultCheckbox->isChecked() );
1603
 
                profileData->setDisableMPPEComp ( newprofilewizardpptppagecontent->UseNoMPPECompressionCheckbox->isChecked() );
 
2185
                profileData->setAllowStatefulMode( newprofilewizardpptppagecontent->AllowStatefulModeCheckbox->isChecked() );
 
2186
                profileData->setUseNoIpDefault( newprofilewizardpptppagecontent->UseNoIpDefaultCheckbox->isChecked() );
 
2187
                profileData->setDisableMPPEComp( newprofilewizardpptppagecontent->UseNoMPPECompressionCheckbox->isChecked() );
 
2188
                profileData->setRequireMppe( newprofilewizardpptppagecontent->RequireMppeCheckbox->isChecked() );
 
2189
                profileData->setRefuse128BitEncryption( newprofilewizardpptppagecontent->Refuse128BitEncryptionCheckbox->isChecked() );
 
2190
                profileData->setRefuse40BitEncryption( newprofilewizardpptppagecontent->Refuse40BitEncryptionCheckbox->isChecked() );
 
2191
                profileData->setDisableMPPEComp( newprofilewizardpptppagecontent->UseNoMPPECompressionCheckbox->isChecked() );
 
2192
                profileData->setUseGetDnsFromPeer( newprofilewizardpptppagecontent->GetDnsFromPeerCheckbox->isChecked() );
 
2193
                profileData->setUseNoBsdComp( newprofilewizardpptppagecontent->UseNoBsdCompCheckbox->isChecked() );
 
2194
                profileData->setUseNoDeflate( newprofilewizardpptppagecontent->UseNoDeflateCheckbox->isChecked() );
 
2195
                profileData->setDisableHeaderCompression(newprofilewizardpptppagecontent->DisableHeaderCompressionCheckbox->isChecked());
 
2196
                profileData->setDisableMagicNumberNegotiation(newprofilewizardpptppagecontent->DisableMagicNumberNegotiationCheckbox->isChecked());
 
2197
                profileData->setDisableIpx(newprofilewizardpptppagecontent->DisableIpxCheckbox->isChecked());
 
2198
                profileData->setDisableAdressControlCompression(newprofilewizardpptppagecontent->DisableAdressControlCompressionCheckbox->isChecked());
 
2199
                profileData->setDisableProtocolFieldCompression(newprofilewizardpptppagecontent->DisableProtocolFieldCompressionCheckbox->isChecked());
 
2200
                profileData->setRequireEap(newprofilewizardpptppagecontent->RequireEapCheckbox->isChecked());
 
2201
                
 
2202
                if ( newprofilewizardpptppagecontent->DnsServerCheckbox->isChecked() )
 
2203
                {
 
2204
                        profileData->setUseDnsServer( true );
 
2205
                        profileData->setDnsServer( newprofilewizardpptppagecontent->DnsServerLineedit->text() );
 
2206
                        
 
2207
                        if ( GlobalConfig->KvpncDebugLevel > 0 )
 
2208
                                GlobalConfig->appendLogEntry ( i18n ( "Using custom DNS server: %1" , QString( profileData->getDnsServer())), KVpncConfig::debug );
 
2209
                }
 
2210
                else
 
2211
                {
 
2212
                        profileData->setUseDnsServer( false );
 
2213
                }
 
2214
                
 
2215
                if ( newprofilewizardpptppagecontent->UseSearchDomainInResolvConfCheckbox ->isChecked() )
 
2216
                {
 
2217
                        profileData->setUseSearchDomainInResolvConf(true);
 
2218
                        profileData->setSearchDomainInResolvConf(newprofilewizardpptppagecontent->SearchDomainInResolvConfLineedit->text());
 
2219
                        
 
2220
                        if ( GlobalConfig->KvpncDebugLevel > 0 )
 
2221
                                GlobalConfig->appendLogEntry ( i18n ( "Using custom DNS search domain: %1" , QString( profileData->getSearchDomainInResolvConf() )), KVpncConfig::debug );
 
2222
                }
 
2223
                else
 
2224
                {
 
2225
                        profileData->setUseSearchDomainInResolvConf(false);
 
2226
                }
1604
2227
 
1605
2228
                if ( newprofilewizardpptppagecontent->AuthMethodComboBox->currentItem() == 0 )
1606
2229
                        profileData->setAuthMethod ( "chap" );
1607
 
                else
 
2230
                if ( newprofilewizardpptppagecontent->AuthMethodComboBox->currentItem() == 1 )
1608
2231
                        profileData->setAuthMethod ( "pap" );
 
2232
                if ( newprofilewizardpptppagecontent->AuthMethodComboBox->currentItem() == 2 )
 
2233
                        profileData->setAuthMethod ( "mschap" );
 
2234
                if ( newprofilewizardpptppagecontent->AuthMethodComboBox->currentItem() == 3 )
 
2235
                        profileData->setAuthMethod ( "mschap-v2" );
 
2236
 
 
2237
                if ( GlobalConfig->KvpncDebugLevel > 0 )
 
2238
                        GlobalConfig->appendLogEntry ( i18n ( "Using auth method: %1" , QString( profileData->getAuthMethod()) ), KVpncConfig::debug );
1609
2239
 
1610
2240
                newprofilewizardnetworkcontent->LabelRemoteNetwork->hide();
1611
2241
                newprofilewizardnetworkcontent->RemoteNetMaskComboBox->hide();
1612
2242
                newprofilewizardnetworkcontent->RemoteNetAddrLineEdit->hide();
1613
2243
                newprofilewizardnetworkcontent->RemoteNetDividetextLabel->hide();
 
2244
                newprofilewizardnetworkcontent->UseRemoteNetworkCheckBox->hide();
 
2245
                newprofilewizardnetworkcontent->RemoteNetworkGroupBox->hide();
1614
2246
 
1615
2247
                insertPage ( newprofilewizarduserpage, "<b>" + i18n ( "User settings" ) + "</b>", indexOf ( currentpage ) + 1 );
1616
2248
 
1624
2256
                if ( newprofilewizardvtunpagecontent->PortCheckbox->isChecked() )
1625
2257
                {
1626
2258
                        if ( GlobalConfig->KvpncDebugLevel > 0 )
1627
 
                                GlobalConfig->appendLogEntry ( i18n ( "Vtun: use userdefinied port: %1" ).arg ( QString().setNum ( newprofilewizardvtunpagecontent->PortSpinbox->value() ) ), KVpncConfig::debug );
 
2259
                                GlobalConfig->appendLogEntry ( i18n ( "Vtun: use userdefined port: %1" , QString().setNum ( newprofilewizardvtunpagecontent->PortSpinbox->value() ) ), KVpncConfig::debug );
1628
2260
                }
1629
2261
 
1630
2262
                if ( newprofilewizardvtunpagecontent->VtunProfileLineEdit->text().isEmpty() )
1637
2269
                else
1638
2270
                        profileData->setVtunProfile ( newprofilewizardvtunpagecontent->VtunProfileLineEdit->text() );
1639
2271
        }
 
2272
        else if ( currentpage == newprofilewizardsshpage )
 
2273
        {
 
2274
                msg = i18n ( "These fields must be filled in:\n" );
 
2275
                profileData->setUseRemotePort( newprofilewizardsshpagecontent->UseUserdefinedRemotePortCheckBox->isChecked() );
 
2276
                profileData->setRemotePort ( newprofilewizardsshpagecontent->UserdefinedRemotePortSpinBox->value() );
 
2277
 
 
2278
                if ( newprofilewizardsshpagecontent->UseUserdefinedRemotePortCheckBox->isChecked() )
 
2279
                {
 
2280
                        if ( GlobalConfig->KvpncDebugLevel > 0 )
 
2281
                                GlobalConfig->appendLogEntry ( i18n ( "SSH: use userdefined port: %1", QString( QString().setNum ( newprofilewizardsshpagecontent->UserdefinedRemotePortSpinBox->value() ) )), KVpncConfig::debug );
 
2282
                }
 
2283
        
 
2284
                // password or key auth
 
2285
                if (newprofilewizardsshpagecontent->AuthPassRadioButton->isChecked())
 
2286
                {
 
2287
                        profileData->setAuthWithUsernameAndPassword(true);
 
2288
                        if ( GlobalConfig->KvpncDebugLevel > 0 )
 
2289
                                GlobalConfig->appendLogEntry ( i18n ( "SSH: use user password authentication" ) , KVpncConfig::debug );
 
2290
                }
 
2291
                else
 
2292
                {
 
2293
                        profileData->setAuthWithUsernameAndPassword(false);
 
2294
                        if ( GlobalConfig->KvpncDebugLevel > 0 )
 
2295
                                GlobalConfig->appendLogEntry ( i18n ( "SSH: use key authentication" ) , KVpncConfig::debug );
 
2296
                }
 
2297
 
 
2298
                profileData->setPreSharedKeyFile(newprofilewizardsshpagecontent->CostumkeyURLRequester->url().path());
 
2299
 
 
2300
                if (newprofilewizardsshpagecontent->CostumKeyRadioButton->isChecked())
 
2301
                {
 
2302
                        profileData->setPskIsInFile(newprofilewizardsshpagecontent->CostumKeyRadioButton->isChecked());
 
2303
                        profileData->setPreSharedKeyFile(newprofilewizardsshpagecontent->CostumkeyURLRequester->url().path());
 
2304
                        if ( GlobalConfig->KvpncDebugLevel > 0 )
 
2305
                                GlobalConfig->appendLogEntry ( i18n ( "SSH: use costum key: %1", QString(newprofilewizardsshpagecontent->CostumkeyURLRequester->url().path())) , KVpncConfig::debug );
 
2306
                }
 
2307
                else
 
2308
                {
 
2309
                        profileData->setPreSharedKey(newprofilewizardsshpagecontent->SshKeyComboBox->currentText());
 
2310
                        if ( GlobalConfig->KvpncDebugLevel > 0 )
 
2311
                                GlobalConfig->appendLogEntry ( i18n ( "SSH: use autotected key: %1" , QString(newprofilewizardsshpagecontent->SshKeyComboBox->currentText())) , KVpncConfig::debug );
 
2312
                }
 
2313
 
 
2314
                if (newprofilewizardsshpagecontent->UseSshConfigRemoteScriptCheckBox->isChecked() && !newprofilewizardsshpagecontent->SshConfigRemoteScriptLineEdit->text().isEmpty())
 
2315
                {
 
2316
                        profileData->setUseSshConfigRemoteScript(true);
 
2317
                        profileData->setSshConfigRemoteScript(newprofilewizardsshpagecontent->SshConfigRemoteScriptLineEdit->text());
 
2318
 
 
2319
                        if ( GlobalConfig->KvpncDebugLevel > 0 )
 
2320
                                GlobalConfig->appendLogEntry ( i18n ( "SSH: use ssh config remote script: %1" , QString(newprofilewizardsshpagecontent->SshConfigRemoteScriptLineEdit->text())) , KVpncConfig::debug );
 
2321
 
 
2322
                }
 
2323
                else
 
2324
                        profileData->setUseSshConfigRemoteScript(false);
 
2325
 
 
2326
                if (newprofilewizardsshpagecontent->UseSshConfigRemoteScriptCheckBox->isChecked() && newprofilewizardsshpagecontent->SshConfigRemoteScriptLineEdit->text().isEmpty())
 
2327
                {
 
2328
                                ok = false;
 
2329
                                msg += "- " + i18n ( "Special server certificate" ) + "\n";
 
2330
                                GlobalConfig->appendLogEntry( i18n( "%1 cant be empty!" , QString("ssh config remote script")), GlobalConfig->error);
 
2331
                }
 
2332
 
 
2333
        }
1640
2334
        else if ( currentpage == newprofilewizardvirtualipaddresspage )
1641
2335
        {
1642
2336
                msg = i18n ( "These fields must be filled in:\n" );
1668
2362
                        IPOk=false;
1669
2363
                }
1670
2364
 
1671
 
 
 
2365
                if ( profileData->getConnectionType() != VpnAccountData::openvpn || profileData->getConnectionType() != VpnAccountData::ssh )
 
2366
                {
 
2367
                        if(profileData->getTunnelDeviceType() == "tun")
 
2368
                        {
1672
2369
                if ( profilenetworkvirtualipoptionscontent->UseVirtualIPCheckBox->isChecked() && !profilenetworkvirtualipoptionscontent->RemoteVirtualIpLineEdit->text().isEmpty() )
1673
2370
                {
1674
2371
                        QString RemoteVirtualIp = profilenetworkvirtualipoptionscontent->RemoteVirtualIpLineEdit->text();
1694
2391
                        IPOk=false;
1695
2392
 
1696
2393
                }
1697
 
 
 
2394
                        }
 
2395
                        if (profileData->getTunnelDeviceType() == "tap")
 
2396
                        {
 
2397
                                QString RemoteVirtualIp = profilenetworkvirtualipoptionscontent->RemoteVirtualIpLineEdit->text();
 
2398
                                if (Utils( GlobalConfig ).isValidIPv4Netmask (RemoteVirtualIp) == false)
 
2399
                                {
 
2400
                                        KMessageBox::error ( this, i18n( "No valid netmask entered!" ), i18n( "No valid netmask" ) );
 
2401
                                        IPOk=false;
 
2402
                                }
 
2403
                                else
 
2404
                                {
 
2405
                                        profileData->setRemoteVirtualIP( RemoteVirtualIp);
 
2406
                                }
 
2407
                        }
 
2408
                }
1698
2409
 
1699
2410
 
1700
2411
                if ( profilenetworkvirtualipoptionscontent->UseVirtualIPCheckBox->isChecked() && IPOk )
1703
2414
 
1704
2415
                        if ( profilenetworkvirtualipoptionscontent->UseVirtualIPCheckBox->isChecked() )
1705
2416
                        {
1706
 
                                if ( GlobalConfig->KvpncDebugLevel > 0 )
1707
 
                                        GlobalConfig->appendLogEntry ( i18n ( "Using virtual IP addresses (local: %1, remote: %2): " ).arg ( profileData->getLocalVirtualIP() ).arg ( profileData->getRemoteVirtualIP() ), KVpncConfig::debug );
1708
2417
 
 
2418
                                if (profileData->getTunnelDeviceType() == "tun")
 
2419
                                {
 
2420
                                if ( GlobalConfig->KvpncDebugLevel > 0 )
 
2421
                                                GlobalConfig->appendLogEntry ( i18n ( "Using virtual IP addresses (local: %1, remote: %2): ", QString( profileData->getLocalVirtualIP() ),  profileData->getRemoteVirtualIP() ), KVpncConfig::debug );
 
2422
                                }
 
2423
                                if (profileData->getTunnelDeviceType() == "tap")
 
2424
                                {
 
2425
                                        if ( GlobalConfig->KvpncDebugLevel > 0 )
 
2426
                                                GlobalConfig->appendLogEntry ( i18n ( "Using virtual IP address (local: %1, netmask: %2): " , QString(profileData->getLocalVirtualIP() ), profileData->getRemoteVirtualIP() ), KVpncConfig::debug );
 
2427
                                }
1709
2428
                        }
1710
2429
                        else
1711
2430
                        {
1716
2435
                else
1717
2436
                {
1718
2437
                        if ( wrongAddress!= "" )
1719
 
                                KMessageBox::error ( this, i18n ( "No valid IP address for %1 entered!" ).arg ( wrongAddress ), i18n ( "No Valid IP Address" ) );
 
2438
                                KMessageBox::error ( this, i18n ( "No valid IP address for %1 entered!" , wrongAddress ), i18n ( "No Valid IP Address" ) );
1720
2439
                        profileData->setUseVirtualIP ( false );
1721
2440
                }
1722
2441
 
1747
2466
                        {
1748
2467
                                profileData->setSavePsk ( true );
1749
2468
                                profileData->setPskIsInFile ( true );
1750
 
                                if ( !newprofilewizardpskcontent->PSKFileURLRequester->url().isEmpty() )
 
2469
                                if ( !newprofilewizardpskcontent->PSKFileURLRequester->url().prettyUrl().isEmpty() )
1751
2470
                                {
1752
2471
                                        profileData->setPreSharedKey ( newprofilewizardpskcontent->PSKLineEdit->text() );
1753
2472
                                }
1767
2486
                if ( newprofilewizardpskcontent->PskInFileCheckBox->isChecked() )
1768
2487
                {
1769
2488
                        profileData->setSavePsk ( newprofilewizardpskcontent->CheckSavePsk->isChecked() );
1770
 
                        if ( !newprofilewizardpskcontent->PSKFileURLRequester->url().isEmpty() )
 
2489
                        if ( !newprofilewizardpskcontent->PSKFileURLRequester->url().prettyUrl().isEmpty() )
1771
2490
                        {
1772
 
                                profileData->setPreSharedKeyFile ( newprofilewizardpskcontent->PSKFileURLRequester->url() );
 
2491
                                profileData->setPreSharedKeyFile ( newprofilewizardpskcontent->PSKFileURLRequester->url().prettyUrl() );
1773
2492
                        }
1774
2493
                        else
1775
2494
                        {
1787
2506
        }
1788
2507
        else if ( currentpage == newprofilewizardcertpage )
1789
2508
        {
1790
 
                
 
2509
 
1791
2510
                profileData->setSpecialRemoteID ( newprofilewizardcertcontent->RemoteIDLineEdit->text() );
1792
2511
                profileData->setUseSpecialRemoteID ( newprofilewizardcertcontent->UseSpecialRemoteIDcheckBox->isChecked() );
1793
 
                profileData->setX509Certificate ( newprofilewizardcertcontent->x509certURLRequester->url() );
1794
 
                profileData->setCaCertificate ( newprofilewizardcertcontent->CaCertpathURLRequester->url() );
1795
 
                profileData->setCertPath ( newprofilewizardcertcontent->certpathURLRequester->url() );
1796
 
                profileData->setPrivateKey ( newprofilewizardcertcontent->privkeypathURLRequester->url() );
 
2512
                profileData->setX509Certificate ( newprofilewizardcertcontent->x509certURLRequester->url().path() );
 
2513
                profileData->setCaCertificate ( newprofilewizardcertcontent->CaCertpathURLRequester->url().path() );
 
2514
                profileData->setCertPath ( newprofilewizardcertcontent->certpathURLRequester->url().path() );
 
2515
                profileData->setPrivateKey ( newprofilewizardcertcontent->privkeypathURLRequester->url().path() );
1797
2516
                profileData->setPrivateKeyPass ( newprofilewizardcertcontent->PrivkeyPasswordEdit->text() );
1798
 
                profileData->setX509Certificate ( newprofilewizardcertcontent->x509certURLRequester->url() );
1799
 
                profileData->setCertPath ( newprofilewizardcertcontent->certpathURLRequester->url() );
 
2517
                profileData->setX509Certificate ( newprofilewizardcertcontent->x509certURLRequester->url().path() );
 
2518
                profileData->setCertPath ( newprofilewizardcertcontent->certpathURLRequester->url().path() );
1800
2519
                profileData->setUseSpecialServerCertificate ( newprofilewizardcertcontent->UseSpecialServerCertificateCheckBox->isChecked() );
1801
 
                profileData->setSpecialServerCertificate ( newprofilewizardcertcontent->SpecialServerCertificateURLRequester->url() );
 
2520
                profileData->setSpecialServerCertificate ( newprofilewizardcertcontent->SpecialServerCertificateURLRequester->url().path() );
1802
2521
 
1803
2522
                if ( !newprofilewizardcertcontent->PrivkeyPasswordEdit->text().isEmpty() )
1804
2523
                        profileData->setSavePrivateKeyPassword ( true );
1809
2528
 
1810
2529
                if ( newprofilewizardcertcontent->UseSpecialServerCertificateCheckBox->isChecked() )
1811
2530
                {
1812
 
                        if ( newprofilewizardcertcontent->SpecialServerCertificateURLRequester->url().isEmpty() )
 
2531
                        if ( newprofilewizardcertcontent->SpecialServerCertificateURLRequester->url().path().isEmpty() )
1813
2532
                        {
1814
2533
                                ok = false;
1815
2534
                                msg += "- " + i18n ( "Special server certificate" ) + "\n";
1827
2546
 
1828
2547
                if ( !newprofilewizardcertcontent->UseSmartcardCheckBox->isChecked() )
1829
2548
                {
1830
 
                        if ( (!profileData->getUseOnlyCaCertAndUserAuth() && newprofilewizardcertcontent->x509certURLRequester->url().isEmpty()) || ( profileData->getConnectionType() == VpnAccountData::ciscoorig && newprofilewizardcertcontent->x509certURLRequester->url().isEmpty())) 
 
2549
                        if ( (!profileData->getUseOnlyCaCertAndUserAuth() && newprofilewizardcertcontent->x509certURLRequester->url().path().isEmpty()) || ( profileData->getConnectionType() == VpnAccountData::ciscoorig && newprofilewizardcertcontent->x509certURLRequester->url().path().isEmpty()))
1831
2550
                        {
1832
2551
                                ok = false;
1833
2552
                                msg += "- " + i18n ( "Certificate" ) + "\n";
1834
2553
                                GlobalConfig->appendLogEntry ( i18n ( "Certificate can't be empty!" ) , GlobalConfig->error );
1835
2554
                        }
1836
2555
 
1837
 
                        if ( !profileData->getUseOnlyCaCertAndUserAuth() && newprofilewizardcertcontent->privkeypathURLRequester->url().isEmpty() )
 
2556
                        if ( !profileData->getUseOnlyCaCertAndUserAuth() && newprofilewizardcertcontent->privkeypathURLRequester->url().path().isEmpty() )
1838
2557
                        {
1839
2558
                                ok = false;
1840
2559
                                msg += "- " + i18n ( "Path to private key" ) + "\n";
1841
2560
                                GlobalConfig->appendLogEntry ( i18n ( "Path to private key can't be empty!" ) , GlobalConfig->error );
1842
2561
                        }
1843
 
                        if ( ! ( profileData->getConnectionType() == VpnAccountData::racoon || profileData->getConnectionType() == VpnAccountData::l2tpd_racoon ) && !profileData->getUseOnlyCaCertAndUserAuth() && newprofilewizardcertcontent->PrivkeyPasswordEdit->text().isEmpty() )
1844
 
                        {
1845
 
                                if ( Utils ( GlobalConfig ).getNeedsPassphrase ( newprofilewizardcertcontent->privkeypathURLRequester->url() ) )
1846
 
                                {
1847
 
                                        ok = false;
1848
 
                                        msg += "- " + i18n ( "Private key password, private key needs passphrase" ) + "\n";
1849
 
                                        GlobalConfig->appendLogEntry ( i18n ( "Private key password can't be empty  because private key is protected with a passphrase." ) , GlobalConfig->error );
1850
 
                                }
1851
 
                        }
 
2562
//                      if ( ! ( profileData->getConnectionType() == VpnAccountData::racoon || profileData->getConnectionType() == VpnAccountData::l2tpd_racoon ) && !profileData->getUseOnlyCaCertAndUserAuth() && newprofilewizardcertcontent->PrivkeyPasswordEdit->text().isEmpty() )
 
2563
//                      {
 
2564
//                              if ( Utils ( GlobalConfig ).getNeedsPassphrase ( newprofilewizardcertcontent->privkeypathURLRequester->url().path() ) )
 
2565
//                              {
 
2566
//                                      ok = false;
 
2567
//                                      msg += "- " + i18n ( "Private key password, private key needs passphrase" ) + "\n";
 
2568
//                                      GlobalConfig->appendLogEntry ( i18n ( "Private key password can't be empty  because private key is protected with a passphrase." ) , GlobalConfig->error );
 
2569
//                              }
 
2570
//                      }
1852
2571
 
1853
2572
                }
1854
2573
                else
1917
2636
                        if ( newprofilewizardcertcontent->UsePkcs11ProvidersCheckBox->isChecked() )
1918
2637
                        {
1919
2638
                                if ( !newprofilewizardcertcontent->Pkcs11ProvidersURLRequester->url().isEmpty() )
1920
 
                                        profileData->setPkcs11Providers ( newprofilewizardcertcontent->Pkcs11ProvidersURLRequester->url() );
 
2639
                                        profileData->setPkcs11Providers ( newprofilewizardcertcontent->Pkcs11ProvidersURLRequester->url().path() );
1921
2640
                                else
1922
2641
                                {
1923
2642
                                        KMessageBox::error ( this, i18n ( "Library path to lib for use with smartcard can't be empty!" ), i18n ( "No providers lib" ) );
1942
2661
                {
1943
2662
                        profileData->setUserName ( newprofilewizarduserpagecontent->UsernameLineEdit->text() );
1944
2663
                        if ( GlobalConfig->KvpncDebugLevel > 0 )
1945
 
                                GlobalConfig->appendLogEntry ( i18n ( "User options: username: %1" ).arg ( profileData->getUserName() ), KVpncConfig::debug );
 
2664
                                GlobalConfig->appendLogEntry ( i18n ( "User options: username: %1" , profileData->getUserName() ), KVpncConfig::debug );
1946
2665
                }
1947
2666
 
1948
2667
                if ( !newprofilewizarduserpagecontent->PasswordEdit->text().isEmpty() )
1982
2701
                                        profileData->setNtDomainName ( newprofilewizarduserpagecontent->NtDomainNameLineedit->text() );
1983
2702
                                        profileData->setUseNtDomainName ( true );
1984
2703
                                        if ( GlobalConfig->KvpncDebugLevel > 0 )
1985
 
                                                GlobalConfig->appendLogEntry ( i18n ( "User options: NT domain name: %1" ).arg ( profileData->getNtDomainName() ), KVpncConfig::debug );
 
2704
                                                GlobalConfig->appendLogEntry ( i18n ( "User options: NT domain name: %1" , profileData->getNtDomainName() ), KVpncConfig::debug );
1986
2705
                                }
1987
2706
                        }
1988
2707
                        else
1998
2717
                if ( ( profileData->getConnectionType() == VpnAccountData::freeswan || profileData->getConnectionType() == VpnAccountData::racoon ||
1999
2718
                        profileData->getConnectionType() == VpnAccountData::l2tpd_freeswan || profileData->getConnectionType() == VpnAccountData::l2tpd_racoon ) )
2000
2719
                {
2001
 
                        if ( !newprofilewizardnetworkcontent->RemoteNetAddrLineEdit->text().isEmpty() )
 
2720
                        if (newprofilewizardnetworkcontent->UseRemoteNetworkCheckBox->isChecked())
2002
2721
                        {
2003
 
                                if ( newprofilewizardnetworkcontent->RemoteNetAddrLineEdit->text().contains ( '.' ) != 3 )
2004
 
                                {
2005
 
                                        KMessageBox::error ( this, i18n ( "No IP address entered!" ), i18n ( "No IP Address" ) );
2006
 
                                        validAddr = false;
2007
 
                                        return ;
2008
 
                                }
2009
 
                                else
2010
 
                                {
2011
 
                                        QString addr = newprofilewizardnetworkcontent->RemoteNetAddrLineEdit->text();
2012
 
                                        int part0 = addr.section ( '.', 0, 0 ).toInt();
2013
 
                                        int part1 = addr.section ( '.', 1, 1 ).toInt();
2014
 
                                        int part2 = addr.section ( '.', 2, 2 ).toInt();
2015
 
                                        int part3 = addr.section ( '.', 3, 3 ).toInt();
2016
 
 
2017
 
                                        /*
2018
 
                                                                LogOutput->append ("part0: "+QString().setNum(part0));
2019
 
                                                                LogOutput->append ("part1: "+QString().setNum(part1));
2020
 
                                                                LogOutput->append ("part2: "+QString().setNum(part2));
2021
 
                                                                LogOutput->append ("part3: "+QString().setNum(part3));
2022
 
                                        */
2023
 
 
2024
 
                                        if ( ( part0 < 1 || part0 > 254 ) || ( part1 < 0 || part1 > 254 ) || ( part2 < 0 || part2 > 254 ) || ( part3 < 0 || part3 > 254 ) )
 
2722
                                if ( !newprofilewizardnetworkcontent->RemoteNetAddrLineEdit->text().isEmpty() )
 
2723
                                {
 
2724
                                        if ( newprofilewizardnetworkcontent->RemoteNetAddrLineEdit->text().contains ( '.' ) != 3 )
2025
2725
                                        {
2026
 
                                                KMessageBox::error ( this, i18n ( "Invalid values in IP address (remote net)!" ), i18n ( "Invalid Values in IP Address" ) );
2027
 
                                                GlobalConfig->appendLogEntry ( i18n ( "Invalid values in IP address (remote net)!" ) , GlobalConfig->error );
 
2726
                                                KMessageBox::error ( this, i18n ( "No IP address entered!" ), i18n ( "No IP Address" ) );
2028
2727
                                                validAddr = false;
2029
2728
                                                return ;
2030
2729
                                        }
2031
 
 
2032
 
                                        if ( validAddr == true )
 
2730
                                        else
2033
2731
                                        {
2034
 
                                                profileData->setRemoteNetAddr ( addr );
2035
 
                                                profileData->setRemoteNetMask ( newprofilewizardnetworkcontent->RemoteNetMaskComboBox->currentText() );
 
2732
                                                QString addr = newprofilewizardnetworkcontent->RemoteNetAddrLineEdit->text();
 
2733
                                                int part0 = addr.section ( '.', 0, 0 ).toInt();
 
2734
                                                int part1 = addr.section ( '.', 1, 1 ).toInt();
 
2735
                                                int part2 = addr.section ( '.', 2, 2 ).toInt();
 
2736
                                                int part3 = addr.section ( '.', 3, 3 ).toInt();
 
2737
 
 
2738
                                                /*
 
2739
                                                                        LogOutput->append ("part0: "+QString().setNum(part0));
 
2740
                                                                        LogOutput->append ("part1: "+QString().setNum(part1));
 
2741
                                                                        LogOutput->append ("part2: "+QString().setNum(part2));
 
2742
                                                                        LogOutput->append ("part3: "+QString().setNum(part3));
 
2743
                                                */
 
2744
 
 
2745
                                                if ( ( part0 < 1 || part0 > 254 ) || ( part1 < 0 || part1 > 254 ) || ( part2 < 0 || part2 > 254 ) || ( part3 < 0 || part3 > 254 ) )
 
2746
                                                {
 
2747
                                                        KMessageBox::error ( this, i18n ( "Invalid values in IP address (remote net)!" ), i18n ( "Invalid Values in IP Address" ) );
 
2748
                                                        GlobalConfig->appendLogEntry ( i18n ( "Invalid values in IP address (remote net)!" ) , GlobalConfig->error );
 
2749
                                                        validAddr = false;
 
2750
                                                        return ;
 
2751
                                                }
 
2752
 
 
2753
                                                if ( validAddr == true )
 
2754
                                                {
 
2755
                                                        if ( GlobalConfig->KvpncDebugLevel > 0 )
 
2756
                                                                GlobalConfig->appendLogEntry ( i18n ( "Use remote network: %1/%2" , QString( addr ), QString(newprofilewizardnetworkcontent->RemoteNetMaskComboBox->currentText())), KVpncConfig::debug );
 
2757
                                                        profileData->setUseRemoteNetwork(true);
 
2758
                                                        profileData->setRemoteNetAddr ( addr );
 
2759
                                                        profileData->setRemoteNetMask ( newprofilewizardnetworkcontent->RemoteNetMaskComboBox->currentText() );
 
2760
                                                }
 
2761
 
2036
2762
                                        }
2037
 
 
2038
 
                                }
2039
 
                        }
2040
 
 
2041
 
 
2042
 
                        else
2043
 
                        {
2044
 
                                ok = false;
2045
 
                                msg += "- " + i18n ( "Remote network" ) + "\n";
2046
 
                                GlobalConfig->appendLogEntry ( i18n ( "Remote network  is empty!" ), GlobalConfig->error );
 
2763
                                }
 
2764
                                else
 
2765
                                {
 
2766
                                        ok = false;
 
2767
                                        msg += "- " + i18n ( "Remote network" ) + "\n";
 
2768
                                        GlobalConfig->appendLogEntry ( i18n ( "Remote network  is empty!" ), GlobalConfig->error );
 
2769
                                }
2047
2770
                        }
2048
2771
                }
2049
2772
                profileData->setNetworkDevice ( newprofilewizardnetworkcontent->NetworkDeviceComboBox->currentText() );
2053
2776
                {
2054
2777
                        profileData->setUseMtu ( true );
2055
2778
                        if ( GlobalConfig->KvpncDebugLevel > 1 )
2056
 
                                GlobalConfig->appendLogEntry ( i18n ( "Network options: use own MTU size: %1" ).arg ( profileData->getMtu() ) , GlobalConfig->debug );
 
2779
                                GlobalConfig->appendLogEntry ( i18n ( "Network options: use own MTU size: %1" , profileData->getMtu() ) , GlobalConfig->debug );
2057
2780
                }
2058
2781
                else
2059
2782
                        profileData->setUseMtu ( false );
2063
2786
                {
2064
2787
                        profileData->setUseMru ( true );
2065
2788
                        if ( GlobalConfig->KvpncDebugLevel > 1 )
2066
 
                                GlobalConfig->appendLogEntry ( i18n ( "Network options: use own MRU size: %1" ).arg ( profileData->getMtu() ) , GlobalConfig->debug );
 
2789
                            GlobalConfig->appendLogEntry ( i18n ( "Network options: use own MRU size: %1" , profileData->getMtu() ) , GlobalConfig->debug );
2067
2790
                }
2068
2791
                else
2069
2792
                        profileData->setUseMru ( false );
2070
2793
 
 
2794
                if ( profileData->getConnectionType() == VpnAccountData::ssh )
 
2795
                {
 
2796
                        profileData->setTunnelDeviceType(newprofilewizardnetworkcontent->TunnelDeviceTypeComboBox->currentText());
 
2797
                        if ( GlobalConfig->KvpncDebugLevel > 1 )
 
2798
                                GlobalConfig->appendLogEntry ( i18n ( "Network options: Tunnel device type: %1" , QString( profileData->getTunnelDeviceType()) ) , GlobalConfig->debug );
 
2799
 
 
2800
                        tunnelDeviceTypeChanged(profileData->getTunnelDeviceType());
 
2801
                }
2071
2802
 
2072
2803
        }
2073
2804
        else if ( currentpage == newprofilewizardnetworkroutepage )
2076
2807
 
2077
2808
                if ( newprofilewizardnetworkroutecontent->DefaultRouteComboBox->currentItem() == 1 )
2078
2809
                {
2079
 
                        profileData->setSetDefaultRoute ( true );
2080
2810
                        profileData->setReplaceDefaultRoute ( true );
2081
 
                        profileData->setKeepDefaultRoute ( false );
2082
2811
 
2083
2812
                        if ( GlobalConfig->KvpncDebugLevel > 1 )
2084
 
                                GlobalConfig->appendLogEntry ( i18n ( "Network route options: replace default route" ).arg ( profileData->getName() ) , GlobalConfig->debug );
 
2813
                                GlobalConfig->appendLogEntry ( i18n ( "Network route options: replace default route"  ) , GlobalConfig->debug );
2085
2814
                }
2086
2815
                else
2087
2816
                {
2088
 
                        profileData->setSetDefaultRoute ( false );
2089
2817
                        profileData->setReplaceDefaultRoute ( false );
2090
 
                        profileData->setKeepDefaultRoute ( true );
2091
2818
                        if ( GlobalConfig->KvpncDebugLevel > 1 )
2092
 
                                GlobalConfig->appendLogEntry ( i18n ( "Network route options: dont replace default route" ).arg ( profileData->getName() ) , GlobalConfig->debug );
 
2819
                                GlobalConfig->appendLogEntry ( i18n ( "Network route options: dont replace default route" )  , GlobalConfig->debug );
2093
2820
                }
2094
2821
 
2095
2822
                profileData->setUseAdditionalNetworkRoutes ( newprofilewizardnetworkroutecontent->UseExtraNetworkRoutesCheckbox->isChecked() );
2097
2824
                if ( newprofilewizardnetworkroutecontent->UseExtraNetworkRoutesCheckbox->isChecked() && newprofilewizardnetworkroutecontent->NetworkListView->childCount() > 0 )
2098
2825
                {
2099
2826
                        if ( GlobalConfig->KvpncDebugLevel > 1 )
2100
 
                                GlobalConfig->appendLogEntry ( i18n ( "Network route options: use additional network routes" ).arg ( profileData->getName() ) , GlobalConfig->debug );
 
2827
                                GlobalConfig->appendLogEntry ( i18n ( "Network route options: use additional network routes" ) , GlobalConfig->debug );
2101
2828
 
2102
2829
                        QStringList AdditionalNetworkRoutes;
2103
 
                        QListViewItemIterator it ( newprofilewizardnetworkroutecontent->NetworkListView );
 
2830
                        Q3ListViewItemIterator it ( newprofilewizardnetworkroutecontent->NetworkListView );
2104
2831
                        for ( ; it.current(); ++it )
2105
2832
                        {
2106
2833
                                // example entry:
2113
2840
                                AdditionalNetworkRoutes.append ( network );
2114
2841
 
2115
2842
                                if ( GlobalConfig->KvpncDebugLevel > 1 )
2116
 
                                        GlobalConfig->appendLogEntry ( i18n ( "Network route options: additional network: %1/%2 gw %3 %4" ).arg ( it.current() ->text ( 0 ) ).arg ( it.current() ->text ( 1 ) ).arg ( it.current() ->text ( 2 ) ).arg ( it.current() ->text ( 3 ) ) , GlobalConfig->debug );
 
2843
                                        GlobalConfig->appendLogEntry ( i18n ( "Network route options: additional network: %1/%2 gw %3 %4" , it.current() ->text ( 0 ) , it.current() ->text ( 1 ) , it.current() ->text ( 2 ) , it.current() ->text ( 3 ) ) , GlobalConfig->debug );
2117
2844
                        }
2118
2845
                        profileData->setAdditionalNetworkRoutes ( AdditionalNetworkRoutes );
2119
2846
                }
2132
2859
                                GlobalConfig->appendLogEntry ( i18n ( "NAT settings: use no NAT" ), KVpncConfig::debug );
2133
2860
 
2134
2861
                        if ( profileData->getUseUdpPort() )
2135
 
                                GlobalConfig->appendLogEntry ( i18n ( "NAT settings: use userdefinied Port: %1" ).arg ( QString().setNum ( profileData->getUdpPort() ) ), KVpncConfig::debug );
 
2862
                                GlobalConfig->appendLogEntry ( i18n ( "NAT settings: use userdefined Port: %1" , QString().setNum ( profileData->getUdpPort() ) ), KVpncConfig::debug );
2136
2863
                }
2137
2864
 
2138
2865
 
2143
2870
 
2144
2871
                if ( GlobalConfig->KvpncDebugLevel > 0 )
2145
2872
                        if ( connectaftercreating )
2146
 
                                GlobalConfig->appendLogEntry ( i18n ( "Connect options: connecting to profile \"%1\" after creating it." ).arg ( profileData->getName() ) , GlobalConfig->debug );
 
2873
                                GlobalConfig->appendLogEntry ( i18n ( "Connect options: connecting to profile \"%1\" after creating it." , profileData->getName() ) , GlobalConfig->debug );
2147
2874
 
2148
2875
        }
2149
2876
        else if ( currentpage == newprofilewizardconnectionstatuscheckpage )
2179
2906
                {
2180
2907
                        profileData->setDoPingIP ( true );
2181
2908
                        if ( GlobalConfig->KvpncDebugLevel > 0 )
2182
 
                                GlobalConfig->appendLogEntry ( i18n ( "Connection status check: ping userdefinied IP address" ), KVpncConfig::debug );
 
2909
                                GlobalConfig->appendLogEntry ( i18n ( "Connection status check: ping userdefined IP address" ), KVpncConfig::debug );
2183
2910
                }
2184
2911
                else
2185
2912
                {
2186
2913
                        profileData->setDoPingIP ( false );
2187
2914
                        if ( GlobalConfig->KvpncDebugLevel > 0 )
2188
 
                                GlobalConfig->appendLogEntry ( i18n ( "Connection status check: dont ping userdefinied IP address" ), KVpncConfig::debug );
 
2915
                                GlobalConfig->appendLogEntry ( i18n ( "Connection status check: dont ping userdefined IP address" ), KVpncConfig::debug );
2189
2916
                }
2190
2917
 
2191
2918
                profileData->setConnectionStatusInterval ( newprofilewizardconnectionstatuscheckcontent->ConnectionStatusCheckIntervalNumInput->value() );
2193
2920
 
2194
2921
                if ( GlobalConfig->KvpncDebugLevel > 0 )
2195
2922
                {
2196
 
                        GlobalConfig->appendLogEntry ( i18n ( "Connection status check: use connection interval: %1" ).arg ( QString().setNum ( newprofilewizardconnectionstatuscheckcontent->ConnectionStatusCheckIntervalNumInput->value() ) ), KVpncConfig::debug );
2197
 
                        GlobalConfig->appendLogEntry ( i18n ( "Connection status check: success count: %1" ).arg ( QString().setNum ( newprofilewizardconnectionstatuscheckcontent->ConnectionStatusSuccessCountNumInput->value() ) ), KVpncConfig::debug );
 
2923
                        GlobalConfig->appendLogEntry ( i18n ( "Connection status check: use connection interval: %1" , QString().setNum ( newprofilewizardconnectionstatuscheckcontent->ConnectionStatusCheckIntervalNumInput->value() ) ), KVpncConfig::debug );
 
2924
                        GlobalConfig->appendLogEntry ( i18n ( "Connection status check: success count: %1" , QString().setNum ( newprofilewizardconnectionstatuscheckcontent->ConnectionStatusSuccessCountNumInput->value() ) ), KVpncConfig::debug );
2198
2925
                }
2199
2926
 
2200
2927
                if ( newprofilewizardconnectionstatuscheckcontent->UseConnectionStatusCheckCheckBox->isChecked() )
2208
2935
                                        else
2209
2936
                                        {
2210
2937
                                                ok = false;
2211
 
                                                msg = i18n ( "The value of userdefinied IP address is not a valid IP address!" );
 
2938
                                                msg = i18n ( "The value of userdefined IP address is not a valid IP address!" );
2212
2939
                                        }
2213
2940
                                }
2214
2941
                                else
2224
2951
        if ( ok )
2225
2952
        {
2226
2953
                previouspage = currentpage;
2227
 
                QWizard::next();
 
2954
                Q3Wizard::next();
2228
2955
        }
2229
2956
        else
2230
2957
        {
2302
3029
                newprofilewizardopenvpnpagecontent->UserdefiniedCipherComboBox->setCurrentText(profileData->getUserdefiniedCipher());
2303
3030
                newprofilewizardopenvpnpagecontent->UseUserdefiniedCipherCheckBox->setChecked(profileData->getUseUserdefiniedCipher());
2304
3031
                newprofilewizardopenvpnpagecontent->UseTlsAuthCheckBox->setChecked(profileData->getUseTlsAuth());
2305
 
                newprofilewizardopenvpnpagecontent->TlsAuthURLRequester->setURL(profileData->getTlsAuthFile());
 
3032
                newprofilewizardopenvpnpagecontent->TlsAuthURLRequester->setUrl(profileData->getTlsAuthFile());
2306
3033
 
2307
3034
                profileData->setUseTlsRemoteHost( newprofilewizardopenvpnpagecontent->UseTlsAuthCheckBox->isChecked());
2308
3035
                profileData->setTlsRemoteHost( newprofilewizardopenvpnpagecontent->TlsRemoteHostLineEdit->text());
2314
3041
 
2315
3042
                insertPage ( newprofilewizardciscoselectionpage,"<b>"+ i18n("Cisco selection")+"</b>" , 2 );
2316
3043
                insertPage ( newprofilewizardciscomanuallypage, "<b>"+ i18n("Cisco settings")+"</b>",  3 );
2317
 
                insertPage ( newprofilewizardfreeswanpage, "<b>"+ i18n("FreeS/WAN settings")  ,  4 );
 
3044
                insertPage ( newprofilewizardfreeswanpage, "<b>"+ i18n("Ipsec settings")  ,  4 );
2318
3045
                insertPage ( newprofilewizardracoonpage, "<b>"+ i18n("Racoon settings")+"</b>"  ,  5 );
2319
3046
                insertPage ( newprofilewizardpptppage,  "<b>"+ i18n("PPTP settings")+"</b>",  6 );
2320
3047
        }
2322
3049
        {
2323
3050
                insertPage ( newprofilewizardciscoselectionpage,"<b>"+ i18n("Cisco selection")+"</b>" , 2 );
2324
3051
                insertPage ( newprofilewizardciscomanuallypage, "<b>"+ i18n("Cisco settings")+"</b>",  3 );
2325
 
                insertPage ( newprofilewizardfreeswanpage, "<b>"+ i18n("FreeS/WAN settings")  ,  4 );
 
3052
                insertPage ( newprofilewizardfreeswanpage, "<b>"+ i18n("Ipsec settings")  ,  4 );
2326
3053
                insertPage ( newprofilewizardracoonpage, "<b>"+ i18n("Racoon settings")+"</b>"  ,  5 );
2327
3054
                insertPage ( newprofilewizardopenvpnpage,   "<b>"+i18n("OpenVPN settings")+"</b>", 6 );
2328
3055
        }
2345
3072
                newprofilewizardnatcontent->UdpPortSpinbox->setValue(profileData->getUdpPort());
2346
3073
        }
2347
3074
        */
2348
 
        QWizard::back();
 
3075
        Q3Wizard::back();
2349
3076
}
2350
3077
 
2351
3078
QString NewProfileWizard::getName()
2366
3093
void NewProfileWizard::showPage ( QWidget* page )
2367
3094
{
2368
3095
        currentpage = page;
2369
 
        QWizard::showPage ( page );
 
3096
        Q3Wizard::showPage ( page );
2370
3097
 
2371
3098
 
2372
3099
        // FIXME set currentpage at back()
2551
3278
 
2552
3279
        bool success = true;
2553
3280
 
2554
 
        if ( ConnType == VpnAccountData::cisco )
 
3281
        if ( ConnType == VpnAccountData::cisco || ConnType == VpnAccountData::ciscoorig )
2555
3282
        {
2556
3283
                ImportProfileDialog dlg ( GlobalConfig, this, i18n ( "Import Cisco PCF profile" ), "" );
2557
 
                dlg.exec();
 
3284
                int ret = dlg.exec();
2558
3285
                importOK = dlg.importOk;
2559
3286
                if ( importOK )
2560
3287
                {
2561
3288
                        profileData = dlg.acc;
2562
 
                        KMessageBox::information ( 0, i18n ( "Import of \"%1\" was successful." ).arg ( profileData->getName() ) );
2563
 
                        GlobalConfig->appendLogEntry ( i18n ( "Import of \"%1\" (%2) was successful." ).arg ( profileData->getName() ).arg ( "PCF" ), GlobalConfig->info );
 
3289
                        KMessageBox::information ( 0, i18n ( "Import of \"%1\" was successful." ,   profileData->getName() ) );
 
3290
                        GlobalConfig->appendLogEntry ( i18n ( "Import of \"%1\" (%2) was successful." ,   profileData->getName() ,    QString("PCF") ), GlobalConfig->info );
2564
3291
                }
2565
3292
                else
2566
3293
                {
2567
 
                        KMessageBox::sorry ( 0, i18n ( "Import of \"%1\" has been failed." ).arg ( profileData->getName() ) );
2568
 
                        GlobalConfig->appendLogEntry ( i18n ( "Import of \"%1\" (%2) has been failed." ).arg ( profileData->getName() ).arg ( "PCF" ), GlobalConfig->error );
 
3294
                                KMessageBox::sorry ( 0, i18n ( "Import of \"%1\" has been failed." ,   profileData->getName() ) );
 
3295
                                GlobalConfig->appendLogEntry ( i18n ( "Import of \"%1\" (%2) has been failed." ,   profileData->getName() ,   QString( "PCF") ), GlobalConfig->error );
2569
3296
                        success = false;
2570
3297
                }
2571
3298
        }
2572
3299
        if ( ConnType == VpnAccountData::openvpn )
2573
3300
        {
2574
3301
                ImportOpenvpnProfileDialog dlg ( GlobalConfig, this, i18n ( "Import OpenVPN profile" ), "" );
2575
 
                dlg.exec();
2576
 
                importOK = dlg.importOk;
2577
 
                if ( importOK )
2578
 
                {
2579
 
                        profileData = dlg.acc;
2580
 
                        KMessageBox::information ( 0, i18n ( "Import of \"%1\" was successful." ).arg ( profileData->getName() ) );
2581
 
                        GlobalConfig->appendLogEntry ( i18n ( "Import of \"%1\" (%2) was successful." ).arg ( profileData->getName() ).arg ( "OpenVPN" ), GlobalConfig->info );
2582
 
                }
2583
 
                else
2584
 
                {
2585
 
                        KMessageBox::sorry ( 0, i18n ( "Import of \"%1\" has been failed." ).arg ( profileData->getName() ) );
2586
 
                        GlobalConfig->appendLogEntry ( i18n ( "Import of \"%1\" (%2) has been failed." ).arg ( profileData->getName() ).arg ( "OpenVPN" ), GlobalConfig->error );
2587
 
                        success = false;
2588
 
                }
2589
 
        }
 
3302
                int ret = dlg.exec();
 
3303
                importOK = dlg.importOk;
 
3304
                if ( importOK )
 
3305
                {
 
3306
                        profileData = dlg.acc;
 
3307
                        KMessageBox::information ( 0, i18n ( "Import of \"%1\" was successful." ,   profileData->getName() ) );
 
3308
                        GlobalConfig->appendLogEntry ( i18n ( "Import of \"%1\" (%2) was successful." ,   profileData->getName() ,   QString("OpenVPN") ), GlobalConfig->info );
 
3309
                }
 
3310
                else
 
3311
                {
 
3312
                        KMessageBox::sorry ( 0, i18n ( "Import of \"%1\" has been failed." ,   profileData->getName() ) );
 
3313
                        GlobalConfig->appendLogEntry ( i18n ( "Import of \"%1\" (%2) has been failed." ,   profileData->getName() ,   QString("OpenVPN") ), GlobalConfig->error );
 
3314
                        success = false;
 
3315
                }
 
3316
        }
 
3317
        if ( ConnType == VpnAccountData::freeswan )
 
3318
        {
 
3319
                ImportIpsecProfileDialog dlg ( GlobalConfig, this, i18n ( "Import IPSec profile" ), "" );
 
3320
                dlg.setCaption(i18n("Import IPSec config"));
 
3321
                int ret = dlg.exec();
 
3322
                importOK = dlg.importOk;
 
3323
                if ( importOK )
 
3324
                {
 
3325
                        profileData = dlg.acc;
 
3326
                        KMessageBox::information ( 0, i18n ( "Import of \"%1\" was successful.", profileData->getName() ) );
 
3327
                                GlobalConfig->appendLogEntry ( i18n ( "Import of \"%1\" (%2) was successful." ,profileData->getName() , QString("IPSec") ), GlobalConfig->info );
 
3328
                }
 
3329
                else
 
3330
                {
 
3331
                        KMessageBox::sorry ( 0, i18n ( "Import of \"%1\" has been failed." ,profileData->getName() ) );
 
3332
                        GlobalConfig->appendLogEntry ( i18n ( "Import of \"%1\" (%2) has been failed." , profileData->getName() , QString("IPsec") ), GlobalConfig->error );
 
3333
                        success = false;
 
3334
                }
 
3335
        }
 
3336
 
2590
3337
        return success;
2591
3338
 
2592
3339
}
2603
3350
        if ( profileData->getConnectionType() == VpnAccountData::freeswan ||
2604
3351
                profileData->getConnectionType() == VpnAccountData::l2tpd_freeswan )
2605
3352
        {
2606
 
                dlg.main->ImporttypeComboBox->setCurrentItem ( ImportCertificateDialog::pkcs12_freeswan );
 
3353
                dlg.ImporttypeComboBox->setCurrentItem (i18n("P12: freeswan") );
2607
3354
                dlg.typeToggeled ( ImportCertificateDialog::pkcs12_freeswan );
2608
3355
        }
2609
3356
        else if ( profileData->getConnectionType() == VpnAccountData::racoon || profileData->getConnectionType() == VpnAccountData::l2tpd_racoon )
2610
3357
        {
2611
 
                dlg.main->ImporttypeComboBox->setCurrentItem ( ImportCertificateDialog::pkcs12_racoon );
2612
 
                dlg.main->FreeswanGroupBox->setEnabled ( false );
 
3358
                dlg.ImporttypeComboBox->setCurrentItem ( i18n("P12: racoon") );
 
3359
                dlg.PrivateKeyPassGroupBox->setEnabled ( false );
2613
3360
                dlg.typeToggeled ( ImportCertificateDialog::pkcs12_racoon );
2614
3361
        }
2615
3362
        else if ( profileData->getConnectionType() == VpnAccountData::openvpn )
2616
3363
        {
2617
 
                dlg.main->ImporttypeComboBox->setCurrentItem ( ImportCertificateDialog::pkcs12_openvpn );
 
3364
                dlg.ImporttypeComboBox->setCurrentItem ( i18n("OpenVPN") );
2618
3365
                dlg.typeToggeled ( ImportCertificateDialog::pkcs12_openvpn );
2619
 
                dlg.main->RacoonCertificatePathUrlrequester->setEnabled ( true );
2620
 
                dlg.main->RacoonCertificatePathUrlrequester->setURL ( profileData->getCertPath() );
2621
 
                dlg.main->FreeswanGroupBox->setEnabled ( true );
2622
 
                dlg.main->PrivateKeyPasswordEdit->setEnabled ( true );
2623
 
                dlg.main->PrivateKeyAgainPasswordEdit->setEnabled ( true );
 
3366
                dlg.RacoonCertificatePathUrlrequester->setEnabled ( true );
 
3367
                dlg.RacoonCertificatePathUrlrequester->setUrl ( profileData->getCertPath() );
 
3368
                dlg.PrivateKeyPassGroupBox->setEnabled ( true );
 
3369
                dlg.PrivateKeyPasswordEdit->setEnabled ( true );
 
3370
                dlg.PrivateKeyAgainPasswordEdit->setEnabled ( true );
2624
3371
        }
2625
3372
        else if ( profileData->getConnectionType() == VpnAccountData::ciscoorig )
2626
3373
        {
2627
 
                dlg.main->ImporttypeComboBox->setCurrentItem ( ImportCertificateDialog::cisco );
 
3374
                dlg.ImporttypeComboBox->setCurrentItem ( i18n("Cisco (propritary)") );
2628
3375
                dlg.typeToggeled ( ImportCertificateDialog::cisco);
2629
 
                dlg.main->RacoonCertificatePathUrlrequester->setEnabled ( false );
2630
 
//              dlg.main->RacoonCertificatePathUrlrequester->hide();
2631
 
                dlg.main->FreeswanGroupBox->setEnabled ( true );
2632
 
                dlg.main->PrivateKeyPasswordEdit->setEnabled ( true );
2633
 
                dlg.main->PrivateKeyAgainPasswordEdit->setEnabled ( true );
 
3376
                dlg.RacoonCertificatePathUrlrequester->setEnabled ( false );
 
3377
//              dlg.RacoonCertificatePathUrlrequester->hide();
 
3378
                dlg.PrivateKeyPassGroupBox->setEnabled ( true );
 
3379
                dlg.PrivateKeyPasswordEdit->setEnabled ( true );
 
3380
                dlg.PrivateKeyAgainPasswordEdit->setEnabled ( true );
2634
3381
        }
2635
3382
 
2636
3383
 
2642
3389
                QString certpath = dlg.certpath;
2643
3390
                QString CertFullPath = dlg.CertFullPath;
2644
3391
                QString CaCertFullPath = dlg.CaCertFullPath;
2645
 
                QString importpassword = dlg.main->ImportPasswordEdit->text();
2646
 
                QString privatekeypassword = dlg.main->PrivateKeyPasswordEdit->password();
 
3392
                QString importpassword = dlg.ImportPasswordEdit->text();
 
3393
                QString privatekeypassword = dlg.PrivateKeyPasswordEdit->text();
2647
3394
                QString certificate = QString ( "mykeys_" + dlg.certName + ".pem" );
2648
3395
                QString privatekey = QString ( dlg.certName + ".pem" );
2649
3396
 
2656
3403
                        privatepostfix = "private/";
2657
3404
                }
2658
3405
 
2659
 
                newprofilewizardcertcontent->CaCertpathURLRequester->setURL ( CaCertFullPath );
 
3406
                newprofilewizardcertcontent->CaCertpathURLRequester->setUrl ( CaCertFullPath );
2660
3407
 
2661
3408
 
2662
3409
                if ( profileData->getConnectionType() == VpnAccountData::openvpn )
2669
3416
                        newprofilewizardcertcontent->PrivkeyPasswordEdit->setEnabled ( false );
2670
3417
 
2671
3418
 
2672
 
                newprofilewizardcertcontent->certpathURLRequester->setURL ( certpath );
 
3419
                newprofilewizardcertcontent->certpathURLRequester->setUrl ( certpath );
2673
3420
 
2674
3421
                if ( profileData->getConnectionType() == VpnAccountData::l2tpd_racoon ||
2675
3422
                        profileData->getConnectionType() == VpnAccountData::racoon )
2676
3423
                {
2677
 
                        newprofilewizardcertcontent->privkeypathURLRequester->setURL ( certpath + "/" + certpostfix + certificate );
 
3424
                        newprofilewizardcertcontent->privkeypathURLRequester->setUrl ( certpath + "/" + certpostfix + certificate );
2678
3425
                        newprofilewizardcertcontent->LabelPrivateKeyPassword->setEnabled ( false );
2679
3426
                }
2680
3427
                else
2681
 
                        newprofilewizardcertcontent->privkeypathURLRequester->setURL ( certpath + "/" + privatepostfix + privatekey );
2682
 
                newprofilewizardcertcontent->x509certURLRequester->setURL ( certpath + "/" + certpostfix + certificate );
 
3428
                        newprofilewizardcertcontent->privkeypathURLRequester->setUrl ( certpath + "/" + privatepostfix + privatekey );
 
3429
                newprofilewizardcertcontent->x509certURLRequester->setUrl ( certpath + "/" + certpostfix + certificate );
2683
3430
 
2684
 
                KMessageBox::information ( 0, i18n ( "Import of \"%1\" was successful." ).arg ( filename ) );
2685
 
                GlobalConfig->appendLogEntry ( i18n ( "Import of \"%1\" (%2) was successful." ).arg ( filename ).arg ( "P12 certificate" ), GlobalConfig->info );
 
3431
                KMessageBox::information ( 0, i18n ( "Import of \"%1\" was successful." ,   filename ) );
 
3432
                GlobalConfig->appendLogEntry ( i18n ( "Import of \"%1\" (%2) was successful." ,   filename ,   "P12 certificate" ), GlobalConfig->info );
2686
3433
        }
2687
3434
        else
2688
3435
        {
2689
 
                GlobalConfig->appendLogEntry ( i18n ( "Import of \"%1\" (%2) has been failed." ).arg ( filename ).arg ( "P12 certificate" ), GlobalConfig->info );
 
3436
                GlobalConfig->appendLogEntry ( i18n ( "Import of \"%1\" (%2) has been failed." ,   filename ,   "P12 certificate" ), GlobalConfig->info );
2690
3437
                success = false;
2691
3438
        }
2692
3439
        return success;
2724
3471
        //              newprofilewizarduserpagecontent->DontSaveUsernameCheckBox->setChecked(false);
2725
3472
}
2726
3473
 
 
3474
void NewProfileWizard::pskToggled ( const QString& )
 
3475
{
 
3476
        if ( !newprofilewizardciscomanuallypagecontent->GroupPasswordLineEdit->text().isEmpty() )
 
3477
                newprofilewizardciscomanuallypagecontent->CheckSavePsk->setChecked ( true );
 
3478
        else
 
3479
                newprofilewizardciscomanuallypagecontent->CheckSavePsk->setChecked ( false );
 
3480
}
 
3481
 
2727
3482
void NewProfileWizard::useRightNextHopToggled ( bool )
2728
3483
{
2729
 
        if ( newprofilewizardracoonpagecontent->UseRightNextHopCheckBox->isChecked() )
2730
 
                newprofilewizardracoonpagecontent->RightNextHopLineEdit->setEnabled ( true );
 
3484
        if ( newprofilewizardfreeswanpagecontent->UseRightNextHopCheckBox->isChecked() )
 
3485
                newprofilewizardfreeswanpagecontent->RightNextHopLineEdit->setEnabled ( true );
2731
3486
        else
2732
 
                newprofilewizardracoonpagecontent->RightNextHopLineEdit->setEnabled ( false );
 
3487
                newprofilewizardfreeswanpagecontent->RightNextHopLineEdit->setEnabled ( false );
2733
3488
}
2734
3489
 
2735
3490
void NewProfileWizard::useLeftNextHopToggled ( bool )
2736
3491
{
2737
 
        if ( newprofilewizardracoonpagecontent->UseLeftNextHopCheckBox->isChecked() )
2738
 
                newprofilewizardracoonpagecontent->LeftNextHopLineEdit->setEnabled ( true );
 
3492
        if ( newprofilewizardfreeswanpagecontent->UseLeftNextHopCheckBox->isChecked() )
 
3493
                newprofilewizardfreeswanpagecontent->LeftNextHopLineEdit->setEnabled ( true );
2739
3494
        else
2740
 
                newprofilewizardracoonpagecontent->LeftNextHopLineEdit->setEnabled ( false );
 
3495
                newprofilewizardfreeswanpagecontent->LeftNextHopLineEdit->setEnabled ( false );
2741
3496
}
2742
3497
 
2743
3498
void NewProfileWizard::additionalNetworkRoutesToggled ( bool )
2760
3515
{
2761
3516
        if ( newprofilewizardnetworkroutecontent->NetworkListView->childCount() > 0 && newprofilewizardnetworkroutecontent->NetworkListView->currentItem() != 0 )
2762
3517
        {
2763
 
                QListViewItem * item = newprofilewizardnetworkroutecontent->NetworkListView->currentItem();
 
3518
                Q3ListViewItem * item = newprofilewizardnetworkroutecontent->NetworkListView->currentItem();
2764
3519
                QString Network = item->text ( 0 );
2765
3520
                QString Netmask = item->text ( 1 );
2766
 
                int result = KMessageBox::questionYesNo ( this, i18n ( "Do you really want to delete the network \"%1/%2\"?" ).arg ( Network ).arg ( Netmask ), i18n ( "Delete?" ) );
 
3521
                int result = KMessageBox::questionYesNo ( this, i18n ( "Do you really want to delete the network \"%1/%2\"?" ,   Network ,   Netmask ), i18n ( "Delete?" ) );
2767
3522
                //LogOutput->append( "Result: "+ QString().setNum(result) ) ;
2768
3523
                if ( result == 3 )  // Yes
2769
3524
                {
2777
3532
        AddNetworkRouteDialog dlg ( this, i18n ( "Add Network Route..." ) );
2778
3533
 
2779
3534
 
2780
 
        dlg.main->InterfaceComboBox->insertItem ( "default" ); // interface where default route points
 
3535
        dlg.InterfaceComboBox->insertItem ( "default" ); // interface where default route points
2781
3536
 
2782
3537
        //FIXME
2783
 
        dlg.main->InterfaceComboBox->insertItem ( "eth0" );
2784
 
        dlg.main->InterfaceComboBox->insertItem ( "eth1" );
2785
 
        dlg.main->InterfaceComboBox->insertItem ( "eth2" );
2786
 
        dlg.main->InterfaceComboBox->insertItem ( "ipsec0" );
2787
 
        dlg.main->InterfaceComboBox->insertItem ( "tun0" );
2788
 
        dlg.main->InterfaceComboBox->insertItem ( "ppp0" );
 
3538
        dlg.InterfaceComboBox->insertItem ( "eth0" );
 
3539
        dlg.InterfaceComboBox->insertItem ( "eth1" );
 
3540
        dlg.InterfaceComboBox->insertItem ( "eth2" );
 
3541
        dlg.InterfaceComboBox->insertItem ( "ipsec0" );
 
3542
        dlg.InterfaceComboBox->insertItem ( "tun0" );
 
3543
        dlg.InterfaceComboBox->insertItem ( "ppp0" );
2789
3544
 
2790
3545
        if ( dlg.exec() )
2791
3546
        {
2795
3550
                        gateway = "-";
2796
3551
                if ( !dlg.getUseInterface() )
2797
3552
                        interface = "-";
2798
 
                newprofilewizardnetworkroutecontent->NetworkListView->insertItem ( new QListViewItem ( newprofilewizardnetworkroutecontent->NetworkListView, dlg.getNetwork(), dlg.getNetmask(), gateway, interface ) );
 
3553
                newprofilewizardnetworkroutecontent->NetworkListView->insertItem ( new Q3ListViewItem ( newprofilewizardnetworkroutecontent->NetworkListView, dlg.getNetwork(), dlg.getNetmask(), gateway, interface ) );
2799
3554
        }
2800
3555
}
2801
3556
 
2837
3592
//                      }
2838
3593
//                      IpsecToolInfo.collectToolInfo();
2839
3594
//                      if (IpsecToolInfo.Version.contains("Openswan") || IpsecToolInfo.Version.contains("Free"))
2840
 
//                              KMessageBox::information(0,i18n("%1 (IPSec) currently has no working smartcard support (pkcs11). Please use strongSwan instead with enabled smartcard support.").arg(IpsecToolInfo.Version.section(' ',0,0)),i18n("Unsupported IPSec version"));
 
3595
//                              KMessageBox::information(0,i18n("%1 (IPSec) currently has no working smartcard support (pkcs11). Please use strongSwan instead with enabled smartcard support.", QString(IpsecToolInfo.Version.section(' ',0,0))),i18n("Unsupported IPSec version"));
2841
3596
//              }
2842
3597
 
2843
3598
        }
2874
3629
//                      }
2875
3630
//                      IpsecToolInfo.collectToolInfo();
2876
3631
//                      if (IpsecToolInfo.Version.contains("Openswan") || IpsecToolInfo.Version.contains("Free"))
2877
 
//                              KMessageBox::information(0,i18n("%1 (IPSec) currently has no working smartcard support (pkcs11). Please use strongSwan instead with enabled smartcard support.").arg(IpsecToolInfo.Version.section(' ',0,0)),i18n("Unsupported IPSec version"));
 
3632
//                              KMessageBox::information(0,i18n("%1 (IPSec) currently has no working smartcard support (pkcs11). Please use strongSwan instead with enabled smartcard support.", QString(IpsecToolInfo.Version.section(' ',0,0))),i18n("Unsupported IPSec version"));
2878
3633
//              }
2879
3634
        }
2880
3635
        else
2913
3668
                Pkcs11IdTypeTmp = "id";
2914
3669
 
2915
3670
                if ( GlobalConfig->KvpncDebugLevel > 1 )
2916
 
                        GlobalConfig->appendLogEntry ( i18n ( "Pkcs11IdType: %1" ).arg ( Pkcs11IdTypeTmp ), KVpncConfig::debug );
 
3671
                        GlobalConfig->appendLogEntry ( i18n ( "Pkcs11IdType: %1" ,   Pkcs11IdTypeTmp ), KVpncConfig::debug );
2917
3672
        }
2918
3673
        else if ( Pkcs11IdType == 1 )
2919
3674
        {
2920
3675
                Pkcs11IdTypeTmp = "label";
2921
3676
                if ( GlobalConfig->KvpncDebugLevel > 1 )
2922
 
                        GlobalConfig->appendLogEntry ( i18n ( "Pkcs11IdType: %1" ).arg ( Pkcs11IdTypeTmp ), KVpncConfig::debug );
 
3677
                        GlobalConfig->appendLogEntry ( i18n ( "Pkcs11IdType: %1" ,   Pkcs11IdTypeTmp ), KVpncConfig::debug );
2923
3678
        }
2924
3679
        else
2925
3680
        {
2926
3681
                Pkcs11IdTypeTmp = "subject";
2927
3682
                if ( GlobalConfig->KvpncDebugLevel > 1 )
2928
 
                        GlobalConfig->appendLogEntry ( i18n ( "Pkcs11IdType: %1" ).arg ( Pkcs11IdTypeTmp ), KVpncConfig::debug );
 
3683
                        GlobalConfig->appendLogEntry ( i18n ( "Pkcs11IdType: %1" ,   Pkcs11IdTypeTmp ), KVpncConfig::debug );
2929
3684
        }
2930
3685
 
2931
3686
        QString ProviderLib = "";
2932
 
        if ( newprofilewizardcertcontent->UsePkcs11ProvidersCheckBox->isChecked() && !newprofilewizardcertcontent->Pkcs11ProvidersURLRequester->url().isEmpty() )
2933
 
                ProviderLib = newprofilewizardcertcontent->Pkcs11ProvidersURLRequester->url();
 
3687
        if ( newprofilewizardcertcontent->UsePkcs11ProvidersCheckBox->isChecked() && !newprofilewizardcertcontent->Pkcs11ProvidersURLRequester->url().prettyUrl().isEmpty() )
 
3688
                ProviderLib = newprofilewizardcertcontent->Pkcs11ProvidersURLRequester->url().prettyUrl();
2934
3689
 
2935
3690
        // we have to split slot id and name ("0 : foobar") => 0
2936
 
        QString Pkcs11Slot = newprofilewizardcertcontent->Pkcs11SlotComboBox->currentText().section ( ':', 0, 0 ).stripWhiteSpace();
 
3691
        QString Pkcs11Slot = newprofilewizardcertcontent->Pkcs11SlotComboBox->currentText().section ( ':', 0, 0 ).trimmed();
2937
3692
 
2938
3693
        QStringList Pkcs11Ids = Utils ( GlobalConfig ).getSmartcardCertsFromSlot ( Pkcs11Slot, Pkcs11IdTypeTmp, ProviderLib );
2939
3694
        for ( QStringList::Iterator it = Pkcs11Ids.begin(); it != Pkcs11Ids.end(); ++it )
2952
3707
        GlobalConfig->appPointer->setOverrideCursor ( QCursor ( Qt::WaitCursor ) );
2953
3708
        newprofilewizardcertcontent->Pkcs11SlotComboBox->clear();
2954
3709
        QString ProviderLib = "";
2955
 
        if ( newprofilewizardcertcontent->UsePkcs11ProvidersCheckBox->isChecked() && !newprofilewizardcertcontent->Pkcs11ProvidersURLRequester->url().isEmpty() )
2956
 
                ProviderLib = newprofilewizardcertcontent->Pkcs11ProvidersURLRequester->url();
 
3710
        if ( newprofilewizardcertcontent->UsePkcs11ProvidersCheckBox->isChecked() && !newprofilewizardcertcontent->Pkcs11ProvidersURLRequester->url().prettyUrl().isEmpty() )
 
3711
                ProviderLib = newprofilewizardcertcontent->Pkcs11ProvidersURLRequester->url().prettyUrl();
2957
3712
        QStringList Pkcs11Slots = Utils ( GlobalConfig ).getSmartcardSlots ( ProviderLib );
2958
3713
        for ( QStringList::Iterator it = Pkcs11Slots.begin(); it != Pkcs11Slots.end(); ++it )
2959
3714
                newprofilewizardcertcontent->Pkcs11SlotComboBox->insertItem ( QString ( *it ) );
2961
3716
        if ( !Pkcs11Slots.isEmpty() )
2962
3717
                newprofilewizardcertcontent->Pkcs11IdTypeComboBox->setEnabled ( true );
2963
3718
        if ( newprofilewizardcertcontent->Pkcs11SlotComboBox->currentText() == "" || newprofilewizardcertcontent->Pkcs11IdComboBox->currentText() == "" )
2964
 
                nextButton()->setEnabled ( false );
 
3719
                nextButton()->setEnabled( false); // Next
2965
3720
        else
2966
 
                nextButton()->setEnabled ( true );
 
3721
                nextButton()->setEnabled( true); // Next
2967
3722
 
2968
3723
        GlobalConfig->appPointer->restoreOverrideCursor();
2969
3724
}
3012
3767
        }
3013
3768
}
3014
3769
 
 
3770
void NewProfileWizard::localIDTypeIpsecToggled ( const QString& text )
 
3771
{
 
3772
        if ( text == "asn1dn" )
 
3773
        {
 
3774
                newprofilewizardfreeswanpagecontent->LocalIDLineEdit->setDisabled ( true );
 
3775
                newprofilewizardfreeswanpagecontent->LocalIDLabel->setDisabled ( true );
 
3776
        }
 
3777
        else
 
3778
        {
 
3779
                newprofilewizardfreeswanpagecontent->LocalIDLineEdit->setDisabled ( false );
 
3780
                newprofilewizardfreeswanpagecontent->LocalIDLabel->setDisabled ( false );
 
3781
        }
 
3782
}
 
3783
 
3015
3784
void NewProfileWizard::usePortToggled ( bool )
3016
3785
{
3017
3786
        if ( newprofilewizardvtunpagecontent->PortCheckbox->isChecked() )
3027
3796
        else
3028
3797
                newprofilewizardopenvpnauthpagecontent->UserdefiniedDigestComboBox->setEnabled ( false );
3029
3798
}
 
3799
 
 
3800
void NewProfileWizard::useRemoteNetworkToggled(bool)
 
3801
{
 
3802
        if ( newprofilewizardnetworkcontent->UseRemoteNetworkCheckBox->isChecked() )
 
3803
                newprofilewizardnetworkcontent->RemoteNetworkGroupBox ->setEnabled ( true );
 
3804
        else
 
3805
                newprofilewizardnetworkcontent->RemoteNetworkGroupBox->setEnabled ( false );
 
3806
}
 
3807
 
 
3808
void NewProfileWizard::useIkeToggled(bool)
 
3809
{
 
3810
        if (newprofilewizardfreeswanpagecontent->UseCustomIkeCheckBox->isChecked())
 
3811
                newprofilewizardfreeswanpagecontent->IkeGroupBox->setEnabled(true);
 
3812
        else
 
3813
                newprofilewizardfreeswanpagecontent->IkeGroupBox->setEnabled(false);
 
3814
}
 
3815
 
 
3816
void NewProfileWizard::useEspToogled(bool)
 
3817
{
 
3818
        if (newprofilewizardfreeswanpagecontent->UseCustomEspCheckBox->isChecked())
 
3819
                newprofilewizardfreeswanpagecontent->EspGroupBox->setEnabled(true);
 
3820
        else
 
3821
                newprofilewizardfreeswanpagecontent->EspGroupBox->setEnabled(false);
 
3822
}
 
3823
 
 
3824
void NewProfileWizard::remoteIDTypeToggled(const QString& text)
 
3825
{
 
3826
        if (text == "asn1dn")
 
3827
        {
 
3828
                newprofilewizardracoonpagecontent->RemoteIDLineEdit->setDisabled(true);
 
3829
                newprofilewizardracoonpagecontent->RemoteIDLabel->setDisabled(true);
 
3830
        }
 
3831
        else
 
3832
        {
 
3833
                newprofilewizardracoonpagecontent->RemoteIDLineEdit->setDisabled(false);
 
3834
                newprofilewizardracoonpagecontent->RemoteIDLabel->setDisabled(false);
 
3835
        }
 
3836
}
 
3837
 
 
3838
void NewProfileWizard::defaultRouteToggled(const QString&)
 
3839
{
 
3840
 
 
3841
        if (newprofilewizardnetworkroutecontent->DefaultRouteComboBox->currentText() == i18n("Keep default route") || newprofilewizardnetworkroutecontent->DefaultRouteComboBox->currentItem() == 0)
 
3842
        {
 
3843
                KMessageBox::information(0,i18n("Additional network route is needed:\n\nYou have selected to keep the default route. You have to add additional network routes to your remote network. Otherwise you probably dont have access to it."),i18n("Route needed"));
 
3844
        }
 
3845
 
 
3846
}
 
3847
 
 
3848
void NewProfileWizard::ikeGroupToggled(bool)
 
3849
{
 
3850
        if (newprofilewizardracoonpagecontent->IkeGroupCheckbox->isChecked())
 
3851
                newprofilewizardracoonpagecontent->DHGroupComboBox->setEnabled(true);
 
3852
        else
 
3853
                newprofilewizardracoonpagecontent->DHGroupComboBox->setEnabled(false);
 
3854
}
 
3855
 
 
3856
void NewProfileWizard::useXauthFreeswanToggled(bool)
 
3857
{
 
3858
        if (newprofilewizardfreeswanpagecontent->UseXauthCheckBox->isChecked())
 
3859
        {
 
3860
                newprofilewizarduserpagecontent->setEnabled(true);
 
3861
                newprofilewizardpskcontent->setEnabled(true);
 
3862
                newprofilewizardfreeswanpagecontent->LocalIdTypeCombobox->setEnabled(false);
 
3863
                newprofilewizardfreeswanpagecontent->LocalIDLineEdit->setEnabled(true);
 
3864
                newprofilewizardfreeswanpagecontent->LocalIdTypeCombobox->setCurrentText("keyid");
 
3865
        }
 
3866
        else
 
3867
        {
 
3868
                newprofilewizarduserpagecontent->setEnabled(false);
 
3869
                newprofilewizardpskcontent->setEnabled(false);
 
3870
                newprofilewizardfreeswanpagecontent->LocalIdTypeCombobox->setEnabled(true);
 
3871
                newprofilewizardfreeswanpagecontent->LocalIDLineEdit->setEnabled(false);
 
3872
                newprofilewizardfreeswanpagecontent->LocalIdTypeCombobox->setCurrentText("asn1dn");
 
3873
        }
 
3874
}
 
3875
 
 
3876
void NewProfileWizard::useXauthRacoonToggled(bool)
 
3877
{
 
3878
        if (newprofilewizardracoonpagecontent->UseXauthCheckBox->isChecked())
 
3879
        {
 
3880
                newprofilewizarduserpagecontent->setEnabled(true);
 
3881
                newprofilewizardpskcontent->setEnabled(true);
 
3882
                newprofilewizardracoonpagecontent->LocalIdTypeCombobox->setEnabled(false);
 
3883
                newprofilewizardracoonpagecontent->LocalIDLineEdit->setEnabled(true);
 
3884
                newprofilewizardracoonpagecontent->LocalIdTypeCombobox->setCurrentText("keyid");
 
3885
        }
 
3886
        else
 
3887
        {
 
3888
                newprofilewizarduserpagecontent->setEnabled(false);
 
3889
                newprofilewizardpskcontent->setEnabled(false);
 
3890
                newprofilewizardracoonpagecontent->LocalIdTypeCombobox->setEnabled(true);
 
3891
                newprofilewizardracoonpagecontent->LocalIDLineEdit->setEnabled(false);
 
3892
                newprofilewizardracoonpagecontent->LocalIdTypeCombobox->setCurrentText("asn1dn");
 
3893
        }
 
3894
}
 
3895
 
 
3896
void NewProfileWizard::tunnelDeviceTypeChanged(const QString & string )
 
3897
{
 
3898
        if ( profileData->getConnectionType() == VpnAccountData::openvpn || GlobalConfig->currentProfile->getConnectionType() == VpnAccountData::ssh)
 
3899
        {
 
3900
                if (string.lower() == "tun")
 
3901
                {
 
3902
                        profilenetworkvirtualipoptionscontent->LabelRemoteVirtualIp->setText(i18n("Remote IP (virtual):"));
 
3903
                }
 
3904
                if (string.lower() == "tap")
 
3905
                {
 
3906
                        profilenetworkvirtualipoptionscontent->LabelRemoteVirtualIp->setText(i18n("Netmask for local IP address:"));
 
3907
                }
 
3908
        }
 
3909
}
 
3910
 
 
3911
void NewProfileWizard::useDnsServerToggled(bool)
 
3912
{
 
3913
        if ( newprofilewizardpptppagecontent->DnsServerCheckbox->isChecked() )
 
3914
                newprofilewizardpptppagecontent->DnsServerLineedit->setEnabled( true );
 
3915
        else
 
3916
                newprofilewizardpptppagecontent->DnsServerLineedit->setEnabled( false );
 
3917
}
 
3918
 
 
3919
void NewProfileWizard::useSearchDomainInResolvConfToggled(bool)
 
3920
{
 
3921
        if ( newprofilewizardpptppagecontent->UseSearchDomainInResolvConfCheckbox ->isChecked() )
 
3922
                newprofilewizardpptppagecontent->SearchDomainInResolvConfLineedit->setEnabled( true );
 
3923
        else
 
3924
                newprofilewizardpptppagecontent->SearchDomainInResolvConfLineedit->setEnabled( false );
 
3925
}
 
3926