-rw-r--r-- | kabc/addressee.cpp | 62 | ||||
-rw-r--r-- | kaddressbook/addresseeeditorwidget.cpp | 56 | ||||
-rw-r--r-- | kaddressbook/mainembedded.cpp | 15 | ||||
-rw-r--r-- | kaddressbook/nameeditdialog.cpp | 7 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/genericwrapper.cpp | 2 | ||||
-rw-r--r-- | korganizer/calendarview.cpp | 8 | ||||
-rw-r--r-- | libkdepim/addresseeview.cpp | 10 | ||||
-rw-r--r-- | libkdepim/kdateedit.cpp | 17 | ||||
-rw-r--r-- | libkdepim/kdateedit.h | 3 | ||||
-rw-r--r-- | microkde/kdeui/kaction.cpp | 44 |
10 files changed, 144 insertions, 80 deletions
diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp index 6b282e2..4cdd5e5 100644 --- a/kabc/addressee.cpp +++ b/kabc/addressee.cpp @@ -803,31 +803,35 @@ void Addressee::setNameFromString( const QString &str ) - QStringList titles; - titles += i18n( "Dr." ); - titles += i18n( "Miss" ); - titles += i18n( "Mr." ); - titles += i18n( "Mrs." ); - titles += i18n( "Ms." ); - titles += i18n( "Prof." ); - - QStringList suffixes; - suffixes += i18n( "I" ); - suffixes += i18n( "II" ); - suffixes += i18n( "III" ); - suffixes += i18n( "Jr." ); - suffixes += i18n( "Sr." ); - - QStringList prefixes; - prefixes += "van"; - prefixes += "von"; - prefixes += "de"; - -//US KConfig config( "kabcrc" ); - KConfig config( locateLocal( "config", "kabcrc") ); - config.setGroup( "General" ); - titles += config.readListEntry( "Prefixes" ); - titles.remove( "" ); - prefixes += config.readListEntry( "Inclusions" ); - prefixes.remove( "" ); - suffixes += config.readListEntry( "Suffixes" ); - suffixes.remove( "" ); + static bool first = true; + static QStringList titles; + static QStringList suffixes; + static QStringList prefixes; + + if ( first ) { + first = false; + titles += i18n( "Dr." ); + titles += i18n( "Miss" ); + titles += i18n( "Mr." ); + titles += i18n( "Mrs." ); + titles += i18n( "Ms." ); + titles += i18n( "Prof." ); + + suffixes += i18n( "I" ); + suffixes += i18n( "II" ); + suffixes += i18n( "III" ); + suffixes += i18n( "Jr." ); + suffixes += i18n( "Sr." ); + + prefixes += "van"; + prefixes += "von"; + prefixes += "de"; + + KConfig config( locateLocal( "config", "kabcrc") ); + config.setGroup( "General" ); + titles += config.readListEntry( "Prefixes" ); + titles.remove( "" ); + prefixes += config.readListEntry( "Inclusions" ); + prefixes.remove( "" ); + suffixes += config.readListEntry( "Suffixes" ); + suffixes.remove( "" ); + } 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, - kdDebug(5720) << "AddresseeEditorWidget()" << endl; mFormattedNameType = NameEditDialog::CustomName; @@ -634,2 +633,3 @@ void AddresseeEditorWidget::setupTab2() mBirthdayPicker = new KDateEdit( tab2 ); + mBirthdayPicker->toggleDateFormat(); mBirthdayPicker->setHandleInvalid( true ); @@ -949,3 +949,2 @@ void AddresseeEditorWidget::load() { - kdDebug(5720) << "AddresseeEditorWidget::load()" << endl; @@ -1030,3 +1029,5 @@ void AddresseeEditorWidget::save() { - if ( !mDirty ) return; + if ( !dirty() ) { + return; + } @@ -1036,7 +1037,13 @@ void AddresseeEditorWidget::save() mAddressee.setNote( mNoteEdit->text() ); - if ( mBirthdayPicker->inputIsValid() ) - mAddressee.setBirthday( QDateTime( mBirthdayPicker->date() ) ); - else + if ( mBirthdayPicker->inputIsValid() ) { + QDate da = mBirthdayPicker->date(); + if ( da > QDate::currentDate() ) + da.setYMD(da.year()-100, da.month(), da.day() ); + mAddressee.setBirthday( QDateTime( da ) ); + qDebug("bday %s ",da.toString().latin1()); + } + else { mAddressee.setBirthday( QDateTime() ); - + mBirthdayPicker->clear(); + } mAddressee.setNickName( mNicknameEdit->text() ); @@ -1064,5 +1071,2 @@ void AddresseeEditorWidget::save() if ( mAnniversaryPicker->inputIsValid() ) { - -//US mAddressee.insertCustom( "KADDRESSBOOK", "X-Anniversary", -//US mAnniversaryPicker->date().toString( Qt::ISODate ) ); QString dt = KGlobal::locale()->formatDate(mAnniversaryPicker->date(), true, KLocale::ISODate); @@ -1070,4 +1074,6 @@ void AddresseeEditorWidget::save() } - else + else { mAddressee.removeCustom( "KADDRESSBOOK", "X-Anniversary" ); + mAnniversaryPicker->clear(); + } @@ -1116,2 +1122,22 @@ bool AddresseeEditorWidget::dirty() { + + if ( ! mDirty ) { + if ( mBirthdayPicker->inputIsValid() ) { + QDate da = mBirthdayPicker->date(); + if ( !(da == mAddressee.birthday().date())) + mDirty = true; + } + else { + mBirthdayPicker->clear(); + } + if ( mAnniversaryPicker->inputIsValid() ) { + QDate da = mAnniversaryPicker->date(); + if ( da != KGlobal::locale()->readDate( mAddressee.custom("KADDRESSBOOK", "X-Anniversary" ), + "%Y-%m-%d")) + mDirty = true; + } + else { + mAnniversaryPicker->clear(); + } + } return mDirty; @@ -1125,5 +1151,5 @@ void AddresseeEditorWidget::nameTextChanged( const QString &text ) if ( !mAddressee.formattedName().isEmpty() ) { - QString fn = mAddressee.formattedName(); - mAddressee.setNameFromString( text ); - mAddressee.setFormattedName( fn ); + QString fn = mAddressee.formattedName(); + mAddressee.setNameFromString( text ); + mAddressee.setFormattedName( fn ); } else { @@ -1171,3 +1197,3 @@ void AddresseeEditorWidget::nameButtonClicked() - if ( dialog.exec() ) { + if ( KApplication::execDialog( &dialog) ) { 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 ) + { + KConfig kon ( locateLocal( "config", "korganizerrc" ) ); + kon.setGroup("Locale"); + KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)kon.readNumEntry( "PreferredDate",0) ); + QString dummy = kon.readEntry( "UserDateFormatShort","%aK %d.%m.%y" );// kon.readEntry( ""); + KGlobal::locale()->setHore24Format( !kon.readBoolEntry( "PreferredTime",0 ) ); + KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") )); + dummy = kon.readEntry( "UserDateFormatLong","%A %d %b %y" ); + KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") )); + kon.setGroup("Time & Date"); + KGlobal::locale()->setDaylightSaving( kon.readBoolEntry( "UseDaylightsaving", true ), + kon.readNumEntry( "DaylightsavingStart", 90), + kon.readNumEntry( "DaylightsavingEnd",304) ); + KGlobal::locale()->setTimezone( kon.readEntry( "TimeZoneName" ," 00:00 Europe/London(UTC)") ); + } #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, connect( mParseBox, SIGNAL( toggled(bool) ), SLOT( modified() ) ); - layout->addMultiCellWidget( mParseBox, 6, 6, 0, 1 ); + layout->addMultiCellWidget( mParseBox, 6, 6, 0, 2 ); @@ -177,6 +177,3 @@ NameEditDialog::NameEditDialog( const KABC::Addressee &addr, int type, -#ifdef KAB_EMBEDDED - resize( KMIN(KGlobal::getDesktopWidth()-10, 490), KMIN(KGlobal::getDesktopHeight()-50, 300)); -#endif //KAB_EMBEDDED - + mChanged = false; diff --git a/kmicromail/libmailwrapper/genericwrapper.cpp b/kmicromail/libmailwrapper/genericwrapper.cpp index ed591fc..c3a1627 100644 --- a/kmicromail/libmailwrapper/genericwrapper.cpp +++ b/kmicromail/libmailwrapper/genericwrapper.cpp @@ -39,2 +39,4 @@ QString Genericwrapper::parseDateTime( mailimf_date_time *date ) KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") )); + dummy = kon.readEntry( "UserDateFormatLong","%A %d %b %y" ); + KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") )); kon.setGroup("Time & Date"); diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index d5d31e2..258bd43 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -1262,5 +1262,7 @@ void CalendarView::syncExternal( int mode ) Incidence* inc = iL.first(); - while ( inc ) { - inc->removeID(mCurrentSyncDevice); - inc = iL.next(); + if ( phoneFormat ) { + while ( inc ) { + inc->removeID(mCurrentSyncDevice); + inc = iL.next(); + } } diff --git a/libkdepim/addresseeview.cpp b/libkdepim/addresseeview.cpp index d710541..5c69010 100644 --- a/libkdepim/addresseeview.cpp +++ b/libkdepim/addresseeview.cpp @@ -67,3 +67,3 @@ void AddresseeView::setSource(const QString& n) { - qDebug("********AddresseeView::setSource %s", n.latin1()); + //qDebug("********AddresseeView::setSource %s", n.latin1()); @@ -126,3 +126,9 @@ void AddresseeView::setAddressee( const KABC::Addressee& addr ) } - + if ( mAddressee.birthday().date().isValid() ) { + dynamicPart += QString( + "<tr><td align=\"right\"><b>%1</b></td>" + "<td align=\"left\">%2</td></tr>" ) + .arg( i18n ("Birthday") ) + .arg( KGlobal::locale()->formatDate( mAddressee.birthday().date() ,true) ); + } KABC::PhoneNumber::List phones = mAddressee.phoneNumbers(); diff --git a/libkdepim/kdateedit.cpp b/libkdepim/kdateedit.cpp index 5fb948a..c4c0081 100644 --- a/libkdepim/kdateedit.cpp +++ b/libkdepim/kdateedit.cpp @@ -126,3 +126,9 @@ KDateEdit::~KDateEdit() } - +void KDateEdit::clear() +{ + bool b = mDateEdit->signalsBlocked(); + mDateEdit->blockSignals(true); + mDateEdit->setText(""); + mDateEdit->blockSignals(b); +} void KDateEdit::setDate(QDate newDate) @@ -465,4 +471,3 @@ bool KDateEdit::eventFilter(QObject *, QEvent *e) { - dateFormShort = dateFormShort?false:true; - mDateEdit->setText(KGlobal::locale()->formatDate(readDate(),dateFormShort)); + toggleDateFormat(); } @@ -475,2 +480,8 @@ bool KDateEdit::eventFilter(QObject *, QEvent *e) } +void KDateEdit::toggleDateFormat() +{ + dateFormShort = ! dateFormShort; + mDateEdit->setText(KGlobal::locale()->formatDate(readDate(),dateFormShort)); + +} diff --git a/libkdepim/kdateedit.h b/libkdepim/kdateedit.h index 742d843..cf3b90a 100644 --- a/libkdepim/kdateedit.h +++ b/libkdepim/kdateedit.h @@ -80,3 +80,4 @@ class KDateEdit : public QHBox virtual bool eventFilter(QObject *o, QEvent *e); - + void toggleDateFormat(); + void clear(); signals: diff --git a/microkde/kdeui/kaction.cpp b/microkde/kdeui/kaction.cpp index 77d36a5..d38a6d5 100644 --- a/microkde/kdeui/kaction.cpp +++ b/microkde/kdeui/kaction.cpp @@ -214,3 +214,2 @@ KAction::~KAction() { - kdDebug(129) << "KAction::~KAction( this = \"" << name() << "\" )" << endl; // -- ellis #ifndef KDE_NO_COMPAT @@ -437,3 +436,4 @@ bool KAction::updateKAccelShortcut( KAccel* kaccel ) { - qDebug("KAction::updateKAccelShortcut~ ...1 has top be fixed"); + //qDebug("KAction::updateKAccelShortcut~ ...1 has top be fixed"); + // Check if action is permitted @@ -464,3 +464,4 @@ void KAction::insertKAccel( KAccel* kaccel ) { - qDebug("KAction::updateKAccelShortcut~ ...1 has top be fixed"); + //qDebug("KAction::updateKAccelShortcut~ ...1 has top be fixed"); + /*US @@ -480,3 +481,4 @@ void KAction::removeKAccel( KAccel* kaccel ) { - qDebug("KAction::removeKAccel~ ...1 has top be fixed"); + // qDebug("KAction::removeKAccel~ ...1 has top be fixed"); + /*US @@ -513,3 +515,4 @@ void KAction::updateShortcut( int i ) //US (QMenuBar*)(w)->setAccel( d->m_cut.keyCodeQt(), id ); - qDebug("KAction::updateShortcut( int i ) ...1 has top be fixed"); + + ; //qDebug("KAction::updateShortcut( int i ) ...1 has top be fixed"); @@ -541,3 +544,5 @@ void KAction::updateShortcut( QPopupMenu* menu, int id ) */ - qDebug("KAction::updateShortcut( QPopupMenu* menu, int id ) ...1 has top be fixed"); + + +//qDebug("KAction::updateShortcut( QPopupMenu* menu, int id ) ...1 has top be fixed"); @@ -567,3 +572,3 @@ int KAction::accel() const { - qDebug("KAction::accel() ...1 has top be fixed"); + // qDebug("KAction::accel() ...1 has top be fixed"); //US return d->m_cut.keyCodeQt(); @@ -603,3 +608,3 @@ void KAction::setToolTip( const QString& tt ) { - qDebug("KAction::setToolTip ...1 has top be fixed"); + //qDebug("KAction::setToolTip ...1 has top be fixed"); d->setToolTip( tt ); @@ -613,3 +618,3 @@ void KAction::updateToolTip( int i ) { - qDebug("KAction::updateToolTip ...1 has top be fixed"); + //qDebug("KAction::updateToolTip ...1 has top be fixed"); QWidget *w = container( i ); @@ -635,10 +640,3 @@ int KAction::plug( QWidget *w, int index ) -#ifndef NDEBUG - KAccel* kaccel = kaccelCurrent(); - // If there is a shortcut, but no KAccel available - if( !d->m_cut.isNull() && kaccel == 0 ) { - kdWarning(129) << "KAction::plug(): has no KAccel object; this = " << this << " name = " << name() << " parentCollection = " << m_parentCollection << endl; // ellis -//US kdDebug(129) << kdBacktrace() << endl; - } -#endif + @@ -777,3 +775,4 @@ void KAction::plugAccel(KAccel *kacc, bool configurable) { - qDebug("KAction::plugAccel ...1 has top be fixed"); + // qDebug("KAction::plugAccel ...1 has top be fixed"); + /*US @@ -808,3 +807,3 @@ void KAction::unplugAccel() { - qDebug("KAction::unplugAccel ...1 has top be fixed"); + // qDebug("KAction::unplugAccel ...1 has top be fixed"); /*US @@ -821,3 +820,4 @@ void KAction::plugMainWindowAccel( QWidget *w ) { - qDebug("KAction::plugMainWindowAccel ...1 has top be fixed"); + // qDebug("KAction::plugMainWindowAccel ...1 has top be fixed"); + /*US @@ -917,3 +917,3 @@ void KAction::updateText( int i ) { - qDebug("KAction::updateText ...3 has top be fixed"); + //qDebug("KAction::updateText ...3 has top be fixed"); QWidget *button = static_cast<KToolBar *>(w)->getWidget( itemId( i ) ); @@ -1120,3 +1120,3 @@ void KAction::slotDestroyed() { - kdDebug(129) << "KAction::slotDestroyed(): this = " << this << ", name = \"" << name() << "\", sender = " << sender() << endl; + const QObject* o = sender(); |