author | zautrix <zautrix> | 2005-03-31 11:26:51 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-31 11:26:51 (UTC) |
commit | c0fa26aa3b33c293853bdd7d028ddb0545e33c85 (patch) (unidiff) | |
tree | 12bbb65fb6d235415bd7a7007c1e019ccfcf97ac /kaddressbook | |
parent | f39d5000ed2f9a436ee94cbd42f840651afa89d6 (diff) | |
download | kdepimpi-c0fa26aa3b33c293853bdd7d028ddb0545e33c85.zip kdepimpi-c0fa26aa3b33c293853bdd7d028ddb0545e33c85.tar.gz kdepimpi-c0fa26aa3b33c293853bdd7d028ddb0545e33c85.tar.bz2 |
many fixes
-rw-r--r-- | kaddressbook/emaileditwidget.cpp | 2 | ||||
-rw-r--r-- | kaddressbook/phoneeditwidget.cpp | 37 |
2 files changed, 32 insertions, 7 deletions
diff --git a/kaddressbook/emaileditwidget.cpp b/kaddressbook/emaileditwidget.cpp index 0e01b02..e72face 100644 --- a/kaddressbook/emaileditwidget.cpp +++ b/kaddressbook/emaileditwidget.cpp | |||
@@ -189,6 +189,7 @@ qDebug("EmailEditDialog::EmailEditDialog has to be changed (lowPrio)"); | |||
189 | mEmailListBox->insertStringList( items ); | 189 | mEmailListBox->insertStringList( items ); |
190 | // set default state | 190 | // set default state |
191 | selectionChanged( -1 ); | 191 | selectionChanged( -1 ); |
192 | mEmailEdit->setFocus(); | ||
192 | 193 | ||
193 | #ifndef KAB_EMBEDDED | 194 | #ifndef KAB_EMBEDDED |
194 | KAcceleratorManager::manage( this ); | 195 | KAcceleratorManager::manage( this ); |
@@ -225,6 +226,7 @@ void EmailEditDialog::add() | |||
225 | void EmailEditDialog::edit() | 226 | void EmailEditDialog::edit() |
226 | { | 227 | { |
227 | mEmailEdit->setText( mEmailListBox->currentText() ); | 228 | mEmailEdit->setText( mEmailListBox->currentText() ); |
229 | mEmailListBox->removeItem( mEmailListBox->currentItem() ); | ||
228 | mEmailEdit->setFocus(); | 230 | mEmailEdit->setFocus(); |
229 | } | 231 | } |
230 | 232 | ||
diff --git a/kaddressbook/phoneeditwidget.cpp b/kaddressbook/phoneeditwidget.cpp index 19bb676..a435959 100644 --- a/kaddressbook/phoneeditwidget.cpp +++ b/kaddressbook/phoneeditwidget.cpp | |||
@@ -213,7 +213,8 @@ void PhoneEditWidget::edit() | |||
213 | 213 | ||
214 | if ( dlg.exec() ) { | 214 | if ( dlg.exec() ) { |
215 | if ( dlg.changed() ) { | 215 | if ( dlg.changed() ) { |
216 | mPhoneList = dlg.phoneNumbers(); | 216 | KABC::PhoneNumber::List list = dlg.phoneNumbers(); |
217 | setPhoneNumbers( list ); | ||
217 | updateCombos(); | 218 | updateCombos(); |
218 | updateLineEdits(); | 219 | updateLineEdits(); |
219 | emit modified(); | 220 | emit modified(); |
@@ -338,7 +339,10 @@ private: | |||
338 | 339 | ||
339 | PhoneViewItem::PhoneViewItem( QListView *parent, const KABC::PhoneNumber &number ) | 340 | PhoneViewItem::PhoneViewItem( QListView *parent, const KABC::PhoneNumber &number ) |
340 | : QListViewItem( parent ), mPhoneNumber( number ) | 341 | : QListViewItem( parent ), mPhoneNumber( number ) |
341 | { | 342 | { |
343 | #ifdef DESKTOP_VERSION | ||
344 | setRenameEnabled ( 0, true ); | ||
345 | #endif | ||
342 | makeText(); | 346 | makeText(); |
343 | } | 347 | } |
344 | 348 | ||
@@ -406,11 +410,28 @@ void PhoneEditDialog::slotAddPhoneNumber() | |||
406 | PhoneTypeDialog dlg( tmp, this ); | 410 | PhoneTypeDialog dlg( tmp, this ); |
407 | 411 | ||
408 | if ( dlg.exec() ) { | 412 | if ( dlg.exec() ) { |
409 | KABC::PhoneNumber phoneNumber = dlg.phoneNumber(); | 413 | QListViewItem* i = mListView->firstChild(); |
410 | mPhoneNumberList.append( phoneNumber ); | 414 | KABC::PhoneNumber phoneNumber = dlg.phoneNumber(); |
411 | new PhoneViewItem( mListView, phoneNumber ); | 415 | bool insert = true; |
412 | 416 | while ( i ) { | |
413 | mChanged = true; | 417 | PhoneViewItem* p = ( PhoneViewItem* ) i; |
418 | KABC::PhoneNumber pn = p->phoneNumber(); | ||
419 | if ( (pn.type() | KABC::PhoneNumber::Pref) == (phoneNumber.type() | KABC::PhoneNumber::Pref) ) { | ||
420 | if ( p->text(0).isEmpty()) { | ||
421 | p->setPhoneNumber( phoneNumber ); | ||
422 | mPhoneNumberList.remove( pn ); | ||
423 | mPhoneNumberList.append( phoneNumber ); | ||
424 | insert = false; | ||
425 | break; | ||
426 | } | ||
427 | } | ||
428 | i = i->nextSibling(); | ||
429 | } | ||
430 | if ( insert ) { | ||
431 | mPhoneNumberList.append( phoneNumber ); | ||
432 | new PhoneViewItem( mListView, phoneNumber ); | ||
433 | } | ||
434 | mChanged = true; | ||
414 | } | 435 | } |
415 | } | 436 | } |
416 | 437 | ||
@@ -504,6 +525,8 @@ PhoneTypeDialog::PhoneTypeDialog( const KABC::PhoneNumber &phoneNumber, | |||
504 | } | 525 | } |
505 | 526 | ||
506 | mPreferredBox->setChecked( mPhoneNumber.type() & KABC::PhoneNumber::Pref ); | 527 | mPreferredBox->setChecked( mPhoneNumber.type() & KABC::PhoneNumber::Pref ); |
528 | mNumber->setFocus(); | ||
529 | mNumber->setSelection( 0, 1024); | ||
507 | } | 530 | } |
508 | 531 | ||
509 | KABC::PhoneNumber PhoneTypeDialog::phoneNumber() | 532 | KABC::PhoneNumber PhoneTypeDialog::phoneNumber() |