summaryrefslogtreecommitdiffabout
path: root/libkdepim
Side-by-side diff
Diffstat (limited to 'libkdepim') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/kdateedit.cpp9
-rw-r--r--libkdepim/kdateedit.h2
2 files changed, 11 insertions, 0 deletions
diff --git a/libkdepim/kdateedit.cpp b/libkdepim/kdateedit.cpp
index 3d9e690..bf38479 100644
--- a/libkdepim/kdateedit.cpp
+++ b/libkdepim/kdateedit.cpp
@@ -69,4 +69,7 @@ KDateEdit::KDateEdit(QWidget *parent, const char *name, bool withoutDP )
mDateButton = new QPushButton(this);
mDateButton->setPixmap(pixmap);
+ QPixmap pixmap2 = SmallIcon("today_small");
+ QPushButton* nowButton = new QPushButton(this);
+ nowButton->setPixmap(pixmap2);
mDateFrame = new QVBox(0,0,WType_Popup);
@@ -83,4 +86,5 @@ KDateEdit::KDateEdit(QWidget *parent, const char *name, bool withoutDP )
connect(mDatePicker,SIGNAL(dateSelected(QDate)),mDateFrame,SLOT(hide()));
connect(mDateButton,SIGNAL(clicked()),SLOT(toggleDatePicker()));
+ connect(nowButton,SIGNAL(clicked()),SLOT(goToNow()));
mDateButton->setFocusPolicy( QWidget::NoFocus );
mDateButton->setAutoDefault( false );
@@ -133,4 +137,9 @@ void KDateEdit::clear()
mDateEdit->blockSignals(b);
}
+void KDateEdit::goToNow()
+{
+ setDate(QDate::currentDate() );
+ emit setTimeTo( QTime::currentTime() );
+}
void KDateEdit::setDate(QDate newDate)
{
diff --git a/libkdepim/kdateedit.h b/libkdepim/kdateedit.h
index cf3b90a..2d8c452 100644
--- a/libkdepim/kdateedit.h
+++ b/libkdepim/kdateedit.h
@@ -88,4 +88,5 @@ class KDateEdit : public QHBox
void dateChanged(QDate);
void returnPressed();
+ void setTimeTo( QTime );
public slots:
/** Sets the date.
@@ -109,4 +110,5 @@ class KDateEdit : public QHBox
void lineEnterPressed();
void textChanged(const QString &);
+ void goToNow();
private: