summaryrefslogtreecommitdiffstats
path: root/kmail/simplestringlisteditor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kmail/simplestringlisteditor.cpp')
-rw-r--r--kmail/simplestringlisteditor.cpp100
1 files changed, 50 insertions, 50 deletions
diff --git a/kmail/simplestringlisteditor.cpp b/kmail/simplestringlisteditor.cpp
index e8dc5647..8d71e221 100644
--- a/kmail/simplestringlisteditor.cpp
+++ b/kmail/simplestringlisteditor.cpp
@@ -41,7 +41,7 @@
#include <kdebug.h>
#include <kpushbutton.h>
-#include <qlayout.h>
+#include <tqlayout.h>
//********************************************************
@@ -49,125 +49,125 @@
//********************************************************
// small helper function:
-static inline QListBoxItem * findSelectedItem( QListBox * lb ) {
- QListBoxItem * item = 0;
+static inline TQListBoxItem * findSelectedItem( TQListBox * lb ) {
+ TQListBoxItem * item = 0;
for ( item = lb->firstItem() ; item && !item->isSelected() ;
item = item->next() ) ;
return item;
}
-SimpleStringListEditor::SimpleStringListEditor( QWidget * parent,
+SimpleStringListEditor::SimpleStringListEditor( TQWidget * parent,
const char * name,
ButtonCode buttons,
- const QString & addLabel,
- const QString & removeLabel,
- const QString & modifyLabel,
- const QString & addDialogLabel )
- : QWidget( parent, name ),
+ const TQString & addLabel,
+ const TQString & removeLabel,
+ const TQString & modifyLabel,
+ const TQString & addDialogLabel )
+ : TQWidget( parent, name ),
mAddButton(0), mRemoveButton(0), mModifyButton(0),
mUpButton(0), mDownButton(0),
mAddDialogLabel( addDialogLabel.isEmpty() ?
i18n("New entry:") : addDialogLabel )
{
- QHBoxLayout * hlay = new QHBoxLayout( this, 0, KDialog::spacingHint() );
+ TQHBoxLayout * hlay = new TQHBoxLayout( this, 0, KDialog::spacingHint() );
- mListBox = new QListBox( this );
+ mListBox = new TQListBox( this );
hlay->addWidget( mListBox, 1 );
if ( buttons == None )
kdDebug(5006) << "SimpleStringListBox called with no buttons. "
- "Consider using a plain QListBox instead!" << endl;
+ "Consider using a plain TQListBox instead!" << endl;
- QVBoxLayout * vlay = new QVBoxLayout( hlay ); // inherits spacing
+ TQVBoxLayout * vlay = new TQVBoxLayout( hlay ); // inherits spacing
if ( buttons & Add ) {
if ( addLabel.isEmpty() )
- mAddButton = new QPushButton( i18n("&Add..."), this );
+ mAddButton = new TQPushButton( i18n("&Add..."), this );
else
- mAddButton = new QPushButton( addLabel, this );
+ mAddButton = new TQPushButton( addLabel, this );
mAddButton->setAutoDefault( false );
vlay->addWidget( mAddButton );
- connect( mAddButton, SIGNAL(clicked()),
- this, SLOT(slotAdd()) );
+ connect( mAddButton, TQT_SIGNAL(clicked()),
+ this, TQT_SLOT(slotAdd()) );
}
if ( buttons & Remove ) {
if ( removeLabel.isEmpty() )
- mRemoveButton = new QPushButton( i18n("&Remove"), this );
+ mRemoveButton = new TQPushButton( i18n("&Remove"), this );
else
- mRemoveButton = new QPushButton( removeLabel, this );
+ mRemoveButton = new TQPushButton( removeLabel, this );
mRemoveButton->setAutoDefault( false );
mRemoveButton->setEnabled( false ); // no selection yet
vlay->addWidget( mRemoveButton );
- connect( mRemoveButton, SIGNAL(clicked()),
- this, SLOT(slotRemove()) );
+ connect( mRemoveButton, TQT_SIGNAL(clicked()),
+ this, TQT_SLOT(slotRemove()) );
}
if ( buttons & Modify ) {
if ( modifyLabel.isEmpty() )
- mModifyButton = new QPushButton( i18n("&Modify..."), this );
+ mModifyButton = new TQPushButton( i18n("&Modify..."), this );
else
- mModifyButton = new QPushButton( modifyLabel, this );
+ mModifyButton = new TQPushButton( modifyLabel, this );
mModifyButton->setAutoDefault( false );
mModifyButton->setEnabled( false ); // no selection yet
vlay->addWidget( mModifyButton );
- connect( mModifyButton, SIGNAL(clicked()),
- this, SLOT(slotModify()) );
- connect( mListBox, SIGNAL( doubleClicked( QListBoxItem* ) ),
- this, SLOT( slotModify() ) );
+ connect( mModifyButton, TQT_SIGNAL(clicked()),
+ this, TQT_SLOT(slotModify()) );
+ connect( mListBox, TQT_SIGNAL( doubleClicked( TQListBoxItem* ) ),
+ this, TQT_SLOT( slotModify() ) );
}
if ( buttons & Up ) {
if ( !(buttons & Down) )
kdDebug(5006) << "Are you sure you want to use an Up button "
"without a Down button??" << endl;
- mUpButton = new KPushButton( QString::null, this );
+ mUpButton = new KPushButton( TQString::null, this );
mUpButton->setIconSet( BarIconSet( "up", KIcon::SizeSmall ) );
mUpButton->setAutoDefault( false );
mUpButton->setEnabled( false ); // no selection yet
vlay->addWidget( mUpButton );
- connect( mUpButton, SIGNAL(clicked()),
- this, SLOT(slotUp()) );
+ connect( mUpButton, TQT_SIGNAL(clicked()),
+ this, TQT_SLOT(slotUp()) );
}
if ( buttons & Down ) {
if ( !(buttons & Up) )
kdDebug(5006) << "Are you sure you want to use a Down button "
"without an Up button??" << endl;
- mDownButton = new KPushButton( QString::null, this );
+ mDownButton = new KPushButton( TQString::null, this );
mDownButton->setIconSet( BarIconSet( "down", KIcon::SizeSmall ) );
mDownButton->setAutoDefault( false );
mDownButton->setEnabled( false ); // no selection yet
vlay->addWidget( mDownButton );
- connect( mDownButton, SIGNAL(clicked()),
- this, SLOT(slotDown()) );
+ connect( mDownButton, TQT_SIGNAL(clicked()),
+ this, TQT_SLOT(slotDown()) );
}
vlay->addStretch( 1 ); // spacer
- connect( mListBox, SIGNAL(selectionChanged()),
- this, SLOT(slotSelectionChanged()) );
+ connect( mListBox, TQT_SIGNAL(selectionChanged()),
+ this, TQT_SLOT(slotSelectionChanged()) );
}
-void SimpleStringListEditor::setStringList( const QStringList & strings ) {
+void SimpleStringListEditor::setStringList( const TQStringList & strings ) {
mListBox->clear();
mListBox->insertStringList( strings );
}
-void SimpleStringListEditor::appendStringList( const QStringList & strings ) {
+void SimpleStringListEditor::appendStringList( const TQStringList & strings ) {
mListBox->insertStringList( strings );
}
-QStringList SimpleStringListEditor::stringList() const {
- QStringList result;
- for ( QListBoxItem * item = mListBox->firstItem() ;
+TQStringList SimpleStringListEditor::stringList() const {
+ TQStringList result;
+ for ( TQListBoxItem * item = mListBox->firstItem() ;
item ; item = item->next() )
result << item->text();
return result;
}
void SimpleStringListEditor::setButtonText( ButtonCode button,
- const QString & text ) {
+ const TQString & text ) {
switch ( button ) {
case Add:
if ( !mAddButton ) break;
@@ -202,8 +202,8 @@ void SimpleStringListEditor::setButtonText( ButtonCode button,
void SimpleStringListEditor::slotAdd() {
bool ok = false;
- QString newEntry = KInputDialog::getText( i18n("New Value"),
- mAddDialogLabel, QString::null,
+ TQString newEntry = KInputDialog::getText( i18n("New Value"),
+ mAddDialogLabel, TQString::null,
&ok, this );
// let the user verify the string before adding
emit aboutToAdd( newEntry );
@@ -218,11 +218,11 @@ void SimpleStringListEditor::slotRemove() {
}
void SimpleStringListEditor::slotModify() {
- QListBoxItem * item = findSelectedItem( mListBox );
+ TQListBoxItem * item = findSelectedItem( mListBox );
if ( !item ) return;
bool ok = false;
- QString newText = KInputDialog::getText( i18n("Change Value"),
+ TQString newText = KInputDialog::getText( i18n("Change Value"),
mAddDialogLabel, item->text(),
&ok, this );
emit aboutToAdd( newText );
@@ -236,11 +236,11 @@ void SimpleStringListEditor::slotModify() {
}
void SimpleStringListEditor::slotUp() {
- QListBoxItem * item = findSelectedItem( mListBox );
+ TQListBoxItem * item = findSelectedItem( mListBox );
if ( !item || !item->prev() ) return;
// find the item that we want to insert after:
- QListBoxItem * pprev = item->prev()->prev();
+ TQListBoxItem * pprev = item->prev()->prev();
// take the item from it's current position...
mListBox->takeItem( item );
// ...and insert it after the above mentioned item:
@@ -260,11 +260,11 @@ void SimpleStringListEditor::slotUp() {
}
void SimpleStringListEditor::slotDown() {
- QListBoxItem * item = findSelectedItem( mListBox );
+ TQListBoxItem * item = findSelectedItem( mListBox );
if ( !item || !item->next() ) return;
// find the item that we want to insert after:
- QListBoxItem * next = item->next();
+ TQListBoxItem * next = item->next();
// take the item from it's current position...
mListBox->takeItem( item );
// ...and insert it after the above mentioned item:
@@ -288,7 +288,7 @@ void SimpleStringListEditor::slotDown() {
void SimpleStringListEditor::slotSelectionChanged() {
// try to find a selected item:
- QListBoxItem * item = findSelectedItem( mListBox );
+ TQListBoxItem * item = findSelectedItem( mListBox );
// if there is one, item will be non-null (ie. true), else 0
// (ie. false):