summaryrefslogtreecommitdiffstats
path: root/src/importopenvpnprofiledialog.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-12-06 14:15:01 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-12-06 14:15:01 -0600
commit1b89319fd93b88313cab40f1e9de24c067b04efb (patch)
tree80132996de993c3dcab4040864d7729842875b2d /src/importopenvpnprofiledialog.cpp
parentd08a0ede1d2cb15bb14b0ff75eacf5c682b1fa0a (diff)
downloadkvpnc-1b89319fd93b88313cab40f1e9de24c067b04efb.tar.gz
kvpnc-1b89319fd93b88313cab40f1e9de24c067b04efb.zip
Initial TQt conversion
Diffstat (limited to 'src/importopenvpnprofiledialog.cpp')
-rw-r--r--src/importopenvpnprofiledialog.cpp256
1 files changed, 128 insertions, 128 deletions
diff --git a/src/importopenvpnprofiledialog.cpp b/src/importopenvpnprofiledialog.cpp
index 1a4877e..61ed32e 100644
--- a/src/importopenvpnprofiledialog.cpp
+++ b/src/importopenvpnprofiledialog.cpp
@@ -33,13 +33,13 @@
#include <klineedit.h>
#include <kpassdlg.h>
#include <kstandarddirs.h>
-#include <qfile.h>
-#include <qurl.h>
+#include <tqfile.h>
+#include <tqurl.h>
#include <kurl.h>
-#include <qtextstream.h>
-#include <qcheckbox.h>
+#include <tqtextstream.h>
+#include <tqcheckbox.h>
#include <string>
-#include <qprocess.h>
+#include <tqprocess.h>
#include <iostream>
@@ -48,7 +48,7 @@
#include "importcertificatedialog.h"
//END INCLUDES
-ImportOpenvpnProfileDialog::ImportOpenvpnProfileDialog ( KVpncConfig *config, QWidget *parent, const QString& caption, QString file )
+ImportOpenvpnProfileDialog::ImportOpenvpnProfileDialog ( KVpncConfig *config, TQWidget *parent, const TQString& caption, TQString file )
: KDialogBase ( parent, "Import_Cisco_OpenVPN_profile", true, caption,
KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, true )
{
@@ -63,7 +63,7 @@ ImportOpenvpnProfileDialog::ImportOpenvpnProfileDialog ( KVpncConfig *config, QW
main = new ImportOpenvpnProfileDialogBase ( this );
setMainWidget ( main );
- //main->setMinimumSize(main->sizeHint());
+ //main->setMinimumSize(main->tqsizeHint());
main->FilenameUrlrequester->setFilter ( "*.ovpn *.conf" );
@@ -98,7 +98,7 @@ void ImportOpenvpnProfileDialog::accept()
void ImportOpenvpnProfileDialog::canAccept()
{
- QFile f ( filename );
+ TQFile f ( filename );
if ( !f.exists() )
{
KMessageBox::sorry ( 0, i18n ( "File not found." ), i18n ( "No File" ) );
@@ -223,21 +223,21 @@ void ImportOpenvpnProfileDialog::canAccept()
*/
//END Sample
- QFile OpenvpnConfigFile ( filename );
- QTextStream stream ( &OpenvpnConfigFile );
+ TQFile OpenvpnConfigFile ( filename );
+ TQTextStream stream ( &OpenvpnConfigFile );
- QString importprefix = QFileInfo ( filename ).dirPath();
+ TQString importprefix = TQFileInfo ( filename ).dirPath();
if ( config->KvpncDebugLevel > 2 )
config->appendLogEntry ( i18n ( "OpenVPN import: import prefix: %1" ).arg ( importprefix ), config->debug );
- QString certprefix = locateLocal ( "data", "kvpnc" );
+ TQString certprefix = locateLocal ( "data", "kvpnc" );
if ( OpenvpnConfigFile.open ( IO_ReadOnly ) )
{
VpnAccountData::ConnectionType ConnType = VpnAccountData::openvpn;
acc = new VpnAccountData ( ConnType, "" );
- QString profilename = Utils ( config ).removeSpecialCharsForFilename ( filename.section ( '/', -1, -1 ) ).section ( '.', -2, -2 );
+ TQString profilename = Utils ( config ).removeSpecialCharsForFilename ( filename.section ( '/', -1, -1 ) ).section ( '.', -2, -2 );
acc->setName ( profilename ); // /home/user/openvpn/CompanyABC.conf -> CompanyABC
acc->setDescription ( i18n ( "Imported from %1" ).arg ( Utils ( config ).removeSpecialCharsForFilename ( filename.section ( '/', -1, -1 ) ) ) );
acc->setLocalPort ( 1194 );
@@ -252,20 +252,20 @@ void ImportOpenvpnProfileDialog::canAccept()
// acc->setDoReconnectAfterConnectionLost( false );
// inline cert settings
- QString CaCert="";
- QString Cert="";
- QString PrivateKey="";
- QString StaticKey="";
+ TQString CaCert="";
+ TQString Cert="";
+ TQString PrivateKey="";
+ TQString StaticKey="";
bool CaCertStartFound=false;
bool CertStartFound=false;
bool PrivateKeyStartFound=false;
bool StaticKeyStartFound=false;
bool TlsAuthStartFound=false;
- QString line = "";
+ TQString line = "";
while ( !stream.atEnd() )
{
- QString line_raw = stream.readLine();
+ TQString line_raw = stream.readLine();
line = line_raw.simplifyWhiteSpace(); // line of text excluding '\n' and replace all white chars with one blank
/* look for inline parts */
@@ -276,14 +276,14 @@ void ImportOpenvpnProfileDialog::canAccept()
if ( config->KvpncDebugLevel > 4 )
config->appendLogEntry ( i18n ( "OpenVPN import: inlince ca end found." ), config->debug );
- QString CaFilePath = certprefix+"/"+"openvpn_ca_"+profilename+".pem";
+ TQString CaFilePath = certprefix+"/"+"openvpn_ca_"+profilename+".pem";
if ( config->KvpncDebugLevel > 2 )
config->appendLogEntry ( i18n ( "OpenVPN import: ca file: %1" ).arg ( CaFilePath ), config->debug );
- QFile CaFileHandle (CaFilePath);
+ TQFile CaFileHandle (CaFilePath);
if( CaFileHandle.open(IO_WriteOnly))
{
- QTextStream ExportStream ( &CaFileHandle );
+ TQTextStream ExportStream ( &CaFileHandle );
ExportStream << CaCert;
CaFileHandle.close();
acc->setCaCertificate ( CaFilePath );
@@ -310,17 +310,17 @@ void ImportOpenvpnProfileDialog::canAccept()
if ( config->KvpncDebugLevel > 4 )
config->appendLogEntry ( i18n ( "OpenVPN import: inlince cert end found." ), config->debug );
- QString CertFilePath = certprefix+"/"+"openvpn_cert_"+profilename+".pem";
+ TQString CertFilePath = certprefix+"/"+"openvpn_cert_"+profilename+".pem";
if ( config->KvpncDebugLevel > 2 )
config->appendLogEntry ( i18n ( "OpenVPN import: cert file: %1" ).arg ( CertFilePath ), config->debug );
acc->setAuthType ( VpnAccountData::cert );
acc->setCertPath (certprefix);
- QFile CertFileHandle (CertFilePath);
+ TQFile CertFileHandle (CertFilePath);
if( CertFileHandle.open(IO_WriteOnly))
{
- QTextStream ExportStream ( &CertFileHandle );
+ TQTextStream ExportStream ( &CertFileHandle );
ExportStream << Cert;
CertFileHandle.close();
acc->setX509Certificate ( CertFilePath );
@@ -347,14 +347,14 @@ void ImportOpenvpnProfileDialog::canAccept()
if ( config->KvpncDebugLevel > 4 )
config->appendLogEntry ( i18n ( "OpenVPN import: inlince private key end found." ), config->debug );
- QString PrivateKeyFilePath = certprefix+"/"+"openvpn_privatekey_"+profilename+".pem";
+ TQString PrivateKeyFilePath = certprefix+"/"+"openvpn_privatekey_"+profilename+".pem";
if ( config->KvpncDebugLevel > 2 )
config->appendLogEntry ( i18n ( "OpenVPN import: private key file: %1" ).arg ( PrivateKeyFilePath ), config->debug );
- QFile PrivateKeyFileHandle (PrivateKeyFilePath);
+ TQFile PrivateKeyFileHandle (PrivateKeyFilePath);
if( PrivateKeyFileHandle.open(IO_WriteOnly))
{
- QTextStream ExportStream ( &PrivateKeyFileHandle );
+ TQTextStream ExportStream ( &PrivateKeyFileHandle );
ExportStream << PrivateKey << "\n";
PrivateKeyFileHandle.close();
acc->setPrivateKey ( PrivateKeyFilePath );
@@ -381,14 +381,14 @@ void ImportOpenvpnProfileDialog::canAccept()
if ( config->KvpncDebugLevel > 4 )
config->appendLogEntry ( i18n ( "OpenVPN import: inlince tls-auth end found." ), config->debug );
- QString StaticKeyFilePath = certprefix+"/"+"openvpn_tlsauth_"+profilename+".pem";
+ TQString StaticKeyFilePath = certprefix+"/"+"openvpn_tlsauth_"+profilename+".pem";
if ( config->KvpncDebugLevel > 2 )
config->appendLogEntry ( i18n ( "OpenVPN import: TLS auth file: %1" ).arg ( StaticKeyFilePath ), config->debug );
- QFile StaticKeyFileHandle (StaticKeyFilePath);
+ TQFile StaticKeyFileHandle (StaticKeyFilePath);
if( StaticKeyFileHandle.open(IO_WriteOnly))
{
- QTextStream ExportStream ( &StaticKeyFileHandle );
+ TQTextStream ExportStream ( &StaticKeyFileHandle );
ExportStream << StaticKey << "\n";
StaticKeyFileHandle.close();
acc->setTlsAuthFile ( StaticKeyFilePath );
@@ -441,7 +441,7 @@ void ImportOpenvpnProfileDialog::canAccept()
}
else if ( line.startsWith ( "dev " ) )
{
- QString Type = line.section ( ' ', 1, 1 ); // tun or tap
+ TQString Type = line.section ( ' ', 1, 1 ); // tun or tap
if ( Type == "tun" || Type == "tap" )
{
acc->setTunnelDeviceType ( Type );
@@ -454,16 +454,16 @@ void ImportOpenvpnProfileDialog::canAccept()
// FIXME no fully supported yet!!!
// FIXME made it possible to remember what type have to been set!
- QString gateway_type = "";
+ TQString gateway_type = "";
bool useGateway;
acc->setUseAdditionalNetworkRoutes ( true );
- QStringList AdditionalNetworkRoutes;
+ TQStringList AdditionalNetworkRoutes;
// example entry:
// <network>/<netmask>#<gateway>
- QString network = line.section ( ' ', 1, 1 ) + "/" + line.section ( ' ', 2, 2 ); // ip and netmask
+ TQString network = line.section ( ' ', 1, 1 ) + "/" + line.section ( ' ', 2, 2 ); // ip and netmask
- QString Part3 = line.section ( ' ', 3, 3 ); // possible gateway
+ TQString Part3 = line.section ( ' ', 3, 3 ); // possible gateway
if ( Part3 != "vpn_gateway" && Part3 != "net_gateway" && Part3 != "remote_host" )
{
network.append ( "#" );
@@ -501,27 +501,27 @@ void ImportOpenvpnProfileDialog::canAccept()
else if ( line.startsWith ( "cert " ) )
{
acc->setAuthType ( VpnAccountData::cert );
- QString cert = line.section ( ' ', 1 ).stripWhiteSpace();
+ TQString cert = line.section ( ' ', 1 ).stripWhiteSpace();
if ( config->KvpncDebugLevel > 2 )
config->appendLogEntry ( i18n ( "OpenVPN import: cert file: %1" ).arg ( importprefix+"/"+cert ), config->debug );
- if ( QFile ( QString ( importprefix+"/"+cert ) ).exists() )
+ if ( TQFile ( TQString ( importprefix+"/"+cert ) ).exists() )
{
// copy to ~/.kde/share/apps/kvpnc/ and rename it
if ( config->KvpncDebugLevel > 0 )
- config->appendLogEntry ( i18n ( "OpenVPN import: copy %1 to %2" ).arg ( QString ( importprefix+"/"+cert ) ).arg ( QString ( certprefix+"/"+"openvpn_cert_"+profilename+"_"+cert ) ), config->debug );
- QProcess CopyProcess ( this );
+ config->appendLogEntry ( i18n ( "OpenVPN import: copy %1 to %2" ).arg ( TQString ( importprefix+"/"+cert ) ).arg ( TQString ( certprefix+"/"+"openvpn_cert_"+profilename+"_"+cert ) ), config->debug );
+ TQProcess CopyProcess ( this );
CopyProcess.addArgument ( "cp" );
- CopyProcess.addArgument ( QString ( importprefix+"/"+cert ) );
- CopyProcess.addArgument ( QString ( certprefix+"/"+"openvpn_cert_"+profilename+"_"+cert ) );
+ CopyProcess.addArgument ( TQString ( importprefix+"/"+cert ) );
+ CopyProcess.addArgument ( TQString ( certprefix+"/"+"openvpn_cert_"+profilename+"_"+cert ) );
if ( CopyProcess.start() )
{
while (CopyProcess.isRunning())
{
sleep(1);
}
- acc->setX509Certificate ( QString ( certprefix+"/"+"openvpn_cert_"+profilename+"_"+cert ) );
+ acc->setX509Certificate ( TQString ( certprefix+"/"+"openvpn_cert_"+profilename+"_"+cert ) );
}
else
{
@@ -541,27 +541,27 @@ void ImportOpenvpnProfileDialog::canAccept()
else if ( line.startsWith ( "key " ) )
{
- QString privatekey = line.section ( ' ', 1 ).stripWhiteSpace();
+ TQString privatekey = line.section ( ' ', 1 ).stripWhiteSpace();
if ( config->KvpncDebugLevel > 2 )
config->appendLogEntry ( i18n ( "OpenVPN import: private key file for certificate: %1" ).arg ( importprefix+"/"+privatekey ), config->debug );
- if ( QFile ( QString ( importprefix+"/"+privatekey ) ).exists() )
+ if ( TQFile ( TQString ( importprefix+"/"+privatekey ) ).exists() )
{
// copy to ~/.kde/share/apps/kvpnc/ and rename it
if ( config->KvpncDebugLevel > 0 )
- config->appendLogEntry ( i18n ( "OpenVPN import: copy %1 to %2" ).arg ( QString ( importprefix+"/"+privatekey ) ).arg ( QString ( certprefix+"/"+"openvpn_privatekey_"+profilename+"_"+privatekey ) ), config->debug );
- QProcess CopyProcess ( this );
+ config->appendLogEntry ( i18n ( "OpenVPN import: copy %1 to %2" ).arg ( TQString ( importprefix+"/"+privatekey ) ).arg ( TQString ( certprefix+"/"+"openvpn_privatekey_"+profilename+"_"+privatekey ) ), config->debug );
+ TQProcess CopyProcess ( this );
CopyProcess.addArgument ( "cp" );
- CopyProcess.addArgument ( QString ( importprefix+"/"+privatekey ) );
- CopyProcess.addArgument ( QString ( certprefix+"/"+"openvpn_privatekey_"+profilename+"_"+privatekey ) );
+ CopyProcess.addArgument ( TQString ( importprefix+"/"+privatekey ) );
+ CopyProcess.addArgument ( TQString ( certprefix+"/"+"openvpn_privatekey_"+profilename+"_"+privatekey ) );
if ( CopyProcess.start() )
{
while (CopyProcess.isRunning())
{
sleep(1);
}
- acc->setPrivateKey ( QString ( certprefix+"/"+"openvpn_privatekey_"+profilename+"_"+privatekey ) );
+ acc->setPrivateKey ( TQString ( certprefix+"/"+"openvpn_privatekey_"+profilename+"_"+privatekey ) );
}
else
{
@@ -582,27 +582,27 @@ void ImportOpenvpnProfileDialog::canAccept()
{
acc->setAuthType ( VpnAccountData::psk );
- QString privatekey = line.section ( ' ', 1 ).stripWhiteSpace();
+ TQString privatekey = line.section ( ' ', 1 ).stripWhiteSpace();
if ( config->KvpncDebugLevel > 2 )
config->appendLogEntry ( i18n ( "OpenVPN import: private key file: %1" ).arg ( importprefix+"/"+privatekey ), config->debug );
- if ( QFile ( QString ( importprefix+"/"+privatekey ) ).exists() )
+ if ( TQFile ( TQString ( importprefix+"/"+privatekey ) ).exists() )
{
// copy to ~/.kde/share/apps/kvpnc/ and rename it
if ( config->KvpncDebugLevel > 0 )
- config->appendLogEntry ( i18n ( "OpenVPN import: copy %1 to %2" ).arg ( QString ( importprefix+"/"+privatekey ) ).arg ( QString ( certprefix+"/"+"openvpn_privatekey_"+profilename+"_"+privatekey ) ), config->debug );
- QProcess CopyProcess ( this );
+ config->appendLogEntry ( i18n ( "OpenVPN import: copy %1 to %2" ).arg ( TQString ( importprefix+"/"+privatekey ) ).arg ( TQString ( certprefix+"/"+"openvpn_privatekey_"+profilename+"_"+privatekey ) ), config->debug );
+ TQProcess CopyProcess ( this );
CopyProcess.addArgument ( "cp" );
- CopyProcess.addArgument ( QString ( importprefix+"/"+privatekey ) );
- CopyProcess.addArgument ( QString ( certprefix+"/"+"openvpn_privatekey_"+profilename+"_"+privatekey ) );
+ CopyProcess.addArgument ( TQString ( importprefix+"/"+privatekey ) );
+ CopyProcess.addArgument ( TQString ( certprefix+"/"+"openvpn_privatekey_"+profilename+"_"+privatekey ) );
if ( CopyProcess.start() )
{
while (CopyProcess.isRunning())
{
sleep(1);
}
- acc->setPreSharedKeyFile ( QString ( certprefix+"/"+"openvpn_privatekey_"+profilename+"_"+privatekey ) );
+ acc->setPreSharedKeyFile ( TQString ( certprefix+"/"+"openvpn_privatekey_"+profilename+"_"+privatekey ) );
acc->setSavePsk ( false );
}
else
@@ -624,27 +624,27 @@ void ImportOpenvpnProfileDialog::canAccept()
{
acc->setAuthType ( VpnAccountData::cert );
- QString ca = line.section ( ' ', 1 );
+ TQString ca = line.section ( ' ', 1 );
if ( config->KvpncDebugLevel > 2 )
config->appendLogEntry ( i18n ( "OpenVPN import: ca file: %1" ).arg ( importprefix+"/"+ca ), config->debug );
- if ( QFile ( QString ( importprefix+"/"+ca ) ).exists() )
+ if ( TQFile ( TQString ( importprefix+"/"+ca ) ).exists() )
{
// copy to ~/.kde/share/apps/kvpnc/ and rename it
if ( config->KvpncDebugLevel > 0 )
- config->appendLogEntry ( i18n ( "OpenVPN import: copy %1 to %2" ).arg ( QString ( importprefix+"/"+ca ) ).arg ( QString ( certprefix+"/"+"openvpn_privatekey_"+profilename+"_"+ca ) ), config->debug );
- QProcess CopyProcess ( this );
+ config->appendLogEntry ( i18n ( "OpenVPN import: copy %1 to %2" ).arg ( TQString ( importprefix+"/"+ca ) ).arg ( TQString ( certprefix+"/"+"openvpn_privatekey_"+profilename+"_"+ca ) ), config->debug );
+ TQProcess CopyProcess ( this );
CopyProcess.addArgument ( "cp" );
- CopyProcess.addArgument ( QString ( importprefix+"/"+ca ) );
- CopyProcess.addArgument ( QString ( certprefix+"/"+"openvpn_privatekey_"+profilename+"_"+ca ) );
+ CopyProcess.addArgument ( TQString ( importprefix+"/"+ca ) );
+ CopyProcess.addArgument ( TQString ( certprefix+"/"+"openvpn_privatekey_"+profilename+"_"+ca ) );
if ( CopyProcess.start() )
{
while (CopyProcess.isRunning())
{
sleep(1);
}
- acc->setCaCertificate ( QString ( certprefix+"/"+"openvpn_privatekey_"+profilename+"_"+ca ) );
+ acc->setCaCertificate ( TQString ( certprefix+"/"+"openvpn_privatekey_"+profilename+"_"+ca ) );
}
else
{
@@ -716,8 +716,8 @@ void ImportOpenvpnProfileDialog::canAccept()
{
acc->setUseTlsAuth ( true );
- QString tlsauth = line.section ( ' ', 1,1 );
- QString tlsauthdirection = line.section ( ' ', 2,2 );
+ TQString tlsauth = line.section ( ' ', 1,1 );
+ TQString tlsauthdirection = line.section ( ' ', 2,2 );
if ( config->KvpncDebugLevel > 2 )
{
@@ -725,22 +725,22 @@ void ImportOpenvpnProfileDialog::canAccept()
config->appendLogEntry ( i18n ( "OpenVPN import: TLS auth direction: %1" ).arg ( tlsauthdirection ), config->debug );
}
- if ( QFile ( QString ( importprefix+"/"+tlsauth ) ).exists() )
+ if ( TQFile ( TQString ( importprefix+"/"+tlsauth ) ).exists() )
{
// copy to ~/.kde/share/apps/kvpnc/ and rename it
if ( config->KvpncDebugLevel > 0 )
- config->appendLogEntry ( i18n ( "OpenVPN import: copy %1 to %2" ).arg ( QString ( importprefix+"/"+tlsauth ) ).arg ( QString ( certprefix+"/"+"openvpn_privatekey_"+profilename+"_"+tlsauth ) ), config->debug );
- QProcess CopyProcess ( this );
+ config->appendLogEntry ( i18n ( "OpenVPN import: copy %1 to %2" ).arg ( TQString ( importprefix+"/"+tlsauth ) ).arg ( TQString ( certprefix+"/"+"openvpn_privatekey_"+profilename+"_"+tlsauth ) ), config->debug );
+ TQProcess CopyProcess ( this );
CopyProcess.addArgument ( "cp" );
- CopyProcess.addArgument ( QString ( importprefix+"/"+tlsauth ) );
- CopyProcess.addArgument ( QString ( certprefix+"/"+"openvpn_tlsauth_"+profilename+"_"+tlsauth ) );
+ CopyProcess.addArgument ( TQString ( importprefix+"/"+tlsauth ) );
+ CopyProcess.addArgument ( TQString ( certprefix+"/"+"openvpn_tlsauth_"+profilename+"_"+tlsauth ) );
if ( CopyProcess.start() )
{
while (CopyProcess.isRunning())
{
sleep(1);
}
- acc->setTlsAuthFile ( QString ( certprefix+"/"+"openvpn_tlsauth_"+profilename+"_"+tlsauth ) );
+ acc->setTlsAuthFile ( TQString ( certprefix+"/"+"openvpn_tlsauth_"+profilename+"_"+tlsauth ) );
}
else
{
@@ -761,7 +761,7 @@ void ImportOpenvpnProfileDialog::canAccept()
{
acc->setAuthenticationDirection(tlsauthdirection);
if ( config->KvpncDebugLevel > 0 )
- config->appendLogEntry ( i18n ( "OpenVPN import: use TLS auth direction: %1" ).arg(tlsauthdirection), config->debug );
+ config->appendLogEntry ( i18n ( "OpenVPN import: use TLS auth direction: %1" ).tqarg(tlsauthdirection), config->debug );
}
}
else if ( line.startsWith ( "redirect-gateway" ) )
@@ -799,14 +799,14 @@ void ImportOpenvpnProfileDialog::canAccept()
acc->setHttpProxy ( line.section ( ' ', 1, 1 ) );
acc->setHttpProxyPort ( line.section ( ' ', 2, 2 ).toInt() );
if ( config->KvpncDebugLevel > 0 )
- config->appendLogEntry ( i18n ( "OpenVPN import: use HTTP proxy: %1, Port: %2" ).arg ( acc->getHttpProxy() ).arg ( QString().setNum ( acc->getHttpProxyPort() ) ), config->debug );
+ config->appendLogEntry ( i18n ( "OpenVPN import: use HTTP proxy: %1, Port: %2" ).arg ( acc->getHttpProxy() ).arg ( TQString().setNum ( acc->getHttpProxyPort() ) ), config->debug );
}
else if ( line.startsWith ( "http-proxy-timeout " ) )
{
acc->setUseHttpProxy ( true );
acc->setHttpProxyTimeout ( line.section ( ' ', 1, 1 ).toInt() );
if ( config->KvpncDebugLevel > 0 )
- config->appendLogEntry ( i18n ( "OpenVPN import: use NS certificate type: %1" ).arg ( QString().setNum ( acc->getHttpProxyTimeout() ) ), config->debug );
+ config->appendLogEntry ( i18n ( "OpenVPN import: use NS certificate type: %1" ).arg ( TQString().setNum ( acc->getHttpProxyTimeout() ) ), config->debug );
}
else if ( line.startsWith ( "pkcs12 " ) )
{
@@ -853,8 +853,8 @@ void ImportOpenvpnProfileDialog::canAccept()
else if ( line.startsWith ( "ifconfig " ) )
{
acc->setUseVirtualIP ( true );
- QString VirtualIpLocal = line.section ( ' ', 1, 1 );
- QString VirtualIpRemote = line.section ( ' ', 2, 2 );
+ TQString VirtualIpLocal = line.section ( ' ', 1, 1 );
+ TQString VirtualIpRemote = line.section ( ' ', 2, 2 );
acc->setLocalVirtualIP ( VirtualIpLocal );
acc->setRemoteVirtualIP ( VirtualIpRemote );
if ( config->KvpncDebugLevel > 0 )
@@ -882,16 +882,16 @@ void ImportOpenvpnProfileDialog::canAccept()
else if ( line.startsWith ( "fragment " ) )
{
acc->setUseFragment( true );
- int Fragment = QString(line.section ( ' ', 1, 1 )).toInt();
+ int Fragment = TQString(line.section ( ' ', 1, 1 )).toInt();
acc->setFragment( Fragment );
if ( config->KvpncDebugLevel > 0 )
- config->appendLogEntry ( i18n ( "OpenVPN import: use fragmention, size: %1" ).arg ( QString().setNum(Fragment) ), config->debug );
+ config->appendLogEntry ( i18n ( "OpenVPN import: use fragmention, size: %1" ).arg ( TQString().setNum(Fragment) ), config->debug );
}
else if ( line.startsWith ( "inactive " ) )
{
// acc->setUseVirtualIP ( true );
-// QString VirtualIpLocal = line.section ( ' ', 1, 1 );
-// QString VirtualIpRemote = line.section ( ' ', 2, 2 );
+// TQString VirtualIpLocal = line.section ( ' ', 1, 1 );
+// TQString VirtualIpRemote = line.section ( ' ', 2, 2 );
// acc->setLocalVirtualIP ( VirtualIpLocal );
// acc->setRemoteVirtualIP ( VirtualIpRemote );
// if ( config->KvpncDebugLevel > 0 )
@@ -900,10 +900,10 @@ void ImportOpenvpnProfileDialog::canAccept()
else if ( line.startsWith ( "mssfix" ) )
{
acc->setUseMssfix ( true );
- int Mssfix = QString(line.section ( ' ', 1, 1 )).toInt();
+ int Mssfix = TQString(line.section ( ' ', 1, 1 )).toInt();
acc->setMssfix( Mssfix );
if ( config->KvpncDebugLevel > 0 )
- config->appendLogEntry ( i18n ( "OpenVPN import: use Mssfix, size: %1" ).arg ( QString().setNum(Mssfix )), config->debug );
+ config->appendLogEntry ( i18n ( "OpenVPN import: use Mssfix, size: %1" ).arg ( TQString().setNum(Mssfix )), config->debug );
}
else if ( line.startsWith ( "nobind" ) )
{
@@ -915,34 +915,34 @@ void ImportOpenvpnProfileDialog::canAccept()
else if ( line.startsWith ( "ping " ) )
{
acc->setUseTunnelPing( true );
- int TunnelPing = QString(line.section ( ' ', 1, 1 )).toInt();
+ int TunnelPing = TQString(line.section ( ' ', 1, 1 )).toInt();
acc->setTunnelPing ( TunnelPing);
if ( config->KvpncDebugLevel > 0 )
- config->appendLogEntry ( i18n ( "OpenVPN import: use ping through tunnel every: %1" ).arg ( QString().setNum(TunnelPing) ), config->debug );
+ config->appendLogEntry ( i18n ( "OpenVPN import: use ping through tunnel every: %1" ).arg ( TQString().setNum(TunnelPing) ), config->debug );
}
else if ( line.startsWith ( "ping-restart " ) )
{
acc->setUseTunnelPingRestart( true );
- int TunnelPingRestart = QString(line.section ( ' ', 1, 1 )).toInt();
+ int TunnelPingRestart = TQString(line.section ( ' ', 1, 1 )).toInt();
acc->setTunnelPingRestart ( TunnelPingRestart );
if ( config->KvpncDebugLevel > 0 )
- config->appendLogEntry ( i18n ( "OpenVPN import: restart ping through tunnel fails after: %1" ).arg ( QString().setNum(TunnelPingRestart) ), config->debug );
+ config->appendLogEntry ( i18n ( "OpenVPN import: restart ping through tunnel fails after: %1" ).arg ( TQString().setNum(TunnelPingRestart) ), config->debug );
}
else if ( line.startsWith ( "reneg-sec " ) )
{
acc->setUseRenegSec ( true );
- int RenegSec =QString(line.section ( ' ', 1, 1 )).toInt();
+ int RenegSec =TQString(line.section ( ' ', 1, 1 )).toInt();
acc->setRenegSec ( RenegSec );
if ( config->KvpncDebugLevel > 0 )
- config->appendLogEntry ( i18n ( "OpenVPN import: use reneg-sec: %1" ).arg ( QString().setNum(RenegSec) ), config->debug );
+ config->appendLogEntry ( i18n ( "OpenVPN import: use reneg-sec: %1" ).arg ( TQString().setNum(RenegSec) ), config->debug );
}
else if ( line.startsWith ( "tun-mtu " ) )
{
acc->setUseMtu ( true );
- int Mtu = QString(line.section ( ' ', 1, 1 )).toInt();
+ int Mtu = TQString(line.section ( ' ', 1, 1 )).toInt();
acc->setMtu ( Mtu );
if ( config->KvpncDebugLevel > 0 )
- config->appendLogEntry ( i18n ( "OpenVPN import: use usedefinied MTU: %1" ).arg ( QString().setNum(Mtu) ), config->debug );
+ config->appendLogEntry ( i18n ( "OpenVPN import: use usedefinied MTU: %1" ).arg ( TQString().setNum(Mtu) ), config->debug );
}
}
}
@@ -954,108 +954,108 @@ void ImportOpenvpnProfileDialog::canAccept()
// }
// // /* we need to put the prefix to all cert paths */
// if ( !acc->getCaCertificate().isEmpty() && !acc->getCaCertificate().startsWith( CertPath ) ) {
-// QString prefix = "./";
+// TQString prefix = "./";
// if ( !filename.find( '/' ) > -1 )
-// prefix = QString( Utils(this->GlobalConfig).removeSpecialCharsForFilename( filename).section( '/', 0, -2 ) + "/" );
+// prefix = TQString( Utils(this->GlobalConfig).removeSpecialCharsForFilename( filename).section( '/', 0, -2 ) + "/" );
//
-// QFile CaCertFileSrc ( prefix + acc->getCaCertificate() );
-// QFile CaCertFileDst ( QString( CertPath + "/openvpnimport_" + acc->getCaCertificate() ) );
-// acc->setCaCertificate( QString( CertPath + "/openvpnimport_" + acc->getCaCertificate() ) );
+// TQFile CaCertFileSrc ( prefix + acc->getCaCertificate() );
+// TQFile CaCertFileDst ( TQString( CertPath + "/openvpnimport_" + acc->getCaCertificate() ) );
+// acc->setCaCertificate( TQString( CertPath + "/openvpnimport_" + acc->getCaCertificate() ) );
//
-// QTextStream CaCertDstStream( &CaCertFileDst );
+// TQTextStream CaCertDstStream( &CaCertFileDst );
//
// if ( config->KvpncDebugLevel > 1 )
-// config->appendLogEntry( i18n( "OpenVPN import: try to copy ca cert file %1 to %2." ).arg( CaCertFileSrc.name() ).arg( CaCertFileDst.name() ), config->debug );
+// config->appendLogEntry( i18n( "OpenVPN import: try to copy ca cert file %1 to %2." ).tqarg( CaCertFileSrc.name() ).tqarg( CaCertFileDst.name() ), config->debug );
//
//
// if ( CaCertFileSrc.open( IO_ReadOnly ) ) {
// if ( CaCertFileDst.open( IO_WriteOnly ) ) {
-// QString CaCertFileString = QString( CaCertFileSrc.readAll() );
+// TQString CaCertFileString = TQString( CaCertFileSrc.readAll() );
// CaCertDstStream << CaCertFileString;
// CaCertFileDst.close();
// if ( config->KvpncDebugLevel > 1 )
-// config->appendLogEntry( i18n( "OpenVPN import: ca cert file %1 copied to %2." ).arg( CaCertFileSrc.name() ).arg( CaCertFileDst.name() ), config->debug );
+// config->appendLogEntry( i18n( "OpenVPN import: ca cert file %1 copied to %2." ).tqarg( CaCertFileSrc.name() ).tqarg( CaCertFileDst.name() ), config->debug );
// } else {
// if ( config->KvpncDebugLevel > 2 )
-// config->appendLogEntry( i18n( "OpenVPN import: ca cert file %1 could not open for writing." ).arg( CaCertFileDst.name() ), config->debug );
+// config->appendLogEntry( i18n( "OpenVPN import: ca cert file %1 could not open for writing." ).tqarg( CaCertFileDst.name() ), config->debug );
//
// // return;
// }
// CaCertFileDst.close();
// } else {
// if ( config->KvpncDebugLevel > 2 )
-// config->appendLogEntry( i18n( "OpenVPN import: ca cert file %1 could not open for reading." ).arg( CaCertFileSrc.name() ), config->debug );
+// config->appendLogEntry( i18n( "OpenVPN import: ca cert file %1 could not open for reading." ).tqarg( CaCertFileSrc.name() ), config->debug );
//
// // return;
// }
// }
// if ( !acc->getX509Certificate().isEmpty() && !acc->getX509Certificate().startsWith( CertPath ) ) {
-// QString prefix = "./";
+// TQString prefix = "./";
// if ( !filename.find( '/' ) > -1 )
-// prefix = QString( Utils(this->GlobalConfig).removeSpecialCharsForFilename(filename).section( '/', 0, -2 ) + "/" );
+// prefix = TQString( Utils(this->GlobalConfig).removeSpecialCharsForFilename(filename).section( '/', 0, -2 ) + "/" );
//
-// QFile X509CertFileSrc ( prefix + acc->getX509Certificate() );
-// QFile X509CertFileDst ( QString( CertPath + "/openvpnimport_" + acc->getX509Certificate() ) );
-// acc->setX509Certificate( QString( CertPath + "/openvpnimport_" + acc->getX509Certificate() ) );
+// TQFile X509CertFileSrc ( prefix + acc->getX509Certificate() );
+// TQFile X509CertFileDst ( TQString( CertPath + "/openvpnimport_" + acc->getX509Certificate() ) );
+// acc->setX509Certificate( TQString( CertPath + "/openvpnimport_" + acc->getX509Certificate() ) );
//
-// QTextStream X509CertDstStream( &X509CertFileDst );
+// TQTextStream X509CertDstStream( &X509CertFileDst );
//
// if ( config->KvpncDebugLevel > 1 )
-// config->appendLogEntry( i18n( "OpenVPN import: try to copy pre shared key file %1 to %2." ).arg( X509CertFileSrc.name() ).arg( X509CertFileDst.name() ), config->debug );
+// config->appendLogEntry( i18n( "OpenVPN import: try to copy pre shared key file %1 to %2." ).tqarg( X509CertFileSrc.name() ).tqarg( X509CertFileDst.name() ), config->debug );
//
//
// if ( X509CertFileSrc.open( IO_ReadOnly ) ) {
// if ( X509CertFileDst.open( IO_WriteOnly ) ) {
-// QString X509CertFileString = QString( X509CertFileSrc.readAll() );
+// TQString X509CertFileString = TQString( X509CertFileSrc.readAll() );
// X509CertDstStream << X509CertFileString;
// X509CertFileDst.close();
// if ( config->KvpncDebugLevel > 2 )
-// config->appendLogEntry( i18n( "OpenVPN import: X509 cert file %1 copied to %2." ).arg( X509CertFileSrc.name() ).arg( X509CertFileDst.name() ), config->debug );
+// config->appendLogEntry( i18n( "OpenVPN import: X509 cert file %1 copied to %2." ).tqarg( X509CertFileSrc.name() ).tqarg( X509CertFileDst.name() ), config->debug );
// } else {
// if ( config->KvpncDebugLevel > 2 )
-// config->appendLogEntry( i18n( "OpenVPN import: X509 cert file %1 could not open for writing." ).arg( X509CertFileDst.name() ), config->debug );
+// config->appendLogEntry( i18n( "OpenVPN import: X509 cert file %1 could not open for writing." ).tqarg( X509CertFileDst.name() ), config->debug );
//
// // return;
// }
// X509CertFileDst.close();
// } else {
// if ( config->KvpncDebugLevel > 2 )
-// config->appendLogEntry( i18n( "OpenVPN import: X509 cert file %1 could not open for reading." ).arg( X509CertFileSrc.name() ), config->debug );
+// config->appendLogEntry( i18n( "OpenVPN import: X509 cert file %1 could not open for reading." ).tqarg( X509CertFileSrc.name() ), config->debug );
//
// // return;
// }
// }
// if ( !acc->getPreSharedKey().isEmpty() && !acc->getPreSharedKey().startsWith( CertPath ) ) {
-// QString prefix = "./";
+// TQString prefix = "./";
// if ( !filename.find( '/' ) > -1 )
-// prefix = QString( Utils(this->GlobalConfig).removeSpecialCharsForFilename( filename).section( '/', 0, -2 ) + "/" );
+// prefix = TQString( Utils(this->GlobalConfig).removeSpecialCharsForFilename( filename).section( '/', 0, -2 ) + "/" );
//
-// QFile PreSharedKeyFileSrc ( QString( prefix + acc->getPreSharedKey() ) );
-// QFile PreSharedKeyFileDst ( QString( CertPath + "/openvpnimport_" + acc->getPreSharedKey() ) );
-// acc->setPreSharedKey( QString( CertPath + "/openvpnimport_" + acc->getPreSharedKey() ) );
+// TQFile PreSharedKeyFileSrc ( TQString( prefix + acc->getPreSharedKey() ) );
+// TQFile PreSharedKeyFileDst ( TQString( CertPath + "/openvpnimport_" + acc->getPreSharedKey() ) );
+// acc->setPreSharedKey( TQString( CertPath + "/openvpnimport_" + acc->getPreSharedKey() ) );
//
-// QTextStream PreSharedKeyDstStream( &PreSharedKeyFileDst );
+// TQTextStream PreSharedKeyDstStream( &PreSharedKeyFileDst );
//
// if ( config->KvpncDebugLevel > 1 )
-// config->appendLogEntry( i18n( "OpenVPN import: try to copy pre shared key file %1 to %2." ).arg( PreSharedKeyFileSrc.name() ).arg( PreSharedKeyFileDst.name() ), config->debug );
+// config->appendLogEntry( i18n( "OpenVPN import: try to copy pre shared key file %1 to %2." ).tqarg( PreSharedKeyFileSrc.name() ).tqarg( PreSharedKeyFileDst.name() ), config->debug );
//
// if ( PreSharedKeyFileSrc.open( IO_ReadOnly ) ) {
// if ( PreSharedKeyFileDst.open( IO_WriteOnly ) ) {
-// QString PreSharedKeyFileString = QString( PreSharedKeyFileSrc.readAll() );
+// TQString PreSharedKeyFileString = TQString( PreSharedKeyFileSrc.readAll() );
// PreSharedKeyDstStream << PreSharedKeyFileString;
// PreSharedKeyFileDst.close();
// if ( config->KvpncDebugLevel > 2 )
-// config->appendLogEntry( i18n( "OpenVPN import: pre shared key file %1 copied to %2." ).arg( PreSharedKeyFileSrc.name() ).arg( PreSharedKeyFileDst.name() ), config->debug );
+// config->appendLogEntry( i18n( "OpenVPN import: pre shared key file %1 copied to %2." ).tqarg( PreSharedKeyFileSrc.name() ).tqarg( PreSharedKeyFileDst.name() ), config->debug );
// } else {
// if ( config->KvpncDebugLevel > 2 )
-// config->appendLogEntry( i18n( "OpenVPN import: pre shared key file %1 could not open for writing." ).arg( PreSharedKeyFileDst.name() ), config->debug );
+// config->appendLogEntry( i18n( "OpenVPN import: pre shared key file %1 could not open for writing." ).tqarg( PreSharedKeyFileDst.name() ), config->debug );
//
// // return;
// }
// PreSharedKeyFileDst.close();
// } else {
// if ( config->KvpncDebugLevel > 2 )
-// config->appendLogEntry( i18n( "OpenVPN import: pre shared key file %1 could not open for reading." ).arg( PreSharedKeyFileSrc.name() ), config->debug );
+// config->appendLogEntry( i18n( "OpenVPN import: pre shared key file %1 could not open for reading." ).tqarg( PreSharedKeyFileSrc.name() ), config->debug );
//
// // return;
// }
@@ -1070,11 +1070,11 @@ void ImportOpenvpnProfileDialog::canAccept()
if ( !Pkcs12CertFile.isEmpty() )
{
- QString filepath = filename.section ( '/', 0, -2 ); // should give the base path
+ TQString filepath = filename.section ( '/', 0, -2 ); // should give the base path
ImportCertificateDialog dlg ( this, i18n ( "Import Certificate..." ).ascii(), config );
- QString p12file="";
+ TQString p12file="";
if ( Pkcs12CertFile.find ( '/' ) < 0 )
p12file = filepath + "/" + Pkcs12CertFile;
@@ -1101,7 +1101,7 @@ void ImportOpenvpnProfileDialog::canAccept()
int result = dlg.exec();
- if ( result == QDialog::Accepted )
+ if ( result == TQDialog::Accepted )
{
if ( dlg.importSuccess )
{
@@ -1131,6 +1131,6 @@ void ImportOpenvpnProfileDialog::canAccept()
}
//std::cout << "accept" << std::endl;
- QDialog::accept();
+ TQDialog::accept();
}