author | eilers <eilers> | 2002-10-14 16:53:10 (UTC) |
---|---|---|
committer | eilers <eilers> | 2002-10-14 16:53:10 (UTC) |
commit | a2795a80a9421ae15cded191755dc8e4701f0c77 (patch) (side-by-side diff) | |
tree | f556efc4a91786425c9a1597f22b9f77edc78237 | |
parent | 03d355295dd4fd6c37e54d281280127c0cf8a068 (diff) | |
download | opie-a2795a80a9421ae15cded191755dc8e4701f0c77.zip opie-a2795a80a9421ae15cded191755dc8e4701f0c77.tar.gz opie-a2795a80a9421ae15cded191755dc8e4701f0c77.tar.bz2 |
Some final language fixes
-rw-r--r-- | core/pim/addressbook/TODO | 3 | ||||
-rw-r--r-- | core/pim/addressbook/abtable.cpp | 2 | ||||
-rw-r--r-- | core/pim/addressbook/contacteditor.cpp | 84 |
3 files changed, 63 insertions, 26 deletions
diff --git a/core/pim/addressbook/TODO b/core/pim/addressbook/TODO index 83e3c6b..a4fc29a 100644 --- a/core/pim/addressbook/TODO +++ b/core/pim/addressbook/TODO @@ -1,16 +1,19 @@ Stuff todo: Urgent: - "Nonenglish" translation bug has to be fixed. Important: - Finishing of new View functions (List, Phonebook...) - Reload if contacts were changed externally +- "What's this" should be added +- The names of the countries are sorted by there english names, only.. + Even if they are translated.. :S Less important: - Find widget should be replaced by something like qpdf has. - The picker (alphabetical sort widget) should be placed verticaly or horizontally (configurable)
\ No newline at end of file diff --git a/core/pim/addressbook/abtable.cpp b/core/pim/addressbook/abtable.cpp index 08c6d0a..70c070f 100644 --- a/core/pim/addressbook/abtable.cpp +++ b/core/pim/addressbook/abtable.cpp @@ -101,65 +101,65 @@ QWidget *AbPickItem::createEditor() const cur = combo->count(); combo->insertItem(*it); } combo->setCurrentItem(cur); return combo; } void AbPickItem::setContentFromEditor( QWidget *w ) { if ( w->inherits("QComboBox") ) setText( ( (QComboBox*)w )->currentText() ); else QTableItem::setContentFromEditor( w ); } /*! \class AbTable abtable.h \brief QTable based class for showing a list of entries */ AbTable::AbTable( const QValueList<int> *order, QWidget *parent, const char *name ) // #ifdef QT_QTABLE_NOHEADER_CONSTRUCTOR // : QTable( 0, 0, parent, name, TRUE ), // #else : QTable( parent, name ), // #endif lastSortCol( -1 ), asc( TRUE ), intFields( order ), currFindRow( -2 ), mCat( 0 ), - m_contactdb ("addressbook") + m_contactdb ("addressbook", 0l, 0l, false) // Handle syncing myself.. ! { mCat.load( categoryFileName() ); setSelectionMode( NoSelection ); init(); setSorting( TRUE ); connect( this, SIGNAL(clicked(int,int,int,const QPoint &)), this, SLOT(itemClicked(int,int)) ); } AbTable::~AbTable() { } void AbTable::init() { showChar = '\0'; setNumRows( 0 ); setNumCols( 2 ); horizontalHeader()->setLabel( 0, tr( "Full Name" )); horizontalHeader()->setLabel( 1, tr( "Contact" )); setLeftMargin( 0 ); verticalHeader()->hide(); columnVisible = true; } void AbTable::columnClicked( int col ) { if ( !sorting() ) return; if ( lastSortCol == -1 ) diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp index bae3a2b..e7f2ebd 100644 --- a/core/pim/addressbook/contacteditor.cpp +++ b/core/pim/addressbook/contacteditor.cpp @@ -311,65 +311,64 @@ void ContactEditor::init() { } if ( (*it) == "Business Country" ) { hasCountry = TRUE; // slDynamicEntries->remove( it ); continue; } if ( (*it) == "Home City" ) { hasCity = TRUE; // slDynamicEntries->remove( it ); continue; } if ( (*it) == "Home State" ) { hasState = TRUE; // slDynamicEntries->remove( it ); continue; } if ( (*it) == "Home Zip" ) { hasZip = TRUE; // slDynamicEntries->remove( it ); continue; } if ( (*it) == "Home Country" ) { hasCountry = TRUE; // slDynamicEntries->remove( it ); continue; } - slDynamicEntries.append( *it ); } } QVBoxLayout *vb = new QVBoxLayout( this ); tabMain = new QTabWidget( this ); vb->addWidget( tabMain ); QWidget *tabViewport = new QWidget ( tabMain ); vb = new QVBoxLayout( tabViewport ); svGeneral = new QScrollView( tabViewport ); vb->addWidget( svGeneral, 0, 0 ); svGeneral->setResizePolicy( QScrollView::AutoOneFit ); svGeneral->setFrameStyle( QFrame::NoFrame ); QWidget *container = new QWidget( svGeneral->viewport() ); svGeneral->addChild( container ); QGridLayout *gl = new QGridLayout( container, 1, 1, 2, 4 ); gl->setResizeMode( QLayout::FreeResize ); btnFullName = new QPushButton( tr( "Full Name..." ), container ); gl->addWidget( btnFullName, 0, 0 ); txtFullName = new QLineEdit( container ); gl->addWidget( txtFullName, 0, 1 ); QLabel *l = new QLabel( tr( "Job Title" ), container ); gl->addWidget( l, 1, 0 ); txtJobTitle = new QLineEdit( container ); @@ -679,73 +678,76 @@ void ContactEditor::init() { cmbCountry->setMaximumWidth( 135 ); gl->addMultiCellWidget( cmbCountry, 5, 5, 1, 2 ); cmbChooserField4 = new QComboBox( FALSE, container ); cmbChooserField4->setMaximumWidth( 90 ); gl->addWidget( cmbChooserField4, 6, 0 ); txtChooserField4 = new QLineEdit( container ); gl->addMultiCellWidget( txtChooserField4, 6, 6, 1, 2 ); QSpacerItem *space = new QSpacerItem(1,1, QSizePolicy::Maximum, QSizePolicy::MinimumExpanding ); gl->addItem( space, 7, 0 ); tabMain->insertTab( tabViewport, tr( "Address" ) ); tabViewport = new QWidget ( tabMain ); vb = new QVBoxLayout( tabViewport ); svDetails = new QScrollView( tabViewport ); vb->addWidget( svDetails, 0, 0 ); svDetails->setResizePolicy( QScrollView::AutoOneFit ); svDetails->setFrameStyle( QFrame::NoFrame ); container = new QWidget( svDetails->viewport() ); svDetails->addChild( container ); gl = new QGridLayout( container, 1, 2, 2, 4 ); + // Create Labels and lineedit fields for every dynamic entry QStringList::ConstIterator it = slDynamicEntries.begin(); for (i = 0; it != slDynamicEntries.end(); i++, ++it) { - l = new QLabel( *it, container ); + l = new QLabel( QString::null , container ); listName.append( l ); gl->addWidget( l, i, 0 ); QLineEdit *e = new QLineEdit( container ); listValue.append( e ); gl->addWidget( e, i, 1); } + // Fill labels with names.. + loadFields(); l = new QLabel( tr("Gender"), container ); gl->addWidget( l, slDynamicEntries.count(), 0 ); cmbGender = new QComboBox( container ); cmbGender->insertItem( "", 0 ); cmbGender->insertItem( tr("Male"), 1); cmbGender->insertItem( tr("Female"), 2); gl->addWidget( cmbGender, slDynamicEntries.count(), 1 ); tabMain->insertTab( tabViewport, tr( "Details" ) ); dlgNote = new QDialog( this, "Note Dialog", TRUE ); dlgNote->setCaption( tr("Enter Note") ); QVBoxLayout *vbNote = new QVBoxLayout( dlgNote ); txtNote = new QMultiLineEdit( dlgNote ); vbNote->addWidget( txtNote ); connect( btnNote, SIGNAL(clicked()), this, SLOT(slotNote()) ); dlgName = new QDialog( this, "Name Dialog", TRUE ); dlgName->setCaption( tr("Edit Name") ); gl = new QGridLayout( dlgName, 5, 2, 2, 3 ); l = new QLabel( tr("First Name"), dlgName ); gl->addWidget( l, 0, 0 ); txtFirstName = new QLineEdit( dlgName ); gl->addWidget( txtFirstName, 0, 1 ); l = new QLabel( tr("Middle Name"), dlgName ); gl->addWidget( l, 1, 0 ); txtMiddleName = new QLineEdit( dlgName ); gl->addWidget( txtMiddleName, 1, 1 ); @@ -983,65 +985,97 @@ void ContactEditor::slotAddressTypeChange( int index ) { txtCity->setText( slHomeAddress[3] ); txtState->setText( slHomeAddress[4] ); txtZip->setText( slHomeAddress[5] ); QLineEdit *txtTmp = cmbCountry->lineEdit(); txtTmp->setText( slHomeAddress[6] ); } } void ContactEditor::slotFullNameChange( const QString &textChanged ) { int index = cmbFileAs->currentItem(); cmbFileAs->clear(); cmbFileAs->insertItem( parseName( textChanged, 0 ) ); cmbFileAs->insertItem( parseName( textChanged, 1 ) ); cmbFileAs->insertItem( parseName( textChanged, 2 ) ); cmbFileAs->insertItem( parseName( textChanged, 3 ) ); cmbFileAs->setCurrentItem( index ); useFullName = TRUE; } void ContactEditor::loadFields() { QStringList::ConstIterator it; QListIterator<QLabel> lit( listName ); for ( it = slDynamicEntries.begin(); *lit; ++lit, ++it) { - (*lit)->setText( *it ); + + if ( *it == "Department" ) + (*lit)->setText( tr( "Department" ) ); + + if ( *it == "Company" ) + (*lit)->setText( tr( "Company" ) ); + + if ( *it == "Office" ) + (*lit)->setText( tr( "Office" ) ); + + if ( *it == "Profession" ) + (*lit)->setText( tr( "Profession" ) ); + + if ( *it == "Assistant" ) + (*lit)->setText( tr( "Assistant" ) ); + + if ( *it == "Manager" ) + (*lit)->setText( tr( "Manager" ) ); + + if ( *it == "Spouse" ) + (*lit)->setText( tr( "Spouse" ) ); + + if ( *it == "Birthday" ) + (*lit)->setText( tr( "Birthday" ) ); + + if ( *it == "Anniversary" ) + (*lit)->setText( tr( "Anniversary" ) ); + + if ( *it == "Nickname" ) + (*lit)->setText( tr( "Nickname" ) ); + + if ( *it == "Children" ) + (*lit)->setText( tr( "Children" ) ); } } void ContactEditor::accept() { if ( isEmpty() ) { cleanupFields(); reject(); } else { saveEntry(); cleanupFields(); QDialog::accept(); } } void ContactEditor::slotNote() { dlgNote->showMaximized(); if ( !dlgNote->exec() ) { txtNote->setText( ent.notes() ); } } void ContactEditor::slotName() { QString tmpName; if (useFullName == TRUE) { txtFirstName->setText( parseName(txtFullName->text(), NAME_F) ); txtMiddleName->setText( parseName(txtFullName->text(), NAME_M) ); txtLastName->setText( parseName(txtFullName->text(), NAME_L) ); txtSuffix->setText( parseName(txtFullName->text(), NAME_S) ); @@ -1345,95 +1379,95 @@ void ContactEditor::setEntry( const OContact &entry ) { (*slHomeAddress)[1] = ent.homeStreet2(); (*slBusinessAddress)[1] = ent.businessStreet2(); } if (hasPOBox) { (*slHomeAddress)[2] = ent.homePOBox(); (*slBusinessAddress)[2] = ent.businessPOBox(); } */ if (hasCity) { slHomeAddress[3] = ent.homeCity(); slBusinessAddress[3] = ent.businessCity(); } if (hasState) { slHomeAddress[4] = ent.homeState(); slBusinessAddress[4] = ent.businessState(); } if (hasZip) { slHomeAddress[5] = ent.homeZip(); slBusinessAddress[5] = ent.businessZip(); } 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 == tr( "Department" ) ) + if ( *it == "Department" ) (*itLE)->setText( ent.department() ); - if ( *it == tr( "Company" ) ) + if ( *it == "Company" ) (*itLE)->setText( ent.company() ); - if ( *it == tr( "Office" ) ) + if ( *it == "Office" ) (*itLE)->setText( ent.office() ); - if ( *it == tr( "Profession" ) ) + if ( *it == "Profession" ) (*itLE)->setText( ent.profession() ); - if ( *it == tr( "Assistant" ) ) + if ( *it == "Assistant" ) (*itLE)->setText( ent.assistant() ); - if ( *it == tr( "Manager" ) ) + if ( *it == "Manager" ) (*itLE)->setText( ent.manager() ); - if ( *it == tr( "Spouse" ) ) + if ( *it == "Spouse" ) (*itLE)->setText( ent.spouse() ); - if ( *it == tr( "Birthday" ) ) + if ( *it == "Birthday" ) (*itLE)->setText( ent.birthday() ); - if ( *it == tr( "Anniversary" ) ) + if ( *it == "Anniversary" ) (*itLE)->setText( ent.anniversary() ); - if ( *it == tr( "Nickname" ) ) + if ( *it == "Nickname" ) (*itLE)->setText( ent.nickname() ); - if ( *it == tr( "Children" ) ) + if ( *it == "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" ) ) *itV = ent.businessPhone(); /* if ( *it == "Business 2 Phone" ) *itV = ent.business2Phone(); */ if ( ( *it == "Business Fax") || ( *it == "Work Fax" ) ) *itV = ent.businessFax(); if ( ( *it == "Business Mobile" ) || ( *it == "work Mobile" ) ) *itV = ent.businessMobile(); /* if ( *it == "Company Phone" ) *itV = ent.companyPhone(); */ if ( *it == "Default Email" ) *itV = ent.defaultEmail(); if ( *it == "Emails" ) *itV = ent.emailList().join(", "); // :SX if ( *it == "Home Phone" ) *itV = ent.homePhone(); /* if ( *it == "Home 2 Phone" ) @@ -1543,95 +1577,95 @@ void ContactEditor::saveEntry() { ent.setHomeStreet2( (*slHomeAddress)[1] ); ent.setBusinessStreet2( (*slBusinessAddress)[1] ); } if (hasPOBox) { ent.setHomePOBox( (*slHomeAddress)[2] ); ent.setBusinessPOBox( (*slBusinessAddress)[2] ); } */ if (hasCity) { ent.setHomeCity( slHomeAddress[3] ); ent.setBusinessCity( slBusinessAddress[3] ); } if (hasState) { ent.setHomeState( slHomeAddress[4] ); ent.setBusinessState( slBusinessAddress[4] ); } if (hasZip) { ent.setHomeZip( slHomeAddress[5] ); ent.setBusinessZip( slBusinessAddress[5] ); } 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 == tr( "Department" ) ) + if ( *it == "Department" ) ent.setDepartment( (*itLE)->text() ); - if ( *it == tr( "Company" ) ) + if ( *it == "Company" ) ent.setCompany( (*itLE)->text() ); - if ( *it == tr( "Office" ) ) + if ( *it == "Office" ) ent.setOffice( (*itLE)->text() ); - if ( *it == tr( "Profession" ) ) + if ( *it == "Profession" ) ent.setProfession( (*itLE)->text() ); - if ( *it == tr( "Assistant" ) ) + if ( *it == "Assistant" ) ent.setAssistant( (*itLE)->text() ); - if ( *it == tr( "Manager" ) ) + if ( *it == "Manager" ) ent.setManager( (*itLE)->text() ); - if ( *it == tr( "Spouse" ) ) + if ( *it == "Spouse" ) ent.setSpouse( (*itLE)->text() ); - if ( *it == tr( "Birthday" ) ) + if ( *it == "Birthday" ) ent.setBirthday( (*itLE)->text() ); - if ( *it == tr( "Anniversary" ) ) + if ( *it == "Anniversary" ) ent.setAnniversary( (*itLE)->text() ); - if ( *it == tr( "Nickname" ) ) + if ( *it == "Nickname" ) ent.setNickname( (*itLE)->text() ); - if ( *it == tr( "Children" ) ) + if ( *it == "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" ) ) ent.setBusinessPhone( *itV ); /* if ( *it == tr("Business 2 Phone" ) ent.setBusiness2Phone( *itV ); */ if ( ( *it == "Business Fax" ) || ( *it == "Work Fax" ) ) ent.setBusinessFax( *itV ); if ( ( *it == "Business Mobile" ) || ( *it == "Work Mobile" ) ) ent.setBusinessMobile( *itV ); /* if ( *it == "Company Phone" ) ent.setCompanyPhone( *itV ); */ //if ( *it == "Default Email" ) //ent.setDefaultEmail( *itV ); if ( *it == "Emails" ){ QString allemail; QString defaultmail; parseEmailFrom( *itV, defaultmail, allemail ); // ent.clearEmails(); ent.setDefaultEmail( defaultmail ); ent.setEmails( allemail ); |