summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--kabc/addressee.cpp12
-rw-r--r--kaddressbook/addresseeeditorwidget.cpp50
-rw-r--r--kaddressbook/mainembedded.cpp15
-rw-r--r--kaddressbook/nameeditdialog.cpp5
-rw-r--r--kmicromail/libmailwrapper/genericwrapper.cpp2
-rw-r--r--korganizer/calendarview.cpp2
-rw-r--r--libkdepim/addresseeview.cpp10
-rw-r--r--libkdepim/kdateedit.cpp17
-rw-r--r--libkdepim/kdateedit.h3
-rw-r--r--microkde/kdeui/kaction.cpp44
10 files changed, 112 insertions, 48 deletions
diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp
index 6b282e2..4cdd5e5 100644
--- a/kabc/addressee.cpp
+++ b/kabc/addressee.cpp
@@ -802,5 +802,11 @@ void Addressee::setNameFromString( const QString &str )
setName( str );
- QStringList titles;
+ static bool first = true;
+ static QStringList titles;
+ static QStringList suffixes;
+ static QStringList prefixes;
+
+ if ( first ) {
+ first = false;
titles += i18n( "Dr." );
titles += i18n( "Miss" );
@@ -810,5 +816,4 @@ void Addressee::setNameFromString( const QString &str )
titles += i18n( "Prof." );
- QStringList suffixes;
suffixes += i18n( "I" );
suffixes += i18n( "II" );
@@ -817,10 +822,8 @@ void Addressee::setNameFromString( const QString &str )
suffixes += i18n( "Sr." );
- QStringList prefixes;
prefixes += "van";
prefixes += "von";
prefixes += "de";
-//US KConfig config( "kabcrc" );
KConfig config( locateLocal( "config", "kabcrc") );
config.setGroup( "General" );
@@ -831,4 +834,5 @@ void Addressee::setNameFromString( const QString &str )
suffixes += config.readListEntry( "Suffixes" );
suffixes.remove( "" );
+ }
// clear all name parts
diff --git a/kaddressbook/addresseeeditorwidget.cpp b/kaddressbook/addresseeeditorwidget.cpp
index 3cfc1f2..826c69b 100644
--- a/kaddressbook/addresseeeditorwidget.cpp
+++ b/kaddressbook/addresseeeditorwidget.cpp
@@ -88,5 +88,4 @@ AddresseeEditorWidget::AddresseeEditorWidget( KABCore *core, bool isExtension,
mAConfig = AddresseeConfig::instance();
- kdDebug(5720) << "AddresseeEditorWidget()" << endl;
mFormattedNameType = NameEditDialog::CustomName;
initGUI();
@@ -633,4 +632,5 @@ void AddresseeEditorWidget::setupTab2()
layout->addWidget( label, 8, 1 );
mBirthdayPicker = new KDateEdit( tab2 );
+ mBirthdayPicker->toggleDateFormat();
mBirthdayPicker->setHandleInvalid( true );
connect( mBirthdayPicker, SIGNAL( dateChanged( QDate ) ),
@@ -948,5 +948,4 @@ void AddresseeEditorWidget::setupTab3_1()
void AddresseeEditorWidget::load()
{
- kdDebug(5720) << "AddresseeEditorWidget::load()" << endl;
// Block signals in case anything tries to emit modified
@@ -1029,5 +1028,7 @@ void AddresseeEditorWidget::load()
void AddresseeEditorWidget::save()
{
- if ( !mDirty ) return;
+ if ( !dirty() ) {
+ return;
+ }
mAddressee.setRole( mRoleEdit->text() );
@@ -1035,9 +1036,15 @@ void AddresseeEditorWidget::save()
mAddressee.setUrl( KURL( mURLEdit->text() ) );
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() );
mAddressee.setCategories( QStringList::split( ",", mCategoryEdit->text() ) );
@@ -1063,12 +1070,11 @@ void AddresseeEditorWidget::save()
mAddressee.insertCustom( "KADDRESSBOOK", "X-Profession", mProfessionEdit->text() );
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);
mAddressee.insertCustom( "KADDRESSBOOK", "X-Anniversary", dt);
}
- else
+ else {
mAddressee.removeCustom( "KADDRESSBOOK", "X-Anniversary" );
+ mAnniversaryPicker->clear();
+ }
// Save the email addresses
@@ -1115,4 +1121,24 @@ void AddresseeEditorWidget::save()
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;
}
@@ -1170,5 +1196,5 @@ void AddresseeEditorWidget::nameButtonClicked()
NameEditDialog dialog( mAddressee, mFormattedNameType, this );
- if ( dialog.exec() ) {
+ if ( KApplication::execDialog( &dialog) ) {
if ( dialog.changed() ) {
mAddressee.setFamilyName( dialog.familyName() );
diff --git a/kaddressbook/mainembedded.cpp b/kaddressbook/mainembedded.cpp
index d781f67..4230c07 100644
--- a/kaddressbook/mainembedded.cpp
+++ b/kaddressbook/mainembedded.cpp
@@ -72,4 +72,19 @@ int main( int argc, char **argv )
QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & )));
+ {
+ 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
a.showMainWidget( &m );
diff --git a/kaddressbook/nameeditdialog.cpp b/kaddressbook/nameeditdialog.cpp
index fb7eb22..8213c2b 100644
--- a/kaddressbook/nameeditdialog.cpp
+++ b/kaddressbook/nameeditdialog.cpp
@@ -110,5 +110,5 @@ NameEditDialog::NameEditDialog( const KABC::Addressee &addr, int type,
connect( mParseBox, SIGNAL( toggled(bool) ), SLOT( parseBoxChanged(bool) ) );
connect( mParseBox, SIGNAL( toggled(bool) ), SLOT( modified() ) );
- layout->addMultiCellWidget( mParseBox, 6, 6, 0, 1 );
+ layout->addMultiCellWidget( mParseBox, 6, 6, 0, 2 );
// Fill in the values
@@ -176,7 +176,4 @@ NameEditDialog::NameEditDialog( const KABC::Addressee &addr, int type,
mFormattedNameCombo->setCurrentItem( 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
@@ -38,4 +38,6 @@ QString Genericwrapper::parseDateTime( mailimf_date_time *date )
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 ),
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index d5d31e2..258bd43 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -1261,8 +1261,10 @@ void CalendarView::syncExternal( int mode )
QPtrList<Incidence> iL = mCalendar->rawIncidences();
Incidence* inc = iL.first();
+ if ( phoneFormat ) {
while ( inc ) {
inc->removeID(mCurrentSyncDevice);
inc = iL.next();
}
+ }
#ifndef DESKTOP_VERSION
if ( sharpFormat )
diff --git a/libkdepim/addresseeview.cpp b/libkdepim/addresseeview.cpp
index d710541..5c69010 100644
--- a/libkdepim/addresseeview.cpp
+++ b/libkdepim/addresseeview.cpp
@@ -66,5 +66,5 @@ AddresseeView::AddresseeView( QWidget *parent, const char *name )
void AddresseeView::setSource(const QString& n)
{
- qDebug("********AddresseeView::setSource %s", n.latin1());
+ //qDebug("********AddresseeView::setSource %s", n.latin1());
if ( n.left( 6 ) == "mailto" )
@@ -125,5 +125,11 @@ 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();
KABC::PhoneNumber::List::ConstIterator phoneIt;
diff --git a/libkdepim/kdateedit.cpp b/libkdepim/kdateedit.cpp
index 5fb948a..c4c0081 100644
--- a/libkdepim/kdateedit.cpp
+++ b/libkdepim/kdateedit.cpp
@@ -125,5 +125,11 @@ KDateEdit::~KDateEdit()
delete mDateFrame;
}
-
+void KDateEdit::clear()
+{
+ bool b = mDateEdit->signalsBlocked();
+ mDateEdit->blockSignals(true);
+ mDateEdit->setText("");
+ mDateEdit->blockSignals(b);
+}
void KDateEdit::setDate(QDate newDate)
{
@@ -464,6 +470,5 @@ bool KDateEdit::eventFilter(QObject *, QEvent *e)
else if (e->type() == QEvent::MouseButtonDblClick)
{
- dateFormShort = dateFormShort?false:true;
- mDateEdit->setText(KGlobal::locale()->formatDate(readDate(),dateFormShort));
+ toggleDateFormat();
}
else if (e->type() == QEvent::FocusIn)
@@ -474,4 +479,10 @@ bool KDateEdit::eventFilter(QObject *, QEvent *e)
return false;
}
+void KDateEdit::toggleDateFormat()
+{
+ dateFormShort = ! dateFormShort;
+ mDateEdit->setText(KGlobal::locale()->formatDate(readDate(),dateFormShort));
+
+}
void KDateEdit::textChanged(const QString &)
diff --git a/libkdepim/kdateedit.h b/libkdepim/kdateedit.h
index 742d843..cf3b90a 100644
--- a/libkdepim/kdateedit.h
+++ b/libkdepim/kdateedit.h
@@ -79,5 +79,6 @@ class KDateEdit : public QHBox
*/
virtual bool eventFilter(QObject *o, QEvent *e);
-
+ void toggleDateFormat();
+ void clear();
signals:
/** This signal is emitted whenever the user modifies the date. This
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
@@ -213,5 +213,4 @@ KAction::KAction( QObject* parent, const char* name )
KAction::~KAction()
{
- kdDebug(129) << "KAction::~KAction( this = \"" << name() << "\" )" << endl; // -- ellis
#ifndef KDE_NO_COMPAT
if (d->m_kaccel)
@@ -436,5 +435,6 @@ bool KAction::setShortcut( const KShortcut& cut )
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
/*US
@@ -463,5 +463,6 @@ bool KAction::updateKAccelShortcut( KAccel* kaccel )
void KAction::insertKAccel( KAccel* kaccel )
{
- qDebug("KAction::updateKAccelShortcut~ ...1 has top be fixed");
+ //qDebug("KAction::updateKAccelShortcut~ ...1 has top be fixed");
+
/*US
//kdDebug(129) << "KAction::insertKAccel( " << kaccel << " ): this = " << this << endl;
@@ -479,5 +480,6 @@ void KAction::insertKAccel( KAccel* kaccel )
void KAction::removeKAccel( KAccel* kaccel )
{
- qDebug("KAction::removeKAccel~ ...1 has top be fixed");
+ // qDebug("KAction::removeKAccel~ ...1 has top be fixed");
+
/*US
//kdDebug(129) << "KAction::removeKAccel( " << i << " ): this = " << this << endl;
@@ -512,5 +514,6 @@ void KAction::updateShortcut( int i )
//US static_cast<QMenuBar*>(w)->setAccel( d->m_cut.keyCodeQt(), id );
//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");
}
@@ -540,5 +543,7 @@ 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");
}
@@ -566,5 +571,5 @@ void KAction::setShortcutText( const QString& s )
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();
return 0;
@@ -602,5 +607,5 @@ bool KAction::isShortcutConfigurable() const
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 );
@@ -612,5 +617,5 @@ void KAction::setToolTip( const QString& tt )
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 );
@@ -634,12 +639,5 @@ 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
+
// Check if action is permitted
@@ -776,5 +774,6 @@ void KAction::unplug( QWidget *w )
void KAction::plugAccel(KAccel *kacc, bool configurable)
{
- qDebug("KAction::plugAccel ...1 has top be fixed");
+ // qDebug("KAction::plugAccel ...1 has top be fixed");
+
/*US
kdWarning(129) << "KAction::plugAccel(): call to deprecated action." << endl;
@@ -807,5 +806,5 @@ void KAction::plugAccel(KAccel *kacc, bool configurable)
void KAction::unplugAccel()
{
- qDebug("KAction::unplugAccel ...1 has top be fixed");
+ // qDebug("KAction::unplugAccel ...1 has top be fixed");
/*US
//kdDebug(129) << "KAction::unplugAccel() " << this << " " << name() << endl;
@@ -820,5 +819,6 @@ void KAction::unplugAccel()
void KAction::plugMainWindowAccel( QWidget *w )
{
- qDebug("KAction::plugMainWindowAccel ...1 has top be fixed");
+ // qDebug("KAction::plugMainWindowAccel ...1 has top be fixed");
+
/*US
// Note: topLevelWidget() stops too early, we can't use it.
@@ -916,5 +916,5 @@ void KAction::updateText( int i )
else if ( w->inherits( "KToolBar" ) )
{
- 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 ) );
if ( button->inherits( "KToolBarButton" ) )
@@ -1119,5 +1119,5 @@ void KAction::slotActivated()
void KAction::slotDestroyed()
{
- kdDebug(129) << "KAction::slotDestroyed(): this = " << this << ", name = \"" << name() << "\", sender = " << sender() << endl;
+
const QObject* o = sender();