diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
commit | 7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch) | |
tree | 8474f9b444b2756228600050f07a7ff25de532b2 /kmail/kmfilterdlg.cpp | |
parent | f587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff) | |
download | tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmail/kmfilterdlg.cpp')
-rw-r--r-- | kmail/kmfilterdlg.cpp | 420 |
1 files changed, 210 insertions, 210 deletions
diff --git a/kmail/kmfilterdlg.cpp b/kmail/kmfilterdlg.cpp index 29bbe037a..c5589c943 100644 --- a/kmail/kmfilterdlg.cpp +++ b/kmail/kmfilterdlg.cpp @@ -31,16 +31,16 @@ using KMail::FilterImporterExporter; #include <kpushbutton.h> // other Qt headers: -#include <qlayout.h> -#include <qlabel.h> -#include <qcombobox.h> -#include <qwidgetstack.h> -#include <qtooltip.h> -#include <qwhatsthis.h> -#include <qcheckbox.h> -#include <qhbox.h> -#include <qvalidator.h> -#include <qtabwidget.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqcombobox.h> +#include <tqwidgetstack.h> +#include <tqtooltip.h> +#include <tqwhatsthis.h> +#include <tqcheckbox.h> +#include <tqhbox.h> +#include <tqvalidator.h> +#include <tqtabwidget.h> // other headers: #include <assert.h> @@ -124,7 +124,7 @@ const char * KMPopFilterDlgHelpAnchor = "popfilters-id" ; // //============================================================================= -KMFilterDlg::KMFilterDlg(QWidget* parent, const char* name, bool popFilter, bool createDummyFilter ) +KMFilterDlg::KMFilterDlg(TQWidget* parent, const char* name, bool popFilter, bool createDummyFilter ) : KDialogBase( parent, name, false /* modality */, (popFilter)? i18n("POP3 Filter Rules"): i18n("Filter Rules") /* caption*/, Help|Ok|Apply|Cancel|User1|User2 /* button mask */, @@ -135,37 +135,37 @@ KMFilterDlg::KMFilterDlg(QWidget* parent, const char* name, bool popFilter, bool setHelp( (bPopFilter)? KMPopFilterDlgHelpAnchor: KMFilterDlgHelpAnchor ); setButtonText( User1, i18n("Import") ); setButtonText( User2, i18n("Export") ); - connect( this, SIGNAL(user1Clicked()), - this, SLOT( slotImportFilters()) ); - connect( this, SIGNAL(user2Clicked()), - this, SLOT( slotExportFilters()) ); + connect( this, TQT_SIGNAL(user1Clicked()), + this, TQT_SLOT( slotImportFilters()) ); + connect( this, TQT_SIGNAL(user2Clicked()), + this, TQT_SLOT( slotExportFilters()) ); - QWidget *w = new QWidget( this ); + TQWidget *w = new TQWidget( this ); setMainWidget( w ); - QHBoxLayout *topLayout = new QHBoxLayout( w, 0, spacingHint(), "topLayout" ); - QHBoxLayout *hbl = topLayout; - QVBoxLayout *vbl2 = 0; - QWidget *page1 = 0; - QWidget *page2 = 0; + TQHBoxLayout *topLayout = new TQHBoxLayout( w, 0, spacingHint(), "topLayout" ); + TQHBoxLayout *hbl = topLayout; + TQVBoxLayout *vbl2 = 0; + TQWidget *page1 = 0; + TQWidget *page2 = 0; mFilterList = new KMFilterListBox( i18n("Available Filters"), w, 0, bPopFilter); topLayout->addWidget( mFilterList, 1 /*stretch*/ ); if(!bPopFilter) { - QTabWidget *tabWidget = new QTabWidget( w, "kmfd_tab" ); + TQTabWidget *tabWidget = new TQTabWidget( w, "kmfd_tab" ); tabWidget->setMargin( KDialog::marginHint() ); topLayout->addWidget( tabWidget ); - page1 = new QWidget( tabWidget ); + page1 = new TQWidget( tabWidget ); tabWidget->addTab( page1, i18n("&General") ); - hbl = new QHBoxLayout( page1, 0, spacingHint(), "kmfd_hbl" ); + hbl = new TQHBoxLayout( page1, 0, spacingHint(), "kmfd_hbl" ); - page2 = new QWidget( tabWidget ); + page2 = new TQWidget( tabWidget ); tabWidget->addTab( page2, i18n("A&dvanced") ); - vbl2 = new QVBoxLayout( page2, 0, spacingHint(), "kmfd_vbl2" ); + vbl2 = new TQVBoxLayout( page2, 0, spacingHint(), "kmfd_vbl2" ); } - QVBoxLayout *vbl = new QVBoxLayout( hbl, spacingHint(), "kmfd_vbl" ); + TQVBoxLayout *vbl = new TQVBoxLayout( hbl, spacingHint(), "kmfd_vbl" ); hbl->setStretchFactor( vbl, 2 ); mPatternEdit = new KMSearchPatternEdit( i18n("Filter Criteria"), bPopFilter ? w : page1 , "spe", bPopFilter); @@ -175,36 +175,36 @@ KMFilterDlg::KMFilterDlg(QWidget* parent, const char* name, bool popFilter, bool mActionGroup = new KMPopFilterActionWidget( i18n("Filter Action"), w ); vbl->addWidget( mActionGroup, 0, Qt::AlignTop ); - mGlobalsBox = new QVGroupBox(i18n("Global Options"), w); - mShowLaterBtn = new QCheckBox(i18n("Always &show matched 'Download Later' messages in confirmation dialog"), mGlobalsBox); - QWhatsThis::add( mShowLaterBtn, i18n(_wt_filterdlg_showLater) ); + mGlobalsBox = new TQVGroupBox(i18n("Global Options"), w); + mShowLaterBtn = new TQCheckBox(i18n("Always &show matched 'Download Later' messages in confirmation dialog"), mGlobalsBox); + TQWhatsThis::add( mShowLaterBtn, i18n(_wt_filterdlg_showLater) ); vbl->addWidget( mGlobalsBox, 0, Qt::AlignTop ); } else { - QGroupBox *agb = new QGroupBox( 1 /*column*/, Vertical, i18n("Filter Actions"), page1 ); + TQGroupBox *agb = new TQGroupBox( 1 /*column*/, Vertical, i18n("Filter Actions"), page1 ); mActionLister = new KMFilterActionWidgetLister( agb ); vbl->addWidget( agb, 0, Qt::AlignTop ); - mAdvOptsGroup = new QGroupBox ( 1 /*columns*/, Vertical, + mAdvOptsGroup = new TQGroupBox ( 1 /*columns*/, Vertical, i18n("Advanced Options"), page2); { - QWidget *adv_w = new QWidget( mAdvOptsGroup ); - QGridLayout *gl = new QGridLayout( adv_w, 8 /*rows*/, 3 /*cols*/, + TQWidget *adv_w = new TQWidget( mAdvOptsGroup ); + TQGridLayout *gl = new TQGridLayout( adv_w, 8 /*rows*/, 3 /*cols*/, 0 /*border*/, spacingHint() ); - QVBoxLayout *vbl3 = new QVBoxLayout( gl, spacingHint(), "vbl3" ); + TQVBoxLayout *vbl3 = new TQVBoxLayout( gl, spacingHint(), "vbl3" ); vbl3->addStretch( 1 ); - mApplyOnIn = new QCheckBox( i18n("Apply this filter to incoming messages:"), adv_w ); + mApplyOnIn = new TQCheckBox( i18n("Apply this filter to incoming messages:"), adv_w ); vbl3->addWidget( mApplyOnIn ); - QButtonGroup *bg = new QButtonGroup( 0, "bg" ); + TQButtonGroup *bg = new TQButtonGroup( 0, "bg" ); bg->setExclusive( true ); - mApplyOnForAll = new QRadioButton( i18n("from all accounts"), adv_w ); + mApplyOnForAll = new TQRadioButton( i18n("from all accounts"), adv_w ); bg->insert( mApplyOnForAll ); vbl3->addWidget( mApplyOnForAll ); - mApplyOnForTraditional = new QRadioButton( i18n("from all but online IMAP accounts"), adv_w ); + mApplyOnForTraditional = new TQRadioButton( i18n("from all but online IMAP accounts"), adv_w ); bg->insert( mApplyOnForTraditional ); vbl3->addWidget( mApplyOnForTraditional ); - mApplyOnForChecked = new QRadioButton( i18n("from checked accounts only"), adv_w ); + mApplyOnForChecked = new TQRadioButton( i18n("from checked accounts only"), adv_w ); bg->insert( mApplyOnForChecked ); vbl3->addWidget( mApplyOnForChecked ); vbl3->addStretch( 2 ); @@ -213,34 +213,34 @@ KMFilterDlg::KMFilterDlg(QWidget* parent, const char* name, bool popFilter, bool mAccountList->addColumn( i18n("Account Name") ); mAccountList->addColumn( i18n("Type") ); mAccountList->setAllColumnsShowFocus( true ); - mAccountList->setFrameStyle( QFrame::WinPanel + QFrame::Sunken ); + mAccountList->setFrameStyle( TQFrame::WinPanel + TQFrame::Sunken ); mAccountList->setSorting( -1 ); gl->addMultiCellWidget( mAccountList, 0, 3, 1, 3 ); - mApplyOnOut = new QCheckBox( i18n("Apply this filter to &sent messages"), adv_w ); + mApplyOnOut = new TQCheckBox( i18n("Apply this filter to &sent messages"), adv_w ); gl->addMultiCellWidget( mApplyOnOut, 4, 4, 0, 3 ); - mApplyOnCtrlJ = new QCheckBox( i18n("Apply this filter on manual &filtering"), adv_w ); + mApplyOnCtrlJ = new TQCheckBox( i18n("Apply this filter on manual &filtering"), adv_w ); gl->addMultiCellWidget( mApplyOnCtrlJ, 5, 5, 0, 3 ); - mStopProcessingHere = new QCheckBox( i18n("If this filter &matches, stop processing here"), adv_w ); + mStopProcessingHere = new TQCheckBox( i18n("If this filter &matches, stop processing here"), adv_w ); gl->addMultiCellWidget( mStopProcessingHere, 6, 6, /*from to row*/ 0, 3 /*from to col*/ ); - mConfigureShortcut = new QCheckBox( i18n("Add this filter to the Apply Filter menu"), adv_w ); + mConfigureShortcut = new TQCheckBox( i18n("Add this filter to the Apply Filter menu"), adv_w ); gl->addMultiCellWidget( mConfigureShortcut, 7, 7, 0, 1 ); - QLabel *keyButtonLabel = new QLabel( i18n( "Shortcut:" ), adv_w ); + TQLabel *keyButtonLabel = new TQLabel( i18n( "Shortcut:" ), adv_w ); keyButtonLabel->setAlignment( AlignVCenter | AlignRight ); gl->addMultiCellWidget( keyButtonLabel, 7, 7, 2, 2 ); mKeyButton = new KKeyButton( adv_w, "FilterShortcutSelector" ); gl->addMultiCellWidget( mKeyButton, 7, 7, 3, 3 ); mKeyButton->setEnabled( false ); - mConfigureToolbar = new QCheckBox( i18n("Additionally add this filter to the toolbar"), adv_w ); + mConfigureToolbar = new TQCheckBox( i18n("Additionally add this filter to the toolbar"), adv_w ); gl->addMultiCellWidget( mConfigureToolbar, 8, 8, 0, 3 ); mConfigureToolbar->setEnabled( false ); - QHBox *hbox = new QHBox( adv_w ); - mFilterActionLabel = new QLabel( i18n( "Icon for this filter:" ), + TQHBox *hbox = new TQHBox( adv_w ); + mFilterActionLabel = new TQLabel( i18n( "Icon for this filter:" ), hbox ); mFilterActionLabel->setEnabled( false ); @@ -259,81 +259,81 @@ KMFilterDlg::KMFilterDlg(QWidget* parent, const char* name, bool popFilter, bool vbl->addStretch( 1 ); // load the filter parts into the edit widgets - connect( mFilterList, SIGNAL(filterSelected(KMFilter*)), - this, SLOT(slotFilterSelected(KMFilter*)) ); + connect( mFilterList, TQT_SIGNAL(filterSelected(KMFilter*)), + this, TQT_SLOT(slotFilterSelected(KMFilter*)) ); if (bPopFilter){ // set the state of the global setting 'show later msgs' - connect( mShowLaterBtn, SIGNAL(toggled(bool)), - mFilterList, SLOT(slotShowLaterToggled(bool))); + connect( mShowLaterBtn, TQT_SIGNAL(toggled(bool)), + mFilterList, TQT_SLOT(slotShowLaterToggled(bool))); // set the action in the filter when changed - connect( mActionGroup, SIGNAL(actionChanged(const KMPopFilterAction)), - this, SLOT(slotActionChanged(const KMPopFilterAction)) ); + connect( mActionGroup, TQT_SIGNAL(actionChanged(const KMPopFilterAction)), + this, TQT_SLOT(slotActionChanged(const KMPopFilterAction)) ); } else { // transfer changes from the 'Apply this filter on...' // combo box to the filter - connect( mApplyOnIn, SIGNAL(clicked()), - this, SLOT(slotApplicabilityChanged()) ); - connect( mApplyOnForAll, SIGNAL(clicked()), - this, SLOT(slotApplicabilityChanged()) ); - connect( mApplyOnForTraditional, SIGNAL(clicked()), - this, SLOT(slotApplicabilityChanged()) ); - connect( mApplyOnForChecked, SIGNAL(clicked()), - this, SLOT(slotApplicabilityChanged()) ); - connect( mApplyOnOut, SIGNAL(clicked()), - this, SLOT(slotApplicabilityChanged()) ); - connect( mApplyOnCtrlJ, SIGNAL(clicked()), - this, SLOT(slotApplicabilityChanged()) ); - connect( mAccountList, SIGNAL(clicked(QListViewItem*)), - this, SLOT(slotApplicableAccountsChanged()) ); - connect( mAccountList, SIGNAL(spacePressed(QListViewItem*)), - this, SLOT(slotApplicableAccountsChanged()) ); + connect( mApplyOnIn, TQT_SIGNAL(clicked()), + this, TQT_SLOT(slotApplicabilityChanged()) ); + connect( mApplyOnForAll, TQT_SIGNAL(clicked()), + this, TQT_SLOT(slotApplicabilityChanged()) ); + connect( mApplyOnForTraditional, TQT_SIGNAL(clicked()), + this, TQT_SLOT(slotApplicabilityChanged()) ); + connect( mApplyOnForChecked, TQT_SIGNAL(clicked()), + this, TQT_SLOT(slotApplicabilityChanged()) ); + connect( mApplyOnOut, TQT_SIGNAL(clicked()), + this, TQT_SLOT(slotApplicabilityChanged()) ); + connect( mApplyOnCtrlJ, TQT_SIGNAL(clicked()), + this, TQT_SLOT(slotApplicabilityChanged()) ); + connect( mAccountList, TQT_SIGNAL(clicked(TQListViewItem*)), + this, TQT_SLOT(slotApplicableAccountsChanged()) ); + connect( mAccountList, TQT_SIGNAL(spacePressed(TQListViewItem*)), + this, TQT_SLOT(slotApplicableAccountsChanged()) ); // transfer changes from the 'stop processing here' // check box to the filter - connect( mStopProcessingHere, SIGNAL(toggled(bool)), - this, SLOT(slotStopProcessingButtonToggled(bool)) ); + connect( mStopProcessingHere, TQT_SIGNAL(toggled(bool)), + this, TQT_SLOT(slotStopProcessingButtonToggled(bool)) ); - connect( mConfigureShortcut, SIGNAL(toggled(bool)), - this, SLOT(slotConfigureShortcutButtonToggled(bool)) ); + connect( mConfigureShortcut, TQT_SIGNAL(toggled(bool)), + this, TQT_SLOT(slotConfigureShortcutButtonToggled(bool)) ); - connect( mKeyButton, SIGNAL( capturedShortcut( const KShortcut& ) ), - this, SLOT( slotCapturedShortcutChanged( const KShortcut& ) ) ); + connect( mKeyButton, TQT_SIGNAL( capturedShortcut( const KShortcut& ) ), + this, TQT_SLOT( slotCapturedShortcutChanged( const KShortcut& ) ) ); - connect( mConfigureToolbar, SIGNAL(toggled(bool)), - this, SLOT(slotConfigureToolbarButtonToggled(bool)) ); + connect( mConfigureToolbar, TQT_SIGNAL(toggled(bool)), + this, TQT_SLOT(slotConfigureToolbarButtonToggled(bool)) ); - connect( mFilterActionIconButton, SIGNAL( iconChanged( QString ) ), - this, SLOT( slotFilterActionIconChanged( QString ) ) ); + connect( mFilterActionIconButton, TQT_SIGNAL( iconChanged( TQString ) ), + this, TQT_SLOT( slotFilterActionIconChanged( TQString ) ) ); } // reset all widgets here - connect( mFilterList, SIGNAL(resetWidgets()), - this, SLOT(slotReset()) ); + connect( mFilterList, TQT_SIGNAL(resetWidgets()), + this, TQT_SLOT(slotReset()) ); - connect( mFilterList, SIGNAL( applyWidgets() ), - this, SLOT( slotUpdateFilter() ) ); + connect( mFilterList, TQT_SIGNAL( applyWidgets() ), + this, TQT_SLOT( slotUpdateFilter() ) ); // support auto-naming the filter - connect( mPatternEdit, SIGNAL(maybeNameChanged()), - mFilterList, SLOT(slotUpdateFilterName()) ); + connect( mPatternEdit, TQT_SIGNAL(maybeNameChanged()), + mFilterList, TQT_SLOT(slotUpdateFilterName()) ); // apply changes on 'Apply' - connect( this, SIGNAL(applyClicked()), - mFilterList, SLOT(slotApplyFilterChanges()) ); + connect( this, TQT_SIGNAL(applyClicked()), + mFilterList, TQT_SLOT(slotApplyFilterChanges()) ); // apply changes on 'OK' - connect( this, SIGNAL(okClicked()), - mFilterList, SLOT(slotApplyFilterChanges()) ); + connect( this, TQT_SIGNAL(okClicked()), + mFilterList, TQT_SLOT(slotApplyFilterChanges()) ); // save dialog size on 'OK' - connect( this, SIGNAL(okClicked()), - this, SLOT(slotSaveSize()) ); + connect( this, TQT_SIGNAL(okClicked()), + this, TQT_SLOT(slotSaveSize()) ); // destruct the dialog on OK, close and Cancel - connect( this, SIGNAL(finished()), - this, SLOT(slotFinished()) ); + connect( this, TQT_SIGNAL(finished()), + this, TQT_SLOT(slotFinished()) ); KConfigGroup geometry( KMKernel::config(), "Geometry"); const char * configKey @@ -398,7 +398,7 @@ void KMFilterDlg::slotFilterSelected( KMFilter* aFilter ) const bool stopHere = aFilter->stopProcessingHere(); const bool configureShortcut = aFilter->configureShortcut(); const bool configureToolbar = aFilter->configureToolbar(); - const QString icon = aFilter->icon(); + const TQString icon = aFilter->icon(); const KShortcut shortcut( aFilter->shortcut() ); mApplyOnIn->setChecked( applyOnIn ); @@ -462,9 +462,9 @@ void KMFilterDlg::slotApplicabilityChanged() mAccountList->setEnabled( mApplyOnForChecked->isEnabled() && mApplyOnForChecked->isChecked() ); // Advanced tab functionality - Update list of accounts this filter applies to - QListViewItemIterator it( mAccountList ); + TQListViewItemIterator it( mAccountList ); while ( it.current() ) { - QCheckListItem *item = dynamic_cast<QCheckListItem*>( it.current() ); + TQCheckListItem *item = dynamic_cast<TQCheckListItem*>( it.current() ); if (item) { int id = item->text( 2 ).toInt(); item->setOn( mFilter->applyOnAccount( id ) ); @@ -484,9 +484,9 @@ void KMFilterDlg::slotApplicableAccountsChanged() { if ( mFilter && mApplyOnForChecked->isEnabled() && mApplyOnForChecked->isChecked() ) { // Advanced tab functionality - Update list of accounts this filter applies to - QListViewItemIterator it( mAccountList ); + TQListViewItemIterator it( mAccountList ); while ( it.current() ) { - QCheckListItem *item = dynamic_cast<QCheckListItem*>( it.current() ); + TQCheckListItem *item = dynamic_cast<TQCheckListItem*>( it.current() ); if (item) { int id = item->text( 2 ).toInt(); mFilter->setApplyOnAccount( id, item->isOn() ); @@ -523,7 +523,7 @@ void KMFilterDlg::slotCapturedShortcutChanged( const KShortcut& sc ) if ( mySc.isNull() || mySc.toString().isEmpty() ) mySc.clear(); if ( !mySc.isNull() && !( kmkernel->getKMMainWidget()->shortcutIsValid( mySc ) ) ) { - QString msg( i18n( "The selected shortcut is already used, " + TQString msg( i18n( "The selected shortcut is already used, " "please select a different one." ) ); KMessageBox::sorry( this, msg ); } else { @@ -539,7 +539,7 @@ void KMFilterDlg::slotConfigureToolbarButtonToggled( bool aChecked ) mFilter->setConfigureToolbar( aChecked ); } -void KMFilterDlg::slotFilterActionIconChanged( QString icon ) +void KMFilterDlg::slotFilterActionIconChanged( TQString icon ) { if ( mFilter ) mFilter->setIcon( icon ); @@ -548,19 +548,19 @@ void KMFilterDlg::slotFilterActionIconChanged( QString icon ) void KMFilterDlg::slotUpdateAccountList() { mAccountList->clear(); - QListViewItem *top = 0; + TQListViewItem *top = 0; for( KMAccount *a = kmkernel->acctMgr()->first(); a!=0; a = kmkernel->acctMgr()->next() ) { - QCheckListItem *listItem = - new QCheckListItem( mAccountList, top, a->name(), QCheckListItem::CheckBox ); + TQCheckListItem *listItem = + new TQCheckListItem( mAccountList, top, a->name(), TQCheckListItem::CheckBox ); listItem->setText( 1, a->type() ); - listItem->setText( 2, QString( "%1" ).arg( a->id() ) ); + listItem->setText( 2, TQString( "%1" ).arg( a->id() ) ); if ( mFilter ) listItem->setOn( mFilter->applyOnAccount( a->id() ) ); top = listItem; } - QListViewItem *listItem = mAccountList->firstChild(); + TQListViewItem *listItem = mAccountList->firstChild(); if ( listItem ) { mAccountList->setCurrentItem( listItem ); mAccountList->setSelected( listItem, true ); @@ -573,89 +573,89 @@ void KMFilterDlg::slotUpdateAccountList() // //============================================================================= -KMFilterListBox::KMFilterListBox( const QString & title, QWidget *parent, const char* name, bool popFilter ) - : QGroupBox( 1, Horizontal, title, parent, name ), +KMFilterListBox::KMFilterListBox( const TQString & title, TQWidget *parent, const char* name, bool popFilter ) + : TQGroupBox( 1, Horizontal, title, parent, name ), bPopFilter(popFilter) { mFilterList.setAutoDelete( true ); mIdxSelItem = -1; //----------- the list box - mListBox = new QListBox(this); + mListBox = new TQListBox(this); mListBox->setMinimumWidth(150); - QWhatsThis::add( mListBox, i18n(_wt_filterlist) ); + TQWhatsThis::add( mListBox, i18n(_wt_filterlist) ); //----------- the first row of buttons - QHBox *hb = new QHBox(this); + TQHBox *hb = new TQHBox(this); hb->setSpacing(4); - mBtnTop = new KPushButton( QString::null, hb ); + mBtnTop = new KPushButton( TQString::null, hb ); mBtnTop->setAutoRepeat( true ); mBtnTop->setIconSet( BarIconSet( "top", KIcon::SizeSmall ) ); mBtnTop->setMinimumSize( mBtnTop->sizeHint() * 1.2 ); - mBtnUp = new KPushButton( QString::null, hb ); + mBtnUp = new KPushButton( TQString::null, hb ); mBtnUp->setAutoRepeat( true ); mBtnUp->setIconSet( BarIconSet( "up", KIcon::SizeSmall ) ); mBtnUp->setMinimumSize( mBtnUp->sizeHint() * 1.2 ); - mBtnDown = new KPushButton( QString::null, hb ); + mBtnDown = new KPushButton( TQString::null, hb ); mBtnDown->setAutoRepeat( true ); mBtnDown->setIconSet( BarIconSet( "down", KIcon::SizeSmall ) ); mBtnDown->setMinimumSize( mBtnDown->sizeHint() * 1.2 ); - mBtnBot = new KPushButton( QString::null, hb ); + mBtnBot = new KPushButton( TQString::null, hb ); mBtnBot->setAutoRepeat( true ); mBtnBot->setIconSet( BarIconSet( "bottom", KIcon::SizeSmall ) ); mBtnBot->setMinimumSize( mBtnBot->sizeHint() * 1.2 ); - QToolTip::add( mBtnTop, i18n("Top") ); - QToolTip::add( mBtnUp, i18n("Up") ); - QToolTip::add( mBtnDown, i18n("Down") ); - QToolTip::add( mBtnBot, i18n("Bottom") ); - QWhatsThis::add( mBtnTop, i18n(_wt_filterlist_top) ); - QWhatsThis::add( mBtnUp, i18n(_wt_filterlist_up) ); - QWhatsThis::add( mBtnDown, i18n(_wt_filterlist_down) ); - QWhatsThis::add( mBtnBot, i18n(_wt_filterlist_bot) ); + TQToolTip::add( mBtnTop, i18n("Top") ); + TQToolTip::add( mBtnUp, i18n("Up") ); + TQToolTip::add( mBtnDown, i18n("Down") ); + TQToolTip::add( mBtnBot, i18n("Bottom") ); + TQWhatsThis::add( mBtnTop, i18n(_wt_filterlist_top) ); + TQWhatsThis::add( mBtnUp, i18n(_wt_filterlist_up) ); + TQWhatsThis::add( mBtnDown, i18n(_wt_filterlist_down) ); + TQWhatsThis::add( mBtnBot, i18n(_wt_filterlist_bot) ); //----------- the second row of buttons - hb = new QHBox(this); + hb = new TQHBox(this); hb->setSpacing(4); - mBtnNew = new QPushButton( QString::null, hb ); + mBtnNew = new TQPushButton( TQString::null, hb ); mBtnNew->setPixmap( BarIcon( "filenew", KIcon::SizeSmall ) ); mBtnNew->setMinimumSize( mBtnNew->sizeHint() * 1.2 ); - mBtnCopy = new QPushButton( QString::null, hb ); + mBtnCopy = new TQPushButton( TQString::null, hb ); mBtnCopy->setIconSet( BarIconSet( "editcopy", KIcon::SizeSmall ) ); mBtnCopy->setMinimumSize( mBtnCopy->sizeHint() * 1.2 ); - mBtnDelete = new QPushButton( QString::null, hb ); + mBtnDelete = new TQPushButton( TQString::null, hb ); mBtnDelete->setIconSet( BarIconSet( "editdelete", KIcon::SizeSmall ) ); mBtnDelete->setMinimumSize( mBtnDelete->sizeHint() * 1.2 ); - mBtnRename = new QPushButton( i18n("Rename..."), hb ); - QToolTip::add( mBtnNew, i18n("New") ); - QToolTip::add( mBtnCopy, i18n("Copy") ); - QToolTip::add( mBtnDelete, i18n("Delete")); - QWhatsThis::add( mBtnNew, i18n(_wt_filterlist_new) ); - QWhatsThis::add( mBtnCopy, i18n(_wt_filterlist_copy) ); - QWhatsThis::add( mBtnDelete, i18n(_wt_filterlist_delete) ); - QWhatsThis::add( mBtnRename, i18n(_wt_filterlist_rename) ); + mBtnRename = new TQPushButton( i18n("Rename..."), hb ); + TQToolTip::add( mBtnNew, i18n("New") ); + TQToolTip::add( mBtnCopy, i18n("Copy") ); + TQToolTip::add( mBtnDelete, i18n("Delete")); + TQWhatsThis::add( mBtnNew, i18n(_wt_filterlist_new) ); + TQWhatsThis::add( mBtnCopy, i18n(_wt_filterlist_copy) ); + TQWhatsThis::add( mBtnDelete, i18n(_wt_filterlist_delete) ); + TQWhatsThis::add( mBtnRename, i18n(_wt_filterlist_rename) ); //----------- now connect everything - connect( mListBox, SIGNAL(highlighted(int)), - this, SLOT(slotSelected(int)) ); - connect( mListBox, SIGNAL( doubleClicked ( QListBoxItem * )), - this, SLOT( slotRename()) ); - connect( mBtnTop, SIGNAL(clicked()), - this, SLOT(slotTop()) ); - connect( mBtnUp, SIGNAL(clicked()), - this, SLOT(slotUp()) ); - connect( mBtnDown, SIGNAL(clicked()), - this, SLOT(slotDown()) ); - connect( mBtnBot, SIGNAL(clicked()), - this, SLOT(slotBottom()) ); - connect( mBtnNew, SIGNAL(clicked()), - this, SLOT(slotNew()) ); - connect( mBtnCopy, SIGNAL(clicked()), - this, SLOT(slotCopy()) ); - connect( mBtnDelete, SIGNAL(clicked()), - this, SLOT(slotDelete()) ); - connect( mBtnRename, SIGNAL(clicked()), - this, SLOT(slotRename()) ); + connect( mListBox, TQT_SIGNAL(highlighted(int)), + this, TQT_SLOT(slotSelected(int)) ); + connect( mListBox, TQT_SIGNAL( doubleClicked ( TQListBoxItem * )), + this, TQT_SLOT( slotRename()) ); + connect( mBtnTop, TQT_SIGNAL(clicked()), + this, TQT_SLOT(slotTop()) ); + connect( mBtnUp, TQT_SIGNAL(clicked()), + this, TQT_SLOT(slotUp()) ); + connect( mBtnDown, TQT_SIGNAL(clicked()), + this, TQT_SLOT(slotDown()) ); + connect( mBtnBot, TQT_SIGNAL(clicked()), + this, TQT_SLOT(slotBottom()) ); + connect( mBtnNew, TQT_SIGNAL(clicked()), + this, TQT_SLOT(slotNew()) ); + connect( mBtnCopy, TQT_SIGNAL(clicked()), + this, TQT_SLOT(slotCopy()) ); + connect( mBtnDelete, TQT_SIGNAL(clicked()), + this, TQT_SLOT(slotDelete()) ); + connect( mBtnRename, TQT_SIGNAL(clicked()), + this, TQT_SLOT(slotRename()) ); // the dialog should call loadFilterList() // when all signals are connected. @@ -663,14 +663,14 @@ KMFilterListBox::KMFilterListBox( const QString & title, QWidget *parent, const } -void KMFilterListBox::createFilter( const QCString & field, - const QString & value ) +void KMFilterListBox::createFilter( const TQCString & field, + const TQString & value ) { KMSearchRule *newRule = KMSearchRule::createInstance( field, KMSearchRule::FuncContains, value ); KMFilter *newFilter = new KMFilter(0, bPopFilter); newFilter->pattern()->append( newRule ); - newFilter->pattern()->setName( QString("<%1>:%2").arg( field ).arg( value) ); + newFilter->pattern()->setName( TQString("<%1>:%2").arg( field ).arg( value) ); KMFilterActionDesc *desc = (*kmkernel->filterActionDict())["transfer"]; if ( desc ) @@ -690,8 +690,8 @@ void KMFilterListBox::slotUpdateFilterName() KMSearchPattern *p = mFilterList.at(mIdxSelItem)->pattern(); if ( !p ) return; - QString shouldBeName = p->name(); - QString displayedName = mListBox->text( mIdxSelItem ); + TQString shouldBeName = p->name(); + TQString displayedName = mListBox->text( mIdxSelItem ); if ( shouldBeName.stripWhiteSpace().isEmpty() ) { mFilterList.at(mIdxSelItem)->setAutoNaming( true ); @@ -700,7 +700,7 @@ void KMFilterListBox::slotUpdateFilterName() if ( mFilterList.at(mIdxSelItem)->isAutoNaming() ) { // auto-naming of patterns if ( p->first() && !p->first()->field().stripWhiteSpace().isEmpty() ) - shouldBeName = QString( "<%1>: %2" ).arg( p->first()->field() ).arg( p->first()->contents() ); + shouldBeName = TQString( "<%1>: %2" ).arg( p->first()->field() ).arg( p->first()->contents() ); else shouldBeName = "<" + i18n("unnamed") + ">"; p->setName( shouldBeName ); @@ -734,28 +734,28 @@ void KMFilterListBox::slotApplyFilterChanges() else fm = kmkernel->filterMgr(); - QValueList<KMFilter*> newFilters = filtersForSaving(); + TQValueList<KMFilter*> newFilters = filtersForSaving(); if (bPopFilter) fm->setShowLaterMsgs(mShowLater); fm->setFilters( newFilters ); if (fm->atLeastOneOnlineImapFolderTarget()) { - QString str = i18n("At least one filter targets a folder on an online " + TQString str = i18n("At least one filter targets a folder on an online " "IMAP account. Such filters will only be applied " "when manually filtering and when filtering " "incoming online IMAP mail."); - KMessageBox::information( this, str, QString::null, + KMessageBox::information( this, str, TQString::null, "filterDlgOnlineImapCheck" ); } } -QValueList<KMFilter*> KMFilterListBox::filtersForSaving() const +TQValueList<KMFilter*> KMFilterListBox::filtersForSaving() const { const_cast<KMFilterListBox*>( this )->applyWidgets(); // signals aren't const - QValueList<KMFilter*> filters; - QStringList emptyFilters; - QPtrListIterator<KMFilter> it( mFilterList ); + TQValueList<KMFilter*> filters; + TQStringList emptyFilters; + TQPtrListIterator<KMFilter> it( mFilterList ); for ( it.toFirst() ; it.current() ; ++it ) { KMFilter *f = new KMFilter( **it ); // deep copy f->purify(); @@ -771,10 +771,10 @@ QValueList<KMFilter*> KMFilterListBox::filtersForSaving() const // report on invalid filters: if ( !emptyFilters.empty() ) { - QString msg = i18n("The following filters have not been saved because they " + TQString msg = i18n("The following filters have not been saved because they " "were invalid (e.g. containing no actions or no search " "rules)."); - KMessageBox::informationList( 0, msg, emptyFilters, QString::null, + KMessageBox::informationList( 0, msg, emptyFilters, TQString::null, "ShowInvalidFilterWarning" ); } return filters; @@ -783,7 +783,7 @@ QValueList<KMFilter*> KMFilterListBox::filtersForSaving() const void KMFilterListBox::slotSelected( int aIdx ) { mIdxSelItem = aIdx; - // QPtrList::at(i) will return 0 if i is out of range. + // TQPtrList::at(i) will return 0 if i is out of range. KMFilter *f = mFilterList.at(aIdx); if ( f ) emit filterSelected( f ); @@ -929,8 +929,8 @@ void KMFilterListBox::slotRename() assert( filter ); // allow empty names - those will turn auto-naming on again - QValidator *validator = new QRegExpValidator( QRegExp( ".*" ), 0 ); - QString newName = KInputDialog::getText + TQValidator *validator = new TQRegExpValidator( TQRegExp( ".*" ), 0 ); + TQString newName = KInputDialog::getText ( i18n("Rename Filter"), i18n("Rename filter \"%1\" to:\n(leave the field empty for automatic naming)") @@ -998,7 +998,7 @@ void KMFilterListBox::loadFilterList( bool createDummyFilter ) } Q_ASSERT( manager ); - QValueListConstIterator<KMFilter*> it; + TQValueListConstIterator<KMFilter*> it; for ( it = manager->filters().constBegin() ; it != manager->filters().constEnd() ; ++it ) { mFilterList.append( new KMFilter( **it ) ); // deep copy mListBox->insertItem( (*it)->pattern()->name() ); @@ -1024,7 +1024,7 @@ void KMFilterListBox::insertFilter( KMFilter* aFilter ) // must be really a filter... assert( aFilter ); - // if mIdxSelItem < 0, QListBox::insertItem will append. + // if mIdxSelItem < 0, TQListBox::insertItem will append. mListBox->insertItem( aFilter->pattern()->name(), mIdxSelItem ); if ( mIdxSelItem < 0 ) { // none selected -> append @@ -1053,7 +1053,7 @@ void KMFilterListBox::swapNeighbouringFilters( int untouchedOne, int movedOne ) // untouchedOne is at idx. to move it down(up), // remove item at idx+(-)1 w/o deleting it. - QListBoxItem *item = mListBox->item( movedOne ); + TQListBoxItem *item = mListBox->item( movedOne ); mListBox->takeItem( item ); // now selected item is at idx(idx-1), so // insert the other item at idx, ie. above(below). @@ -1067,7 +1067,7 @@ void KMFilterListBox::swapNeighbouringFilters( int untouchedOne, int movedOne ) void KMFilterListBox::swapFilters( int from, int to ) { - QListBoxItem *item = mListBox->item( from ); + TQListBoxItem *item = mListBox->item( from ); mListBox->takeItem( item ); mListBox->insertItem( item, to ); @@ -1085,20 +1085,20 @@ void KMFilterListBox::swapFilters( int from, int to ) // //============================================================================= -KMFilterActionWidget::KMFilterActionWidget( QWidget *parent, const char* name ) - : QHBox( parent, name ) +KMFilterActionWidget::KMFilterActionWidget( TQWidget *parent, const char* name ) + : TQHBox( parent, name ) { int i; mActionList.setAutoDelete( true ); - mComboBox = new QComboBox( false , this ); + mComboBox = new TQComboBox( false , this ); assert( mComboBox ); - mWidgetStack = new QWidgetStack(this); + mWidgetStack = new TQWidgetStack(this); assert( mWidgetStack ); setSpacing( 4 ); - QPtrListIterator<KMFilterActionDesc> it ( kmkernel->filterActionDict()->list() ); + TQPtrListIterator<KMFilterActionDesc> it ( kmkernel->filterActionDict()->list() ); for ( i=0, it.toFirst() ; it.current() ; ++it, ++i ) { //create an instance: KMFilterAction *a = (*it)->create(); @@ -1110,7 +1110,7 @@ KMFilterActionWidget::KMFilterActionWidget( QWidget *parent, const char* name ) mComboBox->insertItem( (*it)->label ); } // widget for the case where no action is selected. - mWidgetStack->addWidget( new QLabel( i18n("Please select an action."), mWidgetStack ), i ); + mWidgetStack->addWidget( new TQLabel( i18n("Please select an action."), mWidgetStack ), i ); mWidgetStack->raiseWidget(i); mComboBox->insertItem( " " ); mComboBox->setCurrentItem(i); @@ -1122,16 +1122,16 @@ KMFilterActionWidget::KMFilterActionWidget( QWidget *parent, const char* name ) // the parameter widget should grow instead. // o the whole widget takes all space horizontally, but is fixed vertically. mComboBox->adjustSize(); - mComboBox->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) ); - setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Fixed ) ); + mComboBox->setSizePolicy( TQSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Fixed ) ); + setSizePolicy( TQSizePolicy( TQSizePolicy::Preferred, TQSizePolicy::Fixed ) ); updateGeometry(); // redirect focus to the filter action combo box setFocusProxy( mComboBox ); // now connect the combo box and the widget stack - connect( mComboBox, SIGNAL(activated(int)), - mWidgetStack, SLOT(raiseWidget(int)) ); + connect( mComboBox, TQT_SIGNAL(activated(int)), + mWidgetStack, TQT_SLOT(raiseWidget(int)) ); } void KMFilterActionWidget::setAction( const KMFilterAction* aAction ) @@ -1139,7 +1139,7 @@ void KMFilterActionWidget::setAction( const KMFilterAction* aAction ) int i=0; bool found = false ; int count = mComboBox->count() - 1 ; // last entry is the empty one - QString label = ( aAction ) ? aAction->label() : QString::null ; + TQString label = ( aAction ) ? aAction->label() : TQString::null ; // find the index of typeOf(aAction) in mComboBox // and clear the other widgets on the way. @@ -1165,7 +1165,7 @@ void KMFilterActionWidget::setAction( const KMFilterAction* aAction ) KMFilterAction * KMFilterActionWidget::action() { // look up the action description via the label - // returned by QComboBox::currentText()... + // returned by TQComboBox::currentText()... KMFilterActionDesc *desc = (*kmkernel->filterActionDict())[ mComboBox->currentText() ]; if ( desc ) { // ...create an instance... @@ -1186,7 +1186,7 @@ KMFilterAction * KMFilterActionWidget::action() // //============================================================================= -KMFilterActionWidgetLister::KMFilterActionWidgetLister( QWidget *parent, const char* name ) +KMFilterActionWidgetLister::KMFilterActionWidgetLister( TQWidget *parent, const char* name ) : KWidgetLister( 1, FILTER_MAX_ACTIONS, parent, name ) { mActionList = 0; @@ -1196,7 +1196,7 @@ KMFilterActionWidgetLister::~KMFilterActionWidgetLister() { } -void KMFilterActionWidgetLister::setActionList( QPtrList<KMFilterAction> *aList ) +void KMFilterActionWidgetLister::setActionList( TQPtrList<KMFilterAction> *aList ) { assert ( aList ); @@ -1205,7 +1205,7 @@ void KMFilterActionWidgetLister::setActionList( QPtrList<KMFilterAction> *aList mActionList = aList; - ((QWidget*)parent())->setEnabled( true ); + ((TQWidget*)parent())->setEnabled( true ); if ( aList->count() == 0 ) { slotClear(); @@ -1225,8 +1225,8 @@ void KMFilterActionWidgetLister::setActionList( QPtrList<KMFilterAction> *aList setNumberOfShownWidgetsTo( mActionList->count() ); // load the actions into the widgets - QPtrListIterator<KMFilterAction> aIt( *mActionList ); - QPtrListIterator<QWidget> wIt( mWidgetList ); + TQPtrListIterator<KMFilterAction> aIt( *mActionList ); + TQPtrListIterator<TQWidget> wIt( mWidgetList ); for ( aIt.toFirst(), wIt.toFirst() ; aIt.current() && wIt.current() ; ++aIt, ++wIt ) ((KMFilterActionWidget*)(*wIt))->setAction( (*aIt) ); @@ -1239,15 +1239,15 @@ void KMFilterActionWidgetLister::reset() mActionList = 0; slotClear(); - ((QWidget*)parent())->setEnabled( false ); + ((TQWidget*)parent())->setEnabled( false ); } -QWidget* KMFilterActionWidgetLister::createWidget( QWidget *parent ) +TQWidget* KMFilterActionWidgetLister::createWidget( TQWidget *parent ) { return new KMFilterActionWidget(parent); } -void KMFilterActionWidgetLister::clearWidget( QWidget *aWidget ) +void KMFilterActionWidgetLister::clearWidget( TQWidget *aWidget ) { if ( aWidget ) ((KMFilterActionWidget*)aWidget)->setAction(0); @@ -1259,7 +1259,7 @@ void KMFilterActionWidgetLister::regenerateActionListFromWidgets() mActionList->clear(); - QPtrListIterator<QWidget> it( mWidgetList ); + TQPtrListIterator<TQWidget> it( mWidgetList ); for ( it.toFirst() ; it.current() ; ++it ) { KMFilterAction *a = ((KMFilterActionWidget*)(*it))->action(); if ( a ) @@ -1274,18 +1274,18 @@ void KMFilterActionWidgetLister::regenerateActionListFromWidgets() // //============================================================================= -KMPopFilterActionWidget::KMPopFilterActionWidget( const QString& title, QWidget *parent, const char* name ) - : QVButtonGroup( title, parent, name ) +KMPopFilterActionWidget::KMPopFilterActionWidget( const TQString& title, TQWidget *parent, const char* name ) + : TQVButtonGroup( title, parent, name ) { - mActionMap[Down] = new QRadioButton( i18n("&Download mail"), this ); - mActionMap[Later] = new QRadioButton( i18n("Download mail la&ter"), this ); - mActionMap[Delete] = new QRadioButton( i18n("D&elete mail from server"), this ); + mActionMap[Down] = new TQRadioButton( i18n("&Download mail"), this ); + mActionMap[Later] = new TQRadioButton( i18n("Download mail la&ter"), this ); + mActionMap[Delete] = new TQRadioButton( i18n("D&elete mail from server"), this ); mIdMap[id(mActionMap[Later])] = Later; mIdMap[id(mActionMap[Down])] = Down; mIdMap[id(mActionMap[Delete])] = Delete; - connect( this, SIGNAL(clicked(int)), - this, SLOT( slotActionClicked(int)) ); + connect( this, TQT_SIGNAL(clicked(int)), + this, TQT_SLOT( slotActionClicked(int)) ); } void KMPopFilterActionWidget::setAction( KMPopFilterAction aAction ) @@ -1330,11 +1330,11 @@ void KMPopFilterActionWidget::reset() void KMFilterDlg::slotImportFilters() { FilterImporterExporter importer( this, bPopFilter ); - QValueList<KMFilter*> filters = importer.importFilters(); + TQValueList<KMFilter*> filters = importer.importFilters(); // FIXME message box how many were imported? if (filters.isEmpty()) return; - QValueListConstIterator<KMFilter*> it; + TQValueListConstIterator<KMFilter*> it; for ( it = filters.constBegin() ; it != filters.constEnd() ; ++it ) { mFilterList->appendFilter( *it ); // no need to deep copy, ownership passes to the list @@ -1344,9 +1344,9 @@ void KMFilterDlg::slotImportFilters() void KMFilterDlg::slotExportFilters() { FilterImporterExporter exporter( this, bPopFilter ); - QValueList<KMFilter*> filters = mFilterList->filtersForSaving(); + TQValueList<KMFilter*> filters = mFilterList->filtersForSaving(); exporter.exportFilters( filters ); - QValueList<KMFilter*>::iterator it; + TQValueList<KMFilter*>::iterator it; for ( it = filters.begin(); it != filters.end(); ++it ) delete *it; } |