author | zautrix <zautrix> | 2005-04-07 07:42:53 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-04-07 07:42:53 (UTC) |
commit | c82f9b40f6023dc7b39ac555cba8c4c313f15ca8 (patch) (side-by-side diff) | |
tree | e9e4f0c0ed3243ec060a475983b271bd27b40d15 | |
parent | 76e220bf1236ae6afa9d91f18f0cd9ced730cff0 (diff) | |
download | kdepimpi-c82f9b40f6023dc7b39ac555cba8c4c313f15ca8.zip kdepimpi-c82f9b40f6023dc7b39ac555cba8c4c313f15ca8.tar.gz kdepimpi-c82f9b40f6023dc7b39ac555cba8c4c313f15ca8.tar.bz2 |
added fields to kapi
-rw-r--r-- | bin/kdepim/WhatsNew.txt | 2 | ||||
-rw-r--r-- | bin/kdepim/kaddressbook/germantranslation.txt | 6 | ||||
-rw-r--r-- | kabc/addressee.cpp | 25 | ||||
-rw-r--r-- | kabc/addressee.h | 5 | ||||
-rw-r--r-- | kabc/field.cpp | 20 | ||||
-rw-r--r-- | kabc/phonenumber.cpp | 11 | ||||
-rw-r--r-- | kaddressbook/views/kaddressbooktableview.cpp | 2 |
7 files changed, 60 insertions, 11 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index 53eb428..bc0c62a 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt @@ -2,8 +2,10 @@ Info about the changes in new versions of KDE-Pim/Pi ********** VERSION 2.0.26 ************ And again fixed some bugs. +Added two more fields to the KA/Pi view config: +A "Mobile (home)" and a "Mobile (work)" field. ********** VERSION 2.0.25 ************ And again fixed some bugs. diff --git a/bin/kdepim/kaddressbook/germantranslation.txt b/bin/kdepim/kaddressbook/germantranslation.txt index e54e140..f67a34d 100644 --- a/bin/kdepim/kaddressbook/germantranslation.txt +++ b/bin/kdepim/kaddressbook/germantranslation.txt @@ -752,11 +752,11 @@ { "Edit new contact","Bearbeite neuen Kontakt" },
{ "Edit ","Bearbeite " },
{ "No contact changed!","Kein Kontakt verändert" },
{ "%1 contacts changed!","%1 Kontakte geändert!" },
-{ "","" },
-{ "","" },
-{ "","" },
+{ "Mobile (home)","Handy (Arbeit)" },
+{ "Mobile (work)","Handy (Privat)" },
+{ "Def.Formatted Name","Def. Format. Name" },
{ "","" },
{ "","" },
{ "","" },
{ "","" },
\ No newline at end of file diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp index 39d14bb..7f592e9 100644 --- a/kabc/addressee.cpp +++ b/kabc/addressee.cpp @@ -50,8 +50,9 @@ struct Addressee::AddresseeData : public KShared { QString uid; QString name; QString formattedName; + QString defaultFormattedName; QString familyName; QString givenName; QString additionalName; QString prefix; @@ -746,19 +747,35 @@ void Addressee::setFormattedName( const QString &formattedName ) detach(); mData->empty = false; mData->formattedName = formattedName; } +void Addressee::setDefaultFormattedName( const QString &formattedName ) +{ + if ( formattedName == mData->defaultFormattedName ) return; + detach(); + mData->empty = false; + mData->defaultFormattedName = formattedName; +} QString Addressee::formattedName() const { return mData->formattedName; } +QString Addressee::defaultFormattedName() const +{ + return mData->defaultFormattedName; +} QString Addressee::formattedNameLabel() { return i18n("Formatted Name"); } +QString Addressee::defaultFormattedNameLabel() +{ + return i18n("Def.Formatted Name"); +} + void Addressee::setFamilyName( const QString &familyName ) { if ( familyName == mData->familyName ) return; @@ -979,8 +996,16 @@ QString Addressee::businessPhoneLabel() QString Addressee::mobilePhoneLabel() { return i18n("Mobile Phone"); } +QString Addressee::mobileWorkPhoneLabel() +{ + return i18n("Mobile (work)"); +} +QString Addressee::mobileHomePhoneLabel() +{ + return i18n("Mobile (home)"); +} QString Addressee::homeFaxLabel() { diff --git a/kabc/addressee.h b/kabc/addressee.h index 8051fec..0d688f8 100644 --- a/kabc/addressee.h +++ b/kabc/addressee.h @@ -153,16 +153,19 @@ class Addressee /** Set formatted name. */ void setFormattedName( const QString &formattedName ); + void setDefaultFormattedName( const QString &formattedName ); /** Return formatted name. */ QString formattedName() const; + QString defaultFormattedName() const; /** Return translated label for formattedName field. */ static QString formattedNameLabel(); + static QString defaultFormattedNameLabel(); /** Set family name. */ @@ -327,8 +330,10 @@ class Addressee /** Return translated label for mobilePhone field. */ static QString mobilePhoneLabel(); + static QString mobileWorkPhoneLabel(); + static QString mobileHomePhoneLabel(); /** Return translated label for homeFax field. */ diff --git a/kabc/field.cpp b/kabc/field.cpp index 89d0b77..5c561c3 100644 --- a/kabc/field.cpp +++ b/kabc/field.cpp @@ -85,9 +85,12 @@ class Field::FieldImpl Organization, Note, Url, Resource, - Sip + Sip, + DefaultFormattedName, + MobileWorkPhone, + MobileHomePhone }; int fieldId() { return mFieldId; } int category() { return mCategory; } @@ -125,8 +128,10 @@ QString Field::label() { switch ( mImpl->fieldId() ) { case FieldImpl::FormattedName: return Addressee::formattedNameLabel(); + case FieldImpl::DefaultFormattedName: + return Addressee::defaultFormattedNameLabel(); case FieldImpl::FamilyName: return Addressee::familyNameLabel(); case FieldImpl::GivenName: return Addressee::givenNameLabel(); @@ -169,8 +174,12 @@ QString Field::label() case FieldImpl::BusinessPhone: return Addressee::businessPhoneLabel(); case FieldImpl::MobilePhone: return Addressee::mobilePhoneLabel(); + case FieldImpl::MobileHomePhone: + return Addressee::mobileHomePhoneLabel(); + case FieldImpl::MobileWorkPhone: + return Addressee::mobileWorkPhoneLabel(); case FieldImpl::HomeFax: return Addressee::homeFaxLabel(); case FieldImpl::BusinessFax: return Addressee::businessFaxLabel(); @@ -238,8 +247,10 @@ QString Field::value( const KABC::Addressee &a ) { switch ( mImpl->fieldId() ) { case FieldImpl::FormattedName: return a.formattedName(); + case FieldImpl::DefaultFormattedName: + return a.defaultFormattedName(); case FieldImpl::FamilyName: return a.familyName(); case FieldImpl::GivenName: return a.givenName(); @@ -287,8 +298,12 @@ QString Field::value( const KABC::Addressee &a ) case FieldImpl::BusinessPhone: return a.phoneNumber( PhoneNumber::Work ).number(); case FieldImpl::MobilePhone: return a.phoneNumber( PhoneNumber::Cell ).number(); + case FieldImpl::MobileWorkPhone: + return a.phoneNumber( PhoneNumber::Cell | PhoneNumber::Work ).number(); + case FieldImpl::MobileHomePhone: + return a.phoneNumber( PhoneNumber::Cell | PhoneNumber::Home ).number(); case FieldImpl::HomeFax: return a.phoneNumber( PhoneNumber::Home | PhoneNumber::Fax ).number(); case FieldImpl::BusinessFax: return a.phoneNumber( PhoneNumber::Work | PhoneNumber::Fax ).number(); @@ -392,8 +407,9 @@ bool Field::isCustom() Field::List Field::allFields() { if ( mAllFields.isEmpty() ) { createField( FieldImpl::FormattedName, Frequent ); + createField( FieldImpl::DefaultFormattedName, Frequent ); createField( FieldImpl::FamilyName, Frequent ); createField( FieldImpl::GivenName, Frequent ); createField( FieldImpl::AdditionalName ); createField( FieldImpl::Prefix ); @@ -415,8 +431,10 @@ Field::List Field::allFields() createField( FieldImpl::BusinessAddressLabel, Address|Organization ); createField( FieldImpl::HomePhone, Personal|Frequent ); createField( FieldImpl::BusinessPhone, Organization|Frequent ); createField( FieldImpl::MobilePhone, Frequent ); + createField( FieldImpl::MobileHomePhone, Frequent ); + createField( FieldImpl::MobileWorkPhone, Frequent ); createField( FieldImpl::HomeFax ); createField( FieldImpl::BusinessFax ); createField( FieldImpl::CarPhone ); createField( FieldImpl::Isdn ); diff --git a/kabc/phonenumber.cpp b/kabc/phonenumber.cpp index 041effc..4c6231d 100644 --- a/kabc/phonenumber.cpp +++ b/kabc/phonenumber.cpp @@ -176,17 +176,16 @@ QString PhoneNumber::label( int type ) QString PhoneNumber::typeLabel( int type ) { QString typeString; - if ((type & Home) == Home) - typeString += i18n("Home"); - else if ((type & Work) == Work) - typeString += i18n("Work"); - if (!typeString.isEmpty()) - typeString += " "; if ((type & Cell) == Cell) typeString += i18n("Mobile") +" "; + if ((type & Home) == Home) + typeString += i18n("Home")+" "; + else if ((type & Work) == Work) + typeString += i18n("Work")+" "; + if ((type & Sip) == Sip) typeString += i18n("SIP")+" "; if ((type & Car) == Car) typeString += i18n("Car")+" "; diff --git a/kaddressbook/views/kaddressbooktableview.cpp b/kaddressbook/views/kaddressbooktableview.cpp index e322473..565cd1d 100644 --- a/kaddressbook/views/kaddressbooktableview.cpp +++ b/kaddressbook/views/kaddressbooktableview.cpp @@ -185,9 +185,9 @@ void KAddressBookTableView::doSearch( const QString& s, KABC::Field *field ) } } // Sometimes the background pixmap gets messed up when we add lots // of items. - mListView->repaint(); + //mListView->repaint(); if ( mListView->firstChild() ) { mListView->setCurrentItem ( mListView->firstChild() ); mListView->setSelected ( mListView->firstChild(), true ); } |