author | zautrix <zautrix> | 2004-09-13 21:35:12 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-09-13 21:35:12 (UTC) |
commit | bd6b4acb39498ffea3beea7d9b5f7620b60c14db (patch) (side-by-side diff) | |
tree | e2d7425b7bb49fbcb7acb5ced497ac1fed06dfaf /libkdepim | |
parent | 06eabf6e82c0390699d11fd12580d91261829431 (diff) | |
download | kdepimpi-bd6b4acb39498ffea3beea7d9b5f7620b60c14db.zip kdepimpi-bd6b4acb39498ffea3beea7d9b5f7620b60c14db.tar.gz kdepimpi-bd6b4acb39498ffea3beea7d9b5f7620b60c14db.tar.bz2 |
Many bugfixes
-rw-r--r-- | libkdepim/addresseeview.cpp | 10 | ||||
-rw-r--r-- | libkdepim/kdateedit.cpp | 17 | ||||
-rw-r--r-- | libkdepim/kdateedit.h | 3 |
3 files changed, 24 insertions, 6 deletions
diff --git a/libkdepim/addresseeview.cpp b/libkdepim/addresseeview.cpp index d710541..5c69010 100644 --- a/libkdepim/addresseeview.cpp +++ b/libkdepim/addresseeview.cpp @@ -64,9 +64,9 @@ 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" ) ExternalAppHandler::instance()->mailToOneContact( n.mid(7) ); else if ( n.left( 7 ) == "phoneto" ) @@ -123,9 +123,15 @@ void AddresseeView::setAddressee( const KABC::Addressee& addr ) .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; diff --git a/libkdepim/kdateedit.cpp b/libkdepim/kdateedit.cpp index 5fb948a..c4c0081 100644 --- a/libkdepim/kdateedit.cpp +++ b/libkdepim/kdateedit.cpp @@ -123,9 +123,15 @@ KDateEdit::KDateEdit(QWidget *parent, const char *name, bool withoutDP ) 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; @@ -462,18 +468,23 @@ bool KDateEdit::eventFilter(QObject *, QEvent *e) } // 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()) { diff --git a/libkdepim/kdateedit.h b/libkdepim/kdateedit.h index 742d843..cf3b90a 100644 --- a/libkdepim/kdateedit.h +++ b/libkdepim/kdateedit.h @@ -77,9 +77,10 @@ class KDateEdit : public QHBox /** 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). |