summaryrefslogtreecommitdiffstats
path: root/libkdepim/kscoringeditor.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:53:50 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:53:50 +0000
commit7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch)
tree8474f9b444b2756228600050f07a7ff25de532b2 /libkdepim/kscoringeditor.cpp
parentf587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff)
downloadtdepim-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 'libkdepim/kscoringeditor.cpp')
-rw-r--r--libkdepim/kscoringeditor.cpp338
1 files changed, 169 insertions, 169 deletions
diff --git a/libkdepim/kscoringeditor.cpp b/libkdepim/kscoringeditor.cpp
index 4ead5b8d6..6c469f49a 100644
--- a/libkdepim/kscoringeditor.cpp
+++ b/libkdepim/kscoringeditor.cpp
@@ -30,20 +30,20 @@
#include <kparts/componentfactory.h>
-#include <qlabel.h>
-#include <qpushbutton.h>
-#include <qlayout.h>
-#include <qtooltip.h>
-#include <qcheckbox.h>
-#include <qbuttongroup.h>
-#include <qradiobutton.h>
-#include <qwidgetstack.h>
-#include <qapplication.h>
-#include <qtimer.h>
-#include <qhbox.h>
+#include <tqlabel.h>
+#include <tqpushbutton.h>
+#include <tqlayout.h>
+#include <tqtooltip.h>
+#include <tqcheckbox.h>
+#include <tqbuttongroup.h>
+#include <tqradiobutton.h>
+#include <tqwidgetstack.h>
+#include <tqapplication.h>
+#include <tqtimer.h>
+#include <tqhbox.h>
// works for both ListBox and ComboBox
-template <class T> static int setCurrentItem(T *box, const QString& s)
+template <class T> static int setCurrentItem(T *box, const TQString& s)
{
int cnt = box->count();
for (int i=0;i<cnt;++i) {
@@ -61,37 +61,37 @@ template <class T> static int setCurrentItem(T *box, const QString& s)
// class SingleConditionWidget (editor for one condition, used in ConditionEditWidget)
//
//============================================================================
-SingleConditionWidget::SingleConditionWidget(KScoringManager *m,QWidget *p, const char *n)
- : QFrame(p,n), manager(m)
+SingleConditionWidget::SingleConditionWidget(KScoringManager *m,TQWidget *p, const char *n)
+ : TQFrame(p,n), manager(m)
{
- QBoxLayout *topL = new QVBoxLayout(this,5);
- QBoxLayout *firstRow = new QHBoxLayout(topL);
- neg = new QCheckBox(i18n("Not"),this);
- QToolTip::add(neg,i18n("Negate this condition"));
+ TQBoxLayout *topL = new TQVBoxLayout(this,5);
+ TQBoxLayout *firstRow = new TQHBoxLayout(topL);
+ neg = new TQCheckBox(i18n("Not"),this);
+ TQToolTip::add(neg,i18n("Negate this condition"));
firstRow->addWidget(neg);
headers = new KComboBox(this);
headers->insertStringList(manager->getDefaultHeaders());
headers->setEditable( true );
- QToolTip::add(headers,i18n("Select the header to match this condition against"));
+ TQToolTip::add(headers,i18n("Select the header to match this condition against"));
firstRow->addWidget(headers,1);
matches = new KComboBox(this);
matches->insertStringList(KScoringExpression::conditionNames());
- QToolTip::add(matches,i18n("Select the type of match"));
+ TQToolTip::add(matches,i18n("Select the type of match"));
firstRow->addWidget(matches,1);
- connect( matches, SIGNAL( activated( int ) ), SLOT( toggleRegExpButton( int ) ) );
- QHBoxLayout *secondRow = new QHBoxLayout( topL );
+ connect( matches, TQT_SIGNAL( activated( int ) ), TQT_SLOT( toggleRegExpButton( int ) ) );
+ TQHBoxLayout *secondRow = new TQHBoxLayout( topL );
secondRow->setSpacing( 1 );
expr = new KLineEdit( this );
- QToolTip::add(expr,i18n("The condition for the match"));
+ TQToolTip::add(expr,i18n("The condition for the match"));
// reserve space for at least 20 characters
expr->setMinimumWidth(fontMetrics().maxWidth()*20);
secondRow->addWidget( expr );
- regExpButton = new QPushButton( i18n("Edit..."), this );
+ regExpButton = new TQPushButton( i18n("Edit..."), this );
secondRow->addWidget( regExpButton );
- connect( regExpButton, SIGNAL( clicked() ), SLOT( showRegExpDialog() ) );
+ connect( regExpButton, TQT_SIGNAL( clicked() ), TQT_SLOT( showRegExpDialog() ) );
// occupy at much width as possible
- setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed));
+ setSizePolicy(TQSizePolicy(TQSizePolicy::Expanding,TQSizePolicy::Fixed));
setFrameStyle(Box | Sunken);
setLineWidth(1);
}
@@ -110,12 +110,12 @@ void SingleConditionWidget::setCondition(KScoringExpression *e)
KScoringExpression* SingleConditionWidget::createCondition() const
{
- QString head = headers->currentText();
- QString match = matches->currentText();
+ TQString head = headers->currentText();
+ TQString match = matches->currentText();
int condType = KScoringExpression::getConditionForName(match);
match = KScoringExpression::getTypeString(condType);
- QString cond = expr->text();
- QString negs = (neg->isChecked())?"1":"0";
+ TQString cond = expr->text();
+ TQString negs = (neg->isChecked())?"1":"0";
return new KScoringExpression(head,match,cond,negs);
}
@@ -135,7 +135,7 @@ void SingleConditionWidget::toggleRegExpButton( int selected )
void SingleConditionWidget::showRegExpDialog()
{
- QDialog *editorDialog = KParts::ComponentFactory::createInstanceFromQuery<QDialog>( "KRegExpEditor/KRegExpEditor" );
+ TQDialog *editorDialog = KParts::ComponentFactory::createInstanceFromQuery<TQDialog>( "KRegExpEditor/KRegExpEditor" );
if ( editorDialog ) {
KRegExpEditorInterface *editor = static_cast<KRegExpEditorInterface *>( editorDialog->qt_cast( "KRegExpEditorInterface" ) );
Q_ASSERT( editor ); // This should not fail!
@@ -150,7 +150,7 @@ void SingleConditionWidget::showRegExpDialog()
// class ConditionEditWidget (the widget to edit the conditions of a rule)
//
//============================================================================
-ConditionEditWidget::ConditionEditWidget(KScoringManager *m, QWidget *p, const char *n)
+ConditionEditWidget::ConditionEditWidget(KScoringManager *m, TQWidget *p, const char *n)
: KWidgetLister(1,8,p,n), manager(m)
{
// create one initial widget
@@ -160,12 +160,12 @@ ConditionEditWidget::ConditionEditWidget(KScoringManager *m, QWidget *p, const c
ConditionEditWidget::~ConditionEditWidget()
{}
-QWidget* ConditionEditWidget::createWidget(QWidget *parent)
+TQWidget* ConditionEditWidget::createWidget(TQWidget *parent)
{
return new SingleConditionWidget(manager,parent);
}
-void ConditionEditWidget::clearWidget(QWidget *w)
+void ConditionEditWidget::clearWidget(TQWidget *w)
{
Q_ASSERT( w->isA("SingleConditionWidget") );
SingleConditionWidget *sw = dynamic_cast<SingleConditionWidget*>(w);
@@ -194,7 +194,7 @@ void ConditionEditWidget::slotEditRule(KScoringRule *rule)
void ConditionEditWidget::updateRule(KScoringRule *rule)
{
rule->cleanExpressions();
- for(QWidget *w = mWidgetList.first(); w; w = mWidgetList.next()) {
+ for(TQWidget *w = mWidgetList.first(); w; w = mWidgetList.next()) {
if (! w->isA("SingleConditionWidget")) {
kdWarning(5100) << "there is a widget in ConditionEditWidget "
<< "which isn't a SingleConditionWidget" << endl;
@@ -211,29 +211,29 @@ void ConditionEditWidget::updateRule(KScoringRule *rule)
// class SingleActionWidget (editor for one action, used in ActionEditWidget)
//
//============================================================================
-SingleActionWidget::SingleActionWidget(KScoringManager *m,QWidget *p, const char *n)
- : QWidget(p,n), notifyEditor(0), scoreEditor(0), colorEditor(0),manager(m)
+SingleActionWidget::SingleActionWidget(KScoringManager *m,TQWidget *p, const char *n)
+ : TQWidget(p,n), notifyEditor(0), scoreEditor(0), colorEditor(0),manager(m)
{
- QHBoxLayout *topL = new QHBoxLayout(this,0,5);
+ TQHBoxLayout *topL = new TQHBoxLayout(this,0,5);
types = new KComboBox(this);
types->setEditable(false);
topL->addWidget(types);
- stack = new QWidgetStack(this);
+ stack = new TQWidgetStack(this);
topL->addWidget(stack);
- dummyLabel = new QLabel(i18n("Select an action."), stack);
+ dummyLabel = new TQLabel(i18n("Select an action."), stack);
stack->addWidget(dummyLabel, 0);
// init widget stack and the types combo box
int index = 1;
- types->insertItem(QString::null);
- QStringList l = ActionBase::userNames();
- for ( QStringList::Iterator it = l.begin(); it != l.end(); ++it ) {
- QString name = *it;
+ types->insertItem(TQString::null);
+ TQStringList l = ActionBase::userNames();
+ for ( TQStringList::Iterator it = l.begin(); it != l.end(); ++it ) {
+ TQString name = *it;
int feature = ActionBase::getTypeForUserName(name);
if (manager->hasFeature(feature)) {
types->insertItem(name);
- QWidget *w=0;
+ TQWidget *w=0;
switch (feature) {
case ActionBase::SETSCORE:
w = scoreEditor = new KIntSpinBox(-99999,99999,1,0,10, stack);
@@ -245,7 +245,7 @@ SingleActionWidget::SingleActionWidget(KScoringManager *m,QWidget *p, const char
w = colorEditor = new KColorCombo(stack);
break;
case ActionBase::MARKASREAD:
- w = new QLabel( stack ); // empty dummy
+ w = new TQLabel( stack ); // empty dummy
break;
}
if ( w )
@@ -253,7 +253,7 @@ SingleActionWidget::SingleActionWidget(KScoringManager *m,QWidget *p, const char
}
}
- connect(types,SIGNAL(activated(int)),stack,SLOT(raiseWidget(int)));
+ connect(types,TQT_SIGNAL(activated(int)),stack,TQT_SLOT(raiseWidget(int)));
// raise the dummy label
types->setCurrentItem(0);
@@ -278,7 +278,7 @@ void SingleActionWidget::setAction(ActionBase *act)
notifyEditor->setText(act->getValueString());
break;
case ActionBase::COLOR:
- colorEditor->setColor(QColor(act->getValueString()));
+ colorEditor->setColor(TQColor(act->getValueString()));
break;
case ActionBase::MARKASREAD:
// nothing
@@ -324,7 +324,7 @@ void SingleActionWidget::clear()
// class ActionEditWidget (the widget to edit the actions of a rule)
//
//============================================================================
-ActionEditWidget::ActionEditWidget(KScoringManager *m,QWidget *p, const char *n)
+ActionEditWidget::ActionEditWidget(KScoringManager *m,TQWidget *p, const char *n)
: KWidgetLister(1,8,p,n), manager(m)
{
// create one initial widget
@@ -334,7 +334,7 @@ ActionEditWidget::ActionEditWidget(KScoringManager *m,QWidget *p, const char *n)
ActionEditWidget::~ActionEditWidget()
{}
-QWidget* ActionEditWidget::createWidget( QWidget *parent )
+TQWidget* ActionEditWidget::createWidget( TQWidget *parent )
{
return new SingleActionWidget(manager,parent);
}
@@ -360,7 +360,7 @@ void ActionEditWidget::slotEditRule(KScoringRule *rule)
void ActionEditWidget::updateRule(KScoringRule *rule)
{
rule->cleanActions();
- for(QWidget *w = mWidgetList.first(); w; w = mWidgetList.next()) {
+ for(TQWidget *w = mWidgetList.first(); w; w = mWidgetList.next()) {
if (! w->isA("SingleActionWidget")) {
kdWarning(5100) << "there is a widget in ActionEditWidget "
<< "which isn't a SingleActionWidget" << endl;
@@ -376,7 +376,7 @@ void ActionEditWidget::updateRule(KScoringRule *rule)
}
}
-void ActionEditWidget::clearWidget(QWidget *w)
+void ActionEditWidget::clearWidget(TQWidget *w)
{
Q_ASSERT( w->isA("SingleActionWidget") );
SingleActionWidget *sw = dynamic_cast<SingleActionWidget*>(w);
@@ -389,86 +389,86 @@ void ActionEditWidget::clearWidget(QWidget *w)
// class RuleEditWidget (the widget to edit one rule)
//
//============================================================================
-RuleEditWidget::RuleEditWidget(KScoringManager *m,QWidget *p, const char *n)
- : QWidget(p,n), dirty(false), manager(m), oldRuleName(QString::null)
+RuleEditWidget::RuleEditWidget(KScoringManager *m,TQWidget *p, const char *n)
+ : TQWidget(p,n), dirty(false), manager(m), oldRuleName(TQString::null)
{
kdDebug(5100) << "RuleEditWidget::RuleEditWidget()" << endl;
if ( !n ) setName( "RuleEditWidget" );
- QVBoxLayout *topLayout = new QVBoxLayout( this, 5, KDialog::spacingHint() );
+ TQVBoxLayout *topLayout = new TQVBoxLayout( this, 5, KDialog::spacingHint() );
//------------- Name, Servers, Groups ---------------------
- QGroupBox *groupB = new QGroupBox(i18n("Properties"),this);
+ TQGroupBox *groupB = new TQGroupBox(i18n("Properties"),this);
topLayout->addWidget(groupB);
- QGridLayout* groupL = new QGridLayout(groupB, 6,2, 8,5);
+ TQGridLayout* groupL = new TQGridLayout(groupB, 6,2, 8,5);
groupL->addRowSpacing(0, fontMetrics().lineSpacing()-4);
// name
ruleNameEdit = new KLineEdit( groupB, "ruleNameEdit" );
groupL->addWidget( ruleNameEdit, 1, 1 );
- QLabel *ruleNameLabel = new QLabel(ruleNameEdit, i18n("&Name:"), groupB, "ruleNameLabel");
+ TQLabel *ruleNameLabel = new TQLabel(ruleNameEdit, i18n("&Name:"), groupB, "ruleNameLabel");
groupL->addWidget( ruleNameLabel, 1, 0 );
// groups
groupsEdit = new KLineEdit( groupB, "groupsEdit" );
groupL->addWidget( groupsEdit, 2, 1 );
- QLabel *groupsLabel = new QLabel(groupsEdit, i18n("&Groups:"), groupB, "groupsLabel");
+ TQLabel *groupsLabel = new TQLabel(groupsEdit, i18n("&Groups:"), groupB, "groupsLabel");
groupL->addWidget( groupsLabel, 2, 0 );
- QPushButton *groupsBtn = new QPushButton(i18n("A&dd Group"), groupB);
- connect(groupsBtn,SIGNAL(clicked()),SLOT(slotAddGroup()));
+ TQPushButton *groupsBtn = new TQPushButton(i18n("A&dd Group"), groupB);
+ connect(groupsBtn,TQT_SIGNAL(clicked()),TQT_SLOT(slotAddGroup()));
groupL->addWidget( groupsBtn, 3, 0 );
groupsBox = new KComboBox( false, groupB, "groupsBox" );
groupsBox->setDuplicatesEnabled(false);
groupsBox->insertStringList(manager->getGroups());
- groupsBox->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
+ groupsBox->setSizePolicy(TQSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Fixed));
groupL->addWidget( groupsBox, 3, 1 );
// expires
- expireCheck = new QCheckBox(i18n("&Expire rule automatically"), groupB);
+ expireCheck = new TQCheckBox(i18n("&Expire rule automatically"), groupB);
groupL->addMultiCellWidget( expireCheck, 4,4, 0,1 );
expireEdit = new KIntSpinBox(1,99999,1,30,10, groupB, "expireWidget");
//Init suffix
slotExpireEditChanged(30);
- connect(expireEdit, SIGNAL(valueChanged(int)), SLOT(slotExpireEditChanged(int)));
+ connect(expireEdit, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(slotExpireEditChanged(int)));
groupL->addWidget( expireEdit, 5, 1 );
- expireLabel = new QLabel(expireEdit, i18n("&Rule is valid for:"), groupB, "expireLabel");
+ expireLabel = new TQLabel(expireEdit, i18n("&Rule is valid for:"), groupB, "expireLabel");
groupL->addWidget( expireLabel, 5, 0 );
expireLabel->setEnabled(false);
expireEdit->setEnabled(false);
- connect(expireCheck, SIGNAL(toggled(bool)), expireLabel, SLOT(setEnabled(bool)));
- connect(expireCheck, SIGNAL(toggled(bool)), expireEdit, SLOT(setEnabled(bool)));
+ connect(expireCheck, TQT_SIGNAL(toggled(bool)), expireLabel, TQT_SLOT(setEnabled(bool)));
+ connect(expireCheck, TQT_SIGNAL(toggled(bool)), expireEdit, TQT_SLOT(setEnabled(bool)));
//------------- Conditions ---------------------
- QGroupBox *groupConds = new QGroupBox(i18n("Conditions"), this);
+ TQGroupBox *groupConds = new TQGroupBox(i18n("Conditions"), this);
topLayout->addWidget(groupConds);
- QGridLayout *condL = new QGridLayout(groupConds, 3,2, 8,5);
+ TQGridLayout *condL = new TQGridLayout(groupConds, 3,2, 8,5);
condL->addRowSpacing(0, fontMetrics().lineSpacing()-4);
- QButtonGroup *buttonGroup = new QButtonGroup(groupConds);
+ TQButtonGroup *buttonGroup = new TQButtonGroup(groupConds);
buttonGroup->hide();
- linkModeAnd = new QRadioButton(i18n("Match a&ll conditions"), groupConds);
+ linkModeAnd = new TQRadioButton(i18n("Match a&ll conditions"), groupConds);
buttonGroup->insert(linkModeAnd);
condL->addWidget(linkModeAnd, 1,0);
- linkModeOr = new QRadioButton(i18n("Matc&h any condition"), groupConds);
+ linkModeOr = new TQRadioButton(i18n("Matc&h any condition"), groupConds);
buttonGroup->insert(linkModeOr);
condL->addWidget(linkModeOr, 1,1);
linkModeAnd->setChecked(true);
condEditor = new ConditionEditWidget(manager,groupConds);
condL->addMultiCellWidget(condEditor, 2,2, 0,1);
- connect(condEditor,SIGNAL(widgetRemoved()),this,SLOT(slotShrink()));
+ connect(condEditor,TQT_SIGNAL(widgetRemoved()),this,TQT_SLOT(slotShrink()));
//------------- Actions ---------------------
- QGroupBox *groupActions = new QGroupBox(i18n("Actions"), this);
+ TQGroupBox *groupActions = new TQGroupBox(i18n("Actions"), this);
topLayout->addWidget(groupActions);
- QBoxLayout *actionL = new QVBoxLayout(groupActions,8,5);
+ TQBoxLayout *actionL = new TQVBoxLayout(groupActions,8,5);
actionL->addSpacing(fontMetrics().lineSpacing()-4);
actionEditor = new ActionEditWidget(manager,groupActions);
actionL->addWidget(actionEditor);
- connect(actionEditor,SIGNAL(widgetRemoved()),this,SLOT(slotShrink()));
+ connect(actionEditor,TQT_SIGNAL(widgetRemoved()),this,TQT_SLOT(slotShrink()));
topLayout->addStretch(1);
@@ -479,7 +479,7 @@ RuleEditWidget::~RuleEditWidget()
{
}
-void RuleEditWidget::slotEditRule(const QString& ruleName)
+void RuleEditWidget::slotEditRule(const TQString& ruleName)
{
kdDebug(5100) << "RuleEditWidget::slotEditRule(" << ruleName << ")" << endl;
// // first update the old rule if there is one
@@ -508,7 +508,7 @@ void RuleEditWidget::slotEditRule(const QString& ruleName)
expireEdit->setEnabled(b);
expireLabel->setEnabled(b);
if (b)
- expireEdit->setValue(QDate::currentDate().daysTo(rule->getExpireDate()));
+ expireEdit->setValue(TQDate::currentDate().daysTo(rule->getExpireDate()));
else
expireEdit->setValue(30);
if (rule->getLinkMode() == KScoringRule::AND) {
@@ -533,22 +533,22 @@ void RuleEditWidget::clearContents()
expireEdit->setEnabled(false);
condEditor->slotEditRule(0);
actionEditor->slotEditRule(0);
- oldRuleName = QString::null;
+ oldRuleName = TQString::null;
}
void RuleEditWidget::updateRule(KScoringRule *rule)
{
- oldRuleName = QString::null;
- QString groups = groupsEdit->text();
+ oldRuleName = TQString::null;
+ TQString groups = groupsEdit->text();
if (groups.isEmpty())
- rule->setGroups(QStringList(".*"));
+ rule->setGroups(TQStringList(".*"));
else
- rule->setGroups(QStringList::split(";",groups));
+ rule->setGroups(TQStringList::split(";",groups));
bool b = expireCheck->isChecked();
if (b)
- rule->setExpireDate(QDate::currentDate().addDays(expireEdit->value()));
+ rule->setExpireDate(TQDate::currentDate().addDays(expireEdit->value()));
else
- rule->setExpireDate(QDate());
+ rule->setExpireDate(TQDate());
actionEditor->updateRule(rule);
rule->setLinkMode(linkModeAnd->isChecked()?KScoringRule::AND:KScoringRule::OR);
condEditor->updateRule(rule);
@@ -564,10 +564,10 @@ void RuleEditWidget::updateRule()
void RuleEditWidget::slotAddGroup()
{
- QString grp = groupsBox->currentText();
+ TQString grp = groupsBox->currentText();
if ( grp.isEmpty() )
return;
- QString txt = groupsEdit->text().stripWhiteSpace();
+ TQString txt = groupsEdit->text().stripWhiteSpace();
if ( txt == ".*" || txt.isEmpty() ) groupsEdit->setText(grp);
else groupsEdit->setText(txt + ";" + grp);
}
@@ -594,79 +594,79 @@ void RuleEditWidget::slotExpireEditChanged(int value)
// class RuleListWidget (the widget for managing a list of rules)
//
//============================================================================
-RuleListWidget::RuleListWidget(KScoringManager *m, bool standalone, QWidget *p, const char *n)
- : QWidget(p,n), alone(standalone), manager(m)
+RuleListWidget::RuleListWidget(KScoringManager *m, bool standalone, TQWidget *p, const char *n)
+ : TQWidget(p,n), alone(standalone), manager(m)
{
kdDebug(5100) << "RuleListWidget::RuleListWidget()" << endl;
if (!n) setName("RuleListWidget");
- QVBoxLayout *topL = new QVBoxLayout(this,standalone? 0:5,KDialog::spacingHint());
+ TQVBoxLayout *topL = new TQVBoxLayout(this,standalone? 0:5,KDialog::spacingHint());
ruleList = new KListBox(this);
if (standalone) {
- connect(ruleList,SIGNAL(doubleClicked(QListBoxItem*)),
- this,SLOT(slotEditRule(QListBoxItem*)));
- connect(ruleList,SIGNAL(returnPressed(QListBoxItem*)),
- this,SLOT(slotEditRule(QListBoxItem*)));
+ connect(ruleList,TQT_SIGNAL(doubleClicked(TQListBoxItem*)),
+ this,TQT_SLOT(slotEditRule(TQListBoxItem*)));
+ connect(ruleList,TQT_SIGNAL(returnPressed(TQListBoxItem*)),
+ this,TQT_SLOT(slotEditRule(TQListBoxItem*)));
}
- connect(ruleList, SIGNAL(currentChanged(QListBoxItem*)),
- this, SLOT(slotRuleSelected(QListBoxItem*)));
+ connect(ruleList, TQT_SIGNAL(currentChanged(TQListBoxItem*)),
+ this, TQT_SLOT(slotRuleSelected(TQListBoxItem*)));
topL->addWidget(ruleList);
- QHBoxLayout *btnL = new QHBoxLayout( topL, KDialog::spacingHint() );
- mRuleUp = new QPushButton( this );
+ TQHBoxLayout *btnL = new TQHBoxLayout( topL, KDialog::spacingHint() );
+ mRuleUp = new TQPushButton( this );
mRuleUp->setPixmap( BarIcon( "up", KIcon::SizeSmall ) );
- QToolTip::add( mRuleUp, i18n("Move rule up") );
+ TQToolTip::add( mRuleUp, i18n("Move rule up") );
btnL->addWidget( mRuleUp );
- connect( mRuleUp, SIGNAL( clicked() ), SLOT( slotRuleUp() ) );
- mRuleDown = new QPushButton( this );
+ connect( mRuleUp, TQT_SIGNAL( clicked() ), TQT_SLOT( slotRuleUp() ) );
+ mRuleDown = new TQPushButton( this );
mRuleDown->setPixmap( BarIcon( "down", KIcon::SizeSmall ) );
- QToolTip::add( mRuleDown, i18n("Move rule down") );
+ TQToolTip::add( mRuleDown, i18n("Move rule down") );
btnL->addWidget( mRuleDown );
- connect( mRuleDown, SIGNAL( clicked() ), SLOT( slotRuleDown() ) );
+ connect( mRuleDown, TQT_SIGNAL( clicked() ), TQT_SLOT( slotRuleDown() ) );
- btnL = new QHBoxLayout( topL, KDialog::spacingHint() );
+ btnL = new TQHBoxLayout( topL, KDialog::spacingHint() );
editRule=0L;
- newRule = new QPushButton(this);
+ newRule = new TQPushButton(this);
newRule->setPixmap( BarIcon( "filenew", KIcon::SizeSmall ) );
- QToolTip::add(newRule,i18n("New rule")),
+ TQToolTip::add(newRule,i18n("New rule")),
btnL->addWidget(newRule);
- connect(newRule, SIGNAL(clicked()), this, SLOT(slotNewRule()));
+ connect(newRule, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotNewRule()));
// if we're standalone, we need an additional edit button
if (standalone) {
- editRule = new QPushButton(this);
+ editRule = new TQPushButton(this);
editRule->setIconSet( BarIconSet("edit", KIcon::SizeSmall) );
- QToolTip::add(editRule,i18n("Edit rule"));
+ TQToolTip::add(editRule,i18n("Edit rule"));
btnL->addWidget(editRule);
- connect(editRule,SIGNAL(clicked()),this,SLOT(slotEditRule()));
+ connect(editRule,TQT_SIGNAL(clicked()),this,TQT_SLOT(slotEditRule()));
}
- delRule = new QPushButton(this);
+ delRule = new TQPushButton(this);
delRule->setIconSet( BarIconSet( "editdelete", KIcon::SizeSmall ) );
- QToolTip::add(delRule,i18n("Remove rule"));
+ TQToolTip::add(delRule,i18n("Remove rule"));
btnL->addWidget(delRule);
- connect(delRule, SIGNAL(clicked()), this, SLOT(slotDelRule()));
- copyRule = new QPushButton(this);
+ connect(delRule, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotDelRule()));
+ copyRule = new TQPushButton(this);
copyRule->setIconSet(BarIconSet("editcopy", KIcon::SizeSmall));
- QToolTip::add(copyRule,i18n("Copy rule"));
+ TQToolTip::add(copyRule,i18n("Copy rule"));
btnL->addWidget(copyRule);
- connect(copyRule, SIGNAL(clicked()), this, SLOT(slotCopyRule()));
+ connect(copyRule, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotCopyRule()));
// the group filter
- QBoxLayout *filterL = new QVBoxLayout(topL,KDialog::spacingHint());
+ TQBoxLayout *filterL = new TQVBoxLayout(topL,KDialog::spacingHint());
KComboBox *filterBox = new KComboBox(this);
- QStringList l = m->getGroups();
+ TQStringList l = m->getGroups();
filterBox->insertItem(i18n("<all groups>"));
filterBox->insertStringList(l);
- filterBox->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
- connect(filterBox,SIGNAL(activated(const QString&)),
- this,SLOT(slotGroupFilter(const QString&)));
+ filterBox->setSizePolicy(TQSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Fixed));
+ connect(filterBox,TQT_SIGNAL(activated(const TQString&)),
+ this,TQT_SLOT(slotGroupFilter(const TQString&)));
slotGroupFilter(i18n("<all groups>"));
- QLabel *lab = new QLabel(filterBox,i18n("Sho&w only rules for group:"),this);
+ TQLabel *lab = new TQLabel(filterBox,i18n("Sho&w only rules for group:"),this);
filterL->addWidget(lab);
filterL->addWidget(filterBox);
- connect(manager,SIGNAL(changedRules()),
- this,SLOT(updateRuleList()));
- connect(manager,SIGNAL(changedRuleName(const QString&,const QString&)),
- this,SLOT(slotRuleNameChanged(const QString&,const QString&)));
+ connect(manager,TQT_SIGNAL(changedRules()),
+ this,TQT_SLOT(updateRuleList()));
+ connect(manager,TQT_SIGNAL(changedRuleName(const TQString&,const TQString&)),
+ this,TQT_SLOT(slotRuleNameChanged(const TQString&,const TQString&)));
updateRuleList();
updateButton();
@@ -684,7 +684,7 @@ void RuleListWidget::updateButton()
delRule->setEnabled(state);
copyRule->setEnabled(state);
- QListBoxItem *item = ruleList->item( ruleList->currentItem() );
+ TQListBoxItem *item = ruleList->item( ruleList->currentItem() );
if ( item ) {
mRuleUp->setEnabled( item->prev() != 0 );
mRuleDown->setEnabled( item->next() != 0 );
@@ -695,10 +695,10 @@ void RuleListWidget::updateRuleList()
{
emit leavingRule();
kdDebug(5100) << "RuleListWidget::updateRuleList()" << endl;
- QString curr = ruleList->currentText();
+ TQString curr = ruleList->currentText();
ruleList->clear();
if (group == i18n("<all groups>")) {
- QStringList l = manager->getRuleNames();
+ TQStringList l = manager->getRuleNames();
ruleList->insertStringList(l);
} else {
KScoringManager::ScoringRuleList l = manager->getAllRules();
@@ -719,12 +719,12 @@ void RuleListWidget::updateRuleList()
void RuleListWidget::updateRuleList(const KScoringRule *rule)
{
kdDebug(5100) << "RuleListWidget::updateRuleList(" << rule->getName() << ")" << endl;
- QString name = rule->getName();
+ TQString name = rule->getName();
updateRuleList();
slotRuleSelected(name);
}
-void RuleListWidget::slotRuleNameChanged(const QString& oldName, const QString& newName)
+void RuleListWidget::slotRuleNameChanged(const TQString& oldName, const TQString& newName)
{
int ind = ruleList->currentItem();
for (uint i=0;i<ruleList->count();++i)
@@ -735,7 +735,7 @@ void RuleListWidget::slotRuleNameChanged(const QString& oldName, const QString&
}
}
-void RuleListWidget::slotEditRule(const QString& s)
+void RuleListWidget::slotEditRule(const TQString& s)
{
emit ruleEdited(s);
}
@@ -746,21 +746,21 @@ void RuleListWidget::slotEditRule()
emit ruleEdited(ruleList->currentText());
}
else if (ruleList->count() == 0)
- emit ruleEdited(QString::null);
+ emit ruleEdited(TQString::null);
}
-void RuleListWidget::slotEditRule(QListBoxItem* item)
+void RuleListWidget::slotEditRule(TQListBoxItem* item)
{
slotEditRule(item->text());
}
-void RuleListWidget::slotGroupFilter(const QString& s)
+void RuleListWidget::slotGroupFilter(const TQString& s)
{
group = s;
updateRuleList();
}
-void RuleListWidget::slotRuleSelected(const QString& ruleName)
+void RuleListWidget::slotRuleSelected(const TQString& ruleName)
{
emit leavingRule();
kdDebug(5100) << "RuleListWidget::slotRuleSelected(" << ruleName << ")" << endl;
@@ -771,10 +771,10 @@ void RuleListWidget::slotRuleSelected(const QString& ruleName)
emit ruleSelected(ruleName);
}
-void RuleListWidget::slotRuleSelected(QListBoxItem *item)
+void RuleListWidget::slotRuleSelected(TQListBoxItem *item)
{
if (!item) return;
- QString ruleName = item->text();
+ TQString ruleName = item->text();
slotRuleSelected(ruleName);
}
@@ -782,7 +782,7 @@ void RuleListWidget::slotRuleSelected(int index)
{
uint idx = index;
if (idx >= ruleList->count()) return;
- QString ruleName = ruleList->text(index);
+ TQString ruleName = ruleList->text(index);
slotRuleSelected(ruleName);
}
@@ -808,7 +808,7 @@ void RuleListWidget::slotDelRule()
void RuleListWidget::slotCopyRule()
{
emit leavingRule();
- QString ruleName = ruleList->currentText();
+ TQString ruleName = ruleList->currentText();
KScoringRule *rule = manager->findRule(ruleName);
if (rule) {
KScoringRule *nrule = manager->copyRule(rule);
@@ -821,7 +821,7 @@ void RuleListWidget::slotCopyRule()
void RuleListWidget::slotRuleUp()
{
KScoringRule *rule = 0, *below = 0;
- QListBoxItem *item = ruleList->item( ruleList->currentItem() );
+ TQListBoxItem *item = ruleList->item( ruleList->currentItem() );
if ( item ) {
rule = manager->findRule( item->text() );
item = item->prev();
@@ -837,7 +837,7 @@ void RuleListWidget::slotRuleUp()
void RuleListWidget::slotRuleDown()
{
KScoringRule *rule = 0, *above = 0;
- QListBoxItem *item = ruleList->item( ruleList->currentItem() );
+ TQListBoxItem *item = ruleList->item( ruleList->currentItem() );
if ( item ) {
rule = manager->findRule( item->text() );
item = item->next();
@@ -858,7 +858,7 @@ void RuleListWidget::slotRuleDown()
KScoringEditor* KScoringEditor::scoreEditor = 0;
KScoringEditor::KScoringEditor(KScoringManager* m,
- QWidget *parent, const char *name)
+ TQWidget *parent, const char *name)
: KDialogBase(parent,name,false,i18n("Rule Editor"),Ok|Apply|Cancel,Ok,true), manager(m)
{
manager->pushRuleList();
@@ -867,26 +867,26 @@ KScoringEditor::KScoringEditor(KScoringManager* m,
if (!name) setName("KScoringEditor");
// the left side gives an overview about all rules, the right side
// shows a detailed view of an selected rule
- QWidget *w = new QWidget(this);
+ TQWidget *w = new TQWidget(this);
setMainWidget(w);
- QHBoxLayout *hbl = new QHBoxLayout(w,0,spacingHint());
+ TQHBoxLayout *hbl = new TQHBoxLayout(w,0,spacingHint());
ruleLister = new RuleListWidget(manager,false,w);
hbl->addWidget(ruleLister);
ruleEditor = new RuleEditWidget(manager,w);
hbl->addWidget(ruleEditor);
- connect(ruleLister,SIGNAL(ruleSelected(const QString&)),
- ruleEditor, SLOT(slotEditRule(const QString&)));
- connect(ruleLister, SIGNAL(leavingRule()),
- ruleEditor, SLOT(updateRule()));
- connect(ruleEditor, SIGNAL(shrink()), SLOT(slotShrink()));
- connect(this,SIGNAL(finished()),SLOT(slotFinished()));
+ connect(ruleLister,TQT_SIGNAL(ruleSelected(const TQString&)),
+ ruleEditor, TQT_SLOT(slotEditRule(const TQString&)));
+ connect(ruleLister, TQT_SIGNAL(leavingRule()),
+ ruleEditor, TQT_SLOT(updateRule()));
+ connect(ruleEditor, TQT_SIGNAL(shrink()), TQT_SLOT(slotShrink()));
+ connect(this,TQT_SIGNAL(finished()),TQT_SLOT(slotFinished()));
ruleLister->slotRuleSelected(0);
resize(550, sizeHint().height());
}
void KScoringEditor::setDirty()
{
- QPushButton *applyBtn = actionButton(Apply);
+ TQPushButton *applyBtn = actionButton(Apply);
applyBtn->setEnabled(true);
}
@@ -896,7 +896,7 @@ KScoringEditor::~KScoringEditor()
}
KScoringEditor* KScoringEditor::createEditor(KScoringManager* m,
- QWidget *parent, const char *name)
+ TQWidget *parent, const char *name)
{
if (scoreEditor) return scoreEditor;
else return new KScoringEditor(m,parent,name);
@@ -905,25 +905,25 @@ KScoringEditor* KScoringEditor::createEditor(KScoringManager* m,
void KScoringEditor::setRule(KScoringRule* r)
{
kdDebug(5100) << "KScoringEditor::setRule(" << r->getName() << ")" << endl;
- QString ruleName = r->getName();
+ TQString ruleName = r->getName();
ruleLister->slotRuleSelected(ruleName);
}
void KScoringEditor::slotShrink()
{
- QTimer::singleShot(5, this, SLOT(slotDoShrink()));
+ TQTimer::singleShot(5, this, TQT_SLOT(slotDoShrink()));
}
void KScoringEditor::slotDoShrink()
{
updateGeometry();
- QApplication::sendPostedEvents();
+ TQApplication::sendPostedEvents();
resize(width(),sizeHint().height());
}
void KScoringEditor::slotApply()
{
- QString ruleName = ruleLister->currentRule();
+ TQString ruleName = ruleLister->currentRule();
KScoringRule *rule = manager->findRule(ruleName);
if (rule) {
ruleEditor->updateRule(rule);
@@ -957,16 +957,16 @@ void KScoringEditor::slotFinished()
// class KScoringEditorWidgetDialog (a dialog for the KScoringEditorWidget)
//
//============================================================================
-KScoringEditorWidgetDialog::KScoringEditorWidgetDialog(KScoringManager *m, const QString& r, QWidget *p, const char *n)
+KScoringEditorWidgetDialog::KScoringEditorWidgetDialog(KScoringManager *m, const TQString& r, TQWidget *p, const char *n)
: KDialogBase(p,n,true,i18n("Edit Rule"),
KDialogBase::Ok|KDialogBase::Apply|KDialogBase::Close,
KDialogBase::Ok,true),
manager(m), ruleName(r)
{
- QFrame *f = makeMainWidget();
- QBoxLayout *topL = new QVBoxLayout(f);
+ TQFrame *f = makeMainWidget();
+ TQBoxLayout *topL = new TQVBoxLayout(f);
ruleEditor = new RuleEditWidget(manager,f);
- connect(ruleEditor, SIGNAL(shrink()), SLOT(slotShrink()));
+ connect(ruleEditor, TQT_SIGNAL(shrink()), TQT_SLOT(slotShrink()));
topL->addWidget(ruleEditor);
ruleEditor->slotEditRule(ruleName);
resize(0,0);
@@ -989,13 +989,13 @@ void KScoringEditorWidgetDialog::slotOk()
void KScoringEditorWidgetDialog::slotShrink()
{
- QTimer::singleShot(5, this, SLOT(slotDoShrink()));
+ TQTimer::singleShot(5, this, TQT_SLOT(slotDoShrink()));
}
void KScoringEditorWidgetDialog::slotDoShrink()
{
updateGeometry();
- QApplication::sendPostedEvents();
+ TQApplication::sendPostedEvents();
resize(width(),sizeHint().height());
}
@@ -1004,14 +1004,14 @@ void KScoringEditorWidgetDialog::slotDoShrink()
// class KScoringEditorWidget (a reusable widget for config dialog...)
//
//============================================================================
-KScoringEditorWidget::KScoringEditorWidget(KScoringManager *m,QWidget *p, const char *n)
- : QWidget(p,n), manager(m)
+KScoringEditorWidget::KScoringEditorWidget(KScoringManager *m,TQWidget *p, const char *n)
+ : TQWidget(p,n), manager(m)
{
- QBoxLayout *topL = new QVBoxLayout(this);
+ TQBoxLayout *topL = new TQVBoxLayout(this);
ruleLister = new RuleListWidget(manager,true,this);
topL->addWidget(ruleLister);
- connect(ruleLister,SIGNAL(ruleEdited(const QString&)),
- this,SLOT(slotRuleEdited(const QString &)));
+ connect(ruleLister,TQT_SIGNAL(ruleEdited(const TQString&)),
+ this,TQT_SLOT(slotRuleEdited(const TQString &)));
}
KScoringEditorWidget::~KScoringEditorWidget()
@@ -1019,7 +1019,7 @@ KScoringEditorWidget::~KScoringEditorWidget()
manager->editorReady();
}
-void KScoringEditorWidget::slotRuleEdited(const QString& ruleName)
+void KScoringEditorWidget::slotRuleEdited(const TQString& ruleName)
{
KScoringEditorWidgetDialog dlg(manager,ruleName,this);
dlg.exec();