summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-10-28 14:43:31 (UTC)
committer zautrix <zautrix>2005-10-28 14:43:31 (UTC)
commitab099bc1be027fe01dc252a9d7a0f8821e782d65 (patch) (side-by-side diff)
tree85bfb03f334da60dffcc52d54202f51d0f947e3f
parentcaaa030d8bc2aa82c53e5d30abc314b992d7226f (diff)
downloadkdepimpi-ab099bc1be027fe01dc252a9d7a0f8821e782d65.zip
kdepimpi-ab099bc1be027fe01dc252a9d7a0f8821e782d65.tar.gz
kdepimpi-ab099bc1be027fe01dc252a9d7a0f8821e782d65.tar.bz2
fixxxx
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
@@ -371,65 +371,65 @@
{ "West","West" },
{ "Undefined","Unbestimmt" },
{ "Edit Address","Bearbeite Adresse" },
{ "Street:","Strasse:" },
{ "Post office box:","Postfach:" },
{ "Locality:","Stadt:" },
{ "Region:","Region:" },
{ "Postal code:","PLZ:" },
{ "Country:","Staat:" },
{ "This is the preferred address","Dies ist die bevorzugte Adresse" },
{ "New...","Neu..." },
{ "Change Type","Ändere Art" },
{ "Edit Address Type","Ändere Address Art" },
{ "Address Types","Address Art" },
{ "Domestic","Inland" },
{ "International","International" },
{ "Parcel","Paket" },
{ "Edit Contact Name","Ändere Kontakt Name" },
{ "Honorific prefixes:","Namensprefixes:" },
{ "Given name:","Vorname:" },
{ "Additional names:","Mittelnamen:" },
{ "Family names:","Nachname:" },
{ "Honorific suffixes:","Namenssuffixe:" },
{ "Parse name automatically","Setze Namen automatisch" },
{ "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 " },
{ " &Edit Categories "," B&earbeite Kategorien " },
{ "&OK","&OK" },
{ "&Cancel","Abbre&chen" },
{ "Configure","Konfiguriere" },
{ "Default","Voreinstellungen" },
{ "Addressbook","Adressbuch" },
{ "Details view font","Schriftart Detailansicht" },
{ "phone:123","phone:123" },
{ "Search only after <return> key pressed","Suche nur nach <return> Taste" },
{ "Show edit dialog on single click","Zeige Edit Dialog bei Einzelklick" },
{ "Automatic name parsing for new contacts","Automa. Name Parsen für neue Kontakte" },
{ "Display List and Details at once (restart)","Zeige Liste und Details zusammen(neustart)" },
{ "Show exit confirmation","Vor dem Beenden nachfragen" },
{ "General","Allgemein" },
{ "Extensions (restart)","Extensions (restart)" },
{ "Description","Beschreibungen" },
{ "Extensions","Extensions" },
{ "Prefixes","Prefixe" },
{ "Inclusions","Inclusions" },
{ "Suffixes","Suffixe" },
{ "Default formatted name:","Default format. Name:" },
{ "Empty","Leer" },
{ "Simple Name","Einfacher Name" },
{ "Full Name","Voller Name" },
@@ -795,43 +795,43 @@
{ "Got receive file request\nwith invalid password","Erhielt "empfange Datei" Anfrage\nmit ungültigem Passwort" },
{ "Wrong password: Receiving remote file failed.","Falsches Passwort: Empfangen von entfernter Datei fehlgeschlagen." },
{ "Please close error dialog on remote.","Bitte schließe Fehler-Dialog am entfernten Rechner" },
{ "Unknown error on remote.","Unbekannter Fehler am entfernten Rechner" },
{ "Pi-Sync: Connected!","Pi-Sync: Verbunden!" },
{ "Receiving file from remote...","Empfange entfernte Datei..." },
{ "Sending back synced file...","Sende synchronisierte Datei zurück..." },
{ "Do you want to\nclear all sync info\nof all profiles?","Möchten Sie wirklich\ndie Sync-Info\nfür alle Profile\nlöschen?" },
{ "Do you want to\nclear the sync\ninfo of profile\n%1?\n","Möchten Sie wirklich\ndie Sync-Info für Profil\n%1?\nlöschen" },
{ "Sorry, no valid port.Syncing cancelled.","Sorry, kein gültiger Port. Syncing abgebrochen." },
{ "Remote port number:\n(May be: 1 - 65535)","Ferne Port Nummer:\n(Darf sein: 1 - 65535)" },
{ "Writing back file ...","Schreibe Datei zurück..." },
{ "Sending back file ...","Sende Datei zurück..." },
{ "Eeek, there I am ticklish!","Huch, da bin ich kitzlig!" },
{ "Save using LOCAL storage","Speichere nutze LOCAL Pfad" },
{ "...and %1 more\ncontact(s) selected","...und noch %1 Kontakte\n mehr ausgewählt" },
{ "Do you really\nwant to delete the\nsetected contact(s)?\n\n","Möchten Sie wirklich\ndie ausgewählten\nKontakte löschen?\n\n" },
{ "%1 contacts\nsuccessfully\nimported.","%1 Kontakte\nerfolgreich\nimportiert." },
{ "Import this contact?","Importiere diesen Kontakt?" },
{ "Import all!","Importiere alle!" },
{ "Loading addressbook data ... please wait","Lade Adressbuchdaten ... bitte warten" },
{ "Import Format","Import Format" },
{ "Select import format!\nDefault and standard is Utf8.\nLatin1 may be the right\nfor some West Europian languages.","Wähle Import Format!\nDefault und Standard ist Utf8.\nLatin1 kann das richtige für\nWesteuropäische Sprachen sein." },
{ "Home2","Privat2" },
{ "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
@@ -1066,64 +1066,68 @@ QString Addressee::mobileHomePhoneLabel()
return i18n("Mobile (Home)");
}
QString Addressee::homeFaxLabel()
{
return i18n("Fax (Home)");
}
QString Addressee::businessFaxLabel()
{
return i18n("Fax (Work)");
}
QString Addressee::carPhoneLabel()
{
return i18n("Mobile2 (Car)");
}
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()
{
return i18n("Email Address");
}
void Addressee::setMailer( const QString &mailer )
{
if ( mailer == mData->mailer ) return;
detach();
mData->empty = false;
mData->mailer = mailer;
}
QString Addressee::mailer() const
{
return mData->mailer;
}
QString Addressee::mailerLabel()
{
return i18n("Mail Client");
}
void Addressee::setTimeZone( const TimeZone &timeZone )
diff --git a/kabc/addressee.h b/kabc/addressee.h
index 0c488eb..fcadda6 100644
--- a/kabc/addressee.h
+++ b/kabc/addressee.h
@@ -329,65 +329,65 @@ class Addressee
/**
Return translated label for mobilePhone field.
*/
static QString mobilePhoneLabel();
static QString mobileWorkPhoneLabel();
static QString mobileHomePhoneLabel();
/**
Return translated label for homeFax field.
*/
static QString homeFaxLabel();
/**
Return translated label for businessFax field.
*/
static QString businessFaxLabel();
/**
Return translated label for carPhone field.
*/
static QString carPhoneLabel();
/**
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.
*/
static QString emailLabel();
/**
Set mail client.
*/
void setMailer( const QString &mailer );
/**
Return mail client.
*/
QString mailer() const;
/**
Return translated label for mailer field.
*/
static QString mailerLabel();
/**
Set time zone.
*/
void setTimeZone( const TimeZone &timeZone );
/**
Return time zone.
*/
TimeZone timeZone() const;
/**
diff --git a/kabc/field.cpp b/kabc/field.cpp
index 20885de..6f2b307 100644
--- a/kabc/field.cpp
+++ b/kabc/field.cpp
@@ -59,65 +59,66 @@ class Field::FieldImpl
Birthday,
Category,
HomeAddressStreet,
HomeAddressLocality,
HomeAddressRegion,
HomeAddressPostalCode,
HomeAddressCountry,
HomeAddressLabel,
BusinessAddressStreet,
BusinessAddressLocality,
BusinessAddressRegion,
BusinessAddressPostalCode,
BusinessAddressCountry,
BusinessAddressLabel,
HomePhone,
BusinessPhone,
MobilePhone,
HomeFax,
BusinessFax,
CarPhone,
Isdn,
Pager,
Email,
Mailer,
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; }
private:
int mFieldId;
int mCategory;
QString mLabel;
QString mKey;
QString mApp;
};
Field::List Field::mAllFields;
Field::List Field::mDefaultFields;
Field::List Field::mCustomFields;
Field::Field( FieldImpl *impl )
{
mImpl = impl;
}
Field::~Field()
{
delete mImpl;
@@ -177,64 +178,66 @@ QString Field::label()
case FieldImpl::MobileWorkPhone:
return Addressee::mobileWorkPhoneLabel();
case FieldImpl::HomeFax:
return Addressee::homeFaxLabel();
case FieldImpl::BusinessFax:
return Addressee::businessFaxLabel();
case FieldImpl::CarPhone:
return Addressee::carPhoneLabel();
case FieldImpl::Isdn:
return Addressee::isdnLabel();
case FieldImpl::Pager:
return Addressee::pagerLabel();
case FieldImpl::Email:
return Addressee::emailLabel();
case FieldImpl::Mailer:
return Addressee::mailerLabel();
case FieldImpl::Title:
return Addressee::titleLabel();
case FieldImpl::Role:
return Addressee::roleLabel();
case FieldImpl::Organization:
return Addressee::organizationLabel();
case FieldImpl::Note:
return Addressee::noteLabel();
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()
{
return mImpl->category();
}
QString Field::categoryLabel( int category )
{
switch ( category ) {
case All:
return i18n("All");
case Frequent:
return i18n("Frequent");
case Address:
return i18n("Address");
case Email:
return i18n("Email");
case Personal:
return i18n("Personal");
case Organization:
return i18n("Organization");
case CustomCategory:
return i18n("Custom");
default:
return i18n("Undefined");
}
@@ -281,64 +284,66 @@ QString Field::value( const KABC::Addressee &a )
}
else
return QString::null;
case FieldImpl::Url:
return a.url().prettyURL();
//US
case FieldImpl::Resource:
return a.resource()->resourceName();
case FieldImpl::Category:
return a.categories().join(",");
case FieldImpl::HomePhone:
return a.phoneNumber( PhoneNumber::Home| PhoneNumber::Pref ).number();
case FieldImpl::BusinessPhone:
return a.phoneNumber( PhoneNumber::Work| PhoneNumber::Pref ).number();
case FieldImpl::MobilePhone:
return a.phoneNumber( PhoneNumber::Cell ).number();
case FieldImpl::MobileWorkPhone:
return a.phoneNumber( PhoneNumber::Car ).number();
case FieldImpl::MobileHomePhone:
return a.phoneNumber( PhoneNumber::Cell ).number();
case FieldImpl::HomeFax:
return a.phoneNumber( PhoneNumber::Home | PhoneNumber::Fax ).number();
case FieldImpl::BusinessFax:
return a.phoneNumber( PhoneNumber::Work | PhoneNumber::Fax ).number();
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();
case FieldImpl::HomeAddressCountry:
return a.address( Address::Home ).country();
case FieldImpl::BusinessAddressStreet:
return a.address( Address::Work ).street();
case FieldImpl::BusinessAddressLocality:
return a.address( Address::Work ).locality();
case FieldImpl::BusinessAddressRegion:
return a.address( Address::Work ).region();
case FieldImpl::BusinessAddressPostalCode:
return a.address( Address::Work ).postalCode();
case FieldImpl::BusinessAddressCountry:
return a.address( Address::Work ).country();
case FieldImpl::CustomField:
return a.custom( mImpl->app(), mImpl->key() );
default:
return QString::null;
}
}
bool Field::setValue( KABC::Addressee &a, const QString &value )
{
switch ( mImpl->fieldId() ) {
case FieldImpl::FormattedName:
a.setFormattedName( value );
@@ -413,64 +418,65 @@ Field::List Field::allFields()
createField( FieldImpl::Category );
createField( FieldImpl::HomeAddressStreet, Address|Personal );
createField( FieldImpl::HomeAddressLocality, Address|Personal );
createField( FieldImpl::HomeAddressRegion, Address|Personal );
createField( FieldImpl::HomeAddressPostalCode, Address|Personal );
createField( FieldImpl::HomeAddressCountry, Address|Personal );
createField( FieldImpl::HomeAddressLabel, Address|Personal );
createField( FieldImpl::BusinessAddressStreet, Address|Organization );
createField( FieldImpl::BusinessAddressLocality, Address|Organization );
createField( FieldImpl::BusinessAddressRegion, Address|Organization );
createField( FieldImpl::BusinessAddressPostalCode, Address|Organization );
createField( FieldImpl::BusinessAddressCountry, Address|Organization );
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 );
createField( FieldImpl::Pager );
createField( FieldImpl::Email, Email|Frequent );
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() ) {
createDefaultField( FieldImpl::GivenName );
createDefaultField( FieldImpl::FamilyName );
createDefaultField( FieldImpl::Email );
}
return mDefaultFields;
}
void Field::createField( int id, int category )
{
mAllFields.append( new Field( new FieldImpl( id, category ) ) );
}
void Field::createDefaultField( int id, int category )
{
mDefaultFields.append( new Field( new FieldImpl( id, category ) ) );
}
void Field::deleteFields()
{
Field::List::ConstIterator it;
for( it = mAllFields.begin(); it != mAllFields.end(); ++it ) {
delete (*it);
diff --git a/kaddressbook/phoneeditwidget.cpp b/kaddressbook/phoneeditwidget.cpp
index 9e7e221..66f0a5e 100644
--- a/kaddressbook/phoneeditwidget.cpp
+++ b/kaddressbook/phoneeditwidget.cpp
@@ -139,80 +139,89 @@ void PhoneEditWidget::addNumber()
}
PhoneTypeNumberEdit* PhoneEditWidget::appendEditCombo()
{
PhoneTypeNumberEdit* edit = new PhoneTypeNumberEdit( mw );
connect ( edit, SIGNAL ( typeChange( int , int) ), this, SIGNAL ( typeChange( int , int)) );
connect ( edit, SIGNAL ( modified() ), this, SIGNAL ( modified() ) );
connect ( edit, SIGNAL ( deleteMe( PhoneTypeNumberEdit* ) ), this, SLOT ( deleteEdit( PhoneTypeNumberEdit*) ) );
connect ( this, SIGNAL ( typeChange( int , int)), edit, SLOT ( typeExternalChanged( int, int)) );
mainLayout->add( edit );
mTypeNumberEditList.append( edit );
return edit;
}
void PhoneEditWidget::deleteEdit( PhoneTypeNumberEdit* ew )
{
mPendingDelete = ew;
QTimer::singleShot( 0, this, SLOT ( pendingDelete() ) );
}
void PhoneEditWidget::pendingDelete()
{
mTypeNumberEditList.removeRef( mPendingDelete );
emit modified();
}
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() ) {
retList.append( edit->phoneNumber());
}
edit = mTypeNumberEditList.next();
}
return retList;
}
#if 0
PhoneEditWidget::PhoneEditWidget( QWidget *parent, const char *name )
: QWidget( parent, name )
{
QGridLayout *layout = new QGridLayout( this, 4, 1 );
//US layout->setSpacing( KDialog::spacingHint() );
layout->setSpacing( KDialogBase::spacingHintSmall() );
QLabel* label = new QLabel( this );
//US loadIcon call is ambiguous. Add one more parameter
//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop ) );
label->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop, 0 ) );
label->setAlignment( AlignCenter );
//US layout->addMultiCellWidget( label, 0, 1, 3, 3 );