summaryrefslogtreecommitdiffstats
path: root/src/importprofiledialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/importprofiledialog.cpp')
-rw-r--r--src/importprofiledialog.cpp146
1 files changed, 73 insertions, 73 deletions
diff --git a/src/importprofiledialog.cpp b/src/importprofiledialog.cpp
index 80ec8a0..bf5f1f8 100644
--- a/src/importprofiledialog.cpp
+++ b/src/importprofiledialog.cpp
@@ -26,13 +26,13 @@
#include <kdialogbase.h>
#include <kurlrequester.h>
#include <kcombobox.h>
-#include <qstringlist.h>
-#include <qfile.h>
-#include <qurl.h>
+#include <tqstringlist.h>
+#include <tqfile.h>
+#include <tqurl.h>
#include <kurl.h>
-#include <qtextstream.h>
-#include <qcheckbox.h>
-#include <qfileinfo.h>
+#include <tqtextstream.h>
+#include <tqcheckbox.h>
+#include <tqfileinfo.h>
#include <string>
#include <iostream>
@@ -43,7 +43,7 @@
#include "ciscopasswddecoder.h"
//END INCLUDES
-ImportProfileDialog::ImportProfileDialog(KVpncConfig *GlobalConfig, QWidget *parent, const QString& caption, QString file)
+ImportProfileDialog::ImportProfileDialog(KVpncConfig *GlobalConfig, TQWidget *parent, const TQString& caption, TQString file)
: KDialogBase( parent, "Import_Cisco_PCF_profile", true, caption,
KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok, true )
{
@@ -57,7 +57,7 @@ ImportProfileDialog::ImportProfileDialog(KVpncConfig *GlobalConfig, QWidget *par
main = new ImportProfileDialogBase(this);
setMainWidget(main);
- main->setMinimumSize(main->sizeHint());
+ main->setMinimumSize(main->tqsizeHint());
main->FilenameUrlrequester->setFilter( "*.pcf" );
main->FilenameUrlrequester->setURL(filename);
@@ -77,7 +77,7 @@ void ImportProfileDialog::accept()
filename = main->FilenameUrlrequester->url();
if ( !filename.isEmpty() )
{
- f = new QFile(filename);
+ f = new TQFile(filename);
canAccept();
}
@@ -101,14 +101,14 @@ void ImportProfileDialog::canAccept()
KConfig config( filename, true, false );
- QStringList grouplist = config.groupList();
+ TQStringList grouplist = config.groupList();
if (GlobalConfig->KvpncDebugLevel > 0)
{
- QString groups="";
- for ( QStringList::Iterator group = grouplist.begin(); group != grouplist.end(); ++group )
- groups += QString(" "+*group);
- GlobalConfig->appendLogEntry(i18n("PCF import: groups found: [ %1 ]").arg(groups), GlobalConfig->debug);
+ TQString groups="";
+ for ( TQStringList::Iterator group = grouplist.begin(); group != grouplist.end(); ++group )
+ groups += TQString(" "+*group);
+ GlobalConfig->appendLogEntry(i18n("PCF import: groups found: [ %1 ]").tqarg(groups), GlobalConfig->debug);
}
config.setGroup( "main" );
@@ -148,23 +148,23 @@ void ImportProfileDialog::canAccept()
VpnAccountData::ConnectionType ConnType = VpnAccountData::cisco;
- QString ProfileName = QFileInfo ( f->name().stripWhiteSpace().remove(".pcf").remove(".PCF") ).fileName();
+ TQString ProfileName = TQFileInfo ( f->name().stripWhiteSpace().remove(".pcf").remove(".PCF") ).fileName();
acc = new VpnAccountData ( ConnType, Utils(this->GlobalConfig).removeSpecialCharsForFilename( ProfileName ));
- QString Description = config.readEntry( "Description", "" );
+ TQString Description = config.readEntry( "Description", "" );
if (Description.isEmpty())
- Description = config.readEntry("!Description",i18n("Profile imported from file %1.").arg(filename));
+ Description = config.readEntry("!Description",i18n("Profile imported from file %1.").tqarg(filename));
if (!Description.isEmpty())
{
if (GlobalConfig->KvpncDebugLevel > 0)
- GlobalConfig->appendLogEntry(i18n("PCF import: description found: %1").arg(Description), GlobalConfig->debug);
+ GlobalConfig->appendLogEntry(i18n("PCF import: description found: %1").tqarg(Description), GlobalConfig->debug);
acc->setDescription( Description );
}
- QString Gateway = config.readEntry( "Host", "" );
+ TQString Gateway = config.readEntry( "Host", "" );
if (Gateway.isEmpty())
Gateway = config.readEntry( "!Host", "" );
@@ -172,7 +172,7 @@ void ImportProfileDialog::canAccept()
if (!Gateway.isEmpty())
{
if (GlobalConfig->KvpncDebugLevel > 0)
- GlobalConfig->appendLogEntry(i18n("PCF import: gateway found: %1").arg(Gateway), GlobalConfig->debug);
+ GlobalConfig->appendLogEntry(i18n("PCF import: gateway found: %1").tqarg(Gateway), GlobalConfig->debug);
acc->setGateway( Gateway );
}
@@ -180,9 +180,9 @@ void ImportProfileDialog::canAccept()
acc->setUseApplicationVersion( useApplicationVersion );
bool enableBackup = config.readBoolEntry( "EnableBackup" , FALSE );
- QString BackupServer = config.readEntry( "BackupServer", "" );
+ TQString BackupServer = config.readEntry( "BackupServer", "" );
- QString GroupName = config.readEntry( "GroupName" , "" );
+ TQString GroupName = config.readEntry( "GroupName" , "" );
if (GroupName.isEmpty())
GroupName = config.readEntry( "!GroupName", "" );
@@ -193,18 +193,18 @@ void ImportProfileDialog::canAccept()
if (!GroupName.isEmpty())
{
if (GlobalConfig->KvpncDebugLevel > 0)
- GlobalConfig->appendLogEntry(i18n("PCF import: group name found: %1").arg(GroupName), GlobalConfig->debug);
+ GlobalConfig->appendLogEntry(i18n("PCF import: group name found: %1").tqarg(GroupName), GlobalConfig->debug);
acc->setID( GroupName );
}
- QString NtDomain = config.readEntry( "NTDomain" );
+ TQString NtDomain = config.readEntry( "NTDomain" );
if (NtDomain.isEmpty())
NtDomain = config.readEntry( "!NTDomain", "" );
if (!NtDomain.isEmpty())
{
if (GlobalConfig->KvpncDebugLevel > 0)
- GlobalConfig->appendLogEntry(i18n("PCF import: NT domain found: %1").arg(NtDomain), GlobalConfig->debug);
+ GlobalConfig->appendLogEntry(i18n("PCF import: NT domain found: %1").tqarg(NtDomain), GlobalConfig->debug);
acc->setNtDomainName( NtDomain );
}
@@ -214,14 +214,14 @@ void ImportProfileDialog::canAccept()
if ( enableMSLogon && !NtDomain.isEmpty() )
useNtDomainName = true;
- QString CertName = config.readEntry( "CertName", "" );
+ TQString CertName = config.readEntry( "CertName", "" );
if (GlobalConfig->KvpncDebugLevel > 0)
- GlobalConfig->appendLogEntry(i18n("PCF import: certificate name found: %1").arg(CertName), GlobalConfig->debug);
+ GlobalConfig->appendLogEntry(i18n("PCF import: certificate name found: %1").tqarg(CertName), GlobalConfig->debug);
- QString CertPath = config.readEntry( "CertPath", "" );
- QString CertSubjectName = config.readEntry( "CertSubjectName", "" );
- QString CertSerialHash = config.readEntry( "CertSerialHash", "" );
+ TQString CertPath = config.readEntry( "CertPath", "" );
+ TQString CertSubjectName = config.readEntry( "CertSubjectName", "" );
+ TQString CertSerialHash = config.readEntry( "CertSerialHash", "" );
// bool SendCertChain = config.readBoolEntry( "SendCertChain" , "" );
// bool VerifyCertDN = config.readBoolEntry( "VerifyCertDN", FALSE );
@@ -234,7 +234,7 @@ void ImportProfileDialog::canAccept()
if (CertStore == 1)
useCertStore = true;
if (GlobalConfig->KvpncDebugLevel > 0)
- GlobalConfig->appendLogEntry(i18n("PCF import: certificate should be stored into cisco cert store: %1").arg(QString().setNum(int(useCertStore))), GlobalConfig->debug);
+ GlobalConfig->appendLogEntry(i18n("PCF import: certificate should be stored into cisco cert store: %1").tqarg(TQString().setNum(int(useCertStore))), GlobalConfig->debug);
if (useCertStore)
{
@@ -242,11 +242,11 @@ void ImportProfileDialog::canAccept()
if (!CertName.isEmpty())
{
bool CertPathFound = false;
- QString CertFullPath = CertName;
- if (!QFile(CertFullPath).exists())
+ TQString CertFullPath = CertName;
+ if (!TQFile(CertFullPath).exists())
{
CertFullPath = CertPath+"/"+CertName;
- if (!QFile(CertFullPath).exists())
+ if (!TQFile(CertFullPath).exists())
{
GlobalConfig->appendLogEntry(i18n("Cisco certificate import: cert not found, skipping."), GlobalConfig->error);
}
@@ -266,18 +266,18 @@ void ImportProfileDialog::canAccept()
}
if (CertPathFound)
{
- QStringList OldCiscoCerts = Utils(GlobalConfig).getCertsFromCiscoCertStore();
+ TQStringList OldCiscoCerts = Utils(GlobalConfig).getCertsFromCiscoCertStore();
ImportCertificateDialog dlg( this, i18n( "Import certificate..." ).ascii(), GlobalConfig );
dlg.main->FilenameUrlrequester->setURL(CertFullPath);
dlg.main->ImporttypeComboBox->setCurrentItem(dlg.ciscouserca); // import user and ca cert
int result = dlg.exec();
- if (result == QDialog::Accepted)
+ if (result == TQDialog::Accepted)
{
acc->setUseCiscoCertStore(true);
- QStringList CiscoCerts = Utils(GlobalConfig).getCertsFromCiscoCertStore();
- for ( QStringList::Iterator ciscoit = CiscoCerts.begin(); ciscoit != CiscoCerts.end(); ++ciscoit )
+ TQStringList CiscoCerts = Utils(GlobalConfig).getCertsFromCiscoCertStore();
+ for ( TQStringList::Iterator ciscoit = CiscoCerts.begin(); ciscoit != CiscoCerts.end(); ++ciscoit )
{
- if (OldCiscoCerts.findIndex(QString(*ciscoit)) < 1 )
+ if (OldCiscoCerts.findIndex(TQString(*ciscoit)) < 1 )
{
// if it was not in list, then its the new added one.
acc->setX509Certificate(*ciscoit);
@@ -328,13 +328,13 @@ void ImportProfileDialog::canAccept()
if (useUdp)
{
if (GlobalConfig->KvpncDebugLevel > 0)
- GlobalConfig->appendLogEntry(i18n("PCF import: using %1 for tunneling").arg("UDP"), GlobalConfig->debug);
+ GlobalConfig->appendLogEntry(i18n("PCF import: using %1 for tunneling").tqarg("UDP"), GlobalConfig->debug);
acc->setUseUdp( true);
}
else
{
if (GlobalConfig->KvpncDebugLevel > 0)
- GlobalConfig->appendLogEntry(i18n("PCF import: using %1 for tunneling").arg("TCP"), GlobalConfig->debug);
+ GlobalConfig->appendLogEntry(i18n("PCF import: using %1 for tunneling").tqarg("TCP"), GlobalConfig->debug);
acc->setUseUdp( false);
}
/*
@@ -345,13 +345,13 @@ void ImportProfileDialog::canAccept()
if (enableNAT)
{
if (GlobalConfig->KvpncDebugLevel > 0)
- GlobalConfig->appendLogEntry(i18n("PCF import: enable NAT mode: %1").arg(i18n("yes")), GlobalConfig->debug);
+ GlobalConfig->appendLogEntry(i18n("PCF import: enable NAT mode: %1").tqarg(i18n("yes")), GlobalConfig->debug);
acc->setUseNat(true);
}
else
{
if (GlobalConfig->KvpncDebugLevel > 0)
- GlobalConfig->appendLogEntry(i18n("PCF import: enable NAT mode: %1").arg(i18n("no")), GlobalConfig->debug);
+ GlobalConfig->appendLogEntry(i18n("PCF import: enable NAT mode: %1").tqarg(i18n("no")), GlobalConfig->debug);
acc->setUseNat(false);
}
@@ -364,19 +364,19 @@ void ImportProfileDialog::canAccept()
// useUdpPort = true;
// }
- QString PerfectForwardSecrecy = ""; //QString("dh"+QString().setNum(DHGroup));
+ TQString PerfectForwardSecrecy = ""; //TQString("dh"+TQString().setNum(DHGroup));
// bool usePerfectForwardSecrety = false;
bool usePerfectSecrecy = false;
acc->setPerfectForwardSecrety( PerfectForwardSecrecy );
acc->setUsePerfectForwardSecrety( usePerfectSecrecy );
bool useIkeGroup = false;
- QString IkeGroup;
+ TQString IkeGroup;
int DHGroup = config.readNumEntry( "DHGroup", -1 );
if (DHGroup != -1 )
{
if (GlobalConfig->KvpncDebugLevel > 0)
- GlobalConfig->appendLogEntry(i18n("PCF import: Diffie Hellman group found: %1").arg(QString().setNum(DHGroup)), GlobalConfig->debug);
- IkeGroup = "dh" + QString().setNum( DHGroup ) ;
+ GlobalConfig->appendLogEntry(i18n("PCF import: Diffie Hellman group found: %1").tqarg(TQString().setNum(DHGroup)), GlobalConfig->debug);
+ IkeGroup = "dh" + TQString().setNum( DHGroup ) ;
useIkeGroup = true;
acc->setIkeGroup( IkeGroup );
}
@@ -385,43 +385,43 @@ void ImportProfileDialog::canAccept()
if (PeerTimeout > -1 )
{
if (GlobalConfig->KvpncDebugLevel > 0)
- GlobalConfig->appendLogEntry(i18n("PCF import: peer timeout found: %1").arg(QString().setNum(PeerTimeout)), GlobalConfig->debug);
+ GlobalConfig->appendLogEntry(i18n("PCF import: peer timeout found: %1").tqarg(TQString().setNum(PeerTimeout)), GlobalConfig->debug);
// read minutes but store seconds
acc->setPeerTimeout( PeerTimeout*60 );
}
- QString Username = config.readEntry( "Username" , "" );
+ TQString Username = config.readEntry( "Username" , "" );
if (!Username.isEmpty())
{
if (GlobalConfig->KvpncDebugLevel > 0)
- GlobalConfig->appendLogEntry(i18n("PCF import: user name found: %1").arg(Username), GlobalConfig->debug);
+ GlobalConfig->appendLogEntry(i18n("PCF import: user name found: %1").tqarg(Username), GlobalConfig->debug);
acc->setUserName( Username );
}
- QString UserPassword = config.readEntry( "UserPassword", "" );
+ TQString UserPassword = config.readEntry( "UserPassword", "" );
if (UserPassword.isEmpty())
UserPassword = config.readEntry( "!UserPassword", "" );
if (!UserPassword.isEmpty())
{
if (GlobalConfig->KvpncDebugLevel > 0)
- GlobalConfig->appendLogEntry(i18n("PCF import: clear text user password found: %1").arg(UserPassword), GlobalConfig->debug);
+ GlobalConfig->appendLogEntry(i18n("PCF import: clear text user password found: %1").tqarg(UserPassword), GlobalConfig->debug);
acc->setUserPassword( UserPassword );
}
- QString enc_UserPassword = config.readEntry( "enc_UserPassword", "" );
+ TQString enc_UserPassword = config.readEntry( "enc_UserPassword", "" );
if (enc_UserPassword.isEmpty())
enc_UserPassword = config.readEntry( "!enc_UserPassword", "" );
if (!enc_UserPassword.isEmpty())
{
if (GlobalConfig->KvpncDebugLevel > 0)
- GlobalConfig->appendLogEntry(i18n("PCF import: encrypted user password found: %1").arg(enc_UserPassword), GlobalConfig->debug);
+ GlobalConfig->appendLogEntry(i18n("PCF import: encrypted user password found: %1").tqarg(enc_UserPassword), GlobalConfig->debug);
}
CiscoPasswdDecoder dec (filename);
- QString userpasswd="";
- QString grouppasswd="";
+ TQString userpasswd="";
+ TQString grouppasswd="";
dec.decodePasswords(userpasswd,grouppasswd);
// std::cout << "decoded userpasswd: " << userpasswd << std::endl;
@@ -438,30 +438,30 @@ void ImportProfileDialog::canAccept()
if (!userpasswd.isEmpty())
{
if (GlobalConfig->KvpncDebugLevel > 3)
- GlobalConfig->appendLogEntry(i18n("PCF import: decrypted user password found: %1").arg(userpasswd), GlobalConfig->debug);
+ GlobalConfig->appendLogEntry(i18n("PCF import: decrypted user password found: %1").tqarg(userpasswd), GlobalConfig->debug);
acc->setUserPassword( userpasswd );
}
if (GlobalConfig->KvpncDebugLevel > 0)
if (saveUserPassword)
- GlobalConfig->appendLogEntry(i18n("PCF import: save user pass : %1").arg(i18n("yes")), GlobalConfig->debug);
+ GlobalConfig->appendLogEntry(i18n("PCF import: save user pass : %1").tqarg(i18n("yes")), GlobalConfig->debug);
else
- GlobalConfig->appendLogEntry(i18n("PCF import: save user pass : %1").arg(i18n("no")), GlobalConfig->debug);
+ GlobalConfig->appendLogEntry(i18n("PCF import: save user pass : %1").tqarg(i18n("no")), GlobalConfig->debug);
acc->setSaveUserPassword( saveUserPassword );
bool saveGroupPwd = true;
- QString GroupPwd = config.readEntry( "GroupPwd" , "" );
+ TQString GroupPwd = config.readEntry( "GroupPwd" , "" );
if (GroupPwd.isEmpty())
GroupPwd = config.readEntry( "!GroupPwd", "" );
if (!GroupPwd.isEmpty())
{
if (GlobalConfig->KvpncDebugLevel > 3)
- GlobalConfig->appendLogEntry(i18n("PCF import: clear text group password found: %1").arg(GroupPwd), GlobalConfig->debug);
+ GlobalConfig->appendLogEntry(i18n("PCF import: clear text group password found: %1").tqarg(GroupPwd), GlobalConfig->debug);
acc->setPreSharedKey( GroupPwd );
}
- QString enc_GroupPwd = config.readEntry( "enc_GroupPwd", "" );
+ TQString enc_GroupPwd = config.readEntry( "enc_GroupPwd", "" );
if (enc_GroupPwd.isEmpty())
enc_GroupPwd = config.readEntry( "!enc_GroupPwd", "" );
@@ -469,7 +469,7 @@ void ImportProfileDialog::canAccept()
if (!grouppasswd.isEmpty())
{
if (GlobalConfig->KvpncDebugLevel > 3)
- GlobalConfig->appendLogEntry(i18n("PCF import: decrypted group password found: %1").arg(grouppasswd), GlobalConfig->debug);
+ GlobalConfig->appendLogEntry(i18n("PCF import: decrypted group password found: %1").tqarg(grouppasswd), GlobalConfig->debug);
acc->setPreSharedKey( grouppasswd );
}
@@ -479,7 +479,7 @@ void ImportProfileDialog::canAccept()
if ( Description.isEmpty() )
{
- Description = ( QUrl( filename ).fileName() );
+ Description = ( TQUrl( filename ).fileName() );
Description = Utils(this->GlobalConfig).removeSpecialCharsForFilename( Description.left( filename.section('/',-1).length() - 4 ));
}
@@ -502,13 +502,13 @@ void ImportProfileDialog::canAccept()
if (GlobalConfig->KvpncDebugLevel > 0)
if (AuthType ==1)
- GlobalConfig->appendLogEntry(i18n("PCF import: authentication type found: %1").arg(i18n("PSK")), GlobalConfig->debug);
+ GlobalConfig->appendLogEntry(i18n("PCF import: authentication type found: %1").tqarg(i18n("PSK")), GlobalConfig->debug);
else if (AuthType ==3)
- GlobalConfig->appendLogEntry(i18n("PCF import: authentication type found: %1").arg(i18n("certificate")), GlobalConfig->debug);
+ GlobalConfig->appendLogEntry(i18n("PCF import: authentication type found: %1").tqarg(i18n("certificate")), GlobalConfig->debug);
else if (AuthType ==5)
- GlobalConfig->appendLogEntry(i18n("PCF import: authentication type found: %1").arg(i18n("hybrid")), GlobalConfig->debug);
+ GlobalConfig->appendLogEntry(i18n("PCF import: authentication type found: %1").tqarg(i18n("hybrid")), GlobalConfig->debug);
else
- GlobalConfig->appendLogEntry(i18n("PCF import: no authentication type found, assuming %1").arg(i18n("PSK")), GlobalConfig->debug);
+ GlobalConfig->appendLogEntry(i18n("PCF import: no authentication type found, assuming %1").tqarg(i18n("PSK")), GlobalConfig->debug);
if (AuthType == 3 || AuthType == 5)
{
@@ -580,10 +580,10 @@ void ImportProfileDialog::canAccept()
acc.setUserPassword( UserPassword );
acc.setSaveUserPassword( saveUserPassword );
acc.setSaveGroupPassword( true );
- //acc.setIkeGroup( QString IkeGroup );
- acc.setPerfectForwardSecrety( QString PerfectForwardSecrecy );
- acc.setNtDomainName( QString Name );
- acc.setApplicationVersion( QString version );
+ //acc.setIkeGroup( TQString IkeGroup );
+ acc.setPerfectForwardSecrety( TQString PerfectForwardSecrecy );
+ acc.setNtDomainName( TQString Name );
+ acc.setApplicationVersion( TQString version );
acc.setUseSingleDes( bool useSingleDes );
acc.setLocalPort( int port );
acc.setUseIkeGroup( bool useIkeGroup);
@@ -596,6 +596,6 @@ void ImportProfileDialog::canAccept()
*/
importOk = true;
//std::cout << "accept" << std::endl;
- QDialog::accept();
+ TQDialog::accept();
}