-rw-r--r-- | kaddressbook/addresseeeditorwidget.cpp | 56 | ||||
-rw-r--r-- | kaddressbook/mainembedded.cpp | 15 | ||||
-rw-r--r-- | kaddressbook/nameeditdialog.cpp | 7 |
3 files changed, 58 insertions, 20 deletions
diff --git a/kaddressbook/addresseeeditorwidget.cpp b/kaddressbook/addresseeeditorwidget.cpp index 3cfc1f2..826c69b 100644 --- a/kaddressbook/addresseeeditorwidget.cpp +++ b/kaddressbook/addresseeeditorwidget.cpp | |||
@@ -89,3 +89,2 @@ AddresseeEditorWidget::AddresseeEditorWidget( KABCore *core, bool isExtension, | |||
89 | 89 | ||
90 | kdDebug(5720) << "AddresseeEditorWidget()" << endl; | ||
91 | mFormattedNameType = NameEditDialog::CustomName; | 90 | mFormattedNameType = NameEditDialog::CustomName; |
@@ -634,2 +633,3 @@ void AddresseeEditorWidget::setupTab2() | |||
634 | mBirthdayPicker = new KDateEdit( tab2 ); | 633 | mBirthdayPicker = new KDateEdit( tab2 ); |
634 | mBirthdayPicker->toggleDateFormat(); | ||
635 | mBirthdayPicker->setHandleInvalid( true ); | 635 | mBirthdayPicker->setHandleInvalid( true ); |
@@ -949,3 +949,2 @@ void AddresseeEditorWidget::load() | |||
949 | { | 949 | { |
950 | kdDebug(5720) << "AddresseeEditorWidget::load()" << endl; | ||
951 | 950 | ||
@@ -1030,3 +1029,5 @@ void AddresseeEditorWidget::save() | |||
1030 | { | 1029 | { |
1031 | if ( !mDirty ) return; | 1030 | if ( !dirty() ) { |
1031 | return; | ||
1032 | } | ||
1032 | 1033 | ||
@@ -1036,7 +1037,13 @@ void AddresseeEditorWidget::save() | |||
1036 | mAddressee.setNote( mNoteEdit->text() ); | 1037 | mAddressee.setNote( mNoteEdit->text() ); |
1037 | if ( mBirthdayPicker->inputIsValid() ) | 1038 | if ( mBirthdayPicker->inputIsValid() ) { |
1038 | mAddressee.setBirthday( QDateTime( mBirthdayPicker->date() ) ); | 1039 | QDate da = mBirthdayPicker->date(); |
1039 | else | 1040 | if ( da > QDate::currentDate() ) |
1041 | da.setYMD(da.year()-100, da.month(), da.day() ); | ||
1042 | mAddressee.setBirthday( QDateTime( da ) ); | ||
1043 | qDebug("bday %s ",da.toString().latin1()); | ||
1044 | } | ||
1045 | else { | ||
1040 | mAddressee.setBirthday( QDateTime() ); | 1046 | mAddressee.setBirthday( QDateTime() ); |
1041 | 1047 | mBirthdayPicker->clear(); | |
1048 | } | ||
1042 | mAddressee.setNickName( mNicknameEdit->text() ); | 1049 | mAddressee.setNickName( mNicknameEdit->text() ); |
@@ -1064,5 +1071,2 @@ void AddresseeEditorWidget::save() | |||
1064 | if ( mAnniversaryPicker->inputIsValid() ) { | 1071 | if ( mAnniversaryPicker->inputIsValid() ) { |
1065 | |||
1066 | //US mAddressee.insertCustom( "KADDRESSBOOK", "X-Anniversary", | ||
1067 | //US mAnniversaryPicker->date().toString( Qt::ISODate ) ); | ||
1068 | QString dt = KGlobal::locale()->formatDate(mAnniversaryPicker->date(), true, KLocale::ISODate); | 1072 | QString dt = KGlobal::locale()->formatDate(mAnniversaryPicker->date(), true, KLocale::ISODate); |
@@ -1070,4 +1074,6 @@ void AddresseeEditorWidget::save() | |||
1070 | } | 1074 | } |
1071 | else | 1075 | else { |
1072 | mAddressee.removeCustom( "KADDRESSBOOK", "X-Anniversary" ); | 1076 | mAddressee.removeCustom( "KADDRESSBOOK", "X-Anniversary" ); |
1077 | mAnniversaryPicker->clear(); | ||
1078 | } | ||
1073 | 1079 | ||
@@ -1116,2 +1122,22 @@ bool AddresseeEditorWidget::dirty() | |||
1116 | { | 1122 | { |
1123 | |||
1124 | if ( ! mDirty ) { | ||
1125 | if ( mBirthdayPicker->inputIsValid() ) { | ||
1126 | QDate da = mBirthdayPicker->date(); | ||
1127 | if ( !(da == mAddressee.birthday().date())) | ||
1128 | mDirty = true; | ||
1129 | } | ||
1130 | else { | ||
1131 | mBirthdayPicker->clear(); | ||
1132 | } | ||
1133 | if ( mAnniversaryPicker->inputIsValid() ) { | ||
1134 | QDate da = mAnniversaryPicker->date(); | ||
1135 | if ( da != KGlobal::locale()->readDate( mAddressee.custom("KADDRESSBOOK", "X-Anniversary" ), | ||
1136 | "%Y-%m-%d")) | ||
1137 | mDirty = true; | ||
1138 | } | ||
1139 | else { | ||
1140 | mAnniversaryPicker->clear(); | ||
1141 | } | ||
1142 | } | ||
1117 | return mDirty; | 1143 | return mDirty; |
@@ -1125,5 +1151,5 @@ void AddresseeEditorWidget::nameTextChanged( const QString &text ) | |||
1125 | if ( !mAddressee.formattedName().isEmpty() ) { | 1151 | if ( !mAddressee.formattedName().isEmpty() ) { |
1126 | QString fn = mAddressee.formattedName(); | 1152 | QString fn = mAddressee.formattedName(); |
1127 | mAddressee.setNameFromString( text ); | 1153 | mAddressee.setNameFromString( text ); |
1128 | mAddressee.setFormattedName( fn ); | 1154 | mAddressee.setFormattedName( fn ); |
1129 | } else { | 1155 | } else { |
@@ -1171,3 +1197,3 @@ void AddresseeEditorWidget::nameButtonClicked() | |||
1171 | 1197 | ||
1172 | if ( dialog.exec() ) { | 1198 | if ( KApplication::execDialog( &dialog) ) { |
1173 | if ( dialog.changed() ) { | 1199 | if ( dialog.changed() ) { |
diff --git a/kaddressbook/mainembedded.cpp b/kaddressbook/mainembedded.cpp index d781f67..4230c07 100644 --- a/kaddressbook/mainembedded.cpp +++ b/kaddressbook/mainembedded.cpp | |||
@@ -73,2 +73,17 @@ int main( int argc, char **argv ) | |||
73 | 73 | ||
74 | { | ||
75 | KConfig kon ( locateLocal( "config", "korganizerrc" ) ); | ||
76 | kon.setGroup("Locale"); | ||
77 | KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)kon.readNumEntry( "PreferredDate",0) ); | ||
78 | QString dummy = kon.readEntry( "UserDateFormatShort","%aK %d.%m.%y" );// kon.readEntry( ""); | ||
79 | KGlobal::locale()->setHore24Format( !kon.readBoolEntry( "PreferredTime",0 ) ); | ||
80 | KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") )); | ||
81 | dummy = kon.readEntry( "UserDateFormatLong","%A %d %b %y" ); | ||
82 | KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") )); | ||
83 | kon.setGroup("Time & Date"); | ||
84 | KGlobal::locale()->setDaylightSaving( kon.readBoolEntry( "UseDaylightsaving", true ), | ||
85 | kon.readNumEntry( "DaylightsavingStart", 90), | ||
86 | kon.readNumEntry( "DaylightsavingEnd",304) ); | ||
87 | KGlobal::locale()->setTimezone( kon.readEntry( "TimeZoneName" ," 00:00 Europe/London(UTC)") ); | ||
88 | } | ||
74 | #ifndef DESKTOP_VERSION | 89 | #ifndef DESKTOP_VERSION |
diff --git a/kaddressbook/nameeditdialog.cpp b/kaddressbook/nameeditdialog.cpp index fb7eb22..8213c2b 100644 --- a/kaddressbook/nameeditdialog.cpp +++ b/kaddressbook/nameeditdialog.cpp | |||
@@ -111,3 +111,3 @@ NameEditDialog::NameEditDialog( const KABC::Addressee &addr, int type, | |||
111 | connect( mParseBox, SIGNAL( toggled(bool) ), SLOT( modified() ) ); | 111 | connect( mParseBox, SIGNAL( toggled(bool) ), SLOT( modified() ) ); |
112 | layout->addMultiCellWidget( mParseBox, 6, 6, 0, 1 ); | 112 | layout->addMultiCellWidget( mParseBox, 6, 6, 0, 2 ); |
113 | 113 | ||
@@ -177,6 +177,3 @@ NameEditDialog::NameEditDialog( const KABC::Addressee &addr, int type, | |||
177 | 177 | ||
178 | #ifdef KAB_EMBEDDED | 178 | |
179 | resize( KMIN(KGlobal::getDesktopWidth()-10, 490), KMIN(KGlobal::getDesktopHeight()-50, 300)); | ||
180 | #endif //KAB_EMBEDDED | ||
181 | |||
182 | mChanged = false; | 179 | mChanged = false; |