summaryrefslogtreecommitdiffstats
path: root/certmanager/kwatchgnupg/kwatchgnupgmainwin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'certmanager/kwatchgnupg/kwatchgnupgmainwin.cpp')
-rw-r--r--certmanager/kwatchgnupg/kwatchgnupgmainwin.cpp102
1 files changed, 51 insertions, 51 deletions
diff --git a/certmanager/kwatchgnupg/kwatchgnupgmainwin.cpp b/certmanager/kwatchgnupg/kwatchgnupgmainwin.cpp
index 19bda278b..234973b6e 100644
--- a/certmanager/kwatchgnupg/kwatchgnupgmainwin.cpp
+++ b/certmanager/kwatchgnupg/kwatchgnupgmainwin.cpp
@@ -49,36 +49,36 @@
#include <kedittoolbar.h>
#include <kkeydialog.h>
-#include <qtextedit.h>
-#include <qdir.h>
-#include <qeventloop.h>
-#include <qtimer.h>
-#include <qtextcodec.h>
+#include <tqtextedit.h>
+#include <tqdir.h>
+#include <tqeventloop.h>
+#include <tqtimer.h>
+#include <tqtextcodec.h>
#define WATCHGNUPGBINARY "watchgnupg"
-#define WATCHGNUPGSOCKET ( QDir::home().canonicalPath() + "/.gnupg/log-socket")
+#define WATCHGNUPGSOCKET ( TQDir::home().canonicalPath() + "/.gnupg/log-socket")
-KWatchGnuPGMainWindow::KWatchGnuPGMainWindow( QWidget* parent, const char* name )
+KWatchGnuPGMainWindow::KWatchGnuPGMainWindow( TQWidget* parent, const char* name )
: KMainWindow( parent, name, WType_TopLevel ), mConfig(0)
{
createActions();
createGUI();
- mCentralWidget = new QTextEdit( this, "central log view" );
- mCentralWidget->setTextFormat( QTextEdit::LogText );
+ mCentralWidget = new TQTextEdit( this, "central log view" );
+ mCentralWidget->setTextFormat( TQTextEdit::LogText );
setCentralWidget( mCentralWidget );
- mWatcher = new KProcIO( QTextCodec::codecForMib( 106 /*utf-8*/ ) );
- connect( mWatcher, SIGNAL( processExited(KProcess*) ),
- this, SLOT( slotWatcherExited() ) );
- connect( mWatcher, SIGNAL( readReady(KProcIO*) ),
- this, SLOT( slotReadStdout() ) );
+ mWatcher = new KProcIO( TQTextCodec::codecForMib( 106 /*utf-8*/ ) );
+ connect( mWatcher, TQT_SIGNAL( processExited(KProcess*) ),
+ this, TQT_SLOT( slotWatcherExited() ) );
+ connect( mWatcher, TQT_SIGNAL( readReady(KProcIO*) ),
+ this, TQT_SLOT( slotReadStdout() ) );
slotReadConfig();
mSysTray = new KWatchGnuPGTray( this );
mSysTray->show();
- connect( mSysTray, SIGNAL( quitSelected() ),
- this, SLOT( slotQuit() ) );
+ connect( mSysTray, TQT_SIGNAL( quitSelected() ),
+ this, TQT_SLOT( slotQuit() ) );
setAutoSaveSettings();
}
@@ -90,24 +90,24 @@ KWatchGnuPGMainWindow::~KWatchGnuPGMainWindow()
void KWatchGnuPGMainWindow::slotClear()
{
mCentralWidget->clear();
- mCentralWidget->append( tr("[%1] Log cleared").arg( QDateTime::currentDateTime().toString(Qt::ISODate) ) );
+ mCentralWidget->append( tr("[%1] Log cleared").arg( TQDateTime::currentDateTime().toString(Qt::ISODate) ) );
}
void KWatchGnuPGMainWindow::createActions()
{
(void)new KAction( i18n("C&lear History"), "history_clear", CTRL+Key_L,
- this, SLOT( slotClear() ),
+ this, TQT_SLOT( slotClear() ),
actionCollection(), "clear_log" );
- (void)KStdAction::saveAs( this, SLOT(slotSaveAs()), actionCollection() );
- (void)KStdAction::close( this, SLOT(close()), actionCollection() );
- (void)KStdAction::quit( this, SLOT(slotQuit()), actionCollection() );
- (void)KStdAction::preferences( this, SLOT(slotConfigure()), actionCollection() );
- ( void )KStdAction::keyBindings(this, SLOT(configureShortcuts()), actionCollection());
- ( void )KStdAction::configureToolbars(this, SLOT(slotConfigureToolbars()), actionCollection());
+ (void)KStdAction::saveAs( this, TQT_SLOT(slotSaveAs()), actionCollection() );
+ (void)KStdAction::close( this, TQT_SLOT(close()), actionCollection() );
+ (void)KStdAction::quit( this, TQT_SLOT(slotQuit()), actionCollection() );
+ (void)KStdAction::preferences( this, TQT_SLOT(slotConfigure()), actionCollection() );
+ ( void )KStdAction::keyBindings(this, TQT_SLOT(configureShortcuts()), actionCollection());
+ ( void )KStdAction::configureToolbars(this, TQT_SLOT(slotConfigureToolbars()), actionCollection());
#if 0
- (void)new KAction( i18n("Configure KWatchGnuPG..."), QString::fromLatin1("configure"),
- 0, this, SLOT( slotConfigure() ),
+ (void)new KAction( i18n("Configure KWatchGnuPG..."), TQString::fromLatin1("configure"),
+ 0, this, TQT_SLOT( slotConfigure() ),
actionCollection(), "configure" );
#endif
@@ -127,15 +127,15 @@ void KWatchGnuPGMainWindow::slotConfigureToolbars()
void KWatchGnuPGMainWindow::startWatcher()
{
- disconnect( mWatcher, SIGNAL( processExited(KProcess*) ),
- this, SLOT( slotWatcherExited() ) );
+ disconnect( mWatcher, TQT_SIGNAL( processExited(KProcess*) ),
+ this, TQT_SLOT( slotWatcherExited() ) );
if( mWatcher->isRunning() ) {
mWatcher->kill();
while( mWatcher->isRunning() ) {
- kapp->eventLoop()->processEvents(QEventLoop::ExcludeUserInput);
+ kapp->eventLoop()->processEvents(TQEventLoop::ExcludeUserInput);
}
mCentralWidget->append(tr("[%1] Log stopped")
- .arg( QDateTime::currentDateTime().toString(Qt::ISODate)));
+ .arg( TQDateTime::currentDateTime().toString(Qt::ISODate)));
}
mWatcher->clearArguments();
KConfig* config = kapp->config();
@@ -143,20 +143,20 @@ void KWatchGnuPGMainWindow::startWatcher()
*mWatcher << config->readEntry("Executable", WATCHGNUPGBINARY);
*mWatcher << "--force";
*mWatcher << config->readEntry("Socket", WATCHGNUPGSOCKET);
- config->setGroup(QString::null);
+ config->setGroup(TQString::null);
if( !mWatcher->start() ) {
KMessageBox::sorry( this, i18n("The watchgnupg logging process could not be started.\nPlease install watchgnupg somewhere in your $PATH.\nThis log window is now completely useless." ) );
} else {
mCentralWidget->append( tr("[%1] Log started")
- .arg( QDateTime::currentDateTime().toString(Qt::ISODate) ) );
+ .arg( TQDateTime::currentDateTime().toString(Qt::ISODate) ) );
}
- connect( mWatcher, SIGNAL( processExited(KProcess*) ),
- this, SLOT( slotWatcherExited() ) );
+ connect( mWatcher, TQT_SIGNAL( processExited(KProcess*) ),
+ this, TQT_SLOT( slotWatcherExited() ) );
}
void KWatchGnuPGMainWindow::setGnuPGConfig()
{
- QStringList logclients;
+ TQStringList logclients;
// Get config object
Kleo::CryptoConfig* cconfig = Kleo::CryptoBackendFactory::instance()->config();
if ( !cconfig )
@@ -164,8 +164,8 @@ void KWatchGnuPGMainWindow::setGnuPGConfig()
//Q_ASSERT( cconfig );
KConfig* config = kapp->config();
config->setGroup("WatchGnuPG");
- QStringList comps = cconfig->componentList();
- for( QStringList::const_iterator it = comps.begin(); it != comps.end(); ++it ) {
+ TQStringList comps = cconfig->componentList();
+ for( TQStringList::const_iterator it = comps.begin(); it != comps.end(); ++it ) {
Kleo::CryptoConfigComponent* comp = cconfig->component( *it );
Q_ASSERT(comp);
// Look for log-file entry in Debug group
@@ -173,10 +173,10 @@ void KWatchGnuPGMainWindow::setGnuPGConfig()
if( group ) {
Kleo::CryptoConfigEntry* entry = group->entry("log-file");
if( entry ) {
- entry->setStringValue( QString("socket://")+
+ entry->setStringValue( TQString("socket://")+
config->readEntry("Socket",
WATCHGNUPGSOCKET ));
- logclients << QString("%1 (%2)").arg(*it).arg(comp->description());
+ logclients << TQString("%1 (%2)").arg(*it).arg(comp->description());
}
entry = group->entry("debug-level");
if( entry ) {
@@ -192,7 +192,7 @@ void KWatchGnuPGMainWindow::setGnuPGConfig()
void KWatchGnuPGMainWindow::slotWatcherExited()
{
- if( KMessageBox::questionYesNo( this, i18n("The watchgnupg logging process died.\nDo you want to try to restart it?"), QString::null, i18n("Try Restart"), i18n("Do Not Try") ) == KMessageBox::Yes ) {
+ if( KMessageBox::questionYesNo( this, i18n("The watchgnupg logging process died.\nDo you want to try to restart it?"), TQString::null, i18n("Try Restart"), i18n("Do Not Try") ) == KMessageBox::Yes ) {
mCentralWidget->append( i18n("====== Restarting logging process =====") );
startWatcher();
} else {
@@ -204,7 +204,7 @@ void KWatchGnuPGMainWindow::slotReadStdout()
{
if ( !mWatcher )
return;
- QString str;
+ TQString str;
while( mWatcher->readln(str,false) > 0 ) {
mCentralWidget->append( str );
if( !isVisible() ) {
@@ -213,7 +213,7 @@ void KWatchGnuPGMainWindow::slotReadStdout()
mSysTray->setAttention(true);
}
}
- QTimer::singleShot( 0, this, SLOT(slotAckRead()) );
+ TQTimer::singleShot( 0, this, TQT_SLOT(slotAckRead()) );
}
void KWatchGnuPGMainWindow::slotAckRead() {
@@ -229,10 +229,10 @@ void KWatchGnuPGMainWindow::show()
void KWatchGnuPGMainWindow::slotSaveAs()
{
- QString filename = KFileDialog::getSaveFileName( QString::null, QString::null,
+ TQString filename = KFileDialog::getSaveFileName( TQString::null, TQString::null,
this, i18n("Save Log to File") );
if( filename.isEmpty() ) return;
- QFile file(filename);
+ TQFile file(filename);
if( file.exists() ) {
if( KMessageBox::Yes !=
KMessageBox::warningYesNo( this, i18n("The file named \"%1\" already "
@@ -243,7 +243,7 @@ void KWatchGnuPGMainWindow::slotSaveAs()
}
}
if( file.open( IO_WriteOnly ) ) {
- QTextStream st(&file);
+ TQTextStream st(&file);
st << mCentralWidget->text();
file.close();
}
@@ -251,8 +251,8 @@ void KWatchGnuPGMainWindow::slotSaveAs()
void KWatchGnuPGMainWindow::slotQuit()
{
- disconnect( mWatcher, SIGNAL( processExited(KProcess*) ),
- this, SLOT( slotWatcherExited() ) );
+ disconnect( mWatcher, TQT_SIGNAL( processExited(KProcess*) ),
+ this, TQT_SLOT( slotWatcherExited() ) );
mWatcher->kill();
kapp->quit();
}
@@ -261,8 +261,8 @@ void KWatchGnuPGMainWindow::slotConfigure()
{
if( !mConfig ) {
mConfig = new KWatchGnuPGConfig( this, "config dialog" );
- connect( mConfig, SIGNAL( reconfigure() ),
- this, SLOT( slotReadConfig() ) );
+ connect( mConfig, TQT_SIGNAL( reconfigure() ),
+ this, TQT_SLOT( slotReadConfig() ) );
}
mConfig->loadConfig();
mConfig->exec();
@@ -273,8 +273,8 @@ void KWatchGnuPGMainWindow::slotReadConfig()
KConfig* config = kapp->config();
config->setGroup("LogWindow");
mCentralWidget->setWordWrap( config->readBoolEntry("WordWrap", false)
- ?QTextEdit::WidgetWidth
- :QTextEdit::NoWrap );
+ ?TQTextEdit::WidgetWidth
+ :TQTextEdit::NoWrap );
mCentralWidget->setMaxLogLines( config->readNumEntry( "MaxLogLen", 10000 ) );
setGnuPGConfig();
startWatcher();