summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-10-28 21:15:00 (UTC)
committer zautrix <zautrix>2005-10-28 21:15:00 (UTC)
commit85d2ea5c17a2b2c7a4ae4dd954bc635a56239b57 (patch) (side-by-side diff)
tree8628f5cef407eaeee2d8b893f82d296d5dcd4787
parent16e87ac5b81352c51343715cf1080191aaba9611 (diff)
downloadkdepimpi-85d2ea5c17a2b2c7a4ae4dd954bc635a56239b57.zip
kdepimpi-85d2ea5c17a2b2c7a4ae4dd954bc635a56239b57.tar.gz
kdepimpi-85d2ea5c17a2b2c7a4ae4dd954bc635a56239b57.tar.bz2
fixx
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/kaddressbook/germantranslation.txt5
-rw-r--r--kabc/addressee.cpp14
-rw-r--r--kabc/addressee.h7
-rw-r--r--kabc/field.cpp12
-rw-r--r--kabc/phonenumber.cpp4
-rw-r--r--kaddressbook/xxport/csvimportdialog.cpp4
-rw-r--r--kaddressbook/xxport/csvimportdialog.h2
7 files changed, 10 insertions, 38 deletions
diff --git a/bin/kdepim/kaddressbook/germantranslation.txt b/bin/kdepim/kaddressbook/germantranslation.txt
index 06f25e9..3448dcc 100644
--- a/bin/kdepim/kaddressbook/germantranslation.txt
+++ b/bin/kdepim/kaddressbook/germantranslation.txt
@@ -776,62 +776,61 @@
{ "Spouse","Ehegatte" },
{ "Notes","Notizen" },
{ "Messanger","Messanger" },
{ "Assistant","Assistent" },
{ "Manager","Manager" },
{ "Secrecy","Sichtbar" },
{ "male","männlich" },
{ "female","weiblich" },
{ "Hide!","Verbergen!" },
{ "Show!","Anzeigen!" },
{ "Details","Details" },
{ "Search:","Suche:" },
{ "Automatically sync with KDE-Desktop\nwhen receiving sync request","Synce automatisch mit KDE-Desktop\nwenn eine Sync-Anforderung kommt" },
{ "Pi-Sync Port Error","Pi-Sync Port Fehler" },
{ "<b>Enabling Pi-Sync failed!</b> Failed to bind or listen to the port %1! Is another instance already listening to that port?","<b>Anschalten von Pi-Sync fehlgeschlagen!</b> Fehler beim Ansprechen des Ports %1! Ist bereits eine andere Anwendung dabei diesen Port zu nutzen?" },
{ "No valid port number:\n%1","Keine gültige Port Nummer:\n%1" },
{ "Port number (Default: %1)\nValid range from 1 to 65535","Port Nummer (Standard: %1)\nGültiger Bereich von 1 bis 65535" },
{ "Pi-Sync Error","Pi-Sync Fehler" },
{ "Got send file request\nwith invalid password","Erhielt "sende Datei" Anfrage\nmit ungültigem Passwort" },
{ "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)" },
+{ "Mobile2","Handy2" },
{ "Callback","Rückruf" },
{ "Fax (Other)","Fax (Sonst.)" },
{ "Primary","Bevorzugt" },
-{ "Mobile (Home)","Handy (Privat)" },
+{ "Mobile","Handy" },
{ "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 0d8e8e8..2f4a9af 100644
--- a/kabc/addressee.cpp
+++ b/kabc/addressee.cpp
@@ -1010,126 +1010,116 @@ QString Addressee::businessAddressStreetLabel()
return i18n("Business Address Street");
}
QString Addressee::businessAddressLocalityLabel()
{
return i18n("Business Address Locality");
}
QString Addressee::businessAddressRegionLabel()
{
return i18n("Business Address Region");
}
QString Addressee::businessAddressPostalCodeLabel()
{
return i18n("Business Address Postal Code");
}
QString Addressee::businessAddressCountryLabel()
{
return i18n("Business Address Country");
}
QString Addressee::businessAddressLabelLabel()
{
return i18n("Business Address Label");
}
QString Addressee::homePhoneLabel()
{
return i18n("Home Phone");
}
QString Addressee::businessPhoneLabel()
{
return i18n("Work Phone");
}
QString Addressee::mobilePhoneLabel()
{
- return i18n("Mobile Phone");
+ return i18n("Mobile");
}
QString Addressee::mobileWorkPhoneLabel()
{
- return i18n("Mobile2 (Work)");
-}
-QString Addressee::mobileHomePhoneLabel()
-{
- return i18n("Mobile (Home)");
+ return i18n("Mobile2");
}
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 )
{
if ( timeZone == mData->timeZone ) return;
diff --git a/kabc/addressee.h b/kabc/addressee.h
index fcadda6..aac78dc 100644
--- a/kabc/addressee.h
+++ b/kabc/addressee.h
@@ -287,113 +287,108 @@ class Addressee
*/
static QString homeAddressLabelLabel();
/**
Return translated label for businessAddressStreet field.
*/
static QString businessAddressStreetLabel();
/**
Return translated label for businessAddressLocality field.
*/
static QString businessAddressLocalityLabel();
/**
Return translated label for businessAddressRegion field.
*/
static QString businessAddressRegionLabel();
/**
Return translated label for businessAddressPostalCode field.
*/
static QString businessAddressPostalCodeLabel();
/**
Return translated label for businessAddressCountry field.
*/
static QString businessAddressCountryLabel();
/**
Return translated label for businessAddressLabel field.
*/
static QString businessAddressLabelLabel();
/**
Return translated label for homePhone field.
*/
static QString homePhoneLabel();
/**
Return translated label for businessPhone field.
*/
static QString businessPhoneLabel();
/**
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;
/**
Return translated label for timeZone field.
*/
static QString timeZoneLabel();
/**
Set geographic position.
diff --git a/kabc/field.cpp b/kabc/field.cpp
index 6f2b307..7c6d7a9 100644
--- a/kabc/field.cpp
+++ b/kabc/field.cpp
@@ -30,204 +30,198 @@ $Id$
#include <kconfig.h>
#include <kconfigbase.h>
#include <kglobal.h>
#include "field.h"
#include "resource.h"
using namespace KABC;
class Field::FieldImpl
{
public:
FieldImpl( int fieldId, int category = 0,
const QString &label = QString::null,
const QString &key = QString::null,
const QString &app = QString::null )
: mFieldId( fieldId ), mCategory( category ), mLabel( label ),
mKey( key ), mApp( app ) {}
enum FieldId
{
CustomField,
FormattedName,
FamilyName,
GivenName,
AdditionalName,
Prefix,
Suffix,
NickName,
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,
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;
}
QString Field::label()
{
switch ( mImpl->fieldId() ) {
case FieldImpl::FormattedName:
return Addressee::formattedNameLabel();
case FieldImpl::FamilyName:
return Addressee::familyNameLabel();
case FieldImpl::GivenName:
return Addressee::givenNameLabel();
case FieldImpl::AdditionalName:
return Addressee::additionalNameLabel();
case FieldImpl::Prefix:
return Addressee::prefixLabel();
case FieldImpl::Suffix:
return Addressee::suffixLabel();
case FieldImpl::NickName:
return Addressee::nickNameLabel();
case FieldImpl::Birthday:
return Addressee::birthdayLabel();
case FieldImpl::HomeAddressStreet:
return Addressee::homeAddressStreetLabel();
case FieldImpl::HomeAddressLocality:
return Addressee::homeAddressLocalityLabel();
case FieldImpl::HomeAddressRegion:
return Addressee::homeAddressRegionLabel();
case FieldImpl::HomeAddressPostalCode:
return Addressee::homeAddressPostalCodeLabel();
case FieldImpl::HomeAddressCountry:
return Addressee::homeAddressCountryLabel();
case FieldImpl::HomeAddressLabel:
return Addressee::homeAddressLabelLabel();
case FieldImpl::BusinessAddressStreet:
return Addressee::businessAddressStreetLabel();
case FieldImpl::BusinessAddressLocality:
return Addressee::businessAddressLocalityLabel();
case FieldImpl::BusinessAddressRegion:
return Addressee::businessAddressRegionLabel();
case FieldImpl::BusinessAddressPostalCode:
return Addressee::businessAddressPostalCodeLabel();
case FieldImpl::BusinessAddressCountry:
return Addressee::businessAddressCountryLabel();
case FieldImpl::BusinessAddressLabel:
return Addressee::businessAddressLabelLabel();
case FieldImpl::HomePhone:
return Addressee::homePhoneLabel();
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();
- 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:
@@ -254,104 +248,100 @@ QString Field::value( const KABC::Addressee &a )
return a.givenName();
case FieldImpl::AdditionalName:
return a.additionalName();
case FieldImpl::Prefix:
return a.prefix();
case FieldImpl::Suffix:
return a.suffix();
case FieldImpl::NickName:
return a.nickName();
case FieldImpl::Mailer:
return a.mailer();
case FieldImpl::Title:
return a.title();
case FieldImpl::Role:
return a.role();
case FieldImpl::Organization:
return a.organization();
case FieldImpl::Note:
return a.note();
case FieldImpl::Email:
return a.preferredEmail();
case FieldImpl::Birthday:
if ( a.birthday().isValid() ) {
//the generated code had the following format: return a.birthday().date().toString( Qt::ISODate );
// But Qt::IsoDate was not specified.
// QString _oldFormat = KGlobal::locale()->dateFormat();
// KGlobal::locale()->setDateFormat("%Y-%m-%d"); // = Qt::ISODate
QString dt = KGlobal::locale()->formatDate(a.birthday().date(), false, KLocale::ISODate);
// KGlobal::locale()->setDateFormat(_oldFormat);
return dt;
}
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 );
return true;
case FieldImpl::FamilyName:
a.setFamilyName( value );
return true;
case FieldImpl::GivenName:
a.setGivenName( value );
return true;
case FieldImpl::AdditionalName:
@@ -386,101 +376,99 @@ bool Field::setValue( KABC::Addressee &a, const QString &value )
//the generated code had the following format: return a.setBirthday( QDate::fromString( value, Qt::ISODate ) );
// But Qt::IsoDate and QDate::fromString was not specified. Do I have the wrong QT version ?
{
QDate dt = KGlobal::locale()->readDate( value, "%Y-%m-%d"); // = Qt::ISODate
a.setBirthday(dt);
}
return true;
case FieldImpl::CustomField:
a.insertCustom( mImpl->app(), mImpl->key(), value );
//US never copy the resourcename back to the adressee.
case FieldImpl::Resource:
default:
return false;
}
}
bool Field::isCustom()
{
return mImpl->fieldId() == FieldImpl::CustomField;
}
Field::List Field::allFields()
{
if ( mAllFields.isEmpty() ) {
createField( FieldImpl::FormattedName, Frequent );
createField( FieldImpl::FamilyName, Frequent );
createField( FieldImpl::GivenName, Frequent );
createField( FieldImpl::AdditionalName );
createField( FieldImpl::Prefix );
createField( FieldImpl::Suffix );
createField( FieldImpl::NickName, Personal );
createField( FieldImpl::Birthday, Personal );
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);
}
mAllFields.clear();
for( it = mDefaultFields.begin(); it != mDefaultFields.end(); ++it ) {
diff --git a/kabc/phonenumber.cpp b/kabc/phonenumber.cpp
index 90cc4cf..6db1bcf 100644
--- a/kabc/phonenumber.cpp
+++ b/kabc/phonenumber.cpp
@@ -188,148 +188,148 @@ int PhoneNumber::type() const
{
return mType;
}
QString PhoneNumber::typeLabel() const
{
QString label;
bool first = true;
TypeList list = typeList();
TypeList::Iterator it;
for ( it = list.begin(); it != list.end(); ++it ) {
if ( ( type() & (*it) ) && ( (*it) != Pref ) ) {
label.append( ( first ? "" : "/" ) + typeLabel( *it ) );
if ( first )
first = false;
}
}
return label;
}
QString PhoneNumber::label() const
{
return typeLabel( type() );
}
PhoneNumber::TypeList PhoneNumber::typeList()
{
TypeList list;
list << Home << Work << Msg << Pref << Voice << Fax << Cell << Video
<< Bbs << Modem << Car << Isdn << Pcs << Pager;
return list;
}
PhoneNumber::TypeList PhoneNumber::supportedTypeList()
{
static TypeList list;
if ( list.count() == 0 )
list << (Home| Pref) << (Work| Pref) << Cell <<(Pcs|Pref)<< Pcs<< Home << Work << Car << (Work| Msg | Voice) << (Work| Msg) << (Home | Fax) << (Work| Fax) << Fax<< Pager << Isdn << Video << Msg << Pref << Voice;
return list;
}
QStringList PhoneNumber::supportedTypeListNames()
{
static QStringList list;
if ( list.count() == 0 )
- list << i18n("Home") << i18n("Work") << i18n("Mobile") << i18n("SIP") << i18n("VoIP") <<i18n("Home2")<< i18n("Work2") << i18n("Mobile2 (Work)") << i18n("Assistent") << i18n("Company") << i18n("Fax (Home)") << i18n("Fax (Work)") << i18n("Fax (Other)") << i18n("Pager") << i18n("ISDN") << i18n("Video") << i18n("Callback") << i18n("Primary")<< i18n("Other");
+ list << i18n("Home") << i18n("Work") << i18n("Mobile") << i18n("SIP") << i18n("VoIP") <<i18n("Home2")<< i18n("Work2") << i18n("Mobile2") << i18n("Assistent") << i18n("Company") << i18n("Fax (Home)") << i18n("Fax (Work)") << i18n("Fax (Other)") << i18n("Pager") << i18n("ISDN") << i18n("Video") << i18n("Callback") << i18n("Primary")<< i18n("Other");
return list;
}
int PhoneNumber::typeListIndex4Type(int type )
{
TypeList list = supportedTypeList();
int i = 0;
while ( i < list.count() ) {
if ( list [i] == type )
return i;
++i;
}
return list.count()-1;
}
QString PhoneNumber::label( int type )
{
return typeLabel( type );
}
QString PhoneNumber::typeLabel( int type )
{
if ((type & Cell) == Cell)
return i18n("Mobile");
if ((type & Home) == Home) {
if ((type & Pref) == Pref)
return i18n("Home");
if ((type & Fax) == Fax)
return i18n("Fax (Home)");
return i18n("Home2");
}
if ((type & Work) == Work) {
if ((type & Pref) == Pref)
return i18n("Work");
if ((type & Fax) == Fax)
return i18n("Fax (Work)");
if ((type & Msg) == Msg) {
if ((type & Voice) == Voice)
return i18n("Assistent");
return i18n("Company");
}
return i18n("Work2");
}
if ((type & Pcs) == Pcs) {
if ((type & Pref) == Pref)
return i18n("SIP");
return i18n("VoIP");
}
if ((type & Car) == Car)
- return i18n("Mobile2 (Work)");
+ return i18n("Mobile2");
if ((type & Pager) == Pager)
return i18n("Pager");
if ((type & Isdn) == Isdn)
return i18n("ISDN");
if ((type & Video) == Video)
return i18n("Video");
if ((type & Msg) == Msg)
return i18n("Callback");
if ((type & Fax) == Fax)
return i18n("Fax (Other)");
if ((type & Pref) == Pref)
return i18n("Primary");
return i18n("Other");
#if 0
QString 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")+" ";
if ((type & Fax) == Fax)
typeString += i18n("Fax");
else if ((type & Msg) == Msg)
typeString += i18n("Messenger");
else if ((type & Video) == Video)
typeString += i18n("Video");
else if ((type & Bbs) == Bbs)
typeString += i18n("Mailbox");
else if ((type & Modem) == Modem)
typeString += i18n("Modem");
diff --git a/kaddressbook/xxport/csvimportdialog.cpp b/kaddressbook/xxport/csvimportdialog.cpp
index 4044fa8..862241e 100644
--- a/kaddressbook/xxport/csvimportdialog.cpp
+++ b/kaddressbook/xxport/csvimportdialog.cpp
@@ -67,97 +67,97 @@ CSVImportDialog::CSVImportDialog( KABC::AddressBook *ab, QWidget *parent,
: KDialogBase( Plain, i18n ( "CSV Import Dialog" ), Ok | Cancel | User1 |
User2, Ok, parent, name, true, true ),
mAdjustRows( false ),
mStartLine( 0 ),
mTextQuote( '"' ),
mDelimiter( "," ),
mAddressBook( ab )
{
initGUI();
mTypeMap.insert( i18n( "Undefined" ), Undefined );
mTypeMap.insert( KABC::Addressee::formattedNameLabel(), FormattedName );
mTypeMap.insert( KABC::Addressee::familyNameLabel(), FamilyName );
mTypeMap.insert( KABC::Addressee::givenNameLabel(), GivenName );
mTypeMap.insert( KABC::Addressee::additionalNameLabel(), AdditionalName );
mTypeMap.insert( KABC::Addressee::prefixLabel(), Prefix );
mTypeMap.insert( KABC::Addressee::suffixLabel(), Suffix );
mTypeMap.insert( KABC::Addressee::nickNameLabel(), NickName );
mTypeMap.insert( KABC::Addressee::birthdayLabel(), Birthday );
mTypeMap.insert( KABC::Addressee::homeAddressStreetLabel(), HomeAddressStreet );
mTypeMap.insert( KABC::Addressee::homeAddressLocalityLabel(),
HomeAddressLocality );
mTypeMap.insert( KABC::Addressee::homeAddressRegionLabel(), HomeAddressRegion );
mTypeMap.insert( KABC::Addressee::homeAddressPostalCodeLabel(),
HomeAddressPostalCode );
mTypeMap.insert( KABC::Addressee::homeAddressCountryLabel(),
HomeAddressCountry );
mTypeMap.insert( KABC::Addressee::homeAddressLabelLabel(), HomeAddressLabel );
mTypeMap.insert( KABC::Addressee::businessAddressStreetLabel(),
BusinessAddressStreet );
mTypeMap.insert( KABC::Addressee::businessAddressLocalityLabel(),
BusinessAddressLocality );
mTypeMap.insert( KABC::Addressee::businessAddressRegionLabel(),
BusinessAddressRegion );
mTypeMap.insert( KABC::Addressee::businessAddressPostalCodeLabel(),
BusinessAddressPostalCode );
mTypeMap.insert( KABC::Addressee::businessAddressCountryLabel(),
BusinessAddressCountry );
mTypeMap.insert( KABC::Addressee::businessAddressLabelLabel(),
BusinessAddressLabel );
mTypeMap.insert( KABC::Addressee::homePhoneLabel(), HomePhone );
mTypeMap.insert( KABC::Addressee::businessPhoneLabel(), BusinessPhone );
mTypeMap.insert( KABC::Addressee::mobilePhoneLabel(), MobilePhone );
mTypeMap.insert( KABC::Addressee::homeFaxLabel(), HomeFax );
mTypeMap.insert( KABC::Addressee::businessFaxLabel(), BusinessFax );
- mTypeMap.insert( KABC::Addressee::carPhoneLabel(), CarPhone );
+ mTypeMap.insert( KABC::Addressee::mobileWorkPhoneLabel(), MobileWorkPhone );
mTypeMap.insert( KABC::Addressee::isdnLabel(), Isdn );
mTypeMap.insert( KABC::Addressee::pagerLabel(), Pager );
mTypeMap.insert( KABC::Addressee::emailLabel(), Email );
mTypeMap.insert( KABC::Addressee::mailerLabel(), Mailer );
mTypeMap.insert( KABC::Addressee::titleLabel(), Title );
mTypeMap.insert( KABC::Addressee::roleLabel(), Role );
mTypeMap.insert( KABC::Addressee::organizationLabel(), Organization );
mTypeMap.insert( KABC::Addressee::noteLabel(), Note );
mTypeMap.insert( KABC::Addressee::urlLabel(), URL );
mTypeMap.insert( KABC::Addressee::categoryLabel(), Categories );
mCustomCounter = mTypeMap.count();
int count = mCustomCounter;
KABC::Field::List fields = mAddressBook->fields( KABC::Field::CustomCategory );
KABC::Field::List::Iterator it;
for ( it = fields.begin(); it != fields.end(); ++it, ++count )
mTypeMap.insert( (*it)->label(), count );
connect( mDelimiterBox, SIGNAL( clicked( int ) ),
this, SLOT( delimiterClicked( int ) ) );
connect( mDelimiterEdit, SIGNAL( returnPressed() ),
this, SLOT( returnPressed() ) );
connect( mDelimiterEdit, SIGNAL( textChanged ( const QString& ) ),
this, SLOT( textChanged ( const QString& ) ) );
connect( mComboLine, SIGNAL( activated( const QString& ) ),
this, SLOT( lineSelected( const QString& ) ) );
connect( mComboCodec, SIGNAL( activated( const QString& ) ),
this, SLOT( codecChanged( const QString& ) ) );
connect( mComboQuote, SIGNAL( activated( const QString& ) ),
this, SLOT( textquoteSelected( const QString& ) ) );
connect( mIgnoreDuplicates, SIGNAL( stateChanged( int ) ),
this, SLOT( ignoreDuplicatesChanged( int ) ) );
connect( mUrlRequester, SIGNAL( returnPressed( const QString& ) ),
this, SLOT( setFile( const QString& ) ) );
connect( mUrlRequester, SIGNAL( urlSelected( const QString& ) ),
this, SLOT( setFile( const QString& ) ) );
connect( mUrlRequester->lineEdit(), SIGNAL( textChanged ( const QString& ) ),
this, SLOT( urlChanged( const QString& ) ) );
connect( this, SIGNAL( user1Clicked() ),
this, SLOT( applyTemplate() ) );
connect( this, SIGNAL( user2Clicked() ),
this, SLOT( saveTemplate() ) );
// if ( QApplication::desktop()->width() < 321 )
@@ -248,97 +248,97 @@ KABC::AddresseeList CSVImportDialog::contacts() const
case URL:
a.setUrl( value );
break;
case Organization:
a.setOrganization( value );
break;
case Note:
if ( a.note().isEmpty() )
a.setNote( value );
else {
a.setNote( a.note()+"\n"+value );
}
break;
case Categories:
a.insertCategory( value );
break;
case HomePhone:
if ( !value.isEmpty() ) {
KABC::PhoneNumber number( value, KABC::PhoneNumber::Home );
a.insertPhoneNumber( number );
}
break;
case BusinessPhone:
if ( !value.isEmpty() ) {
KABC::PhoneNumber number( value, KABC::PhoneNumber::Work );
a.insertPhoneNumber( number );
}
break;
case MobilePhone:
if ( !value.isEmpty() ) {
KABC::PhoneNumber number( value, KABC::PhoneNumber::Cell );
a.insertPhoneNumber( number );
}
break;
case HomeFax:
if ( !value.isEmpty() ) {
KABC::PhoneNumber number( value, KABC::PhoneNumber::Home |
KABC::PhoneNumber::Fax );
a.insertPhoneNumber( number );
}
break;
case BusinessFax:
if ( !value.isEmpty() ) {
KABC::PhoneNumber number( value, KABC::PhoneNumber::Work |
KABC::PhoneNumber::Fax );
a.insertPhoneNumber( number );
}
break;
- case CarPhone:
+ case MobileWorkPhone:
if ( !value.isEmpty() ) {
KABC::PhoneNumber number( value, KABC::PhoneNumber::Car );
a.insertPhoneNumber( number );
}
break;
case Isdn:
if ( !value.isEmpty() ) {
KABC::PhoneNumber number( value, KABC::PhoneNumber::Isdn );
a.insertPhoneNumber( number );
}
break;
case Pager:
if ( !value.isEmpty() ) {
KABC::PhoneNumber number( value, KABC::PhoneNumber::Pager );
a.insertPhoneNumber( number );
}
break;
case HomeAddressStreet:
addrHome.setStreet( value );
break;
case HomeAddressLocality:
addrHome.setLocality( value );
break;
case HomeAddressRegion:
addrHome.setRegion( value );
break;
case HomeAddressPostalCode:
addrHome.setPostalCode( value );
break;
case HomeAddressCountry:
addrHome.setCountry( value );
break;
case HomeAddressLabel:
addrHome.setLabel( value );
break;
case BusinessAddressStreet:
addrWork.setStreet( value );
break;
case BusinessAddressLocality:
addrWork.setLocality( value );
break;
case BusinessAddressRegion:
addrWork.setRegion( value );
break;
case BusinessAddressPostalCode:
addrWork.setPostalCode( value );
diff --git a/kaddressbook/xxport/csvimportdialog.h b/kaddressbook/xxport/csvimportdialog.h
index 5f55ab2..2661420 100644
--- a/kaddressbook/xxport/csvimportdialog.h
+++ b/kaddressbook/xxport/csvimportdialog.h
@@ -36,91 +36,91 @@ $Id$
#include <qvaluelist.h>
class KURLRequester;
class QButtonGroup;
class QComboBox;
class QCheckBox;
class QLineEdit;
class QPushButton;
class QRadioButton;
class QTable;
class CSVImportDialog : public KDialogBase
{
Q_OBJECT
public:
CSVImportDialog( KABC::AddressBook *ab, QWidget *parent,
const char *name = 0 );
~CSVImportDialog();
KABC::AddresseeList contacts() const;
protected slots:
virtual void slotOk();
private slots:
void returnPressed();
void delimiterClicked( int id );
void lineSelected( const QString& line );
void textquoteSelected( const QString& mark );
void textChanged ( const QString & );
void ignoreDuplicatesChanged( int );
void setFile( const QString& );
void urlChanged( const QString& );
void codecChanged ( const QString& );
void applyTemplate();
void saveTemplate();
private:
enum { Undefined, FormattedName, FamilyName, GivenName, AdditionalName,
Prefix, Suffix, NickName, Birthday,
HomeAddressStreet, HomeAddressLocality, HomeAddressRegion,
HomeAddressPostalCode, HomeAddressCountry, HomeAddressLabel,
BusinessAddressStreet, BusinessAddressLocality, BusinessAddressRegion,
BusinessAddressPostalCode, BusinessAddressCountry,
BusinessAddressLabel,
- HomePhone, BusinessPhone, MobilePhone, HomeFax, BusinessFax, CarPhone,
+ HomePhone, BusinessPhone, MobilePhone, HomeFax, BusinessFax, MobileWorkPhone,
Isdn, Pager, Email, Mailer, Title, Role, Organization, Note, URL, Categories
};
QTable* mTable;
QButtonGroup* mDelimiterBox;
QRadioButton* mRadioComma;
QRadioButton* mRadioSemicolon;
QRadioButton* mRadioTab;
QRadioButton* mRadioSpace;
QRadioButton* mRadioOther;
QLineEdit* mDelimiterEdit;
QComboBox* mComboLine;
QComboBox* mComboQuote;
QComboBox* mComboCodec;
QCheckBox* mIgnoreDuplicates;
KURLRequester* mUrlRequester;
void initGUI();
void fillTable();
void clearTable();
void fillComboBox();
void setText( int row, int col, const QString& text );
void adjustRows( int rows );
QString getText( int row, int col );
uint posToType( int pos ) const;
int typeToPos( uint type ) const;
bool mAdjustRows;
int mStartLine;
QChar mTextQuote;
QString mDelimiter;
QString mData;
QByteArray mFileArray;
QMap<QString, uint> mTypeMap;
KABC::AddressBook *mAddressBook;
int mCustomCounter;
bool mClearTypeStore;
QValueList<int> mTypeStore;
};
#endif