author | eilers <eilers> | 2002-10-14 09:26:18 (UTC) |
---|---|---|
committer | eilers <eilers> | 2002-10-14 09:26:18 (UTC) |
commit | 0bccef01b70fec98e744fab286f5ea443287cdad (patch) (side-by-side diff) | |
tree | 3a602e633dcbe81eca22f490402d39467c4eb32a | |
parent | 59d6018e53537e15d27cd0174adefba2ec8b8f6e (diff) | |
download | opie-0bccef01b70fec98e744fab286f5ea443287cdad.zip opie-0bccef01b70fec98e744fab286f5ea443287cdad.tar.gz opie-0bccef01b70fec98e744fab286f5ea443287cdad.tar.bz2 |
Last patch for language bug. I am not really happy with it, but it should work now.
Please use the current release of libopie with this application. Otherwise the
app will fail !
-rw-r--r-- | core/pim/addressbook/addressbook.cpp | 3 | ||||
-rw-r--r-- | core/pim/addressbook/contacteditor.cpp | 88 |
2 files changed, 53 insertions, 38 deletions
diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp index 472b13e..2eb9ddf 100644 --- a/core/pim/addressbook/addressbook.cpp +++ b/core/pim/addressbook/addressbook.cpp @@ -26,17 +26,17 @@ #include "addresssettings.h" #include "addressbook.h" #include <opie/ofileselector.h> #include <opie/ofiledialog.h> #include <qpe/qpeapplication.h> #include <qpe/config.h> -#include <qpe/contact.h> +#include <opie/ocontact.h> #ifndef MAKE_FOR_SHARP_ROM #include <qpe/finddialog.h> #endif #include <qpe/global.h> #include <qpe/resource.h> #include <qpe/ir.h> @@ -852,16 +852,17 @@ void AddressbookWindow::initFields() } else { QString str; str = getenv("HOME"); str += "/Settings/AddressBook.conf"; QFile::remove( str ); } + if ( slOrderedFields.count() > 0 ) { for( QStringList::ConstIterator it = slOrderedFields.begin(); it != slOrderedFields.end(); ++it ) { QValueList<int>::ConstIterator itVl; QStringList::ConstIterator itVis; itVl = allFields.begin(); for ( itVis = visibleFields.begin(); itVis != visibleFields.end() && itVl != allFields.end(); diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp index b01583f..bae3a2b 100644 --- a/core/pim/addressbook/contacteditor.cpp +++ b/core/pim/addressbook/contacteditor.cpp @@ -79,16 +79,18 @@ void ContactEditor::init() { slBusinessAddress = new QStringList; slChooserNames = new QStringList; slChooserValues = new QStringList; slDynamicEntries = new QStringList; */ //*slDynamicEntries = *slOrdered; + QStringList trlChooserNames; + for (i = 0; i <= 6; i++) { slHomeAddress.append( "" ); slBusinessAddress.append( "" ); } { hasGender = FALSE; hasTitle = FALSE; @@ -98,100 +100,112 @@ void ContactEditor::init() { hasStreet2 = FALSE; hasPOBox = FALSE; hasCity = FALSE; hasState = FALSE; hasZip = FALSE; hasCountry = FALSE; QStringList::ConstIterator it = slOrdered.begin(); + for ( i = 0; it != slOrdered.end(); i++, ++it ) { if ( (*it) == "Business Fax" ) { - slChooserNames.append( tr( "Business Fax" ) ); + trlChooserNames.append( tr( "Business Fax" ) ); + slChooserNames.append( *it ); slChooserValues.append("" ); //slDynamicEntries->remove( it ); continue; } if ( (*it) == "Home Fax" ) { - slChooserNames.append( tr( "Home Fax" ) ); + trlChooserNames.append( tr( "Home Fax" ) ); + slChooserNames.append( *it ); slChooserValues.append("" ); //slDynamicEntries->remove( it ); continue; } if ( (*it) == "Business Phone" ) { - slChooserNames.append( tr( "Business Phone" ) ); + trlChooserNames.append( tr( "Business Phone" ) ); + slChooserNames.append( *it ); slChooserValues.append( "" ); //slDynamicEntries->remove( it ); continue; } if ( (*it) == "Home Phone" ) { - slChooserNames.append( tr( "Home Phone" ) ); + trlChooserNames.append( tr( "Home Phone" ) ); + slChooserNames.append( *it ); slChooserValues.append( "" ); //slDynamicEntries->remove( it ); continue; } /* if ( (*it).right( 2 ) == tr( "IM" ) ) { slChooserNames.append( *it ); slChooserValues.append( "" ); //slDynamicEntries->remove( it ); continue; } */ if ( (*it) == "Business Mobile" ) { - slChooserNames.append( tr( "Business Mobile" ) ); + trlChooserNames.append( tr( "Business Mobile" ) ); + slChooserNames.append( *it ); slChooserValues.append( "" ); //slDynamicEntries->remove( it ); continue; } if ( (*it) == "Home Mobile" ) { - slChooserNames.append( tr( "Home Mobile" ) ); + trlChooserNames.append( tr( "Home Mobile" ) ); + slChooserNames.append( *it ); slChooserValues.append( "" ); //slDynamicEntries->remove( it ); continue; } if ( (*it) == "Business WebPage" ) { - slChooserNames.append( tr( "Business WebPage" ) ); + trlChooserNames.append( tr( "Business WebPage" ) ); + slChooserNames.append( *it ); slChooserValues.append( "" ); //slDynamicEntries->remove( it ); continue; } if ( (*it) == "Home Web Page" ) { - slChooserNames.append( tr( "Home Web Page" ) ); + trlChooserNames.append( tr( "Home Web Page" ) ); + slChooserNames.append( *it ); slChooserValues.append( "" ); //slDynamicEntries->remove( it ); continue; } if ( (*it) == "Business Pager" ) { - slChooserNames.append( tr( "Business Pager" ) ); + trlChooserNames.append( tr( "Business Pager" ) ); + slChooserNames.append( *it ); slChooserValues.append( "" ); //slDynamicEntries->remove( it ); continue; } if ( *it == "Default Email" ) { - slChooserNames.append( tr( "Default Email" ) ); + trlChooserNames.append( tr( "Default Email" ) ); + slChooserNames.append( *it ); slChooserValues.append( "" ); //slDynamicEntries->remove( it ); continue; } if ( *it == "Emails" ) { - slChooserNames.append( tr( "Emails" ) ); + trlChooserNames.append( tr( "Emails" ) ); + slChooserNames.append( *it ); slChooserValues.append( "" ); //slDynamicEntries->remove( it ); continue; } if ( *it == "Name Title" || *it == "First Name" || *it == "Middle Name" || *it == "Last Name" || *it == "File As" || *it == "Default Email" || *it == "Emails" || *it == "Groups" ) continue; @@ -744,20 +758,20 @@ void ContactEditor::init() { gl->addWidget( l, 3, 0 ); txtSuffix = new QLineEdit( dlgName ); gl->addWidget( txtSuffix, 3, 1 ); space = new QSpacerItem(1,1, QSizePolicy::Maximum, QSizePolicy::MinimumExpanding ); gl->addItem( space, 4, 0 ); - cmbChooserField1->insertStringList( slChooserNames ); - cmbChooserField2->insertStringList( slChooserNames ); - cmbChooserField3->insertStringList( slChooserNames ); - cmbChooserField4->insertStringList( slChooserNames ); + cmbChooserField1->insertStringList( trlChooserNames ); + cmbChooserField2->insertStringList( trlChooserNames ); + cmbChooserField3->insertStringList( trlChooserNames ); + cmbChooserField4->insertStringList( trlChooserNames ); cmbChooserField1->setCurrentItem( 0 ); cmbChooserField2->setCurrentItem( 1 ); cmbChooserField3->setCurrentItem( 2 ); connect( btnFullName, SIGNAL(clicked()), this, SLOT(slotName()) ); connect( txtFullName, SIGNAL(textChanged(const QString &)), this, SLOT(slotFullNameChange(const QString &)) ); @@ -1355,47 +1369,47 @@ void ContactEditor::setEntry( const OContact &entry ) { if (hasCountry) { slHomeAddress[6] = ent.homeCountry(); slBusinessAddress[6] = ent.businessCountry(); } QStringList::ConstIterator it; QListIterator<QLineEdit> itLE( listValue ); for ( it = slDynamicEntries.begin(); it != slDynamicEntries.end(); ++it, ++itLE) { - if ( *it =="Department" ) + if ( *it == tr( "Department" ) ) (*itLE)->setText( ent.department() ); - if ( *it == "Company" ) + if ( *it == tr( "Company" ) ) (*itLE)->setText( ent.company() ); - if ( *it == "Office" ) + if ( *it == tr( "Office" ) ) (*itLE)->setText( ent.office() ); - if ( *it == "Profession" ) + if ( *it == tr( "Profession" ) ) (*itLE)->setText( ent.profession() ); - if ( *it == "Assistant" ) + if ( *it == tr( "Assistant" ) ) (*itLE)->setText( ent.assistant() ); - if ( *it == "Manager" ) + if ( *it == tr( "Manager" ) ) (*itLE)->setText( ent.manager() ); - if ( *it == "Spouse" ) + if ( *it == tr( "Spouse" ) ) (*itLE)->setText( ent.spouse() ); - if ( *it == "Birthday" ) + if ( *it == tr( "Birthday" ) ) (*itLE)->setText( ent.birthday() ); - if ( *it == "Anniversary" ) + if ( *it == tr( "Anniversary" ) ) (*itLE)->setText( ent.anniversary() ); - if ( *it == "Nickname" ) + if ( *it == tr( "Nickname" ) ) (*itLE)->setText( ent.nickname() ); - if ( *it == "Children" ) + if ( *it == tr( "Children" ) ) (*itLE)->setText( ent.children() ); } QStringList::Iterator itV; for ( it = slChooserNames.begin(), itV = slChooserValues.begin(); it != slChooserNames.end(); ++it, ++itV ) { if ( ( *it == "Business Phone") || ( *it == "Work Phone" ) ) @@ -1553,47 +1567,47 @@ void ContactEditor::saveEntry() { if (hasCountry) { ent.setHomeCountry( slHomeAddress[6] ); ent.setBusinessCountry( slBusinessAddress[6] ); } QStringList::ConstIterator it; QListIterator<QLineEdit> itLE( listValue ); for ( it = slDynamicEntries.begin(); it != slDynamicEntries.end(); ++it, ++itLE) { - if ( *it == "Department" ) + if ( *it == tr( "Department" ) ) ent.setDepartment( (*itLE)->text() ); - if ( *it == "Company" ) + if ( *it == tr( "Company" ) ) ent.setCompany( (*itLE)->text() ); - if ( *it == "Office" ) + if ( *it == tr( "Office" ) ) ent.setOffice( (*itLE)->text() ); - if ( *it == "Profession" ) + if ( *it == tr( "Profession" ) ) ent.setProfession( (*itLE)->text() ); - if ( *it == "Assistant" ) + if ( *it == tr( "Assistant" ) ) ent.setAssistant( (*itLE)->text() ); - if ( *it == "Manager" ) + if ( *it == tr( "Manager" ) ) ent.setManager( (*itLE)->text() ); - if ( *it == "Spouse" ) + if ( *it == tr( "Spouse" ) ) ent.setSpouse( (*itLE)->text() ); - if ( *it == "Birthday" ) + if ( *it == tr( "Birthday" ) ) ent.setBirthday( (*itLE)->text() ); - if ( *it == "Anniversary" ) + if ( *it == tr( "Anniversary" ) ) ent.setAnniversary( (*itLE)->text() ); - if ( *it == "Nickname" ) + if ( *it == tr( "Nickname" ) ) ent.setNickname( (*itLE)->text() ); - if ( *it == "Children" ) + if ( *it == tr( "Children" ) ) ent.setChildren( (*itLE)->text() ); } QStringList::ConstIterator itV; for ( it = slChooserNames.begin(), itV = slChooserValues.begin(); it != slChooserNames.end(); ++it, ++itV ) { if ( ( *it == "Business Phone" ) || ( *it == "Work Phone" ) ) |