summaryrefslogtreecommitdiffstats
path: root/kmail/managesievescriptsdialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kmail/managesievescriptsdialog.cpp')
-rw-r--r--kmail/managesievescriptsdialog.cpp134
1 files changed, 67 insertions, 67 deletions
diff --git a/kmail/managesievescriptsdialog.cpp b/kmail/managesievescriptsdialog.cpp
index 594a467d0..a089c94a6 100644
--- a/kmail/managesievescriptsdialog.cpp
+++ b/kmail/managesievescriptsdialog.cpp
@@ -15,21 +15,21 @@
#include <kglobalsettings.h>
#include <kmessagebox.h>
-#include <qlayout.h>
-#include <qlistview.h>
-#include <qtextedit.h>
-#include <qpopupmenu.h>
+#include <tqlayout.h>
+#include <tqlistview.h>
+#include <tqtextedit.h>
+#include <tqpopupmenu.h>
#include <cassert>
-inline QCheckListItem * qcli_cast( QListViewItem * lvi ) {
- return lvi && lvi->rtti() == 1 ? static_cast<QCheckListItem*>( lvi ) : 0 ;
+inline TQCheckListItem * qcli_cast( TQListViewItem * lvi ) {
+ return lvi && lvi->rtti() == 1 ? static_cast<TQCheckListItem*>( lvi ) : 0 ;
}
-inline const QCheckListItem * qcli_cast( const QListViewItem * lvi ) {
- return lvi && lvi->rtti() == 1 ? static_cast<const QCheckListItem*>( lvi ) : 0 ;
+inline const TQCheckListItem * qcli_cast( const TQListViewItem * lvi ) {
+ return lvi && lvi->rtti() == 1 ? static_cast<const TQCheckListItem*>( lvi ) : 0 ;
}
-KMail::ManageSieveScriptsDialog::ManageSieveScriptsDialog( QWidget * parent, const char * name )
+KMail::ManageSieveScriptsDialog::ManageSieveScriptsDialog( TQWidget * parent, const char * name )
: KDialogBase( Plain, i18n( "Manage Sieve Scripts" ), Close, Close,
parent, name, false ),
mSieveEditor( 0 ),
@@ -39,19 +39,19 @@ KMail::ManageSieveScriptsDialog::ManageSieveScriptsDialog( QWidget * parent, con
setWFlags( WGroupLeader|WDestructiveClose );
KWin::setIcons( winId(), kapp->icon(), kapp->miniIcon() );
- QVBoxLayout * vlay = new QVBoxLayout( plainPage(), 0, 0 );
+ TQVBoxLayout * vlay = new TQVBoxLayout( plainPage(), 0, 0 );
- mListView = new QListView( plainPage() );
+ mListView = new TQListView( plainPage() );
mListView->addColumn( i18n( "Available Scripts" ) );
- mListView->setResizeMode( QListView::LastColumn );
+ mListView->setResizeMode( TQListView::LastColumn );
mListView->setRootIsDecorated( true );
- mListView->setSelectionMode( QListView::Single );
- connect( mListView, SIGNAL(contextMenuRequested(QListViewItem*,const QPoint&,int)),
- this, SLOT(slotContextMenuRequested(QListViewItem*, const QPoint&)) );
- connect( mListView, SIGNAL(doubleClicked(QListViewItem*,const QPoint&,int)),
- this, SLOT(slotDoubleClicked(QListViewItem*)) );
- connect( mListView, SIGNAL(selectionChanged(QListViewItem*)),
- this, SLOT(slotSelectionChanged(QListViewItem*)) );
+ mListView->setSelectionMode( TQListView::Single );
+ connect( mListView, TQT_SIGNAL(contextMenuRequested(TQListViewItem*,const TQPoint&,int)),
+ this, TQT_SLOT(slotContextMenuRequested(TQListViewItem*, const TQPoint&)) );
+ connect( mListView, TQT_SIGNAL(doubleClicked(TQListViewItem*,const TQPoint&,int)),
+ this, TQT_SLOT(slotDoubleClicked(TQListViewItem*)) );
+ connect( mListView, TQT_SIGNAL(selectionChanged(TQListViewItem*)),
+ this, TQT_SLOT(slotSelectionChanged(TQListViewItem*)) );
vlay->addWidget( mListView );
resize( 2 * sizeHint().width(), sizeHint().height() );
@@ -64,7 +64,7 @@ KMail::ManageSieveScriptsDialog::~ManageSieveScriptsDialog() {
}
void KMail::ManageSieveScriptsDialog::killAllJobs() {
- for ( QMap<SieveJob*,QCheckListItem*>::const_iterator it = mJobs.constBegin(), end = mJobs.constEnd() ; it != end ; ++it )
+ for ( TQMap<SieveJob*,TQCheckListItem*>::const_iterator it = mJobs.constBegin(), end = mJobs.constEnd() ; it != end ; ++it )
it.key()->kill();
mJobs.clear();
}
@@ -97,31 +97,31 @@ void KMail::ManageSieveScriptsDialog::slotRefresh() {
KMail::AccountManager * am = kmkernel->acctMgr();
assert( am );
- QCheckListItem * last = 0;
+ TQCheckListItem * last = 0;
for ( KMAccount * a = am->first() ; a ; a = am->next() ) {
- last = new QCheckListItem( mListView, last, a->name(), QCheckListItem::Controller );
+ last = new TQCheckListItem( mListView, last, a->name(), TQCheckListItem::Controller );
last->setPixmap( 0, SmallIcon( "server" ) );
if ( ImapAccountBase * iab = dynamic_cast<ImapAccountBase*>( a ) ) {
const KURL u = ::findUrlForAccount( iab );
if ( u.isEmpty() )
continue;
SieveJob * job = SieveJob::list( u );
- connect( job, SIGNAL(item(KMail::SieveJob*,const QString&,bool)),
- this, SLOT(slotItem(KMail::SieveJob*,const QString&,bool)) );
- connect( job, SIGNAL(result(KMail::SieveJob*,bool,const QString&,bool)),
- this, SLOT(slotResult(KMail::SieveJob*,bool,const QString&,bool)) );
+ connect( job, TQT_SIGNAL(item(KMail::SieveJob*,const TQString&,bool)),
+ this, TQT_SLOT(slotItem(KMail::SieveJob*,const TQString&,bool)) );
+ connect( job, TQT_SIGNAL(result(KMail::SieveJob*,bool,const TQString&,bool)),
+ this, TQT_SLOT(slotResult(KMail::SieveJob*,bool,const TQString&,bool)) );
mJobs.insert( job, last );
mUrls.insert( last, u );
} else {
- QListViewItem * item = new QListViewItem( last, i18n( "No Sieve URL configured" ) );
+ TQListViewItem * item = new TQListViewItem( last, i18n( "No Sieve URL configured" ) );
item->setEnabled( false );
last->setOpen( true );
}
}
}
-void KMail::ManageSieveScriptsDialog::slotResult( KMail::SieveJob * job, bool success, const QString &, bool ) {
- QCheckListItem * parent = mJobs[job];
+void KMail::ManageSieveScriptsDialog::slotResult( KMail::SieveJob * job, bool success, const TQString &, bool ) {
+ TQCheckListItem * parent = mJobs[job];
if ( !parent )
return;
@@ -132,46 +132,46 @@ void KMail::ManageSieveScriptsDialog::slotResult( KMail::SieveJob * job, bool su
if ( success )
return;
- QListViewItem * item = new QListViewItem( parent, i18n( "Failed to fetch the list of scripts" ) );
+ TQListViewItem * item = new TQListViewItem( parent, i18n( "Failed to fetch the list of scripts" ) );
item->setEnabled( false );
}
-void KMail::ManageSieveScriptsDialog::slotItem( KMail::SieveJob * job, const QString & filename, bool isActive ) {
- QCheckListItem * parent = mJobs[job];
+void KMail::ManageSieveScriptsDialog::slotItem( KMail::SieveJob * job, const TQString & filename, bool isActive ) {
+ TQCheckListItem * parent = mJobs[job];
if ( !parent )
return;
- QCheckListItem * item = new QCheckListItem( parent, filename, QCheckListItem::RadioButton );
+ TQCheckListItem * item = new TQCheckListItem( parent, filename, TQCheckListItem::RadioButton );
if ( isActive ) {
item->setOn( true );
mSelectedItems[parent] = item;
}
}
-void KMail::ManageSieveScriptsDialog::slotContextMenuRequested( QListViewItem * i, const QPoint & p ) {
- QCheckListItem * item = qcli_cast( i );
+void KMail::ManageSieveScriptsDialog::slotContextMenuRequested( TQListViewItem * i, const TQPoint & p ) {
+ TQCheckListItem * item = qcli_cast( i );
if ( !item )
return;
if ( !item->depth() && !mUrls.count( item ) )
return;
- QPopupMenu menu;
+ TQPopupMenu menu;
mContextMenuItem = item;
if ( item->depth() ) {
// script items:
- menu.insertItem( i18n( "Delete Script" ), this, SLOT(slotDeleteScript()) );
- menu.insertItem( i18n( "Edit Script..." ), this, SLOT(slotEditScript()) );
+ menu.insertItem( i18n( "Delete Script" ), this, TQT_SLOT(slotDeleteScript()) );
+ menu.insertItem( i18n( "Edit Script..." ), this, TQT_SLOT(slotEditScript()) );
} else {
// top-levels:
- menu.insertItem( i18n( "New Script..." ), this, SLOT(slotNewScript()) );
+ menu.insertItem( i18n( "New Script..." ), this, TQT_SLOT(slotNewScript()) );
}
menu.exec( p );
mContextMenuItem = 0;
}
-void KMail::ManageSieveScriptsDialog::slotSelectionChanged( QListViewItem * i ) {
- QCheckListItem * item = qcli_cast( i );
+void KMail::ManageSieveScriptsDialog::slotSelectionChanged( TQListViewItem * i ) {
+ TQCheckListItem * item = qcli_cast( i );
if ( !item )
return;
- QCheckListItem * parent = qcli_cast( item->parent() );
+ TQCheckListItem * parent = qcli_cast( item->parent() );
if ( !parent )
return;
if ( item->isOn() && mSelectedItems[parent] != item ) {
@@ -180,7 +180,7 @@ void KMail::ManageSieveScriptsDialog::slotSelectionChanged( QListViewItem * i )
}
}
-void KMail::ManageSieveScriptsDialog::changeActiveScript( QCheckListItem * item ) {
+void KMail::ManageSieveScriptsDialog::changeActiveScript( TQCheckListItem * item ) {
if ( !item )
return;
if ( !mUrls.count( item ) )
@@ -190,18 +190,18 @@ void KMail::ManageSieveScriptsDialog::changeActiveScript( QCheckListItem * item
KURL u = mUrls[item];
if ( u.isEmpty() )
return;
- QCheckListItem * selected = mSelectedItems[item];
+ TQCheckListItem * selected = mSelectedItems[item];
if ( !selected )
return;
u.setFileName( selected->text( 0 ) );
SieveJob * job = SieveJob::activate( u );
- connect( job, SIGNAL(result(KMail::SieveJob*,bool,const QString&,bool)),
- this, SLOT(slotRefresh()) );
+ connect( job, TQT_SIGNAL(result(KMail::SieveJob*,bool,const TQString&,bool)),
+ this, TQT_SLOT(slotRefresh()) );
}
-void KMail::ManageSieveScriptsDialog::slotDoubleClicked( QListViewItem * i ) {
- QCheckListItem * item = qcli_cast( i );
+void KMail::ManageSieveScriptsDialog::slotDoubleClicked( TQListViewItem * i ) {
+ TQCheckListItem * item = qcli_cast( i );
if ( !item )
return;
if ( !item->depth() )
@@ -217,7 +217,7 @@ void KMail::ManageSieveScriptsDialog::slotDeleteScript() {
if ( !mContextMenuItem->depth() )
return;
- QCheckListItem * parent = qcli_cast( mContextMenuItem->parent() );
+ TQCheckListItem * parent = qcli_cast( mContextMenuItem->parent() );
if ( !parent )
return;
@@ -237,8 +237,8 @@ void KMail::ManageSieveScriptsDialog::slotDeleteScript() {
return;
SieveJob * job = SieveJob::del( u );
- connect( job, SIGNAL(result(KMail::SieveJob*,bool,const QString&,bool)),
- this, SLOT(slotRefresh()) );
+ connect( job, TQT_SIGNAL(result(KMail::SieveJob*,bool,const TQString&,bool)),
+ this, TQT_SLOT(slotRefresh()) );
}
void KMail::ManageSieveScriptsDialog::slotEditScript() {
@@ -246,7 +246,7 @@ void KMail::ManageSieveScriptsDialog::slotEditScript() {
return;
if ( !mContextMenuItem->depth() )
return;
- QCheckListItem * parent = qcli_cast( mContextMenuItem->parent() );
+ TQCheckListItem * parent = qcli_cast( mContextMenuItem->parent() );
if ( !mUrls.count( parent ) )
return;
KURL url = mUrls[parent];
@@ -255,8 +255,8 @@ void KMail::ManageSieveScriptsDialog::slotEditScript() {
url.setFileName( mContextMenuItem->text( 0 ) );
mCurrentURL = url;
SieveJob * job = SieveJob::get( url );
- connect( job, SIGNAL(result(KMail::SieveJob*,bool,const QString&,bool)),
- this, SLOT(slotGetResult(KMail::SieveJob*,bool,const QString&,bool)) );
+ connect( job, TQT_SIGNAL(result(KMail::SieveJob*,bool,const TQString&,bool)),
+ this, TQT_SLOT(slotGetResult(KMail::SieveJob*,bool,const TQString&,bool)) );
}
void KMail::ManageSieveScriptsDialog::slotNewScript() {
@@ -275,7 +275,7 @@ void KMail::ManageSieveScriptsDialog::slotNewScript() {
return;
bool ok = false;
- const QString name = KInputDialog::getText( i18n( "New Sieve Script" ),
+ const TQString name = KInputDialog::getText( i18n( "New Sieve Script" ),
i18n( "Please enter a name for the new Sieve script:" ),
i18n( "unnamed" ), &ok, this );
if ( !ok || name.isEmpty() )
@@ -283,20 +283,20 @@ void KMail::ManageSieveScriptsDialog::slotNewScript() {
u.setFileName( name );
- (void) new QCheckListItem( mContextMenuItem, name, QCheckListItem::RadioButton );
+ (void) new TQCheckListItem( mContextMenuItem, name, TQCheckListItem::RadioButton );
mCurrentURL = u;
- slotGetResult( 0, true, QString::null, false );
+ slotGetResult( 0, true, TQString::null, false );
}
-KMail::SieveEditor::SieveEditor( QWidget * parent, const char * name )
+KMail::SieveEditor::SieveEditor( TQWidget * parent, const char * name )
: KDialogBase( Plain, i18n( "Edit Sieve Script" ), Ok|Cancel, Ok, parent, name )
{
- QVBoxLayout * vlay = new QVBoxLayout( plainPage(), 0, spacingHint() );
- mTextEdit = new QTextEdit( plainPage() );
+ TQVBoxLayout * vlay = new TQVBoxLayout( plainPage(), 0, spacingHint() );
+ mTextEdit = new TQTextEdit( plainPage() );
vlay->addWidget( mTextEdit );
- mTextEdit->setTextFormat( QTextEdit::PlainText );
- mTextEdit->setWordWrap( QTextEdit::NoWrap );
+ mTextEdit->setTextFormat( TQTextEdit::PlainText );
+ mTextEdit->setWordWrap( TQTextEdit::NoWrap );
mTextEdit->setFont( KGlobalSettings::fixedFont() );
resize( 3 * sizeHint() );
@@ -304,7 +304,7 @@ KMail::SieveEditor::SieveEditor( QWidget * parent, const char * name )
KMail::SieveEditor::~SieveEditor() {}
-void KMail::ManageSieveScriptsDialog::slotGetResult( KMail::SieveJob *, bool success, const QString & script, bool isActive ) {
+void KMail::ManageSieveScriptsDialog::slotGetResult( KMail::SieveJob *, bool success, const TQString & script, bool isActive ) {
if ( !success )
return;
@@ -313,8 +313,8 @@ void KMail::ManageSieveScriptsDialog::slotGetResult( KMail::SieveJob *, bool suc
mSieveEditor = new SieveEditor( this );
mSieveEditor->setScript( script );
- connect( mSieveEditor, SIGNAL(okClicked()), this, SLOT(slotSieveEditorOkClicked()) );
- connect( mSieveEditor, SIGNAL(cancelClicked()), this, SLOT(slotSieveEditorCancelClicked()) );
+ connect( mSieveEditor, TQT_SIGNAL(okClicked()), this, TQT_SLOT(slotSieveEditorOkClicked()) );
+ connect( mSieveEditor, TQT_SIGNAL(cancelClicked()), this, TQT_SLOT(slotSieveEditorCancelClicked()) );
mSieveEditor->show();
mWasActive = isActive;
}
@@ -323,8 +323,8 @@ void KMail::ManageSieveScriptsDialog::slotSieveEditorOkClicked() {
if ( !mSieveEditor )
return;
SieveJob * job = SieveJob::put( mCurrentURL,mSieveEditor->script(), mWasActive, mWasActive );
- connect( job, SIGNAL(result(KMail::SieveJob*,bool,const QString&,bool)),
- this, SLOT(slotPutResult(KMail::SieveJob*,bool)) );
+ connect( job, TQT_SIGNAL(result(KMail::SieveJob*,bool,const TQString&,bool)),
+ this, TQT_SLOT(slotPutResult(KMail::SieveJob*,bool)) );
}
void KMail::ManageSieveScriptsDialog::slotSieveEditorCancelClicked() {