summaryrefslogtreecommitdiffstats
path: root/src/openvpnmanagementhandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/openvpnmanagementhandler.cpp')
-rw-r--r--src/openvpnmanagementhandler.cpp252
1 files changed, 126 insertions, 126 deletions
diff --git a/src/openvpnmanagementhandler.cpp b/src/openvpnmanagementhandler.cpp
index 02e73f8..a30b8e0 100644
--- a/src/openvpnmanagementhandler.cpp
+++ b/src/openvpnmanagementhandler.cpp
@@ -21,12 +21,12 @@
***************************************************************************/
//BEGIN INCLUDES
#include "openvpnmanagementhandler.h"
-#include <qregexp.h>
-#include <qtextstream.h>
+#include <tqregexp.h>
+#include <tqtextstream.h>
#include <kpassdlg.h>
#include <klocale.h>
-#include <qlabel.h>
-#include <qcheckbox.h>
+#include <tqlabel.h>
+#include <tqcheckbox.h>
#include <kmessagebox.h>
#include <kinputdialog.h>
#include "kvpncconfig.h"
@@ -34,7 +34,7 @@
#include "enterxauthinteractivepasscodedialog.h"
//END INCLUDES
-OpenvpnManagementHandler::OpenvpnManagementHandler( QObject *, KVpncConfig *GlobalConfig )
+OpenvpnManagementHandler::OpenvpnManagementHandler( TQObject *, KVpncConfig *GlobalConfig )
{
this->GlobalConfig = GlobalConfig;
fInHold = false;
@@ -54,18 +54,18 @@ void OpenvpnManagementHandler::closeConnection()
{
if (socket)
{
- //disconnect( socket, SIGNAL( connected() ), this, SLOT( socketConnected() ) );
- disconnect( socket, SIGNAL( connectionClosed() ), this, SLOT( socketConnectionClosed() ) );
- disconnect( socket, SIGNAL( readyRead() ), this, SLOT( socketReadyRead() ) );
- disconnect( socket, SIGNAL( error( int ) ), this, SLOT( socketError( int ) ) );
- disconnect( socket, SIGNAL( hostFound() ), this, SLOT( hostFound() ) );
+ //disconnect( socket, TQT_SIGNAL( connected() ), this, TQT_SLOT( socketConnected() ) );
+ disconnect( socket, TQT_SIGNAL( connectionClosed() ), this, TQT_SLOT( socketConnectionClosed() ) );
+ disconnect( socket, TQT_SIGNAL( readyRead() ), this, TQT_SLOT( socketReadyRead() ) );
+ disconnect( socket, TQT_SIGNAL( error( int ) ), this, TQT_SLOT( socketError( int ) ) );
+ disconnect( socket, TQT_SIGNAL( hostFound() ), this, TQT_SLOT( hostFound() ) );
socket->clearPendingData();
socket->close();
- if ( socket->state() == QSocket::Closing )
+ if ( socket->state() == TQSocket::Closing )
{
// We have a delayed close.
- connect( socket, SIGNAL( delayedCloseFinished() ), this, SLOT( socketClosed() ) );
+ connect( socket, TQT_SIGNAL( delayedCloseFinished() ), this, TQT_SLOT( socketClosed() ) );
}
else
{
@@ -80,18 +80,18 @@ void OpenvpnManagementHandler::socketConnectionClosed()
if ( GlobalConfig->KvpncDebugLevel > 1 )
- GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + i18n( "Disconnected to the OpenVPN manage port (%1)." ).arg( QString().setNum( GlobalConfig->OpenvpnManagementPort ) ), GlobalConfig->debug );
+ GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + i18n( "Disconnected to the OpenVPN manage port (%1)." ).tqarg( TQString().setNum( GlobalConfig->OpenvpnManagementPort ) ), GlobalConfig->debug );
}
void OpenvpnManagementHandler::socketClosed()
{
socketReallyClosed = false;
- disconnect( socket, SIGNAL( delayedCloseFinished() ), this, SLOT( socketClosed() ) );
+ disconnect( socket, TQT_SIGNAL( delayedCloseFinished() ), this, TQT_SLOT( socketClosed() ) );
delete socket;
greetingtimer.stop();
- disconnect ( &greetingtimer, SIGNAL ( timeout() ), this, SLOT ( greetingTimedOut() ) );
+ disconnect ( &greetingtimer, TQT_SIGNAL ( timeout() ), this, TQT_SLOT ( greetingTimedOut() ) );
if ( GlobalConfig->KvpncDebugLevel > 1 )
- GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + i18n( "Socket to the OpenVPN manage port (%1) closed." ).arg( QString().setNum( GlobalConfig->OpenvpnManagementPort ) ), GlobalConfig->debug );
+ GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + i18n( "Socket to the OpenVPN manage port (%1) closed." ).tqarg( TQString().setNum( GlobalConfig->OpenvpnManagementPort ) ), GlobalConfig->debug );
socketReallyClosed = true;
// emit terminate_openvpn();
}
@@ -99,14 +99,14 @@ void OpenvpnManagementHandler::socketClosed()
void OpenvpnManagementHandler::socketConnected()
{
- connect( socket, SIGNAL( connectionClosed() ), this, SLOT( socketConnectionClosed() ) );
- connect( socket, SIGNAL( readyRead() ), this, SLOT( socketReadyRead() ) );
+ connect( socket, TQT_SIGNAL( connectionClosed() ), this, TQT_SLOT( socketConnectionClosed() ) );
+ connect( socket, TQT_SIGNAL( readyRead() ), this, TQT_SLOT( socketReadyRead() ) );
-// KMessageBox::error ( 0, QString("bar"), QString("foo") );
+// KMessageBox::error ( 0, TQString("bar"), TQString("foo") );
connectedToManagementPort=true;
if ( GlobalConfig->KvpncDebugLevel > 1 )
- GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + i18n( "Connected to the OpenVPN manage port (%1)." ).arg( QString().setNum( GlobalConfig->OpenvpnManagementPort ) ), GlobalConfig->debug );
+ GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + i18n( "Connected to the OpenVPN manage port (%1)." ).tqarg( TQString().setNum( GlobalConfig->OpenvpnManagementPort ) ), GlobalConfig->debug );
socketReadyRead();
@@ -115,17 +115,17 @@ void OpenvpnManagementHandler::socketConnected()
void OpenvpnManagementHandler::socketError( int e )
{
- // infoText->append( tr("Error number %1 occurred\n").arg(e) );
+ // infoText->append( tr("Error number %1 occurred\n").tqarg(e) );
if ( e != 0 )
- GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + QString().setNum( e ) , GlobalConfig->error );
+ GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + TQString().setNum( e ) , GlobalConfig->error );
}
void OpenvpnManagementHandler::greetingTimedOut()
{
- disconnect ( &greetingtimer, SIGNAL ( timeout() ), this, SLOT ( greetingTimedOut() ) );
+ disconnect ( &greetingtimer, TQT_SIGNAL ( timeout() ), this, TQT_SLOT ( greetingTimedOut() ) );
greetingtimer.stop();
- GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + i18n("Got no greeting within %1 seconds from management interface, retrying.").arg("3"), GlobalConfig->error );
+ GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + i18n("Got no greeting within %1 seconds from management interface, retrying.").tqarg("3"), GlobalConfig->error );
closeConnection();
@@ -138,10 +138,10 @@ void OpenvpnManagementHandler::greetingTimedOut()
doConnect();
}
-void OpenvpnManagementHandler::sendToServer( QString cmd )
+void OpenvpnManagementHandler::sendToServer( TQString cmd )
{
// write to the server
- QTextStream os( socket );
+ TQTextStream os( socket );
os << cmd << "\n";
}
@@ -150,17 +150,17 @@ void OpenvpnManagementHandler::socketReadyRead()
bool abort=false;
if (socket)
{
- if (socket->state() != QSocket::Closing && socket->state() != QSocket::Idle)
+ if (socket->state() != TQSocket::Closing && socket->state() != TQSocket::Idle)
{
while ( !abort && socket->canReadLine() )
{
- QString line = socket->readLine();
+ TQString line = socket->readLine();
// {
- // QCString s;
+ // TQCString s;
// s.resize( socket->bytesAvailable() + 1 );
// socket->readBlock( s.data(), socket->bytesAvailable() );
- // QString line( s );
+ // TQString line( s );
// {
if ( GlobalConfig->KvpncDebugLevel > 2 )
@@ -173,7 +173,7 @@ void OpenvpnManagementHandler::socketReadyRead()
// else if ( line.find( ">HOLD:", 0, FALSE ) > -1 ) {
//
// if ( GlobalConfig->KvpncDebugLevel > 2 )
- // GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + i18n( "got %1 message." ).arg("'hold'"), GlobalConfig->debug );
+ // GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + i18n( "got %1 message." ).tqarg("'hold'"), GlobalConfig->debug );
//
// fInHold = true;
// int ret = 0;
@@ -194,7 +194,7 @@ void OpenvpnManagementHandler::socketReadyRead()
if ( line.find( "INFO:OpenVPN Management Interface", 0, FALSE ) > -1 )
{
gotGreeting=true;
- disconnect ( &greetingtimer, SIGNAL ( timeout() ), this, SLOT ( greetingTimedOut() ) );
+ disconnect ( &greetingtimer, TQT_SIGNAL ( timeout() ), this, TQT_SLOT ( greetingTimedOut() ) );
greetingtimer.stop ();
if ( GlobalConfig->KvpncDebugLevel > 2 )
@@ -205,16 +205,16 @@ void OpenvpnManagementHandler::socketReadyRead()
{
if ( GlobalConfig->KvpncDebugLevel > 2 )
- GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + i18n( "got %1 message" ).arg("'need ok'"), GlobalConfig->debug );
+ GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + i18n( "got %1 message" ).tqarg("'need ok'"), GlobalConfig->debug );
- QString req = line.section( QRegExp( ".*'(.*)'. * MSG:( .* )" ), 0, 0 ); // $1;
- QString msg = line.section( QRegExp( ".*'(.*)'. * MSG:( .* )" ), 1, 1 ); // $2;
+ TQString req = line.section( TQRegExp( ".*'(.*)'. * MSG:( .* )" ), 0, 0 ); // $1;
+ TQString msg = line.section( TQRegExp( ".*'(.*)'. * MSG:( .* )" ), 1, 1 ); // $2;
if ( GlobalConfig->KvpncDebugLevel > 2 )
- GlobalConfig->appendLogEntry( QString("OpenvpnManagementHandler: req: ")+req+QString(", msg: ")+msg , GlobalConfig->debug );
+ GlobalConfig->appendLogEntry( TQString("OpenvpnManagementHandler: req: ")+req+TQString(", msg: ")+msg , GlobalConfig->debug );
//TODO: look for possible messages, msg2 is the translatable msg
- QString msg2 = msg;
+ TQString msg2 = msg;
int ret = KMessageBox::questionYesNo ( 0, msg2, i18n( "OpenVPN" ) );
@@ -223,7 +223,7 @@ void OpenvpnManagementHandler::socketReadyRead()
{
if ( GlobalConfig->KvpncDebugLevel > 2 )
- GlobalConfig->appendLogEntry( QString("OpenvpnManagementHandler: ") + QString("'needok': ok") , GlobalConfig->debug );
+ GlobalConfig->appendLogEntry( TQString("OpenvpnManagementHandler: ") + TQString("'needok': ok") , GlobalConfig->debug );
sendToServer( "needok \"" + req + "\" ok\n" );
}
@@ -231,7 +231,7 @@ void OpenvpnManagementHandler::socketReadyRead()
{
if ( GlobalConfig->KvpncDebugLevel > 2 )
- GlobalConfig->appendLogEntry( QString("OpenvpnManagementHandler: ") +QString( "'needok': cancel") , GlobalConfig->debug );
+ GlobalConfig->appendLogEntry( TQString("OpenvpnManagementHandler: ") +TQString( "'needok': cancel") , GlobalConfig->debug );
sendToServer( "needok \"" + req + "\" cancel\n" );
}
@@ -240,18 +240,18 @@ void OpenvpnManagementHandler::socketReadyRead()
// if ( line.find( " >PASSWORD:", 0, FALSE ) > -1 ) {
//
// if ( GlobalConfig->KvpncDebugLevel > 2 )
- // GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + i18n( "got %1 message" ).arg("'password'"), GlobalConfig->debug );
+ // GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + i18n( "got %1 message" ).tqarg("'password'"), GlobalConfig->debug );
//
- // QString req = line.section( QRegExp( ".*'(.*)'.*" ), 0, 0 ); // $1;
- // QCString password;
- // QString pass = "";
- // int result = KPasswordDialog::getPassword( password, QString( req + i18n( " password:" ) ) );
- // QTextStream os( socket );
- // // os.setEncoding( QTextStream::UnicodeUTF8 );
+ // TQString req = line.section( TQRegExp( ".*'(.*)'.*" ), 0, 0 ); // $1;
+ // TQCString password;
+ // TQString pass = "";
+ // int result = KPasswordDialog::getPassword( password, TQString( req + i18n( " password:" ) ) );
+ // TQTextStream os( socket );
+ // // os.setEncoding( TQTextStream::UnicodeUTF8 );
// if ( result == KPasswordDialog::Accepted ) {
// if ( GlobalConfig->KvpncDebugLevel > 2 )
// GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + i18n( "password got from user" ), GlobalConfig->debug );
- // pass = QString( password );
+ // pass = TQString( password );
//
// pass = pass.remove( '\r' );
// pass = pass.remove( '\n' );
@@ -264,7 +264,7 @@ void OpenvpnManagementHandler::socketReadyRead()
{
if ( GlobalConfig->KvpncDebugLevel > 2 )
- GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + i18n( "got %1 message" ).arg("'need username/password'"), GlobalConfig->debug );
+ GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + i18n( "got %1 message" ).tqarg("'need username/password'"), GlobalConfig->debug );
if ( GlobalConfig->KvpncDebugLevel > 2 )
GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + i18n( "Send username..." ), GlobalConfig->debug );
@@ -282,9 +282,9 @@ void OpenvpnManagementHandler::socketReadyRead()
if ( GlobalConfig->TmpUsername.isEmpty() )
{
bool ok = false;
- QString username = KInputDialog::getText ( i18n( "User name" ), i18n( "Enter username:" ), "", &ok );
- QTextStream os( socket );
- os.setEncoding( QTextStream::UnicodeUTF8 );
+ TQString username = KInputDialog::getText ( i18n( "User name" ), i18n( "Enter username:" ), "", &ok );
+ TQTextStream os( socket );
+ os.setEncoding( TQTextStream::UnicodeUTF8 );
if ( ok == true && !username.isEmpty() )
{
if ( GlobalConfig->KvpncDebugLevel > 2 )
@@ -314,7 +314,7 @@ void OpenvpnManagementHandler::socketReadyRead()
{
if ( GlobalConfig->KvpncDebugLevel > 2 )
- GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + i18n( "got %1 message" ).arg("SUCCESS: 'Auth' username entered"), GlobalConfig->debug );
+ GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + i18n( "got %1 message" ).tqarg("SUCCESS: 'Auth' username entered"), GlobalConfig->debug );
if ( GlobalConfig->KvpncDebugLevel > 2 )
GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + i18n( "Send password..." ), GlobalConfig->debug );
@@ -331,16 +331,16 @@ void OpenvpnManagementHandler::socketReadyRead()
{
if ( GlobalConfig->TmpPassword.isEmpty() )
{
- QCString password;
- QString pass = "";
- int result = KPasswordDialog::getPassword( password, QString( i18n( " password:" ) ) );
- QTextStream os( socket );
- // os.setEncoding( QTextStream::UnicodeUTF8 );
+ TQCString password;
+ TQString pass = "";
+ int result = KPasswordDialog::getPassword( password, TQString( i18n( " password:" ) ) );
+ TQTextStream os( socket );
+ // os.setEncoding( TQTextStream::UnicodeUTF8 );
if ( result == KPasswordDialog::Accepted )
{
if ( GlobalConfig->KvpncDebugLevel > 2 )
GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + i18n( "password got from user" ), GlobalConfig->debug );
- GlobalConfig->TmpPassword = QString( password );
+ GlobalConfig->TmpPassword = TQString( password );
// if ( GlobalConfig->KvpncDebugLevel > 5 )
@@ -367,7 +367,7 @@ void OpenvpnManagementHandler::socketReadyRead()
// else if ( line.find( "SUCCESS: 'Auth' username entered", 0, FALSE ) > -1 ) {
//
// if ( GlobalConfig->KvpncDebugLevel > 2 )
- // GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + i18n( "got %1 message, 2. step" ).arg("'need username/password'"), GlobalConfig->debug );
+ // GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + i18n( "got %1 message, 2. step" ).tqarg("'need username/password'"), GlobalConfig->debug );
//
// if ( GlobalConfig->KvpncDebugLevel > 2 )
// GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + i18n( "Send password..." ), GlobalConfig->debug );
@@ -383,7 +383,7 @@ void OpenvpnManagementHandler::socketReadyRead()
{
if ( GlobalConfig->KvpncDebugLevel > 2 )
- GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + i18n( "got %1 message" ).arg("'HTTP Proxy password'"), GlobalConfig->debug );
+ GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + i18n( "got %1 message" ).tqarg("'HTTP Proxy password'"), GlobalConfig->debug );
if ( GlobalConfig->KvpncDebugLevel > 2 )
GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + i18n( "Send HTTP Proxy username..." ), GlobalConfig->debug );
@@ -402,7 +402,7 @@ void OpenvpnManagementHandler::socketReadyRead()
{
if ( GlobalConfig->KvpncDebugLevel > 2 )
- GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + i18n( "got %1 message" ).arg("SUCCESS: 'HTTP Proxy' username entered"), GlobalConfig->debug );
+ GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + i18n( "got %1 message" ).tqarg("SUCCESS: 'HTTP Proxy' username entered"), GlobalConfig->debug );
if ( GlobalConfig->KvpncDebugLevel > 2 )
GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + i18n( "Send HTTP Proxy password..." ), GlobalConfig->debug );
@@ -418,11 +418,11 @@ void OpenvpnManagementHandler::socketReadyRead()
{
if ( GlobalConfig->TmpHttpProxyPassword.isEmpty() )
{
- QCString password;
- QString pass = "";
+ TQCString password;
+ TQString pass = "";
- QTextStream os( socket );
- os.setEncoding( QTextStream::UnicodeUTF8 );
+ TQTextStream os( socket );
+ os.setEncoding( TQTextStream::UnicodeUTF8 );
GlobalConfig->TmpHttpProxyPassword = "";
EnterXauthInteractivePasscodeDialog dlg( 0);
@@ -445,10 +445,10 @@ void OpenvpnManagementHandler::socketReadyRead()
if ( dlg.main->SavePasswordCheckBox->isChecked() )
{
// GlobalConfig->currentProfile->setSavePrivateKeyPassword(true);
- GlobalConfig->currentProfile->setHttpProxyPass ( QString( pass ) );
+ GlobalConfig->currentProfile->setHttpProxyPass ( TQString( pass ) );
}
- GlobalConfig->TmpHttpProxyPassword = QString( pass );
+ GlobalConfig->TmpHttpProxyPassword = TQString( pass );
if ( GlobalConfig->KvpncDebugLevel > 5 )
GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: HTTP proxy auth password: " + GlobalConfig->TmpHttpProxyPassword, GlobalConfig->debug );
@@ -476,7 +476,7 @@ void OpenvpnManagementHandler::socketReadyRead()
if ( GlobalConfig->KvpncDebugLevel > 5 )
{
GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: HTTP proxy auth password: " + GlobalConfig->TmpHttpProxyPassword, GlobalConfig->debug );
- GlobalConfig->appendLogEntry( QString( "OpenvpnManagementHandler: HTTP proxy auth password string: " ) + QString( "password \"HTTP Proxy\" " + GlobalConfig->TmpHttpProxyPassword + "\n" ), GlobalConfig->debug );
+ GlobalConfig->appendLogEntry( TQString( "OpenvpnManagementHandler: HTTP proxy auth password string: " ) + TQString( "password \"HTTP Proxy\" " + GlobalConfig->TmpHttpProxyPassword + "\n" ), GlobalConfig->debug );
}
}
}
@@ -486,7 +486,7 @@ void OpenvpnManagementHandler::socketReadyRead()
{
if ( GlobalConfig->KvpncDebugLevel > 2 )
- GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + i18n( "got %1 message" ).arg("'private key password'"), GlobalConfig->debug );
+ GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + i18n( "got %1 message" ).tqarg("'private key password'"), GlobalConfig->debug );
if ( !GlobalConfig->currentProfile->getPrivateKeyPass().isEmpty() )
{
@@ -504,11 +504,11 @@ void OpenvpnManagementHandler::socketReadyRead()
if ( ( Utils(GlobalConfig).getNeedsPassphrase(GlobalConfig->TmpPrivateKeyPass) && GlobalConfig->TmpPrivateKeyPass.isEmpty() ) || GlobalConfig->currentProfile->getPrivateKeyPass().isEmpty() )
{
GlobalConfig->TmpPassword = "";
- QCString password;
- QString pass = "";
+ TQCString password;
+ TQString pass = "";
- QTextStream os( socket );
- // os.setEncoding( QTextStream::UnicodeUTF8 );
+ TQTextStream os( socket );
+ // os.setEncoding( TQTextStream::UnicodeUTF8 );
GlobalConfig->TmpPrivateKeyPass = "";
EnterXauthInteractivePasscodeDialog dlg( 0);
@@ -532,10 +532,10 @@ void OpenvpnManagementHandler::socketReadyRead()
if ( dlg.main->SavePasswordCheckBox->isChecked() )
{
GlobalConfig->currentProfile->setSavePrivateKeyPassword( true );
- GlobalConfig->currentProfile->setPrivateKeyPass( QString( pass ) );
+ GlobalConfig->currentProfile->setPrivateKeyPass( TQString( pass ) );
}
- GlobalConfig->TmpPrivateKeyPass = QString( pass );
+ GlobalConfig->TmpPrivateKeyPass = TQString( pass );
// if ( GlobalConfig->KvpncDebugLevel > 5 )
// GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: private key password: " + GlobalConfig->TmpPrivateKeyPass, GlobalConfig->debug );
@@ -563,7 +563,7 @@ void OpenvpnManagementHandler::socketReadyRead()
// if ( GlobalConfig->KvpncDebugLevel > 5 )
// {
// GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: private key password: " + GlobalConfig->TmpPrivateKeyPass, GlobalConfig->debug );
- // GlobalConfig->appendLogEntry( QString("OpenvpnManagementHandler: private key password string: ") + QString("password \"Private Key\" " + GlobalConfig->TmpPrivateKeyPass + "\n"),GlobalConfig->debug);
+ // GlobalConfig->appendLogEntry( TQString("OpenvpnManagementHandler: private key password string: ") + TQString("password \"Private Key\" " + GlobalConfig->TmpPrivateKeyPass + "\n"),GlobalConfig->debug);
// }
}
}
@@ -576,11 +576,11 @@ void OpenvpnManagementHandler::socketReadyRead()
GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + i18n( "wrong private key password" ), GlobalConfig->debug );
GlobalConfig->TmpPassword = "";
- QCString password;
- QString pass = "";
+ TQCString password;
+ TQString pass = "";
- QTextStream os( socket );
- // os.setEncoding( QTextStream::UnicodeUTF8 );
+ TQTextStream os( socket );
+ // os.setEncoding( TQTextStream::UnicodeUTF8 );
GlobalConfig->TmpPrivateKeyPass = "";
EnterXauthInteractivePasscodeDialog dlg( 0);
@@ -603,10 +603,10 @@ void OpenvpnManagementHandler::socketReadyRead()
if ( dlg.main->SavePasswordCheckBox->isChecked() )
{
GlobalConfig->currentProfile->setSavePrivateKeyPassword( true );
- GlobalConfig->currentProfile->setPrivateKeyPass( QString( pass ) );
+ GlobalConfig->currentProfile->setPrivateKeyPass( TQString( pass ) );
}
- GlobalConfig->TmpPrivateKeyPass = QString( pass );
+ GlobalConfig->TmpPrivateKeyPass = TQString( pass );
// if ( GlobalConfig->KvpncDebugLevel > 5 )
// GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: private key password: " + GlobalConfig->TmpPrivateKeyPass, GlobalConfig->debug );
@@ -643,7 +643,7 @@ void OpenvpnManagementHandler::socketReadyRead()
if ( GlobalConfig->KvpncDebugLevel > 2 )
GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: password verification failed!" , GlobalConfig->error );
- GlobalConfig->appendLogEntry( i18n( "Authentication failed (%1)!" ).arg( i18n( "user password" ) ) , GlobalConfig->error );
+ GlobalConfig->appendLogEntry( i18n( "Authentication failed (%1)!" ).tqarg( i18n( "user password" ) ) , GlobalConfig->error );
abort = true;
}
@@ -654,7 +654,7 @@ void OpenvpnManagementHandler::socketReadyRead()
if ( GlobalConfig->KvpncDebugLevel > 2 )
GlobalConfig->appendLogEntry( i18n("OpenvpnManagementHandler: CA certifcate file could not be loaded! Please check your CA certificate file.") , GlobalConfig->error );
- GlobalConfig->appendLogEntry( i18n( "Certificate load failed (%1)!" ).arg( i18n( "CA certificate" ) ) , GlobalConfig->error );
+ GlobalConfig->appendLogEntry( i18n( "Certificate load failed (%1)!" ).tqarg( i18n( "CA certificate" ) ) , GlobalConfig->error );
abort = true;
}
@@ -663,9 +663,9 @@ void OpenvpnManagementHandler::socketReadyRead()
{
if ( GlobalConfig->KvpncDebugLevel > 2 )
- GlobalConfig->appendLogEntry( i18n("OpenvpnManagementHandler: Hash algorithm %1 could not found! Please check your OpenVPN settings.").arg(line.section(' ',3,3).remove('\'')) , GlobalConfig->error );
+ GlobalConfig->appendLogEntry( i18n("OpenvpnManagementHandler: Hash algorithm %1 could not found! Please check your OpenVPN settings.").tqarg(line.section(' ',3,3).remove('\'')) , GlobalConfig->error );
- GlobalConfig->appendLogEntry( i18n( "Hash algorithm not found (%1)!" ).arg(line.section(' ',3,3).remove('\'') ) , GlobalConfig->error );
+ GlobalConfig->appendLogEntry( i18n( "Hash algorithm not found (%1)!" ).tqarg(line.section(' ',3,3).remove('\'') ) , GlobalConfig->error );
abort = true;
}
@@ -673,16 +673,16 @@ void OpenvpnManagementHandler::socketReadyRead()
else if ( line.find( "PASSWORD:Need 'eToken token' password", 0, FALSE ) > -1)
{
GlobalConfig->TmpPassword = "";
- QCString password;
- QString pass = "";
+ TQCString password;
+ TQString pass = "";
- QTextStream os( socket );
- // os.setEncoding( QTextStream::UnicodeUTF8 );
+ TQTextStream os( socket );
+ // os.setEncoding( TQTextStream::UnicodeUTF8 );
GlobalConfig->TmpPrivateKeyPass = "";
EnterXauthInteractivePasscodeDialog dlg( 0);
dlg.setCaption( i18n( "Enter token pin" ) );
- dlg.main->DescriptionLabel->setText( i18n( "Enter eToken pin for unlocking token \"%1\":" ).arg(GlobalConfig->currentProfile->getPkcs11Id()) );
+ dlg.main->DescriptionLabel->setText( i18n( "Enter eToken pin for unlocking token \"%1\":" ).tqarg(GlobalConfig->currentProfile->getPkcs11Id()) );
dlg.main->LabelPassword->setText( i18n( "eToken pin:" ) );
dlg.main->SavePasswordCheckBox->hide();
dlg.main->adjustSize();
@@ -700,7 +700,7 @@ void OpenvpnManagementHandler::socketReadyRead()
GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + i18n( "token password got from user" ), GlobalConfig->debug );
- GlobalConfig->TmpPrivateKeyPass = QString( pass );
+ GlobalConfig->TmpPrivateKeyPass = TQString( pass );
// if ( GlobalConfig->KvpncDebugLevel > 5 )
// GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: token password: " + GlobalConfig->TmpPrivateKeyPass, GlobalConfig->debug );
@@ -727,27 +727,27 @@ void OpenvpnManagementHandler::socketReadyRead()
else if ( line.find( "SUCCESS: 'eToken token' password entered, but not yet verified", 0, FALSE ) > -1 )
{
if ( GlobalConfig->KvpncDebugLevel > 1 )
- GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + i18n( "got %1 message" ).arg("SUCCESS for 'eToken token' password"), GlobalConfig->debug );
+ GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + i18n( "got %1 message" ).tqarg("SUCCESS for 'eToken token' password"), GlobalConfig->debug );
}
else if ( line.find( ">PASSWORD:Need '", 0, FALSE) > -1 && line.find( "token' password", 0, FALSE ) > -1)
{
GlobalConfig->TmpPassword = "";
- QCString password;
- QString pass = "";
- QString TokenName = line.section('\'',1,1);
+ TQCString password;
+ TQString pass = "";
+ TQString TokenName = line.section('\'',1,1);
if ( GlobalConfig->KvpncDebugLevel > 4 )
{
- GlobalConfig->appendLogEntry ( "[openvpn] " + i18n( "token name detected: %1\n" ).arg(TokenName), GlobalConfig->debug );
+ GlobalConfig->appendLogEntry ( "[openvpn] " + i18n( "token name detected: %1\n" ).tqarg(TokenName), GlobalConfig->debug );
}
- QTextStream os( socket );
- // os.setEncoding( QTextStream::UnicodeUTF8 );
+ TQTextStream os( socket );
+ // os.setEncoding( TQTextStream::UnicodeUTF8 );
GlobalConfig->TmpPrivateKeyPass = "";
EnterXauthInteractivePasscodeDialog dlg( 0);
dlg.setCaption( i18n( "Enter token pin" ) );
- dlg.main->DescriptionLabel->setText( i18n( "Enter pin for unlocking token \"%1\":" ).arg(GlobalConfig->currentProfile->getPkcs11Id()) );
+ dlg.main->DescriptionLabel->setText( i18n( "Enter pin for unlocking token \"%1\":" ).tqarg(GlobalConfig->currentProfile->getPkcs11Id()) );
dlg.main->LabelPassword->setText( i18n( "PIN:" ) );
dlg.main->SavePasswordCheckBox->hide();
dlg.main->adjustSize();
@@ -765,7 +765,7 @@ void OpenvpnManagementHandler::socketReadyRead()
GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + i18n( "token password got from user" ), GlobalConfig->debug );
- GlobalConfig->TmpPrivateKeyPass = QString( pass );
+ GlobalConfig->TmpPrivateKeyPass = TQString( pass );
// if ( GlobalConfig->KvpncDebugLevel > 5 )
// GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: token password: " + GlobalConfig->TmpPrivateKeyPass, GlobalConfig->debug );
@@ -791,26 +791,26 @@ void OpenvpnManagementHandler::socketReadyRead()
else if ( line.find( "SUCCESS: '", 0, FALSE ) > -1 && line.find( "token' password entered, but not yet verified", 0, FALSE ) > -1 )
{
- QString TokenName = line.section('\'',1,1);
+ TQString TokenName = line.section('\'',1,1);
if ( GlobalConfig->KvpncDebugLevel > 4 )
{
- GlobalConfig->appendLogEntry ( "[openvpn] " + i18n( "token name detected: %1\n" ).arg(TokenName), GlobalConfig->debug );
+ GlobalConfig->appendLogEntry ( "[openvpn] " + i18n( "token name detected: %1\n" ).tqarg(TokenName), GlobalConfig->debug );
}
if ( GlobalConfig->KvpncDebugLevel > 1 )
- GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + i18n( "got %1 message" ).arg("SUCCESS for '%1' password").arg(TokenName), GlobalConfig->debug );
+ GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + i18n( "got %1 message" ).tqarg("SUCCESS for '%1' password").tqarg(TokenName), GlobalConfig->debug );
}
else if ( line.find( "SUCCESS: 'Auth' password entered, but not yet verified", 0, FALSE ) > -1 )
{
if ( GlobalConfig->KvpncDebugLevel > 1 )
- GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + i18n( "got %1 message" ).arg("SUCCESS for user password"), GlobalConfig->debug );
+ GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + i18n( "got %1 message" ).tqarg("SUCCESS for user password"), GlobalConfig->debug );
}
else if ( line.find( "Need 'token-insertion-request'", 0, FALSE ) > -1 )
{
// if ( GlobalConfig->KvpncDebugLevel > 1 )
- GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + i18n( "got %1 message" ).arg("token-insertion-request"), GlobalConfig->debug );
- KMessageBox::error ( 0, i18n("Token \"%1\" is not inserted!").arg(GlobalConfig->currentProfile->getPkcs11Id()), i18n("Token missing") );
+ GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + i18n( "got %1 message" ).tqarg("token-insertion-request"), GlobalConfig->debug );
+ KMessageBox::error ( 0, i18n("Token \"%1\" is not inserted!").tqarg(GlobalConfig->currentProfile->getPkcs11Id()), i18n("Token missing") );
abort = true;
}
@@ -818,7 +818,7 @@ void OpenvpnManagementHandler::socketReadyRead()
{
if ( GlobalConfig->KvpncDebugLevel > 1 )
- GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + i18n( "got %1 message" ).arg("SUCCESS for 'Private Key' password"), GlobalConfig->debug );
+ GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + i18n( "got %1 message" ).tqarg("SUCCESS for 'Private Key' password"), GlobalConfig->debug );
}
else if ( line.find( "external program fork failed", 0, FALSE ) > -1 )
{
@@ -830,22 +830,22 @@ void OpenvpnManagementHandler::socketReadyRead()
else
{
if ( GlobalConfig->KvpncDebugLevel > 1 )
- GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + i18n( "got other management message: %1" ).arg(line), GlobalConfig->debug );
+ GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + i18n( "got other management message: %1" ).tqarg(line), GlobalConfig->debug );
}
if (abort)
{
if (socket)
{
- disconnect( socket, SIGNAL( connected() ), this, SLOT( socketConnected() ) );
- disconnect( socket, SIGNAL( connectionClosed() ), this, SLOT( socketConnectionClosed() ) );
- disconnect( socket, SIGNAL( readyRead() ), this, SLOT( socketReadyRead() ) );
- disconnect( socket, SIGNAL( error( int ) ), this, SLOT( socketError( int ) ) );
- disconnect( socket, SIGNAL( hostFound() ), this, SLOT( hostFound() ) );
+ disconnect( socket, TQT_SIGNAL( connected() ), this, TQT_SLOT( socketConnected() ) );
+ disconnect( socket, TQT_SIGNAL( connectionClosed() ), this, TQT_SLOT( socketConnectionClosed() ) );
+ disconnect( socket, TQT_SIGNAL( readyRead() ), this, TQT_SLOT( socketReadyRead() ) );
+ disconnect( socket, TQT_SIGNAL( error( int ) ), this, TQT_SLOT( socketError( int ) ) );
+ disconnect( socket, TQT_SIGNAL( hostFound() ), this, TQT_SLOT( hostFound() ) );
socket->close();
- if ( socket->state() == QSocket::Closing )
+ if ( socket->state() == TQSocket::Closing )
{
// We have a delayed close.
- connect( socket, SIGNAL(delayedCloseFinished()), this, SLOT(socketClosed()) );
+ connect( socket, TQT_SIGNAL(delayedCloseFinished()), this, TQT_SLOT(socketClosed()) );
}
else
{
@@ -861,7 +861,7 @@ void OpenvpnManagementHandler::socketReadyRead()
{
if ( GlobalConfig->KvpncDebugLevel > 4 )
{
- GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + i18n( "Socket state is strange: %1" ).arg( QString().setNum( socket->state() ) ), GlobalConfig->debug );
+ GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + i18n( "Socket state is strange: %1" ).tqarg( TQString().setNum( socket->state() ) ), GlobalConfig->debug );
}
}
}
@@ -876,23 +876,23 @@ bool OpenvpnManagementHandler::doConnect()
{
socket = 0L;
- socket = new QSocket( this );
+ socket = new TQSocket( this );
if (socket)
{
- connect( socket, SIGNAL( connected() ), this, SLOT( socketConnected() ) );
- connect( socket, SIGNAL( hostFound() ), this, SLOT( hostFound() ) );
- connect( socket, SIGNAL( error( int ) ), this, SLOT( socketError( int ) ) );
+ connect( socket, TQT_SIGNAL( connected() ), this, TQT_SLOT( socketConnected() ) );
+ connect( socket, TQT_SIGNAL( hostFound() ), this, TQT_SLOT( hostFound() ) );
+ connect( socket, TQT_SIGNAL( error( int ) ), this, TQT_SLOT( socketError( int ) ) );
- if ( socket->state() == QSocket::Idle )
+ if ( socket->state() == TQSocket::Idle )
{
if ( GlobalConfig->KvpncDebugLevel > 1 )
{
- GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + i18n( "Connecting to the OpenVPN manage port (%1)..." ).arg( QString().setNum( GlobalConfig->OpenvpnManagementPort ) ), GlobalConfig->debug );
+ GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + i18n( "Connecting to the OpenVPN manage port (%1)..." ).tqarg( TQString().setNum( GlobalConfig->OpenvpnManagementPort ) ), GlobalConfig->debug );
}
socket->connectToHost( "127.0.0.1", GlobalConfig->OpenvpnManagementPort );
- connect ( &greetingtimer, SIGNAL ( timeout() ), this, SLOT ( greetingTimedOut() ) );
+ connect ( &greetingtimer, TQT_SIGNAL ( timeout() ), this, TQT_SLOT ( greetingTimedOut() ) );
greetingtimer.start ( 3 * 1000, TRUE );
if ( GlobalConfig->KvpncDebugLevel > 2 )
@@ -916,10 +916,10 @@ bool OpenvpnManagementHandler::doConnect()
void OpenvpnManagementHandler::hostFound()
{
-// KMessageBox::error ( 0, QString("bar"), QString("foo") );
+// KMessageBox::error ( 0, TQString("bar"), TQString("foo") );
if ( GlobalConfig->KvpncDebugLevel > 1 )
{
- GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + i18n( "Connecting to the OpenVPN manage port (%1)... host found" ).arg( QString().setNum( GlobalConfig->OpenvpnManagementPort ) ), GlobalConfig->debug );
+ GlobalConfig->appendLogEntry( "OpenvpnManagementHandler: " + i18n( "Connecting to the OpenVPN manage port (%1)... host found" ).tqarg( TQString().setNum( GlobalConfig->OpenvpnManagementPort ) ), GlobalConfig->debug );
}
}