summaryrefslogtreecommitdiffstats
path: root/kmail/kmsearchpatternedit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kmail/kmsearchpatternedit.cpp')
-rw-r--r--kmail/kmsearchpatternedit.cpp112
1 files changed, 56 insertions, 56 deletions
diff --git a/kmail/kmsearchpatternedit.cpp b/kmail/kmsearchpatternedit.cpp
index df09bbd21..a928e57f3 100644
--- a/kmail/kmsearchpatternedit.cpp
+++ b/kmail/kmsearchpatternedit.cpp
@@ -14,11 +14,11 @@ using KMail::RuleWidgetHandlerManager;
#include <kdialog.h>
#include <kdebug.h>
-#include <qradiobutton.h>
-#include <qcombobox.h>
-#include <qbuttongroup.h>
-#include <qwidgetstack.h>
-#include <qlayout.h>
+#include <tqradiobutton.h>
+#include <tqcombobox.h>
+#include <tqbuttongroup.h>
+#include <tqwidgetstack.h>
+#include <tqlayout.h>
#include <assert.h>
@@ -48,10 +48,10 @@ static const int SpecialRuleFieldsCount =
//
//=============================================================================
-KMSearchRuleWidget::KMSearchRuleWidget( QWidget *parent, KMSearchRule *aRule,
+KMSearchRuleWidget::KMSearchRuleWidget( TQWidget *parent, KMSearchRule *aRule,
const char *name, bool headersOnly,
bool absoluteDates )
- : QWidget( parent, name ),
+ : TQWidget( parent, name ),
mRuleField( 0 ),
mFunctionStack( 0 ),
mValueStack( 0 ),
@@ -69,7 +69,7 @@ KMSearchRuleWidget::KMSearchRuleWidget( QWidget *parent, KMSearchRule *aRule,
void KMSearchRuleWidget::setHeadersOnly( bool headersOnly )
{
KMSearchRule* srule = rule();
- QCString currentText = srule->field();
+ TQCString currentText = srule->field();
delete srule;
initFieldList( headersOnly, mAbsoluteDates );
@@ -80,17 +80,17 @@ void KMSearchRuleWidget::setHeadersOnly( bool headersOnly )
if (( currentText != "<message>") &&
( currentText != "<body>"))
- mRuleField->changeItem( QString::fromAscii( currentText ), 0 );
+ mRuleField->changeItem( TQString::fromAscii( currentText ), 0 );
else
- mRuleField->changeItem( QString::null, 0 );
+ mRuleField->changeItem( TQString::null, 0 );
}
void KMSearchRuleWidget::initWidget()
{
- QHBoxLayout * hlay = new QHBoxLayout( this, 0, KDialog::spacingHint() );
+ TQHBoxLayout * hlay = new TQHBoxLayout( this, 0, KDialog::spacingHint() );
// initialize the header field combo box
- mRuleField = new QComboBox( true, this, "mRuleField" );
+ mRuleField = new TQComboBox( true, this, "mRuleField" );
mRuleField->insertStringList( mFilterFieldList );
// don't show sliders when popping up this menu
mRuleField->setSizeLimit( mRuleField->count() );
@@ -98,14 +98,14 @@ void KMSearchRuleWidget::initWidget()
hlay->addWidget( mRuleField );
// initialize the function/value widget stack
- mFunctionStack = new QWidgetStack( this, "mFunctionStack" );
+ mFunctionStack = new TQWidgetStack( this, "mFunctionStack" );
//Don't expand the widget in vertical direction
- mFunctionStack->setSizePolicy( QSizePolicy::Preferred,QSizePolicy::Fixed );
+ mFunctionStack->setSizePolicy( TQSizePolicy::Preferred,TQSizePolicy::Fixed );
hlay->addWidget( mFunctionStack );
- mValueStack = new QWidgetStack( this, "mValueStack" );
- mValueStack->setSizePolicy( QSizePolicy::Preferred,QSizePolicy::Fixed );
+ mValueStack = new TQWidgetStack( this, "mValueStack" );
+ mValueStack->setSizePolicy( TQSizePolicy::Preferred,TQSizePolicy::Fixed );
hlay->addWidget( mValueStack );
hlay->setStretchFactor( mValueStack, 10 );
@@ -116,12 +116,12 @@ void KMSearchRuleWidget::initWidget()
// redirect focus to the header field combo box
setFocusProxy( mRuleField );
- connect( mRuleField, SIGNAL( activated( const QString & ) ),
- this, SLOT( slotRuleFieldChanged( const QString & ) ) );
- connect( mRuleField, SIGNAL( textChanged( const QString & ) ),
- this, SLOT( slotRuleFieldChanged( const QString & ) ) );
- connect( mRuleField, SIGNAL( textChanged( const QString & ) ),
- this, SIGNAL( fieldChanged( const QString & ) ) );
+ connect( mRuleField, TQT_SIGNAL( activated( const TQString & ) ),
+ this, TQT_SLOT( slotRuleFieldChanged( const TQString & ) ) );
+ connect( mRuleField, TQT_SIGNAL( textChanged( const TQString & ) ),
+ this, TQT_SLOT( slotRuleFieldChanged( const TQString & ) ) );
+ connect( mRuleField, TQT_SIGNAL( textChanged( const TQString & ) ),
+ this, TQT_SIGNAL( fieldChanged( const TQString & ) ) );
}
void KMSearchRuleWidget::setRule( KMSearchRule *aRule )
@@ -137,10 +137,10 @@ void KMSearchRuleWidget::setRule( KMSearchRule *aRule )
mRuleField->blockSignals( true );
if ( i < 0 ) { // not found -> user defined field
- mRuleField->changeItem( QString::fromLatin1( aRule->field() ), 0 );
+ mRuleField->changeItem( TQString::fromLatin1( aRule->field() ), 0 );
i = 0;
} else { // found in the list of predefined fields
- mRuleField->changeItem( QString::null, 0 );
+ mRuleField->changeItem( TQString::null, 0 );
}
mRuleField->setCurrentItem( i );
@@ -151,11 +151,11 @@ void KMSearchRuleWidget::setRule( KMSearchRule *aRule )
}
KMSearchRule* KMSearchRuleWidget::rule() const {
- const QCString ruleField = ruleFieldToEnglish( mRuleField->currentText() );
+ const TQCString ruleField = ruleFieldToEnglish( mRuleField->currentText() );
const KMSearchRule::Function function =
RuleWidgetHandlerManager::instance()->function( ruleField,
mFunctionStack );
- const QString value =
+ const TQString value =
RuleWidgetHandlerManager::instance()->value( ruleField, mFunctionStack,
mValueStack );
@@ -174,7 +174,7 @@ void KMSearchRuleWidget::reset()
void KMSearchRuleWidget::slotFunctionChanged()
{
- const QCString ruleField = ruleFieldToEnglish( mRuleField->currentText() );
+ const TQCString ruleField = ruleFieldToEnglish( mRuleField->currentText() );
RuleWidgetHandlerManager::instance()->update( ruleField,
mFunctionStack,
mValueStack );
@@ -182,15 +182,15 @@ void KMSearchRuleWidget::slotFunctionChanged()
void KMSearchRuleWidget::slotValueChanged()
{
- const QCString ruleField = ruleFieldToEnglish( mRuleField->currentText() );
- const QString prettyValue =
+ const TQCString ruleField = ruleFieldToEnglish( mRuleField->currentText() );
+ const TQString prettyValue =
RuleWidgetHandlerManager::instance()->prettyValue( ruleField,
mFunctionStack,
mValueStack );
emit contentsChanged( prettyValue );
}
-QCString KMSearchRuleWidget::ruleFieldToEnglish( const QString & i18nVal )
+TQCString KMSearchRuleWidget::ruleFieldToEnglish( const TQString & i18nVal )
{
for ( int i = 0; i < SpecialRuleFieldsCount; ++i ) {
if ( i18nVal == i18n( SpecialRuleFields[i].displayName ) )
@@ -199,7 +199,7 @@ QCString KMSearchRuleWidget::ruleFieldToEnglish( const QString & i18nVal )
return i18nVal.latin1();
}
-int KMSearchRuleWidget::ruleFieldToId( const QString & i18nVal )
+int KMSearchRuleWidget::ruleFieldToId( const TQString & i18nVal )
{
for ( int i = 0; i < SpecialRuleFieldsCount; ++i ) {
if ( i18nVal == i18n( SpecialRuleFields[i].displayName ) )
@@ -208,7 +208,7 @@ int KMSearchRuleWidget::ruleFieldToId( const QString & i18nVal )
return -1; // no pseudo header
}
-static QString displayNameFromInternalName( const QString & internal )
+static TQString displayNameFromInternalName( const TQString & internal )
{
for ( int i = 0; i < SpecialRuleFieldsCount; ++i ) {
if ( internal == SpecialRuleFields[i].internalName )
@@ -219,12 +219,12 @@ static QString displayNameFromInternalName( const QString & internal )
-int KMSearchRuleWidget::indexOfRuleField( const QCString & aName ) const
+int KMSearchRuleWidget::indexOfRuleField( const TQCString & aName ) const
{
if ( aName.isEmpty() )
return -1;
- QString i18n_aName = displayNameFromInternalName( aName );
+ TQString i18n_aName = displayNameFromInternalName( aName );
for ( int i = 1; i < mRuleField->count(); ++i ) {
if ( mRuleField->text( i ) == i18n_aName )
@@ -263,7 +263,7 @@ void KMSearchRuleWidget::initFieldList( bool headersOnly, bool absoluteDates )
mFilterFieldList.append("X-Spam-Flag");
}
-void KMSearchRuleWidget::slotRuleFieldChanged( const QString & field )
+void KMSearchRuleWidget::slotRuleFieldChanged( const TQString & field )
{
RuleWidgetHandlerManager::instance()->update( ruleFieldToEnglish( field ),
mFunctionStack,
@@ -276,7 +276,7 @@ void KMSearchRuleWidget::slotRuleFieldChanged( const QString & field )
//
//=============================================================================
-KMSearchRuleWidgetLister::KMSearchRuleWidgetLister( QWidget *parent, const char* name, bool headersOnly, bool absoluteDates )
+KMSearchRuleWidgetLister::KMSearchRuleWidgetLister( TQWidget *parent, const char* name, bool headersOnly, bool absoluteDates )
: KWidgetLister( 2, FILTER_MAX_RULES, parent, name )
{
mRuleList = 0;
@@ -288,7 +288,7 @@ KMSearchRuleWidgetLister::~KMSearchRuleWidgetLister()
{
}
-void KMSearchRuleWidgetLister::setRuleList( QPtrList<KMSearchRule> *aList )
+void KMSearchRuleWidgetLister::setRuleList( TQPtrList<KMSearchRule> *aList )
{
assert ( aList );
@@ -321,8 +321,8 @@ void KMSearchRuleWidgetLister::setRuleList( QPtrList<KMSearchRule> *aList )
setNumberOfShownWidgetsTo( QMAX((int)mRuleList->count(),mMinWidgets) );
// load the actions into the widgets
- QPtrListIterator<KMSearchRule> rIt( *mRuleList );
- QPtrListIterator<QWidget> wIt( mWidgetList );
+ TQPtrListIterator<KMSearchRule> rIt( *mRuleList );
+ TQPtrListIterator<TQWidget> wIt( mWidgetList );
for ( rIt.toFirst(), wIt.toFirst() ;
rIt.current() && wIt.current() ; ++rIt, ++wIt ) {
static_cast<KMSearchRuleWidget*>(*wIt)->setRule( (*rIt) );
@@ -336,7 +336,7 @@ void KMSearchRuleWidgetLister::setRuleList( QPtrList<KMSearchRule> *aList )
void KMSearchRuleWidgetLister::setHeadersOnly( bool headersOnly )
{
- QPtrListIterator<QWidget> wIt( mWidgetList );
+ TQPtrListIterator<TQWidget> wIt( mWidgetList );
for ( wIt.toFirst() ; wIt.current() ; ++wIt ) {
(static_cast<KMSearchRuleWidget*>(*wIt))->setHeadersOnly( headersOnly );
}
@@ -351,12 +351,12 @@ void KMSearchRuleWidgetLister::reset()
slotClear();
}
-QWidget* KMSearchRuleWidgetLister::createWidget( QWidget *parent )
+TQWidget* KMSearchRuleWidgetLister::createWidget( TQWidget *parent )
{
return new KMSearchRuleWidget(parent, 0, 0, mHeadersOnly, mAbsoluteDates);
}
-void KMSearchRuleWidgetLister::clearWidget( QWidget *aWidget )
+void KMSearchRuleWidgetLister::clearWidget( TQWidget *aWidget )
{
if ( aWidget )
((KMSearchRuleWidget*)aWidget)->reset();
@@ -368,7 +368,7 @@ void KMSearchRuleWidgetLister::regenerateRuleListFromWidgets()
mRuleList->clear();
- QPtrListIterator<QWidget> it( mWidgetList );
+ TQPtrListIterator<TQWidget> it( mWidgetList );
for ( it.toFirst() ; it.current() ; ++it ) {
KMSearchRule *r = ((KMSearchRuleWidget*)(*it))->rule();
if ( r )
@@ -385,15 +385,15 @@ void KMSearchRuleWidgetLister::regenerateRuleListFromWidgets()
//
//=============================================================================
-KMSearchPatternEdit::KMSearchPatternEdit(QWidget *parent, const char *name, bool headersOnly, bool absoluteDates )
- : QGroupBox( 1/*columns*/, Horizontal, parent, name )
+KMSearchPatternEdit::KMSearchPatternEdit(TQWidget *parent, const char *name, bool headersOnly, bool absoluteDates )
+ : TQGroupBox( 1/*columns*/, Horizontal, parent, name )
{
setTitle( i18n("Search Criteria") );
initLayout( headersOnly, absoluteDates );
}
-KMSearchPatternEdit::KMSearchPatternEdit(const QString & title, QWidget *parent, const char *name, bool headersOnly, bool absoluteDates)
- : QGroupBox( 1/*column*/, Horizontal, title, parent, name )
+KMSearchPatternEdit::KMSearchPatternEdit(const TQString & title, TQWidget *parent, const char *name, bool headersOnly, bool absoluteDates)
+ : TQGroupBox( 1/*column*/, Horizontal, title, parent, name )
{
initLayout( headersOnly, absoluteDates );
}
@@ -405,13 +405,13 @@ KMSearchPatternEdit::~KMSearchPatternEdit()
void KMSearchPatternEdit::initLayout(bool headersOnly, bool absoluteDates)
{
//------------the radio buttons
- mAllRBtn = new QRadioButton( i18n("Match a&ll of the following"), this, "mAllRBtn" );
- mAnyRBtn = new QRadioButton( i18n("Match an&y of the following"), this, "mAnyRBtn" );
+ mAllRBtn = new TQRadioButton( i18n("Match a&ll of the following"), this, "mAllRBtn" );
+ mAnyRBtn = new TQRadioButton( i18n("Match an&y of the following"), this, "mAnyRBtn" );
mAllRBtn->setChecked(true);
mAnyRBtn->setChecked(false);
- QButtonGroup *bg = new QButtonGroup( this );
+ TQButtonGroup *bg = new TQButtonGroup( this );
bg->hide();
bg->insert( mAllRBtn, (int)KMSearchPattern::OpAnd );
bg->insert( mAnyRBtn, (int)KMSearchPattern::OpOr );
@@ -421,15 +421,15 @@ void KMSearchPatternEdit::initLayout(bool headersOnly, bool absoluteDates)
mRuleLister->slotClear();
//------------connect a few signals
- connect( bg, SIGNAL(clicked(int)),
- this, SLOT(slotRadioClicked(int)) );
+ connect( bg, TQT_SIGNAL(clicked(int)),
+ this, TQT_SLOT(slotRadioClicked(int)) );
KMSearchRuleWidget *srw = (KMSearchRuleWidget*)mRuleLister->mWidgetList.first();
if ( srw ) {
- connect( srw, SIGNAL(fieldChanged(const QString &)),
- this, SLOT(slotAutoNameHack()) );
- connect( srw, SIGNAL(contentsChanged(const QString &)),
- this, SLOT(slotAutoNameHack()) );
+ connect( srw, TQT_SIGNAL(fieldChanged(const TQString &)),
+ this, TQT_SLOT(slotAutoNameHack()) );
+ connect( srw, TQT_SIGNAL(contentsChanged(const TQString &)),
+ this, TQT_SLOT(slotAutoNameHack()) );
} else
kdDebug(5006) << "KMSearchPatternEdit: no first KMSearchRuleWidget, though slotClear() has been called!" << endl;
}