From 1b89319fd93b88313cab40f1e9de24c067b04efb Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Tue, 6 Dec 2011 14:15:01 -0600 Subject: Initial TQt conversion --- src/manageciscocert.cpp | 102 ++++++++++++++++++++++++------------------------ 1 file changed, 51 insertions(+), 51 deletions(-) (limited to 'src/manageciscocert.cpp') diff --git a/src/manageciscocert.cpp b/src/manageciscocert.cpp index 611d185..c05ce1a 100644 --- a/src/manageciscocert.cpp +++ b/src/manageciscocert.cpp @@ -22,10 +22,10 @@ #include "importcertificatedialog.h" #include "displaycertdialog.h" -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -38,19 +38,19 @@ #include -ManageCiscoCert::ManageCiscoCert(QWidget *parent, const char* caption, KVpncConfig *GlobalConfig) : KDialogBase (parent, i18n ( "Manage Cisco certificates..." ).ascii(), true, caption, KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok, true) +ManageCiscoCert::ManageCiscoCert(TQWidget *parent, const char* caption, KVpncConfig *GlobalConfig) : KDialogBase (parent, i18n ( "Manage Cisco certificates..." ).ascii(), true, caption, KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok, true) { main = new ManageCiscoCertBase ( this ); setMainWidget ( main ); - main->sizeHint(); + main->tqsizeHint(); // main->show(); -// main->setMinimumSize ( main->sizeHint() ); - sizeHint(); +// main->setMinimumSize ( main->tqsizeHint() ); + tqsizeHint(); this->GlobalConfig = GlobalConfig; - connect (main->ImportCertFilePushButton,SIGNAL(clicked()),this,SLOT(importCertClicked())); - connect (main->DeleteCertPushButton,SIGNAL(clicked()),this,SLOT(deleteCertClicked())); - connect (main->CertListView,SIGNAL(contextMenuRequested ( QListViewItem *, const QPoint &, int )),this,SLOT(contextMenuRequested ( QListViewItem *, const QPoint &, int ))); + connect (main->ImportCertFilePushButton,TQT_SIGNAL(clicked()),this,TQT_SLOT(importCertClicked())); + connect (main->DeleteCertPushButton,TQT_SIGNAL(clicked()),this,TQT_SLOT(deleteCertClicked())); + connect (main->CertListView,TQT_SIGNAL(contextMenuRequested ( TQListViewItem *, const TQPoint &, int )),this,TQT_SLOT(contextMenuRequested ( TQListViewItem *, const TQPoint &, int ))); checkList(); } @@ -63,17 +63,17 @@ void ManageCiscoCert::deleteCertClicked() { if ( main->CertListView->childCount() > 0 && main->CertListView->currentItem()!= 0 ) { - QListViewItem *item = main->CertListView->currentItem(); + TQListViewItem *item = main->CertListView->currentItem(); - int result = KMessageBox::questionYesNo ( this, i18n( "Do you really want to delete the cert \"%1\" (type: %2) from cert store?" ).arg(item->text(1).arg(item->text(2))), i18n( "Delete certificate?" ) ); + int result = KMessageBox::questionYesNo ( this, i18n( "Do you really want to delete the cert \"%1\" (type: %2) from cert store?" ).tqarg(item->text(1).tqarg(item->text(2))), i18n( "Delete certificate?" ) ); // if ( GlobalConfig->KvpncDebugLevel > 2 ) -// GlobalConfig->appendLogEntry( "Result: "+ QString().setNum(result), GlobalConfig->debug ) ; +// GlobalConfig->appendLogEntry( "Result: "+ TQString().setNum(result), GlobalConfig->debug ) ; if ( result == 3) // Yes { - DeleteProcess = new QProcess(0); + DeleteProcess = new TQProcess(0); DeleteProcess->addArgument ( GlobalConfig->pathToCiscoCertMgr ); if (item->text(2) == i18n("User")) @@ -85,11 +85,11 @@ void ManageCiscoCert::deleteCertClicked() DeleteProcess->addArgument ( "-ct" ); DeleteProcess->addArgument ( item->text(0) ); - connect ( DeleteProcess, SIGNAL ( readyReadStdout() ), this, SLOT ( readFromStdout_remove() ) ); - connect ( DeleteProcess, SIGNAL ( readyReadStderr() ), this, SLOT ( readFromStderr_remove() ) ); - connect ( DeleteProcess, SIGNAL ( processExited()) , this, SLOT(deleteProcessFinished())); + connect ( DeleteProcess, TQT_SIGNAL ( readyReadStdout() ), this, TQT_SLOT ( readFromStdout_remove() ) ); + connect ( DeleteProcess, TQT_SIGNAL ( readyReadStderr() ), this, TQT_SLOT ( readFromStderr_remove() ) ); + connect ( DeleteProcess, TQT_SIGNAL ( processExited()) , this, TQT_SLOT(deleteProcessFinished())); - QStringList *env = new QStringList(); + TQStringList *env = new TQStringList(); *env << "LC_ALL=C" << "LANG=C" << "PATH=/bin:/usr/bin:/usr/sbin:/sbin"; if ( !DeleteProcess->start ( env ) ) @@ -103,7 +103,7 @@ void ManageCiscoCert::deleteCertClicked() if ( GlobalConfig->KvpncDebugLevel > 2 ) GlobalConfig->appendLogEntry ( i18n ( "Process (%1) started." ).arg ("cisco_cert_mgr" ),GlobalConfig->debug ); - QCString password; + TQCString password; int result = KPasswordDialog::getPassword(password, i18n("Certificate password")); if (result == KPasswordDialog::Accepted) @@ -112,16 +112,16 @@ void ManageCiscoCert::deleteCertClicked() if ( GlobalConfig->KvpncDebugLevel > 2 ) GlobalConfig->appendLogEntry ( i18n ( "Certicate password got from user, send it..." ),GlobalConfig->debug ); - DeleteProcess->writeToStdin( QString(password)+"\n"); + DeleteProcess->writeToStdin( TQString(password)+"\n"); while (DeleteProcess->isRunning()) { sleep(1); } checkList(); - disconnect ( DeleteProcess, SIGNAL ( readyReadStdout() ), this, SLOT ( readFromStdout_remove() ) ); - disconnect ( DeleteProcess, SIGNAL ( readyReadStderr() ), this, SLOT ( readFromStderr_remove() ) ); - disconnect ( DeleteProcess, SIGNAL ( processExited()) , this, SLOT(deleteProcessFinished())); + disconnect ( DeleteProcess, TQT_SIGNAL ( readyReadStdout() ), this, TQT_SLOT ( readFromStdout_remove() ) ); + disconnect ( DeleteProcess, TQT_SIGNAL ( readyReadStderr() ), this, TQT_SLOT ( readFromStderr_remove() ) ); + disconnect ( DeleteProcess, TQT_SIGNAL ( processExited()) , this, TQT_SLOT(deleteProcessFinished())); delete DeleteProcess; DeleteProcess=0L; } @@ -160,11 +160,11 @@ void ManageCiscoCert::showCertClicked() { if ( main->CertListView->childCount() > 0 && main->CertListView->currentItem()!= 0 ) { - QListViewItem *item = main->CertListView->currentItem(); + TQListViewItem *item = main->CertListView->currentItem(); CertDataName=item->text(1); CertStartFound=false; - ShowProcess = new QProcess(0); + ShowProcess = new TQProcess(0); ShowProcess->addArgument ( GlobalConfig->pathToCiscoCertMgr ); if (item->text(2) == i18n("User")) @@ -182,14 +182,14 @@ void ManageCiscoCert::showCertClicked() ShowProcess->addArgument ( "-ct" ); ShowProcess->addArgument ( item->text(0) ); - connect ( ShowProcess, SIGNAL ( readyReadStdout() ), this, SLOT ( readFromStdout_display() ) ); - connect ( ShowProcess, SIGNAL ( readyReadStderr() ), this, SLOT ( readFromStderr_display() ) ); - connect ( ShowProcess, SIGNAL ( processExited()) , this, SLOT(showProcessFinished())); + connect ( ShowProcess, TQT_SIGNAL ( readyReadStdout() ), this, TQT_SLOT ( readFromStdout_display() ) ); + connect ( ShowProcess, TQT_SIGNAL ( readyReadStderr() ), this, TQT_SLOT ( readFromStderr_display() ) ); + connect ( ShowProcess, TQT_SIGNAL ( processExited()) , this, TQT_SLOT(showProcessFinished())); - QStringList *env = new QStringList(); + TQStringList *env = new TQStringList(); *env << "LC_ALL=C" << "LANG=C" << "PATH=/bin:/usr/bin:/usr/sbin:/sbin"; - GlobalConfig->appPointer->setOverrideCursor( QCursor(Qt::WaitCursor) ); + GlobalConfig->appPointer->setOverrideCursor( TQCursor(TQt::WaitCursor) ); if (GlobalConfig->KvpncDebugLevel > 2) GlobalConfig->appendLogEntry(i18n("Getting cert info from Cisco certificate store..."), GlobalConfig->debug); if ( !ShowProcess->start ( env ) ) @@ -206,9 +206,9 @@ void ManageCiscoCert::showCertClicked() GlobalConfig->appPointer->processEvents(); } } - disconnect ( ShowProcess, SIGNAL ( readyReadStdout() ), this, SLOT ( readFromStdout_display() ) ); - disconnect ( ShowProcess, SIGNAL ( readyReadStderr() ), this, SLOT ( readFromStderr_display() ) ); - disconnect ( ShowProcess, SIGNAL ( processExited()) , this, SLOT(showProcessFinished())); + disconnect ( ShowProcess, TQT_SIGNAL ( readyReadStdout() ), this, TQT_SLOT ( readFromStdout_display() ) ); + disconnect ( ShowProcess, TQT_SIGNAL ( readyReadStderr() ), this, TQT_SLOT ( readFromStderr_display() ) ); + disconnect ( ShowProcess, TQT_SIGNAL ( processExited()) , this, TQT_SLOT(showProcessFinished())); } } @@ -246,20 +246,20 @@ void ManageCiscoCert::checkList() { main->CertListView->clear(); - GlobalConfig->appPointer->setOverrideCursor( QCursor(Qt::WaitCursor) ); + GlobalConfig->appPointer->setOverrideCursor( TQCursor(TQt::WaitCursor) ); GlobalConfig->slotStatusMsg(i18n("Collecting cisco certs from Cisco certificate store..."), ID_STATUS_MSG); if (GlobalConfig->KvpncDebugLevel > 2) GlobalConfig->appendLogEntry(i18n("Looking for certs in Cisco certificate store..."), GlobalConfig->debug); - QStringList CiscoCerts = Utils(GlobalConfig).getCertsFromCiscoCertStore("user"); + TQStringList CiscoCerts = Utils(GlobalConfig).getCertsFromCiscoCertStore("user"); if (GlobalConfig->KvpncDebugLevel > 2) GlobalConfig->appendLogEntry(i18n("Done."), GlobalConfig->debug); GlobalConfig->slotStatusMsg(i18n("Collecting cisco CA certs from Cisco certificate store..."), ID_STATUS_MSG); if (GlobalConfig->KvpncDebugLevel > 2) GlobalConfig->appendLogEntry(i18n("Looking for CA certs in Cisco certificate store..."), GlobalConfig->debug); - QStringList CiscoCaCerts = Utils(GlobalConfig).getCertsFromCiscoCertStore("ca"); + TQStringList CiscoCaCerts = Utils(GlobalConfig).getCertsFromCiscoCertStore("ca"); if (GlobalConfig->KvpncDebugLevel > 2) GlobalConfig->appendLogEntry(i18n("Done."), GlobalConfig->debug); @@ -269,18 +269,18 @@ void ManageCiscoCert::checkList() main->CertListView->takeItem(main->CertListView->currentItem()); int current_user_idx=0; int current_ca_idx=0; - for ( QStringList::Iterator it = CiscoCerts.begin(); it != CiscoCerts.end(); ++it ) + for ( TQStringList::Iterator it = CiscoCerts.begin(); it != CiscoCerts.end(); ++it ) { if (GlobalConfig->KvpncDebugLevel > 2) - std::cout << "insert item (cisco certs): " << QString(*it) << std::endl; - main->CertListView->insertItem( new QListViewItem(main->CertListView, QString().setNum(current_user_idx),QString(*it),i18n("User"))); + std::cout << "insert item (cisco certs): " << TQString(*it) << std::endl; + main->CertListView->insertItem( new TQListViewItem(main->CertListView, TQString().setNum(current_user_idx),TQString(*it),i18n("User"))); current_user_idx++; } - for ( QStringList::Iterator it = CiscoCaCerts.begin(); it != CiscoCaCerts.end(); ++it ) + for ( TQStringList::Iterator it = CiscoCaCerts.begin(); it != CiscoCaCerts.end(); ++it ) { if (GlobalConfig->KvpncDebugLevel > 2) - std::cout << "insert item (cisco certs): " << QString(*it) << std::endl; - main->CertListView->insertItem( new QListViewItem(main->CertListView, QString().setNum(current_ca_idx),QString(*it),i18n("CA"))); + std::cout << "insert item (cisco certs): " << TQString(*it) << std::endl; + main->CertListView->insertItem( new TQListViewItem(main->CertListView, TQString().setNum(current_ca_idx),TQString(*it),i18n("CA"))); current_ca_idx++; } @@ -300,7 +300,7 @@ void ManageCiscoCert::readFromStdout_remove() { while ( DeleteProcess->canReadLineStdout() ) { - QString line = QString ( DeleteProcess->readLineStdout() ); + TQString line = TQString ( DeleteProcess->readLineStdout() ); if ( GlobalConfig->KvpncDebugLevel > 2 ) GlobalConfig->appendLogEntry ( "[cisco_cert_mgr]: "+line,GlobalConfig->debug ); @@ -311,7 +311,7 @@ void ManageCiscoCert::readFromStderr_remove() { while ( DeleteProcess->canReadLineStderr() ) { - QString line = QString ( DeleteProcess->readLineStderr() ); + TQString line = TQString ( DeleteProcess->readLineStderr() ); GlobalConfig->appendLogEntry ( "[cisco_cert_mgr err]: "+line ,GlobalConfig->error ); } checkList(); @@ -322,7 +322,7 @@ void ManageCiscoCert::readFromStdout_display() { while ( ShowProcess->canReadLineStdout() ) { - QString line = QString ( ShowProcess->readLineStdout() ); + TQString line = TQString ( ShowProcess->readLineStdout() ); if ( GlobalConfig->KvpncDebugLevel > 2 ) GlobalConfig->appendLogEntry ( "[cisco_cert_mgr]: "+line,GlobalConfig->debug ); @@ -349,15 +349,15 @@ void ManageCiscoCert::readFromStderr_display() { while ( ShowProcess->canReadLineStderr() ) { - QString line = QString ( ShowProcess->readLineStderr() ); + TQString line = TQString ( ShowProcess->readLineStderr() ); GlobalConfig->appendLogEntry ( "[cisco_cert_mgr err]: "+line ,GlobalConfig->error ); } } -void ManageCiscoCert::contextMenuRequested ( QListViewItem * item, const QPoint &pos, int ) +void ManageCiscoCert::contextMenuRequested ( TQListViewItem * item, const TQPoint &pos, int ) { - ContextMenu = new QPopupMenu ( 0 ); + ContextMenu = new TQPopupMenu ( 0 ); if (item != 0) { ContextMenu->insertItem(i18n("&Show...")); @@ -365,14 +365,14 @@ void ManageCiscoCert::contextMenuRequested ( QListViewItem * item, const QPoint ContextMenu->insertItem(i18n("&Delete...")); } ContextMenu->insertItem(i18n("&Add...")); - connect ( ContextMenu, SIGNAL ( activated ( int ) ), this, SLOT ( doContextMenuAction ( int ) ) ); + connect ( ContextMenu, TQT_SIGNAL ( activated ( int ) ), this, TQT_SLOT ( doContextMenuAction ( int ) ) ); ContextMenu->show(); ContextMenu->setGeometry(pos.x(),pos.y(), ContextMenu->width(),ContextMenu->height()); } void ManageCiscoCert::doContextMenuAction ( int action) { - QString itemtext = ContextMenu->text ( action ); + TQString itemtext = ContextMenu->text ( action ); // std::cout << "action: " << itemtext << std::endl; if (itemtext == i18n("&Delete...")) deleteCertClicked(); -- cgit v1.2.1