summaryrefslogtreecommitdiffabout
path: root/kabc
authorzautrix <zautrix>2005-06-20 06:01:55 (UTC)
committer zautrix <zautrix>2005-06-20 06:01:55 (UTC)
commit3876e95ff79298e9d95c506973c69790290b611e (patch) (side-by-side diff)
tree654477f1cf73911d57fff86f0e087faf4021e113 /kabc
parent19768fad9c35bd2611512dcdb426c879ad080493 (diff)
downloadkdepimpi-3876e95ff79298e9d95c506973c69790290b611e.zip
kdepimpi-3876e95ff79298e9d95c506973c69790290b611e.tar.gz
kdepimpi-3876e95ff79298e9d95c506973c69790290b611e.tar.bz2
fixes in contact selection
Diffstat (limited to 'kabc') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/addresseedialog.cpp18
-rw-r--r--kabc/addresseedialog.h2
2 files changed, 16 insertions, 4 deletions
diff --git a/kabc/addresseedialog.cpp b/kabc/addresseedialog.cpp
index e89584d..3e7b72c 100644
--- a/kabc/addresseedialog.cpp
+++ b/kabc/addresseedialog.cpp
@@ -44,6 +44,7 @@ AddresseeItem::AddresseeItem( QListView *parent, const Addressee &addressee ) :
{
setText( Name,addressee.realName());
setText( Email, addressee.preferredEmail() );
+ setText( Category, addressee.categories().join(";") );
}
QString AddresseeItem::key( int column, bool ) const
@@ -80,18 +81,22 @@ AddresseeDialog::AddresseeDialog( QWidget *parent, bool multiple ) :
mAddresseeList = new KListView( listWidget );
mAddresseeList->addColumn( i18n("Name") );
mAddresseeList->addColumn( i18n("Email") );
+ mAddresseeList->addColumn( i18n("Category") );
mAddresseeList->setAllColumnsShowFocus( true );
mAddresseeList->setFullWidth( true );
listLayout->addWidget( mAddresseeList );
connect( mAddresseeList, SIGNAL( doubleClicked( QListViewItem * ) ),
SLOT( slotOk() ) );
- mAddresseeEdit = new QLineEdit( listWidget );
+ QHBox* searchBox = new QHBox ( listWidget );
+ mAddresseeEdit = new QLineEdit( searchBox );
connect( mAddresseeEdit, SIGNAL( returnPressed() ),
SLOT( loadAddressBook() ) );
mAddresseeEdit->setFocus();
+ QPushButton *searchButton = new QPushButton( i18n("Search!"), searchBox );
+ connect ( searchButton, SIGNAL( clicked() ), SLOT( loadAddressBook() ) );
- listLayout->addWidget( mAddresseeEdit );
+ listLayout->addWidget( searchBox );
if ( mMultiple ) {
//QBoxLayout *selectedLayout = new QVBoxLayout;
@@ -107,12 +112,18 @@ AddresseeDialog::AddresseeDialog( QWidget *parent, bool multiple ) :
mSelectedList->addColumn( i18n("Email") );
mSelectedList->setAllColumnsShowFocus( true );
mSelectedList->setFullWidth( true );
- connect( mSelectedList, SIGNAL( doubleClicked( QListViewItem * ) ),
+ //connect( mSelectedList, SIGNAL( doubleClicked( QListViewItem * ) ),
+ // SLOT( removeSelected() ) );
+ connect( mSelectedList, SIGNAL( clicked( QListViewItem * ) ),
+ SLOT( removeSelected() ) );
+ connect( mSelectedList, SIGNAL( returnPressed( QListViewItem *) ),
SLOT( removeSelected() ) );
+#if 0
QPushButton *unselectButton = new QPushButton( i18n("Unselect"), selectedGroup );
connect ( unselectButton, SIGNAL( clicked() ), SLOT( removeSelected() ) );
+#endif
connect( mAddresseeList, SIGNAL( clicked( QListViewItem * ) ),
SLOT( addSelected( QListViewItem * ) ) );
connect( mAddresseeList, SIGNAL( returnPressed( QListViewItem * ) ),
@@ -164,6 +175,7 @@ void AddresseeDialog::loadAddressBook()
continue;
QString name = (*it).realName();
name += (*it).preferredEmail();
+ name += (*it).categories().join(";");
#if QT_VERSION >= 0x030000
if (re.search(name) != -1)
#else
diff --git a/kabc/addresseedialog.h b/kabc/addresseedialog.h
index 99c74bd..6fab62d 100644
--- a/kabc/addresseedialog.h
+++ b/kabc/addresseedialog.h
@@ -43,7 +43,7 @@ class AddresseeItem : public QListViewItem
@li @p Name - Name in Addressee
@li @p Email - Email in Addressee
*/
- enum columns { Name = 0, Email = 1 };
+ enum columns { Name = 0, Email = 1,Category = 2 };
/**
Constructor.