summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/kaddressbook/germantranslation.txt6
-rw-r--r--kabc/addressee.cpp4
-rw-r--r--kabc/addressee.h2
-rw-r--r--kabc/field.cpp8
-rw-r--r--kaddressbook/phoneeditwidget.cpp33
5 files changed, 36 insertions, 17 deletions
diff --git a/bin/kdepim/kaddressbook/germantranslation.txt b/bin/kdepim/kaddressbook/germantranslation.txt
index f12f880..06f25e9 100644
--- a/bin/kdepim/kaddressbook/germantranslation.txt
+++ b/bin/kdepim/kaddressbook/germantranslation.txt
@@ -395,17 +395,17 @@
{ "Edit Phone Numbers","Bearbeite Telefonnummern" },
{ "Number","Nummer" },
{ "Type","Typ" },
{ "Edit Phone Number","Bearbeite Telefonnummer" },
{ "Number:","Nummer:" },
{ "This is the preferred phone number","Dies ist die bevorzugte Telefonnummer" },
{ "Types","Typen" },
{ "Messenger","Messenger" },
-{ "Other","Anderes" },
+{ "Other","Sonstiges" },
{ "Video","Video" },
{ "Mailbox","Mailbox" },
{ "Modem","Modem" },
{ "Car","Auto" },
{ "PCS","PCS" },
{ "Category","Kategorie" },
{ "Select Categories","Wähle Kategorien" },
{ " &Deselect All "," &Deselektiere alle " },
@@ -819,19 +819,19 @@
{ "Work2","Arbeit2" },
{ "Fax (Work)","Fax (Arbeit)" },
{ "Fax (Home)","Fax (Privat)" },
{ "Assistent","Sekretär(in)" },
{ "Company","Firma" },
{ "Mobile2 (Work)","Handy2 (Arbeit)" },
{ "Mobile2 (Car)","Handy2 (Auto)" },
{ "Callback","Rückruf" },
-{ "Fax (Other)","Fax (Anderes)" },
+{ "Fax (Other)","Fax (Sonst.)" },
{ "Primary","Bevorzugt" },
{ "Mobile (Home)","Handy (Privat)" },
{ "Unfiled","Nicht zugeordnet" },
{ "Format.n.:","Format.N.:" },
-{ "","" },
+{ "Other Phone","Sonst. Telefon" },
{ "","" },
{ "","" },
{ "","" },
{ "","" },
{ "","" }, \ No newline at end of file
diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp
index 789a694..0d8e8e8 100644
--- a/kabc/addressee.cpp
+++ b/kabc/addressee.cpp
@@ -1090,16 +1090,20 @@ QString Addressee::isdnLabel()
return i18n("ISDN");
}
QString Addressee::pagerLabel()
{
return i18n("Pager");
}
+QString Addressee::otherPhoneLabel()
+{
+ return i18n("Other Phone");
+}
QString Addressee::sipLabel()
{
return i18n("SIP");
}
QString Addressee::emailLabel()
{
diff --git a/kabc/addressee.h b/kabc/addressee.h
index 0c488eb..fcadda6 100644
--- a/kabc/addressee.h
+++ b/kabc/addressee.h
@@ -353,17 +353,17 @@ class Addressee
Return translated label for isdn field.
*/
static QString isdnLabel();
/**
Return translated label for pager field.
*/
static QString pagerLabel();
-
+ static QString otherPhoneLabel();
/**
Return translated label for sip field.
*/
static QString sipLabel();
/**
Return translated label for email field.
*/
diff --git a/kabc/field.cpp b/kabc/field.cpp
index 20885de..6f2b307 100644
--- a/kabc/field.cpp
+++ b/kabc/field.cpp
@@ -83,17 +83,18 @@ class Field::FieldImpl
Title,
Role,
Organization,
Note,
Url,
Resource,
Sip,
MobileWorkPhone,
- MobileHomePhone
+ MobileHomePhone,
+ OtherPhone
};
int fieldId() { return mFieldId; }
int category() { return mCategory; }
QString label() { return mLabel; }
QString key() { return mKey; }
QString app() { return mApp; }
@@ -201,16 +202,18 @@ QString Field::label()
case FieldImpl::Url:
return Addressee::urlLabel();
case FieldImpl::Resource:
return Addressee::resourceLabel();
case FieldImpl::Category:
return Addressee::categoryLabel();
case FieldImpl::Sip:
return Addressee::sipLabel();
+ case FieldImpl::OtherPhone:
+ return Addressee::otherPhoneLabel();
case FieldImpl::CustomField:
return mImpl->label();
default:
return i18n("Unknown Field");
}
}
int Field::category()
@@ -305,16 +308,18 @@ QString Field::value( const KABC::Addressee &a )
case FieldImpl::CarPhone:
return a.phoneNumber( PhoneNumber::Car ).number();
case FieldImpl::Isdn:
return a.phoneNumber( PhoneNumber::Isdn ).number();
case FieldImpl::Pager:
return a.phoneNumber( PhoneNumber::Pager ).number();
case FieldImpl::Sip:
return a.phoneNumber( PhoneNumber::Pcs | PhoneNumber::Pref ).number();
+ case FieldImpl::OtherPhone:
+ return a.phoneNumber( PhoneNumber::Voice ).number();
case FieldImpl::HomeAddressStreet:
return a.address( Address::Home ).street();
case FieldImpl::HomeAddressLocality:
return a.address( Address::Home ).locality();
case FieldImpl::HomeAddressRegion:
return a.address( Address::Home ).region();
case FieldImpl::HomeAddressPostalCode:
return a.address( Address::Home ).postalCode();
@@ -437,16 +442,17 @@ Field::List Field::allFields()
createField( FieldImpl::Mailer, Email );
createField( FieldImpl::Title, Organization );
createField( FieldImpl::Role, Organization );
createField( FieldImpl::Organization, Organization );
createField( FieldImpl::Note );
createField( FieldImpl::Url );
createField( FieldImpl::Resource );
createField( FieldImpl::Sip );
+ createField( FieldImpl::OtherPhone );
}
return mAllFields;
}
Field::List Field::defaultFields()
{
if ( mDefaultFields.isEmpty() ) {
diff --git a/kaddressbook/phoneeditwidget.cpp b/kaddressbook/phoneeditwidget.cpp
index 9e7e221..66f0a5e 100644
--- a/kaddressbook/phoneeditwidget.cpp
+++ b/kaddressbook/phoneeditwidget.cpp
@@ -163,32 +163,41 @@ void PhoneEditWidget::pendingDelete()
void PhoneEditWidget::setPhoneNumbers( const KABC::PhoneNumber::List &li )
{
if ( li.isEmpty() ) {
setDefaults();
return;
}
mTypeNumberEditList.clear();
- KABC::PhoneNumber::List::Iterator it;
- KABC::PhoneNumber::List list = li;
- PhoneTypeNumberEdit* edit = 0;//mTypeNumberEditList.first();
+ KABC::PhoneNumber::List::Iterator it;
+ KABC::PhoneNumber::List list2 = li;
+ KABC::PhoneNumber::List list ;
+
+ PhoneNumber::TypeList tList = PhoneNumber::supportedTypeList();
+ int i = 0;
+ int max = tList.count();
+ while ( i < max-1 ) {
+ for ( it = list2.begin(); it != list2.end(); ++it ) {
+ if ( (*it).type() == tList[i] ) {
+ list.append( (*it ) );
+ break;
+ }
+ }
+ ++i;
+ }
+ for ( it = list2.begin(); it != list2.end(); ++it ) {
+ if ( (*it).type() == tList[ max-1 ] )
+ list.append( (*it ) );
+ }
for ( it = list.begin(); it != list.end(); ++it ) {
- if ( edit ) {
- edit->setPhoneNumber( (*it ) );
- edit = mTypeNumberEditList.next();
- } else {
PhoneTypeNumberEdit* editNew = appendEditCombo();
editNew->setPhoneNumber( (*it ) );
- }
- }
- while ( edit ) {
- edit->hide();
- edit = mTypeNumberEditList.next();
}
+
}
KABC::PhoneNumber::List PhoneEditWidget::phoneNumbers()
{
KABC::PhoneNumber::List retList;
PhoneTypeNumberEdit* edit = mTypeNumberEditList.first();
while ( edit ) {
if ( edit->isValid() ) {