author | zautrix <zautrix> | 2005-06-20 06:01:55 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-06-20 06:01:55 (UTC) |
commit | 3876e95ff79298e9d95c506973c69790290b611e (patch) (side-by-side diff) | |
tree | 654477f1cf73911d57fff86f0e087faf4021e113 /kabc/addresseedialog.cpp | |
parent | 19768fad9c35bd2611512dcdb426c879ad080493 (diff) | |
download | kdepimpi-3876e95ff79298e9d95c506973c69790290b611e.zip kdepimpi-3876e95ff79298e9d95c506973c69790290b611e.tar.gz kdepimpi-3876e95ff79298e9d95c506973c69790290b611e.tar.bz2 |
fixes in contact selection
-rw-r--r-- | kabc/addresseedialog.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/kabc/addresseedialog.cpp b/kabc/addresseedialog.cpp index e89584d..3e7b72c 100644 --- a/kabc/addresseedialog.cpp +++ b/kabc/addresseedialog.cpp @@ -41,12 +41,13 @@ using namespace KABC; AddresseeItem::AddresseeItem( QListView *parent, const Addressee &addressee ) : QListViewItem( parent ), mAddressee( addressee ) { setText( Name,addressee.realName()); setText( Email, addressee.preferredEmail() ); + setText( Category, addressee.categories().join(";") ); } QString AddresseeItem::key( int column, bool ) const { if (column == Email) { @@ -77,24 +78,28 @@ AddresseeDialog::AddresseeDialog( QWidget *parent, bool multiple ) : QBoxLayout *listLayout = new QVBoxLayout (listWidget) ; //topLayout->addLayout( listLayout ); 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; //topLayout->addLayout( selectedLayout ); //topLayout->setSpacing( spacingHint() ); @@ -104,18 +109,24 @@ AddresseeDialog::AddresseeDialog( QWidget *parent, bool multiple ) : mSelectedList = new KListView( selectedGroup ); mSelectedList->addColumn( i18n("Name") ); 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 * ) ), SLOT( selectNextItem( QListViewItem * ) ) ); } @@ -161,12 +172,13 @@ void AddresseeDialog::loadAddressBook() AddressBook::Iterator it; for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) continue; QString name = (*it).realName(); name += (*it).preferredEmail(); + name += (*it).categories().join(";"); #if QT_VERSION >= 0x030000 if (re.search(name) != -1) #else if (re.match(name) != -1) #endif AddresseeItem *item = new AddresseeItem( mAddresseeList, (*it) ); |