summaryrefslogtreecommitdiffstats
path: root/kaddressbook/features/distributionlistwidget.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 /kaddressbook/features/distributionlistwidget.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 'kaddressbook/features/distributionlistwidget.cpp')
-rw-r--r--kaddressbook/features/distributionlistwidget.cpp162
1 files changed, 81 insertions, 81 deletions
diff --git a/kaddressbook/features/distributionlistwidget.cpp b/kaddressbook/features/distributionlistwidget.cpp
index 9c322d6f6..93a00bdfa 100644
--- a/kaddressbook/features/distributionlistwidget.cpp
+++ b/kaddressbook/features/distributionlistwidget.cpp
@@ -22,13 +22,13 @@
#include "distributionlistwidget.h"
-#include <qbuttongroup.h>
-#include <qcombobox.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qlistview.h>
-#include <qpushbutton.h>
-#include <qradiobutton.h>
+#include <tqbuttongroup.h>
+#include <tqcombobox.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqlistview.h>
+#include <tqpushbutton.h>
+#include <tqradiobutton.h>
#include <kaccelmanager.h>
#include <kconfig.h>
@@ -55,12 +55,12 @@ typedef KABC::DistributionList DistributionList;
class DistributionListFactory : 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 DistributionListWidget( core, parent, name );
}
- QString identifier() const
+ TQString identifier() const
{
return "distribution_list_editor";
}
@@ -82,15 +82,15 @@ class DeletePressedCatcher : public QObject
{
public:
DeletePressedCatcher( DistributionListWidget *parent )
- : QObject( parent, "DeletePressedCatcher" ), mWidget( parent )
+ : TQObject( parent, "DeletePressedCatcher" ), mWidget( parent )
{
}
protected:
- bool eventFilter( QObject*, QEvent *event )
+ bool eventFilter( TQObject*, TQEvent *event )
{
- if ( event->type() == QEvent::AccelOverride ) {
- QKeyEvent *keyEvent = (QKeyEvent*)event;
+ if ( event->type() == TQEvent::AccelOverride ) {
+ TQKeyEvent *keyEvent = (TQKeyEvent*)event;
if ( keyEvent->key() == Qt::Key_Delete ) {
keyEvent->accept();
mWidget->removeContact();
@@ -110,8 +110,8 @@ class ContactItem : public QListViewItem
{
public:
ContactItem( DistributionListView *parent, const KABC::Addressee &addressee,
- const QString &email = QString::null ) :
- QListViewItem( parent ),
+ const TQString &email = TQString::null ) :
+ TQListViewItem( parent ),
mAddressee( addressee ),
mEmail( email )
{
@@ -130,47 +130,47 @@ class ContactItem : public QListViewItem
return mAddressee;
}
- QString email() const
+ TQString email() const
{
return mEmail;
}
protected:
- bool acceptDrop( const QMimeSource* )
+ bool acceptDrop( const TQMimeSource* )
{
return true;
}
private:
KABC::Addressee mAddressee;
- QString mEmail;
+ TQString mEmail;
};
-DistributionListWidget::DistributionListWidget( KAB::Core *core, QWidget *parent,
+DistributionListWidget::DistributionListWidget( KAB::Core *core, TQWidget *parent,
const char *name )
: KAB::ExtensionWidget( core, parent, name )
#ifndef KDEPIM_NEW_DISTRLISTS
, mManager( 0 )
#endif
{
- QGridLayout *topLayout = new QGridLayout( this, 3, 4, KDialog::marginHint(),
+ TQGridLayout *topLayout = new TQGridLayout( this, 3, 4, KDialog::marginHint(),
KDialog::spacingHint() );
- mNameCombo = new QComboBox( this );
+ mNameCombo = new TQComboBox( this );
topLayout->addWidget( mNameCombo, 0, 0 );
- connect( mNameCombo, SIGNAL( activated( int ) ), SLOT( updateContactView() ) );
+ connect( mNameCombo, TQT_SIGNAL( activated( int ) ), TQT_SLOT( updateContactView() ) );
- mCreateListButton = new QPushButton( i18n( "New List..." ), this );
+ mCreateListButton = new TQPushButton( i18n( "New List..." ), this );
topLayout->addWidget( mCreateListButton, 0, 1 );
- connect( mCreateListButton, SIGNAL( clicked() ), SLOT( createList() ) );
+ connect( mCreateListButton, TQT_SIGNAL( clicked() ), TQT_SLOT( createList() ) );
- mEditListButton = new QPushButton( i18n( "Rename List..." ), this );
+ mEditListButton = new TQPushButton( i18n( "Rename List..." ), this );
topLayout->addWidget( mEditListButton, 0, 2 );
- connect( mEditListButton, SIGNAL( clicked() ), SLOT( editList() ) );
+ connect( mEditListButton, TQT_SIGNAL( clicked() ), TQT_SLOT( editList() ) );
- mRemoveListButton = new QPushButton( i18n( "Remove List" ), this );
+ mRemoveListButton = new TQPushButton( i18n( "Remove List" ), this );
topLayout->addWidget( mRemoveListButton, 0, 3 );
- connect( mRemoveListButton, SIGNAL( clicked() ), SLOT( removeList() ) );
+ connect( mRemoveListButton, TQT_SIGNAL( clicked() ), TQT_SLOT( removeList() ) );
mContactView = new DistributionListView( this );
mContactView->addColumn( i18n( "Name" ) );
@@ -180,44 +180,44 @@ DistributionListWidget::DistributionListWidget( KAB::Core *core, QWidget *parent
mContactView->setAllColumnsShowFocus( true );
mContactView->setFullWidth( true );
topLayout->addMultiCellWidget( mContactView, 1, 1, 0, 3 );
- connect( mContactView, SIGNAL( selectionChanged() ),
- SLOT( selectionContactViewChanged() ) );
- connect( mContactView, SIGNAL( dropped( QDropEvent*, QListViewItem* ) ),
- SLOT( dropped( QDropEvent*, QListViewItem* ) ) );
+ connect( mContactView, TQT_SIGNAL( selectionChanged() ),
+ TQT_SLOT( selectionContactViewChanged() ) );
+ connect( mContactView, TQT_SIGNAL( dropped( TQDropEvent*, TQListViewItem* ) ),
+ TQT_SLOT( dropped( TQDropEvent*, TQListViewItem* ) ) );
- mAddContactButton = new QPushButton( i18n( "Add Contact" ), this );
+ mAddContactButton = new TQPushButton( i18n( "Add Contact" ), this );
mAddContactButton->setEnabled( false );
topLayout->addWidget( mAddContactButton, 2, 0 );
- connect( mAddContactButton, SIGNAL( clicked() ), SLOT( addContact() ) );
+ connect( mAddContactButton, TQT_SIGNAL( clicked() ), TQT_SLOT( addContact() ) );
- mEntryCountLabel = new QLabel( this );
+ mEntryCountLabel = new TQLabel( this );
topLayout->addWidget( mEntryCountLabel, 2, 1 );
- mChangeEmailButton = new QPushButton( i18n( "Change Email..." ), this );
+ mChangeEmailButton = new TQPushButton( i18n( "Change Email..." ), this );
topLayout->addWidget( mChangeEmailButton, 2, 2 );
- connect( mChangeEmailButton, SIGNAL( clicked() ), SLOT( changeEmail() ) );
+ connect( mChangeEmailButton, TQT_SIGNAL( clicked() ), TQT_SLOT( changeEmail() ) );
- mRemoveContactButton = new QPushButton( i18n( "Remove Contact" ), this );
+ mRemoveContactButton = new TQPushButton( i18n( "Remove Contact" ), this );
topLayout->addWidget( mRemoveContactButton, 2, 3 );
- connect( mRemoveContactButton, SIGNAL( clicked() ), SLOT( removeContact() ) );
+ connect( mRemoveContactButton, TQT_SIGNAL( clicked() ), TQT_SLOT( removeContact() ) );
#ifdef KDEPIM_NEW_DISTRLISTS
// When contacts are changed, update both distr list combo and contents of displayed distr list
- connect( core, SIGNAL( contactsUpdated() ),
- this, SLOT( updateNameCombo() ) );
+ connect( core, TQT_SIGNAL( contactsUpdated() ),
+ this, TQT_SLOT( updateNameCombo() ) );
#else
mManager = new KABC::DistributionListManager( core->addressBook() );
- connect( KABC::DistributionListWatcher::self(), SIGNAL( changed() ),
- this, SLOT( updateNameCombo() ) );
+ connect( KABC::DistributionListWatcher::self(), TQT_SIGNAL( changed() ),
+ this, TQT_SLOT( updateNameCombo() ) );
#endif
- connect( core->addressBook(), SIGNAL( addressBookChanged( AddressBook* ) ),
- this, SLOT( updateNameCombo() ) );
+ connect( core->addressBook(), TQT_SIGNAL( addressBookChanged( AddressBook* ) ),
+ this, TQT_SLOT( updateNameCombo() ) );
updateNameCombo();
- QObject *catcher = new DeletePressedCatcher( this );
+ TQObject *catcher = new DeletePressedCatcher( this );
installEventFilter( catcher );
mContactView->installEventFilter( catcher );
@@ -252,7 +252,7 @@ void DistributionListWidget::selectionContactViewChanged()
mRemoveContactButton->setEnabled( state );
}
-bool DistributionListWidget::alreadyExists( const QString& distrListName ) const
+bool DistributionListWidget::alreadyExists( const TQString& distrListName ) const
{
#ifdef KDEPIM_NEW_DISTRLISTS
return core()->distributionListNames().contains( distrListName );
@@ -263,9 +263,9 @@ bool DistributionListWidget::alreadyExists( const QString& distrListName ) const
void DistributionListWidget::createList()
{
- QString newName = KInputDialog::getText( i18n( "New Distribution List" ),
+ TQString newName = KInputDialog::getText( i18n( "New Distribution List" ),
i18n( "Please enter name:" ),
- QString::null, 0, this );
+ TQString::null, 0, this );
if ( newName.isEmpty() ) return;
@@ -301,9 +301,9 @@ void DistributionListWidget::createList()
void DistributionListWidget::editList()
{
- const QString oldName = mNameCombo->currentText();
+ const TQString oldName = mNameCombo->currentText();
- const QString newName = KInputDialog::getText( i18n( "Rename Distribution List" ),
+ const TQString newName = KInputDialog::getText( i18n( "Rename Distribution List" ),
i18n( "Please enter name:" ),
oldName, 0, this );
@@ -344,7 +344,7 @@ void DistributionListWidget::removeList()
{
int result = KMessageBox::warningContinueCancel( this,
i18n( "<qt>Delete distribution list <b>%1</b>?</qt>" ) .arg( mNameCombo->currentText() ),
- QString::null, KGuiItem( i18n("Delete"), "editdelete") );
+ TQString::null, KGuiItem( i18n("Delete"), "editdelete") );
if ( result != KMessageBox::Continue )
return;
@@ -447,7 +447,7 @@ void DistributionListWidget::changeEmail()
return;
bool canceled = false;
- const QString email = EmailSelector::getEmail( contactItem->addressee().emails(),
+ const TQString email = EmailSelector::getEmail( contactItem->addressee().emails(),
contactItem->email(), this, canceled);
if( canceled)
return;
@@ -513,10 +513,10 @@ void DistributionListWidget::updateNameCombo()
int pos = mNameCombo->currentItem();
mNameCombo->clear();
#ifdef KDEPIM_NEW_DISTRLISTS
- const QStringList names = core()->distributionListNames();
+ const TQStringList names = core()->distributionListNames();
#else
mManager->load();
- const QStringList names = mManager->listNames();
+ const TQStringList names = mManager->listNames();
#endif
mNameCombo->insertStringList( names );
mNameCombo->setCurrentItem( QMIN( pos, (int)names.count() - 1 ) );
@@ -524,7 +524,7 @@ void DistributionListWidget::updateNameCombo()
updateContactView();
}
-void DistributionListWidget::dropEvent( QDropEvent *e )
+void DistributionListWidget::dropEvent( TQDropEvent *e )
{
if ( mNameCombo->count() == 0 )
return;
@@ -541,7 +541,7 @@ void DistributionListWidget::dropEvent( QDropEvent *e )
KABC::DistributionList& dist = *list;
#endif
- QString vcards;
+ TQString vcards;
if ( KVCardDrag::decode( e, vcards ) ) {
KABC::VCardConverter converter;
const KABC::Addressee::List lst = converter.parseVCards( vcards );
@@ -563,17 +563,17 @@ void DistributionListWidget::contactsSelectionChanged()
mAddContactButton->setEnabled( contactsSelected() && mNameCombo->count() > 0 );
}
-QString DistributionListWidget::title() const
+TQString DistributionListWidget::title() const
{
return i18n( "Distribution List Editor" );
}
-QString DistributionListWidget::identifier() const
+TQString DistributionListWidget::identifier() const
{
return "distribution_list_editor";
}
-void DistributionListWidget::dropped( QDropEvent *e, QListViewItem* )
+void DistributionListWidget::dropped( TQDropEvent *e, TQListViewItem* )
{
dropEvent( e );
}
@@ -590,7 +590,7 @@ void DistributionListWidget::changed()
}
#endif
-DistributionListView::DistributionListView( QWidget *parent, const char* name )
+DistributionListView::DistributionListView( TQWidget *parent, const char* name )
: KListView( parent, name )
{
setDragEnabled( true );
@@ -598,66 +598,66 @@ DistributionListView::DistributionListView( QWidget *parent, const char* name )
setAllColumnsShowFocus( true );
}
-void DistributionListView::dragEnterEvent( QDragEnterEvent* e )
+void DistributionListView::dragEnterEvent( TQDragEnterEvent* e )
{
- bool canDecode = QTextDrag::canDecode( e );
+ bool canDecode = TQTextDrag::canDecode( e );
e->accept( canDecode );
}
-void DistributionListView::viewportDragMoveEvent( QDragMoveEvent *e )
+void DistributionListView::viewportDragMoveEvent( TQDragMoveEvent *e )
{
- bool canDecode = QTextDrag::canDecode( e );
+ bool canDecode = TQTextDrag::canDecode( e );
e->accept( canDecode );
}
-void DistributionListView::viewportDropEvent( QDropEvent *e )
+void DistributionListView::viewportDropEvent( TQDropEvent *e )
{
emit dropped( e, 0 );
}
-void DistributionListView::dropEvent( QDropEvent *e )
+void DistributionListView::dropEvent( TQDropEvent *e )
{
emit dropped( e, 0 );
}
-EmailSelector::EmailSelector( const QStringList &emails,
- const QString &current, QWidget *parent )
+EmailSelector::EmailSelector( const TQStringList &emails,
+ const TQString &current, TQWidget *parent )
: KDialogBase( KDialogBase::Plain, i18n("Select Email Address"), Ok|Cancel, Ok,
parent )
{
- QFrame *topFrame = plainPage();
- QBoxLayout *topLayout = new QVBoxLayout( topFrame );
+ TQFrame *topFrame = plainPage();
+ TQBoxLayout *topLayout = new TQVBoxLayout( topFrame );
- mButtonGroup = new QButtonGroup( 1, Horizontal, i18n("Email Addresses"),
+ mButtonGroup = new TQButtonGroup( 1, Horizontal, i18n("Email Addresses"),
topFrame );
mButtonGroup->setRadioButtonExclusive( true );
topLayout->addWidget( mButtonGroup );
- QRadioButton *button = new QRadioButton( i18n("Preferred address"), mButtonGroup );
+ TQRadioButton *button = new TQRadioButton( i18n("Preferred address"), mButtonGroup );
button->setDown( true );
mEmailMap.insert( mButtonGroup->id( button ), "" );
- QStringList::ConstIterator it;
+ TQStringList::ConstIterator it;
for ( it = emails.begin(); it != emails.end(); ++it ) {
- button = new QRadioButton( *it, mButtonGroup );
+ button = new TQRadioButton( *it, mButtonGroup );
mEmailMap.insert( mButtonGroup->id( button ), *it );
if ( (*it) == current )
button->setDown( true );
}
}
-QString EmailSelector::selected() const
+TQString EmailSelector::selected() const
{
- QButton *button = mButtonGroup->selected();
+ TQButton *button = mButtonGroup->selected();
if ( button )
return mEmailMap[ mButtonGroup->id( button ) ];
- return QString::null;
+ return TQString::null;
}
-QString EmailSelector::getEmail( const QStringList &emails,
- const QString &current, QWidget *parent, bool &canceled )
+TQString EmailSelector::getEmail( const TQStringList &emails,
+ const TQString &current, TQWidget *parent, bool &canceled )
{
EmailSelector dlg( emails, current, parent );
if(dlg.exec())
@@ -666,7 +666,7 @@ QString EmailSelector::getEmail( const QStringList &emails,
return dlg.selected();
}
canceled = true;
- return QString();
+ return TQString();
}