summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/addressee.cpp62
-rw-r--r--kaddressbook/addresseeeditorwidget.cpp56
-rw-r--r--kaddressbook/mainembedded.cpp15
-rw-r--r--kaddressbook/nameeditdialog.cpp7
-rw-r--r--kmicromail/libmailwrapper/genericwrapper.cpp2
-rw-r--r--korganizer/calendarview.cpp8
-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, 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
@@ -792,53 +792,57 @@ Agent Addressee::agent() const
QString Addressee::agentLabel()
{
return i18n("Agent");
}
void Addressee::setNameFromString( const QString &str )
{
setFormattedName( str );
setName( 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( "" );
+ }
// clear all name parts
setPrefix( "" );
setGivenName( "" );
setAdditionalName( "" );
setFamilyName( "" );
setSuffix( "" );
if ( str.isEmpty() )
return;
int i = str.find(',');
diff --git a/kaddressbook/addresseeeditorwidget.cpp b/kaddressbook/addresseeeditorwidget.cpp
index 3cfc1f2..826c69b 100644
--- a/kaddressbook/addresseeeditorwidget.cpp
+++ b/kaddressbook/addresseeeditorwidget.cpp
@@ -78,25 +78,24 @@
#include "addresseeeditorwidget.h"
AddresseeEditorWidget::AddresseeEditorWidget( KABCore *core, bool isExtension,
QWidget *parent, const char *name )
: ExtensionWidget( core, parent, name ), mIsExtension( isExtension ),
mBlockSignals( false )
{
mAConfig = AddresseeConfig::instance();
- kdDebug(5720) << "AddresseeEditorWidget()" << endl;
mFormattedNameType = NameEditDialog::CustomName;
initGUI();
mCategoryDialog = 0;
mCategoryEditDialog = 0;
// Load the empty addressee as defaults
load();
mDirty = false;
}
AddresseeEditorWidget::~AddresseeEditorWidget()
@@ -623,24 +622,25 @@ void AddresseeEditorWidget::setupTab2()
layout->addWidget( label, 7, 1 );
mSpouseEdit = new KLineEdit( tab2 );
connect( mSpouseEdit, SIGNAL( textChanged( const QString& ) ),
SLOT( textChanged( const QString& ) ) );
label->setBuddy( mSpouseEdit );
//US layout->addWidget( mSpouseEdit, 5, 2 );
layout->addWidget( mSpouseEdit, 7, 2 );
label = new QLabel( i18n( "Birthday:" ), tab2 );
//US layout->addWidget( label, 4, 3 );
layout->addWidget( label, 8, 1 );
mBirthdayPicker = new KDateEdit( tab2 );
+ mBirthdayPicker->toggleDateFormat();
mBirthdayPicker->setHandleInvalid( true );
connect( mBirthdayPicker, SIGNAL( dateChanged( QDate ) ),
SLOT( dateChanged( QDate ) ) );
#ifndef KAB_EMBEDDED
//US invalid dates are handdled by the KDateEdit widget itself
connect( mBirthdayPicker, SIGNAL( invalidDateEntered() ),
SLOT( invalidDate() ) );
connect( mBirthdayPicker, SIGNAL( textChanged( const QString& ) ),
SLOT( emitModified() ) );
#endif //KAB_EMBEDDED
@@ -938,25 +938,24 @@ void AddresseeEditorWidget::setupTab3_1()
// Keys
mKeyWidget = new KeyWidget( tab3 );
mKeyWidget->setMinimumSize( mKeyWidget->sizeHint() );
connect( mKeyWidget, SIGNAL( changed() ), SLOT( emitModified() ) );
layout->addWidget( mKeyWidget, 1, 1, Qt::AlignTop );
*/
mTabWidget->addTab( tab3, i18n( "&Images" ) );
}
void AddresseeEditorWidget::load()
{
- kdDebug(5720) << "AddresseeEditorWidget::load()" << endl;
// Block signals in case anything tries to emit modified
// CS: This doesn't seem to work.
bool block = signalsBlocked();
blockSignals( true );
mBlockSignals = true; // used for internal signal blocking
mNameEdit->setText( mAddressee.assembledName() );
if ( mAddressee.formattedName().isEmpty() ) {
//US KConfig config( "kaddressbookrc" );
KConfig config( locateLocal("config", "kaddressbookrc") );
@@ -1019,66 +1018,73 @@ void AddresseeEditorWidget::load()
mDepartmentEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Department" ) );
mOfficeEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Office" ) );
mProfessionEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Profession" ) );
blockSignals( block );
mBlockSignals = false;
mDirty = false;
}
void AddresseeEditorWidget::save()
{
- if ( !mDirty ) return;
+ if ( !dirty() ) {
+ return;
+ }
mAddressee.setRole( mRoleEdit->text() );
mAddressee.setOrganization( mOrgEdit->text() );
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() ) );
mAddressee.setGeo( mGeoWidget->geo() );
mAddressee.setPhoto( mImageWidget->photo() );
mAddressee.setLogo( mImageWidget->logo() );
mAddressee.setKeys( mKeyWidget->keys() );
#ifndef KAB_EMBEDDED
mAddressee.setSound( mSoundWidget->sound() );
#else //KAB_EMBEDDED
//US qDebug("AddresseeEditorWidget::save sound not supported");
#endif //KAB_EMBEDDED
mAddressee.setSecrecy( mSecrecyWidget->secrecy() );
// save custom fields
mAddressee.insertCustom( "KADDRESSBOOK", "X-IMAddress", mIMAddressEdit->text() );
mAddressee.insertCustom( "KADDRESSBOOK", "X-SpousesName", mSpouseEdit->text() );
mAddressee.insertCustom( "KADDRESSBOOK", "X-ManagersName", mManagerEdit->text() );
mAddressee.insertCustom( "KADDRESSBOOK", "X-AssistantsName", mAssistantEdit->text() );
mAddressee.insertCustom( "KADDRESSBOOK", "X-Department", mDepartmentEdit->text() );
mAddressee.insertCustom( "KADDRESSBOOK", "X-Office", mOfficeEdit->text() );
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
QStringList emails = mAddressee.emails();
QStringList::Iterator iter;
for ( iter = emails.begin(); iter != emails.end(); ++iter )
mAddressee.removeEmail( *iter );
emails = mEmailWidget->emails();
bool first = true;
for ( iter = emails.begin(); iter != emails.end(); ++iter ) {
mAddressee.insertEmail( *iter, first );
first = false;
@@ -1105,36 +1111,56 @@ void AddresseeEditorWidget::save()
++addressIter )
mAddressee.removeAddress( *addressIter );
addresses = mAddressEditWidget->addresses();
for ( addressIter = addresses.begin(); addressIter != addresses.end();
++addressIter )
mAddressee.insertAddress( *addressIter );
mDirty = false;
}
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;
}
void AddresseeEditorWidget::nameTextChanged( const QString &text )
{
// use the addressee class to parse the name for us
mAConfig->setUid( mAddressee.uid() );
if ( mAConfig->automaticNameParsing() ) {
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 {
// use extra addressee to avoid a formatted name assignment
Addressee addr;
addr.setNameFromString( text );
mAddressee.setPrefix( addr.prefix() );
mAddressee.setGivenName( addr.givenName() );
mAddressee.setAdditionalName( addr.additionalName() );
mAddressee.setFamilyName( addr.familyName() );
mAddressee.setSuffix( addr.suffix() );
}
}
@@ -1160,25 +1186,25 @@ void AddresseeEditorWidget::nameBoxChanged()
if ( mFormattedNameType != NameEditDialog::CustomName ) {
mFormattedNameLabel->setText( NameEditDialog::formattedName( mAddressee, mFormattedNameType ) );
mAddressee.setFormattedName( NameEditDialog::formattedName( mAddressee, mFormattedNameType ) );
}
}
void AddresseeEditorWidget::nameButtonClicked()
{
// show the name dialog.
NameEditDialog dialog( mAddressee, mFormattedNameType, this );
- if ( dialog.exec() ) {
+ if ( KApplication::execDialog( &dialog) ) {
if ( dialog.changed() ) {
mAddressee.setFamilyName( dialog.familyName() );
mAddressee.setGivenName( dialog.givenName() );
mAddressee.setPrefix( dialog.prefix() );
mAddressee.setSuffix( dialog.suffix() );
mAddressee.setAdditionalName( dialog.additionalName() );
mFormattedNameType = dialog.formattedNameType();
if ( mFormattedNameType == NameEditDialog::CustomName ) {
mFormattedNameLabel->setText( dialog.customFormattedName() );
mAddressee.setFormattedName( dialog.customFormattedName() );
}
// Update the name edit.
diff --git a/kaddressbook/mainembedded.cpp b/kaddressbook/mainembedded.cpp
index d781f67..4230c07 100644
--- a/kaddressbook/mainembedded.cpp
+++ b/kaddressbook/mainembedded.cpp
@@ -62,24 +62,39 @@ int main( int argc, char **argv )
#else
QString fileName ;
fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/icons22/";
KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName));
QApplication::addLibraryPath ( qApp->applicationDirPath () );
#endif
KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kaddressbook")));
KAddressBookMain m ;
//US MainWindow m;
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 );
#else
a.setMainWidget( &m );
m.resize (640, 480 );
m.show();
#endif
a.exec();
}
qDebug("KA: Bye! ");
}
diff --git a/kaddressbook/nameeditdialog.cpp b/kaddressbook/nameeditdialog.cpp
index fb7eb22..8213c2b 100644
--- a/kaddressbook/nameeditdialog.cpp
+++ b/kaddressbook/nameeditdialog.cpp
@@ -100,25 +100,25 @@ NameEditDialog::NameEditDialog( const KABC::Addressee &addr, int type,
mFormattedNameCombo->setMaximumWidth(100);
layout->addMultiCellWidget( mFormattedNameCombo, 5, 5, 0, 0 );
connect( mFormattedNameCombo, SIGNAL( activated( int ) ), SLOT( typeChanged( int ) ) );
mFormattedNameEdit = new KLineEdit( page );
mFormattedNameEdit->setEnabled( type == CustomName );
layout->addMultiCellWidget( mFormattedNameEdit, 5, 5, 1, 2 );
mParseBox = new QCheckBox( i18n( "Parse name automatically" ), page );
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
mFamilyNameEdit->setText( addr.familyName() );
mGivenNameEdit->setText( addr.givenName() );
mAdditionalNameEdit->setText( addr.additionalName() );
mFormattedNameEdit->setText( addr.formattedName() );
// Prefix and suffix combos
//US KConfig config( "kabcrc" );
KConfig config( locateLocal("config", "kabcrc") );
config.setGroup( "General" );
@@ -166,28 +166,25 @@ NameEditDialog::NameEditDialog( const KABC::Addressee &addr, int type,
connect( mAdditionalNameEdit, SIGNAL( textChanged( const QString& ) ), SLOT( modified() ) );
connect( mAdditionalNameEdit, SIGNAL( textChanged( const QString& ) ), SLOT( updateTypeCombo() ) );
connect( mFamilyNameEdit, SIGNAL( textChanged( const QString& ) ), SLOT( modified() ) );
connect( mFamilyNameEdit, SIGNAL( textChanged( const QString& ) ), SLOT( updateTypeCombo() ) );
connect( mSuffixCombo, SIGNAL( textChanged( const QString& ) ), SLOT( modified() ) );
connect( mSuffixCombo, SIGNAL( textChanged( const QString& ) ), SLOT( updateTypeCombo() ) );
connect( mFormattedNameCombo, SIGNAL( activated( int ) ), SLOT( modified() ) );
connect( mFormattedNameEdit, SIGNAL( textChanged( const QString& ) ), SLOT( modified() ) );
updateTypeCombo();
mFormattedNameCombo->setCurrentItem( type );
-#ifdef KAB_EMBEDDED
- resize( KMIN(KGlobal::getDesktopWidth()-10, 490), KMIN(KGlobal::getDesktopHeight()-50, 300));
-#endif //KAB_EMBEDDED
-
+
mChanged = false;
}
NameEditDialog::~NameEditDialog()
{
}
QString NameEditDialog::familyName() const
{
return mFamilyNameEdit->text();
}
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
@@ -28,24 +28,26 @@ Genericwrapper::~Genericwrapper()
cleanMimeCache();
}
QString Genericwrapper::parseDateTime( mailimf_date_time *date )
{
static bool init = false ;
if ( ! init ) {
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)") );
init = true;
}
QDate da (date->dt_year,date->dt_month, date->dt_day );
QTime ti ( date->dt_hour, date->dt_min, date->dt_sec );
QDateTime dt ( da ,ti );
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index d5d31e2..258bd43 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -1251,27 +1251,29 @@ void CalendarView::syncExternal( int mode )
} else
return;
if ( loadSuccess ) {
getEventViewerDialog()->setSyncMode( true );
syncOK = synchronizeCalendar( mCalendar, calendar, KOPrefs::instance()->mSyncAlgoPrefs );
getEventViewerDialog()->setSyncMode( false );
qApp->processEvents();
if ( syncOK ) {
if ( KOPrefs::instance()->mWriteBackFile )
{
QPtrList<Incidence> iL = mCalendar->rawIncidences();
Incidence* inc = iL.first();
- while ( inc ) {
- inc->removeID(mCurrentSyncDevice);
- inc = iL.next();
+ if ( phoneFormat ) {
+ while ( inc ) {
+ inc->removeID(mCurrentSyncDevice);
+ inc = iL.next();
+ }
}
#ifndef DESKTOP_VERSION
if ( sharpFormat )
sharpFormat->save(calendar);
#endif
if ( phoneFormat )
phoneFormat->save(calendar);
iL = calendar->rawIncidences();
inc = iL.first();
Incidence* loc;
while ( inc ) {
if ( inc->tempSyncStat() == SYNC_TEMPSTATE_NEW_ID ) {
diff --git a/libkdepim/addresseeview.cpp b/libkdepim/addresseeview.cpp
index d710541..5c69010 100644
--- a/libkdepim/addresseeview.cpp
+++ b/libkdepim/addresseeview.cpp
@@ -56,25 +56,25 @@ AddresseeView::AddresseeView( QWidget *parent, const char *name )
setLinkUnderline( false );
// setVScrollBarMode( QScrollView::AlwaysOff );
//setHScrollBarMode( QScrollView::AlwaysOff );
//US QStyleSheet *sheet = styleSheet();
//US QStyleSheetItem *link = sheet->item( "a" );
//US link->setColor( KGlobalSettings::linkColor() );
}
void AddresseeView::setSource(const QString& n)
{
- qDebug("********AddresseeView::setSource %s", n.latin1());
+ //qDebug("********AddresseeView::setSource %s", n.latin1());
if ( n.left( 6 ) == "mailto" )
ExternalAppHandler::instance()->mailToOneContact( n.mid(7) );
else if ( n.left( 7 ) == "phoneto" )
ExternalAppHandler::instance()->callByPhone( n.mid(8) );
else if ( n.left( 5 ) == "faxto" )
ExternalAppHandler::instance()->callByFax( n.mid(6) );
else if ( n.left( 5 ) == "smsto" )
ExternalAppHandler::instance()->callBySMS( n.mid(6) );
else if ( n.left( 7 ) == "pagerto" )
ExternalAppHandler::instance()->callByPager( n.mid(8) );
@@ -115,25 +115,31 @@ void AddresseeView::setAddressee( const KABC::Addressee& addr )
.arg( *emailIt )
.arg( *emailIt );
++emailIt;
} else {
dynamicPart += QString(
"<tr><td align=\"right\"><b>%1</b></td>"
"<td align=\"left\">%2</td></tr>" )
.arg( type )
.arg( *emailIt );
++emailIt;
}
}
-
+ 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;
QString extension;
int phonetype;
QString sms;
for ( phoneIt = phones.begin(); phoneIt != phones.end(); ++phoneIt ) {
phonetype = (*phoneIt).type();
if (ksmsAvail &&
(
((phonetype & KABC::PhoneNumber::Car) == KABC::PhoneNumber::Car) ||
((phonetype & KABC::PhoneNumber::Cell) == KABC::PhoneNumber::Cell)
)
diff --git a/libkdepim/kdateedit.cpp b/libkdepim/kdateedit.cpp
index 5fb948a..c4c0081 100644
--- a/libkdepim/kdateedit.cpp
+++ b/libkdepim/kdateedit.cpp
@@ -115,25 +115,31 @@ KDateEdit::KDateEdit(QWidget *parent, const char *name, bool withoutDP )
mKeywordMap[dayName] = 7 - currentDay + i;
}
mTextChanged = false;
mHandleInvalid = false;
QWidget::setTabOrder( mDateEdit, mDateButton );
}
KDateEdit::~KDateEdit()
{
delete mDateFrame;
}
-
+void KDateEdit::clear()
+{
+ bool b = mDateEdit->signalsBlocked();
+ mDateEdit->blockSignals(true);
+ mDateEdit->setText("");
+ mDateEdit->blockSignals(b);
+}
void KDateEdit::setDate(QDate newDate)
{
if (!newDate.isValid() && !mHandleInvalid)
return;
if ( readDate() == newDate )
return;
QString dateString = "";
if(newDate.isValid())
dateString = KGlobal::locale()->formatDate( newDate, dateFormShort );
mTextChanged = false;
@@ -454,33 +460,38 @@ QDate KDateEdit::readDate() const
bool KDateEdit::eventFilter(QObject *, QEvent *e)
{
// We only process the focus out event if the text has changed
// since we got focus
if ((e->type() == QEvent::FocusOut) && mTextChanged)
{
lineEnterPressed();
mTextChanged = false;
}
// switch dateFormShort by double klick with mouse
else if (e->type() == QEvent::MouseButtonDblClick)
{
- dateFormShort = dateFormShort?false:true;
- mDateEdit->setText(KGlobal::locale()->formatDate(readDate(),dateFormShort));
+ toggleDateFormat();
}
else if (e->type() == QEvent::FocusIn)
{
maxDay = readDate().day();
}
return false;
}
+void KDateEdit::toggleDateFormat()
+{
+ dateFormShort = ! dateFormShort;
+ mDateEdit->setText(KGlobal::locale()->formatDate(readDate(),dateFormShort));
+
+}
void KDateEdit::textChanged(const QString &)
{
if(mHandleInvalid && mDateEdit->text().stripWhiteSpace().isEmpty()) {
QDate date; //invalid date
emit(dateChanged(date));
} else {
mTextChanged = true;
}
maxDay = readDate().day();
}
diff --git a/libkdepim/kdateedit.h b/libkdepim/kdateedit.h
index 742d843..cf3b90a 100644
--- a/libkdepim/kdateedit.h
+++ b/libkdepim/kdateedit.h
@@ -69,25 +69,26 @@ class KDateEdit : public QHBox
/** @param handleInvalid If true the date edit accepts invalid dates
* and displays them as the empty ("") string. It also returns an invalid date.
* If false (default) invalid dates are not accepted and instead the date
* of today will be returned.
*/
void setHandleInvalid(bool handleInvalid);
/** Checks for a focus out event. The display of the date is updated
* to display the proper date when the focus leaves.
*/
virtual bool eventFilter(QObject *o, QEvent *e);
-
+ void toggleDateFormat();
+ void clear();
signals:
/** This signal is emitted whenever the user modifies the date. This
* may not get emitted until the user presses enter in the line edit or
* focus leaves the widget (ie: the user confirms their selection).
*/
void dateChanged(QDate);
void returnPressed();
public slots:
/** Sets the date.
*
* @param date The new date to display. This date must be valid or
* it will not be displayed.
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
@@ -203,25 +203,24 @@ KAction::KAction( const QString& text, const QString& pix,
}
KAction::KAction( QObject* parent, const char* name )
: QObject( parent, name )
{
initPrivate( QString::null, KShortcut(), 0, 0 );
}
// KDE 4: remove end
KAction::~KAction()
{
- kdDebug(129) << "KAction::~KAction( this = \"" << name() << "\" )" << endl; // -- ellis
#ifndef KDE_NO_COMPAT
if (d->m_kaccel)
unplugAccel();
#endif
// If actionCollection hasn't already been destructed,
if ( m_parentCollection ) {
m_parentCollection->take( this );
for( uint i = 0; i < d->m_kaccelList.count(); i++ )
//US d->m_kaccelList[i]->remove( name() );
qDebug("KAction::KAction~ ...1 has top be fixed");
}
@@ -426,25 +425,26 @@ bool KAction::setShortcut( const KShortcut& cut )
// KDE 4: remove end
int len = containerCount();
for( int i = 0; i < len; ++i )
updateShortcut( i );
}
*/
return true;
}
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
if (kapp && !kapp->authorizeKAction(name()))
return false;
bool b = true;
if ( !kaccel->actions().actionPtr( name() ) ) {
if(!d->m_cut.isNull() ) {
kdDebug(129) << "Inserting " << name() << ", " << d->text() << ", " << d->plainText() << endl;
b = kaccel->insert( name(), d->plainText(), QString::null,
d->m_cut,
@@ -453,41 +453,43 @@ bool KAction::updateKAccelShortcut( KAccel* kaccel )
}
}
else
b = kaccel->setShortcut( name(), d->m_cut );
return b;
*/
return true;
}
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;
if ( !kaccel->actions().actionPtr( name() ) ) {
if( updateKAccelShortcut( kaccel ) ) {
d->m_kaccelList.append( kaccel );
connect( kaccel, SIGNAL(destroyed()), this, SLOT(slotDestroyed()) );
}
}
else
kdWarning(129) << "KAction::insertKAccel( kaccel = " << kaccel << " ): KAccel object already contains an action name \"" << name() << "\"" << endl; // -- ellis
*/
}
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;
for( uint i = 0; i < d->m_kaccelList.count(); i++ ) {
if( d->m_kaccelList[i] == kaccel ) {
kaccel->remove( name() );
d->m_kaccelList.remove( d->m_kaccelList.at( i ) );
disconnect( kaccel, SIGNAL(destroyed()), this, SLOT(slotDestroyed()) );
break;
}
}
*/
}
@@ -502,25 +504,26 @@ void KAction::setAccel( int keyQt )
void KAction::updateShortcut( int i )
{
int id = itemId( i );
QWidget* w = container( i );
if ( w->inherits( "QPopupMenu" ) ) {
QPopupMenu* menu = static_cast<QPopupMenu*>(w);
updateShortcut( menu, id );
}
else if ( w->inherits( "QMenuBar" ) )
//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");
}
void KAction::updateShortcut( QPopupMenu* menu, int id )
{
/*US
//kdDebug(129) << "KAction::updateShortcut(): this = " << this << " d->m_kaccelList.count() = " << d->m_kaccelList.count() << endl;
// If the action has a KAccel object,
// show the string representation of its shortcut.
if ( d->m_kaccel || d->m_kaccelList.count() ) {
QString s = menu->text( id );
int i = s.find( '\t' );
@@ -530,25 +533,27 @@ void KAction::updateShortcut( QPopupMenu* menu, int id )
s += "\t" + d->m_cut.seq(0).toString();
menu->changeItem( id, s );
}
// Otherwise insert the shortcut itself into the popup menu.
else {
// This is a fall-hack in case the KAction is missing a proper parent collection.
// It should be removed eventually. --ellis
menu->setAccel( d->m_cut.keyCodeQt(), id );
kdWarning(129) << "KAction::updateShortcut(): name = \"" << name() << "\", cut = " << d->m_cut.toStringInternal() << "; No KAccel, probably missing a parent collection." << endl;
}
*/
- qDebug("KAction::updateShortcut( QPopupMenu* menu, int id ) ...1 has top be fixed");
+
+
+//qDebug("KAction::updateShortcut( QPopupMenu* menu, int id ) ...1 has top be fixed");
}
const KShortcut& KAction::shortcut() const
{
return d->m_cut;
}
const KShortcut& KAction::shortcutDefault() const
{
return d->m_cutDefault;
}
@@ -556,25 +561,25 @@ const KShortcut& KAction::shortcutDefault() const
QString KAction::shortcutText() const
{
return d->m_cut.toStringInternal();
}
void KAction::setShortcutText( const QString& s )
{
setShortcut( KShortcut(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;
}
void KAction::setGroup( const QString& grp )
{
d->m_group = grp;
int len = containerCount();
for( int i = 0; i < len; ++i )
updateGroup( i );
}
@@ -592,64 +597,57 @@ QString KAction::group() const
bool KAction::isEnabled() const
{
return d->isEnabled();
}
bool KAction::isShortcutConfigurable() const
{
return d->m_configurable;
}
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 );
int len = containerCount();
for( int i = 0; i < len; ++i )
updateToolTip( i );
}
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 );
if ( w->inherits( "KToolBar" ) )
QToolTip::add( static_cast<KToolBar*>(w)->getWidget( itemId( i ) ), d->toolTip() );
else if ( w->inherits( "QToolBar" ) )
QToolTip::add( static_cast<KToolBar*>(w)->getWidget( itemId( i ) ), d->toolTip() );
}
QString KAction::toolTip() const
{
return d->toolTip();
}
int KAction::plug( QWidget *w, int index )
{
//kdDebug(129) << "KAction::plug( " << w << ", " << index << " )" << endl;
if (w == 0) {
kdWarning(129) << "KAction::plug called with 0 argument\n";
return -1;
}
-#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
//US if (kapp && !kapp->authorizeKAction(name()))
//US return -1;
plugShortcut();
if ( w->inherits("QPopupMenu") )
{
QPopupMenu* menu = static_cast<QPopupMenu*>( w );
int id;
// Don't insert shortcut into menu if it's already in a KAccel object.
@@ -766,25 +764,26 @@ void KAction::unplug( QWidget *w )
QMenuBar *bar = static_cast<QMenuBar *>( w );
bar->removeItem( id );
}
removeContainer( i );
if ( m_parentCollection )
m_parentCollection->disconnectHighlight( w, this );
}
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;
kdDebug(129) << kdBacktrace() << endl;
//kdDebug(129) << "KAction::plugAccel( kacc = " << kacc << " ): name \"" << name() << "\"" << endl;
if ( d->m_kaccel )
unplugAccel();
// If the parent collection's accel ptr isn't set yet
//if ( m_parentCollection && !m_parentCollection->accel() )
// m_parentCollection->setAccel( kacc );
// We can only plug this action into the given KAccel object
@@ -797,38 +796,39 @@ void KAction::plugAccel(KAccel *kacc, bool configurable)
this, SLOT(slotActivated()),
configurable, isEnabled());
connect(d->m_kaccel, SIGNAL(destroyed()), this, SLOT(slotDestroyed()));
//connect(d->m_kaccel, SIGNAL(keycodeChanged()), this, SLOT(slotKeycodeChanged()));
}
else
kdWarning(129) << "KAction::plugAccel( kacc = " << kacc << " ): KAccel object already contains an action name \"" << name() << "\"" << endl; // -- ellis
*/
}
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;
if ( d->m_kaccel )
{
d->m_kaccel->remove(name());
d->m_kaccel = 0;
}
*/
}
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.
QWidget * tl = w;
QWidget * n;
while ( !tl->isDialog() && ( n = tl->parentWidget() ) ) // lookup parent and store
tl = n;
KMainWindow * mw = dynamic_cast<KMainWindow *>(tl); // try to see if it's a kmainwindow
if (mw)
plugAccel( mw->accel() );
else
kdDebug(129) << "KAction::plugMainWindowAccel: Toplevel widget isn't a KMainWindow, can't plug accel. " << tl << endl;
@@ -906,25 +906,25 @@ void KAction::updateText( int i )
{
QWidget *w = container( i );
if ( w->inherits( "QPopupMenu" ) ) {
int id = itemId( i );
static_cast<QPopupMenu*>(w)->changeItem( id, d->text() );
updateShortcut( static_cast<QPopupMenu*>(w), id );
}
else if ( w->inherits( "QMenuBar" ) )
static_cast<QMenuBar*>(w)->changeItem( itemId( i ), d->text() );
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" ) )
static_cast<KToolBarButton *>(button)->setText( d->plainText() );
}
}
QString KAction::text() const
{
return d->text();
}
@@ -1109,25 +1109,25 @@ void KAction::addContainer( QWidget* c, QWidget* w )
void KAction::activate()
{
slotActivated();
}
void KAction::slotActivated()
{
emit activated();
}
void KAction::slotDestroyed()
{
- kdDebug(129) << "KAction::slotDestroyed(): this = " << this << ", name = \"" << name() << "\", sender = " << sender() << endl;
+
const QObject* o = sender();
/*
// KDE 4: remove
if ( o == d->m_kaccel )
{
d->m_kaccel = 0;
return;
}
// KDE 4: remove end