diff options
Diffstat (limited to 'kaddressbook/features/distributionlistngwidget.cpp')
-rw-r--r-- | kaddressbook/features/distributionlistngwidget.cpp | 114 |
1 files changed, 57 insertions, 57 deletions
diff --git a/kaddressbook/features/distributionlistngwidget.cpp b/kaddressbook/features/distributionlistngwidget.cpp index fee8377a6..08ef3e4cd 100644 --- a/kaddressbook/features/distributionlistngwidget.cpp +++ b/kaddressbook/features/distributionlistngwidget.cpp @@ -35,23 +35,23 @@ #include <klocale.h> #include <kpopupmenu.h> -#include <qevent.h> -#include <qguardedptr.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qpoint.h> -#include <qtimer.h> -#include <qpushbutton.h> -#include <qtooltip.h> - -KAB::DistributionListNg::ListBox::ListBox( QWidget* parent ) : KListBox( parent ) +#include <tqevent.h> +#include <tqguardedptr.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqpoint.h> +#include <tqtimer.h> +#include <tqpushbutton.h> +#include <tqtooltip.h> + +KAB::DistributionListNg::ListBox::ListBox( TQWidget* parent ) : KListBox( parent ) { setAcceptDrops( true ); } -void KAB::DistributionListNg::ListBox::dragMoveEvent( QDragMoveEvent *event ) +void KAB::DistributionListNg::ListBox::dragMoveEvent( TQDragMoveEvent *event ) { - QListBoxItem *item = itemAt( event->pos() ); + TQListBoxItem *item = itemAt( event->pos() ); if ( !item ) { event->ignore(); } @@ -60,18 +60,18 @@ void KAB::DistributionListNg::ListBox::dragMoveEvent( QDragMoveEvent *event ) } } -void KAB::DistributionListNg::ListBox::dragEnterEvent( QDragEnterEvent *event ) +void KAB::DistributionListNg::ListBox::dragEnterEvent( TQDragEnterEvent *event ) { KListBox::dragEnterEvent( event ); } -void KAB::DistributionListNg::ListBox::dropEvent( QDropEvent *event ) +void KAB::DistributionListNg::ListBox::dropEvent( TQDropEvent *event ) { - QListBoxItem *item = itemAt( event->pos() ); + TQListBoxItem *item = itemAt( event->pos() ); if ( !item || index( item ) == 0 ) return; - QString vcards; + TQString vcards; if ( !KVCardDrag::decode( event, vcards ) ) return; @@ -85,12 +85,12 @@ namespace DistributionListNg { class Factory : public KAB::ExtensionFactory { public: - KAB::ExtensionWidget *extension( KAB::Core *core, QWidget *parent, const char *name ) + KAB::ExtensionWidget *extension( KAB::Core *core, TQWidget *parent, const char *name ) { return new KAB::DistributionListNg::MainWidget( core, parent, name ); } - QString identifier() const + TQString identifier() const { return "distribution_list_editor"; } @@ -106,76 +106,76 @@ extern "C" { } } -QString KAB::DistributionListNg::MainWidget::title() const +TQString KAB::DistributionListNg::MainWidget::title() const { return i18n( "Distribution List Editor NG" ); } -QString KAB::DistributionListNg::MainWidget::identifier() const +TQString KAB::DistributionListNg::MainWidget::identifier() const { return "distribution_list_editor_ng"; } -KAB::DistributionListNg::MainWidget::MainWidget( KAB::Core *core, QWidget *parent, const char *name ) : KAB::ExtensionWidget( core, parent, name ) +KAB::DistributionListNg::MainWidget::MainWidget( KAB::Core *core, TQWidget *parent, const char *name ) : KAB::ExtensionWidget( core, parent, name ) { - QVBoxLayout *layout = new QVBoxLayout( this ); + TQVBoxLayout *layout = new TQVBoxLayout( this ); layout->setSpacing( KDialog::spacingHint() ); - QHBoxLayout *buttonLayout = new QHBoxLayout(); + TQHBoxLayout *buttonLayout = new TQHBoxLayout(); layout->addLayout( buttonLayout ); - QLabel *label = new QLabel( this ); + TQLabel *label = new TQLabel( this ); label->setText( i18n( "Distribution Lists" ) ); buttonLayout->addWidget( label ); buttonLayout->addStretch( 1 ); - mAddButton = new QPushButton( this ); + mAddButton = new TQPushButton( this ); mAddButton->setIconSet( SmallIconSet( "add" ) ); - QToolTip::add( mAddButton, i18n( "Add distribution list" ) ); - connect( mAddButton, SIGNAL(clicked()), core, SLOT(newDistributionList()) ); + TQToolTip::add( mAddButton, i18n( "Add distribution list" ) ); + connect( mAddButton, TQT_SIGNAL(clicked()), core, TQT_SLOT(newDistributionList()) ); buttonLayout->addWidget( mAddButton ); - mEditButton = new QPushButton( this ); + mEditButton = new TQPushButton( this ); mEditButton->setIconSet( SmallIconSet( "edit" ) ); - QToolTip::add( mEditButton, i18n( "Edit distribution list" ) ); - connect( mEditButton, SIGNAL(clicked()), this, SLOT(editSelectedDistributionList()) ); + TQToolTip::add( mEditButton, i18n( "Edit distribution list" ) ); + connect( mEditButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(editSelectedDistributionList()) ); buttonLayout->addWidget( mEditButton ); - mRemoveButton = new QPushButton( this ); + mRemoveButton = new TQPushButton( this ); mRemoveButton->setIconSet( SmallIconSet( "remove" ) ); - QToolTip::add( mRemoveButton, i18n( "Remove distribution list" ) ); - connect( mRemoveButton, SIGNAL(clicked()), this, SLOT(deleteSelectedDistributionList()) ); + TQToolTip::add( mRemoveButton, i18n( "Remove distribution list" ) ); + connect( mRemoveButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(deleteSelectedDistributionList()) ); buttonLayout->addWidget( mRemoveButton ); mListBox = new ListBox( this ); - connect( mListBox, SIGNAL( contextMenuRequested( QListBoxItem*, const QPoint& ) ), - this, SLOT( contextMenuRequested( QListBoxItem*, const QPoint& ) ) ); - connect( mListBox, SIGNAL( dropped( const QString &, const KABC::Addressee::List & ) ), - this, SLOT( contactsDropped( const QString &, const KABC::Addressee::List & ) ) ); - connect( mListBox, SIGNAL( highlighted( int ) ), - this, SLOT( itemSelected( int ) ) ); + connect( mListBox, TQT_SIGNAL( contextMenuRequested( TQListBoxItem*, const TQPoint& ) ), + this, TQT_SLOT( contextMenuRequested( TQListBoxItem*, const TQPoint& ) ) ); + connect( mListBox, TQT_SIGNAL( dropped( const TQString &, const KABC::Addressee::List & ) ), + this, TQT_SLOT( contactsDropped( const TQString &, const KABC::Addressee::List & ) ) ); + connect( mListBox, TQT_SIGNAL( highlighted( int ) ), + this, TQT_SLOT( itemSelected( int ) ) ); layout->addWidget( mListBox ); - connect( core, SIGNAL( contactsUpdated() ), - this, SLOT( updateEntries() ) ); - connect( core->addressBook(), SIGNAL( addressBookChanged( AddressBook* ) ), - this, SLOT( updateEntries() ) ); + connect( core, TQT_SIGNAL( contactsUpdated() ), + this, TQT_SLOT( updateEntries() ) ); + connect( core->addressBook(), TQT_SIGNAL( addressBookChanged( AddressBook* ) ), + this, TQT_SLOT( updateEntries() ) ); // When contacts are changed, update both distr list combo and contents of displayed distr list - connect( core, SIGNAL( contactsUpdated() ), - this, SLOT( updateEntries() ) ); + connect( core, TQT_SIGNAL( contactsUpdated() ), + this, TQT_SLOT( updateEntries() ) ); - QTimer::singleShot( 0, this, SLOT( updateEntries() ) ); + TQTimer::singleShot( 0, this, TQT_SLOT( updateEntries() ) ); } -void KAB::DistributionListNg::MainWidget::contextMenuRequested( QListBoxItem *item, const QPoint &point ) +void KAB::DistributionListNg::MainWidget::contextMenuRequested( TQListBoxItem *item, const TQPoint &point ) { - QGuardedPtr<KPopupMenu> menu = new KPopupMenu( this ); - menu->insertItem( i18n( "New Distribution List..." ), core(), SLOT( newDistributionList() ) ); + TQGuardedPtr<KPopupMenu> menu = new KPopupMenu( this ); + menu->insertItem( i18n( "New Distribution List..." ), core(), TQT_SLOT( newDistributionList() ) ); if ( item ) { - menu->insertItem( i18n( "Edit..." ), this, SLOT( editSelectedDistributionList() ) ); - menu->insertItem( i18n( "Delete" ), this, SLOT( deleteSelectedDistributionList() ) ); + menu->insertItem( i18n( "Edit..." ), this, TQT_SLOT( editSelectedDistributionList() ) ); + menu->insertItem( i18n( "Delete" ), this, TQT_SLOT( deleteSelectedDistributionList() ) ); } menu->exec( point ); delete menu; @@ -183,7 +183,7 @@ void KAB::DistributionListNg::MainWidget::contextMenuRequested( QListBoxItem *it void KAB::DistributionListNg::MainWidget::editSelectedDistributionList() { - const QListBoxItem* const item = mListBox->selectedItem(); + const TQListBoxItem* const item = mListBox->selectedItem(); if ( !item ) return; core()->editDistributionList( item->text() ); @@ -191,8 +191,8 @@ void KAB::DistributionListNg::MainWidget::editSelectedDistributionList() void KAB::DistributionListNg::MainWidget::deleteSelectedDistributionList() { - const QListBoxItem* const item = mListBox->selectedItem(); - const QString name = item ? item->text() : QString(); + const TQListBoxItem* const item = mListBox->selectedItem(); + const TQString name = item ? item->text() : TQString(); if ( name.isNull() ) return; const KPIM::DistributionList list = KPIM::DistributionList::findByName( @@ -202,7 +202,7 @@ void KAB::DistributionListNg::MainWidget::deleteSelectedDistributionList() core()->deleteDistributionLists( name ); } -void KAB::DistributionListNg::MainWidget::contactsDropped( const QString &listName, const KABC::Addressee::List &addressees ) +void KAB::DistributionListNg::MainWidget::contactsDropped( const TQString &listName, const KABC::Addressee::List &addressees ) { if ( addressees.isEmpty() ) return; @@ -228,7 +228,7 @@ void KAB::DistributionListNg::MainWidget::changed( const KABC::Addressee& dist ) void KAB::DistributionListNg::MainWidget::updateEntries() { const bool hadSelection = mListBox->selectedItem() != 0; - const QStringList newEntries = core()->distributionListNames(); + const TQStringList newEntries = core()->distributionListNames(); if ( !mCurrentEntries.isEmpty() && newEntries == mCurrentEntries ) return; mCurrentEntries = newEntries; @@ -241,7 +241,7 @@ void KAB::DistributionListNg::MainWidget::updateEntries() void KAB::DistributionListNg::MainWidget::itemSelected( int index ) { - core()->setSelectedDistributionList( index == 0 ? QString() : mListBox->item( index )->text() ); + core()->setSelectedDistributionList( index == 0 ? TQString() : mListBox->item( index )->text() ); mEditButton->setEnabled( index > 0 ); mRemoveButton->setEnabled( index > 0 ); } |