Diffstat (limited to 'core/pim/addressbook/contacteditor.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/addressbook/contacteditor.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp index 52ab0f2..e034b35 100644 --- a/core/pim/addressbook/contacteditor.cpp +++ b/core/pim/addressbook/contacteditor.cpp @@ -1,14 +1,15 @@ /* * Copyright (c) 2002 Michael R. Crawford <mike@tuxnami.org> + * Copyright (C) 2002 by Stefan Eilers (eilers.stefan@epost.de) * * This file is an add-on for the OPIE Palmtop Environment * * This file may be distributed and/or modified under the terms of the * GNU General Public License version 2 as published by the Free Software * Foundation and appearing in the file LICENSE.GPL included in the pacakaging * of this file. * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * @@ -1099,38 +1100,24 @@ void ContactEditor::loadFields() { if ( *it == "Manager" ) (*lit)->setText( tr( "Manager" ) ); if ( *it == "Spouse" ) (*lit)->setText( tr( "Spouse" ) ); if ( *it == "Nickname" ) (*lit)->setText( tr( "Nickname" ) ); if ( *it == "Children" ) (*lit)->setText( tr( "Children" ) ); } - // Set DatePicker - qWarning ("**Info: %s", ent.birthday().latin1() ); - if ( !ent.birthday().isEmpty() ){ - birthdayButton->setText( ent.birthday() ); - birthdayPicker->setDate( TimeConversion::fromString ( ent.birthday() ) ); - } else - birthdayButton->setText( tr ("Unknown") ); - - qWarning ("**Info: %s", ent.anniversary().latin1() ); - if ( !ent.anniversary().isEmpty() ){ - anniversaryButton->setText( ent.anniversary() ); - anniversaryPicker->setDate( TimeConversion::fromString ( ent.birthday() ) ); - } else - anniversaryButton->setText( tr ("Unknown") ); } void ContactEditor::accept() { if ( isEmpty() ) { cleanupFields(); reject(); } else { saveEntry(); cleanupFields(); QDialog::accept(); @@ -1592,25 +1579,38 @@ void ContactEditor::setEntry( const OContact &entry ) { QString gender = ent.gender(); cmbGender->setCurrentItem( gender.toInt() ); txtNote->setText( ent.notes() ); slotCmbChooser1Change( cmbChooserField1->currentItem() ); slotCmbChooser2Change( cmbChooserField2->currentItem() ); slotCmbChooser3Change( cmbChooserField3->currentItem() ); slotAddressTypeChange( cmbAddress->currentItem() ); - loadFields(); + // loadFields(); :SX + + // Set DatePicker + if ( !ent.birthday().isNull() ){ + birthdayButton->setText( TimeString::numberDateString( ent.birthday() ) ); + birthdayPicker->setDate( ent.birthday() ); + } else + birthdayButton->setText( tr ("Unknown") ); + + if ( !ent.anniversary().isNull() ){ + anniversaryButton->setText( TimeString::numberDateString( ent.anniversary() ) ); + anniversaryPicker->setDate( ent.anniversary() ); + } else + anniversaryButton->setText( tr ("Unknown") ); } void ContactEditor::saveEntry() { 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 ) ); useFullName = FALSE; @@ -1882,23 +1882,23 @@ void ContactEditor::setPersonalView( bool personal ) cmbCat->show(); labCat->show(); } } void ContactEditor::slotAnniversaryDateChanged( int year, int month, int day) { QDate date; date.setYMD( year, month, day ); QString dateString = TimeString::numberDateString( date ); anniversaryButton->setText( dateString ); - ent.setAnniversary ( dateString ); + ent.setAnniversary ( date ); } void ContactEditor::slotBirthdayDateChanged( int year, int month, int day) { QDate date; date.setYMD( year, month, day ); QString dateString = TimeString::numberDateString( date ); birthdayButton->setText( dateString ); - ent.setBirthday ( dateString ); + ent.setBirthday ( date ); } |