summaryrefslogtreecommitdiffabout
path: root/kaddressbook
authorzautrix <zautrix>2005-03-31 11:26:51 (UTC)
committer zautrix <zautrix>2005-03-31 11:26:51 (UTC)
commitc0fa26aa3b33c293853bdd7d028ddb0545e33c85 (patch) (side-by-side diff)
tree12bbb65fb6d235415bd7a7007c1e019ccfcf97ac /kaddressbook
parentf39d5000ed2f9a436ee94cbd42f840651afa89d6 (diff)
downloadkdepimpi-c0fa26aa3b33c293853bdd7d028ddb0545e33c85.zip
kdepimpi-c0fa26aa3b33c293853bdd7d028ddb0545e33c85.tar.gz
kdepimpi-c0fa26aa3b33c293853bdd7d028ddb0545e33c85.tar.bz2
many fixes
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
@@ -189,6 +189,7 @@ qDebug("EmailEditDialog::EmailEditDialog has to be changed (lowPrio)");
mEmailListBox->insertStringList( items );
// set default state
selectionChanged( -1 );
+ mEmailEdit->setFocus();
#ifndef KAB_EMBEDDED
KAcceleratorManager::manage( this );
@@ -225,6 +226,7 @@ void EmailEditDialog::add()
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
@@ -213,7 +213,8 @@ void PhoneEditWidget::edit()
if ( dlg.exec() ) {
if ( dlg.changed() ) {
- mPhoneList = dlg.phoneNumbers();
+ KABC::PhoneNumber::List list = dlg.phoneNumbers();
+ setPhoneNumbers( list );
updateCombos();
updateLineEdits();
emit modified();
@@ -339,6 +340,9 @@ private:
PhoneViewItem::PhoneViewItem( QListView *parent, const KABC::PhoneNumber &number )
: QListViewItem( parent ), mPhoneNumber( number )
{
+#ifdef DESKTOP_VERSION
+ setRenameEnabled ( 0, true );
+#endif
makeText();
}
@@ -406,10 +410,27 @@ void PhoneEditDialog::slotAddPhoneNumber()
PhoneTypeDialog dlg( tmp, this );
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;
}
}
@@ -504,6 +525,8 @@ PhoneTypeDialog::PhoneTypeDialog( const KABC::PhoneNumber &phoneNumber,
}
mPreferredBox->setChecked( mPhoneNumber.type() & KABC::PhoneNumber::Pref );
+ mNumber->setFocus();
+ mNumber->setSelection( 0, 1024);
}
KABC::PhoneNumber PhoneTypeDialog::phoneNumber()