summaryrefslogtreecommitdiffabout
path: root/kaddressbook
Side-by-side diff
Diffstat (limited to 'kaddressbook') (more/less context) (show whitespace changes)
-rw-r--r--kaddressbook/emaileditwidget.cpp2
-rw-r--r--kaddressbook/phoneeditwidget.cpp27
2 files changed, 27 insertions, 2 deletions
diff --git a/kaddressbook/emaileditwidget.cpp b/kaddressbook/emaileditwidget.cpp
index 0e01b02..e72face 100644
--- a/kaddressbook/emaileditwidget.cpp
+++ b/kaddressbook/emaileditwidget.cpp
@@ -191,2 +191,3 @@ qDebug("EmailEditDialog::EmailEditDialog has to be changed (lowPrio)");
selectionChanged( -1 );
+ mEmailEdit->setFocus();
@@ -227,2 +228,3 @@ void EmailEditDialog::edit()
mEmailEdit->setText( mEmailListBox->currentText() );
+ mEmailListBox->removeItem( mEmailListBox->currentItem() );
mEmailEdit->setFocus();
diff --git a/kaddressbook/phoneeditwidget.cpp b/kaddressbook/phoneeditwidget.cpp
index 19bb676..a435959 100644
--- a/kaddressbook/phoneeditwidget.cpp
+++ b/kaddressbook/phoneeditwidget.cpp
@@ -215,3 +215,4 @@ void PhoneEditWidget::edit()
if ( dlg.changed() ) {
- mPhoneList = dlg.phoneNumbers();
+ KABC::PhoneNumber::List list = dlg.phoneNumbers();
+ setPhoneNumbers( list );
updateCombos();
@@ -341,2 +342,5 @@ PhoneViewItem::PhoneViewItem( QListView *parent, const KABC::PhoneNumber &number
{
+#ifdef DESKTOP_VERSION
+ setRenameEnabled ( 0, true );
+#endif
makeText();
@@ -408,6 +412,23 @@ void PhoneEditDialog::slotAddPhoneNumber()
if ( dlg.exec() ) {
+ QListViewItem* i = mListView->firstChild();
KABC::PhoneNumber phoneNumber = dlg.phoneNumber();
+ bool insert = true;
+ while ( i ) {
+ PhoneViewItem* p = ( PhoneViewItem* ) i;
+ KABC::PhoneNumber pn = p->phoneNumber();
+ if ( (pn.type() | KABC::PhoneNumber::Pref) == (phoneNumber.type() | KABC::PhoneNumber::Pref) ) {
+ if ( p->text(0).isEmpty()) {
+ p->setPhoneNumber( phoneNumber );
+ mPhoneNumberList.remove( pn );
+ mPhoneNumberList.append( phoneNumber );
+ insert = false;
+ break;
+ }
+ }
+ i = i->nextSibling();
+ }
+ if ( insert ) {
mPhoneNumberList.append( phoneNumber );
new PhoneViewItem( mListView, phoneNumber );
-
+ }
mChanged = true;
@@ -506,2 +527,4 @@ PhoneTypeDialog::PhoneTypeDialog( const KABC::PhoneNumber &phoneNumber,
mPreferredBox->setChecked( mPhoneNumber.type() & KABC::PhoneNumber::Pref );
+ mNumber->setFocus();
+ mNumber->setSelection( 0, 1024);
}