-rw-r--r-- | kabc/addresseedialog.cpp | 18 | ||||
-rw-r--r-- | kabc/addresseedialog.h | 2 |
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 ) : | |||
44 | { | 44 | { |
45 | setText( Name,addressee.realName()); | 45 | setText( Name,addressee.realName()); |
46 | setText( Email, addressee.preferredEmail() ); | 46 | setText( Email, addressee.preferredEmail() ); |
47 | setText( Category, addressee.categories().join(";") ); | ||
47 | } | 48 | } |
48 | 49 | ||
49 | QString AddresseeItem::key( int column, bool ) const | 50 | QString AddresseeItem::key( int column, bool ) const |
@@ -80,18 +81,22 @@ AddresseeDialog::AddresseeDialog( QWidget *parent, bool multiple ) : | |||
80 | mAddresseeList = new KListView( listWidget ); | 81 | mAddresseeList = new KListView( listWidget ); |
81 | mAddresseeList->addColumn( i18n("Name") ); | 82 | mAddresseeList->addColumn( i18n("Name") ); |
82 | mAddresseeList->addColumn( i18n("Email") ); | 83 | mAddresseeList->addColumn( i18n("Email") ); |
84 | mAddresseeList->addColumn( i18n("Category") ); | ||
83 | mAddresseeList->setAllColumnsShowFocus( true ); | 85 | mAddresseeList->setAllColumnsShowFocus( true ); |
84 | mAddresseeList->setFullWidth( true ); | 86 | mAddresseeList->setFullWidth( true ); |
85 | listLayout->addWidget( mAddresseeList ); | 87 | listLayout->addWidget( mAddresseeList ); |
86 | connect( mAddresseeList, SIGNAL( doubleClicked( QListViewItem * ) ), | 88 | connect( mAddresseeList, SIGNAL( doubleClicked( QListViewItem * ) ), |
87 | SLOT( slotOk() ) ); | 89 | SLOT( slotOk() ) ); |
88 | 90 | ||
89 | mAddresseeEdit = new QLineEdit( listWidget ); | 91 | QHBox* searchBox = new QHBox ( listWidget ); |
92 | mAddresseeEdit = new QLineEdit( searchBox ); | ||
90 | connect( mAddresseeEdit, SIGNAL( returnPressed() ), | 93 | connect( mAddresseeEdit, SIGNAL( returnPressed() ), |
91 | SLOT( loadAddressBook() ) ); | 94 | SLOT( loadAddressBook() ) ); |
92 | mAddresseeEdit->setFocus(); | 95 | mAddresseeEdit->setFocus(); |
96 | QPushButton *searchButton = new QPushButton( i18n("Search!"), searchBox ); | ||
97 | connect ( searchButton, SIGNAL( clicked() ), SLOT( loadAddressBook() ) ); | ||
93 | 98 | ||
94 | listLayout->addWidget( mAddresseeEdit ); | 99 | listLayout->addWidget( searchBox ); |
95 | 100 | ||
96 | if ( mMultiple ) { | 101 | if ( mMultiple ) { |
97 | //QBoxLayout *selectedLayout = new QVBoxLayout; | 102 | //QBoxLayout *selectedLayout = new QVBoxLayout; |
@@ -107,12 +112,18 @@ AddresseeDialog::AddresseeDialog( QWidget *parent, bool multiple ) : | |||
107 | mSelectedList->addColumn( i18n("Email") ); | 112 | mSelectedList->addColumn( i18n("Email") ); |
108 | mSelectedList->setAllColumnsShowFocus( true ); | 113 | mSelectedList->setAllColumnsShowFocus( true ); |
109 | mSelectedList->setFullWidth( true ); | 114 | mSelectedList->setFullWidth( true ); |
110 | connect( mSelectedList, SIGNAL( doubleClicked( QListViewItem * ) ), | 115 | //connect( mSelectedList, SIGNAL( doubleClicked( QListViewItem * ) ), |
116 | // SLOT( removeSelected() ) ); | ||
117 | connect( mSelectedList, SIGNAL( clicked( QListViewItem * ) ), | ||
118 | SLOT( removeSelected() ) ); | ||
119 | connect( mSelectedList, SIGNAL( returnPressed( QListViewItem *) ), | ||
111 | SLOT( removeSelected() ) ); | 120 | SLOT( removeSelected() ) ); |
112 | 121 | ||
122 | #if 0 | ||
113 | QPushButton *unselectButton = new QPushButton( i18n("Unselect"), selectedGroup ); | 123 | QPushButton *unselectButton = new QPushButton( i18n("Unselect"), selectedGroup ); |
114 | connect ( unselectButton, SIGNAL( clicked() ), SLOT( removeSelected() ) ); | 124 | connect ( unselectButton, SIGNAL( clicked() ), SLOT( removeSelected() ) ); |
115 | 125 | ||
126 | #endif | ||
116 | connect( mAddresseeList, SIGNAL( clicked( QListViewItem * ) ), | 127 | connect( mAddresseeList, SIGNAL( clicked( QListViewItem * ) ), |
117 | SLOT( addSelected( QListViewItem * ) ) ); | 128 | SLOT( addSelected( QListViewItem * ) ) ); |
118 | connect( mAddresseeList, SIGNAL( returnPressed( QListViewItem * ) ), | 129 | connect( mAddresseeList, SIGNAL( returnPressed( QListViewItem * ) ), |
@@ -164,6 +175,7 @@ void AddresseeDialog::loadAddressBook() | |||
164 | continue; | 175 | continue; |
165 | QString name = (*it).realName(); | 176 | QString name = (*it).realName(); |
166 | name += (*it).preferredEmail(); | 177 | name += (*it).preferredEmail(); |
178 | name += (*it).categories().join(";"); | ||
167 | #if QT_VERSION >= 0x030000 | 179 | #if QT_VERSION >= 0x030000 |
168 | if (re.search(name) != -1) | 180 | if (re.search(name) != -1) |
169 | #else | 181 | #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 | |||
43 | @li @p Name - Name in Addressee | 43 | @li @p Name - Name in Addressee |
44 | @li @p Email - Email in Addressee | 44 | @li @p Email - Email in Addressee |
45 | */ | 45 | */ |
46 | enum columns { Name = 0, Email = 1 }; | 46 | enum columns { Name = 0, Email = 1,Category = 2 }; |
47 | 47 | ||
48 | /** | 48 | /** |
49 | Constructor. | 49 | Constructor. |