summaryrefslogtreecommitdiffabout
path: root/libkdepim
Unidiff
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 )
69 mDateButton = new QPushButton(this); 69 mDateButton = new QPushButton(this);
70 mDateButton->setPixmap(pixmap); 70 mDateButton->setPixmap(pixmap);
71 QPixmap pixmap2 = SmallIcon("today_small");
72 QPushButton* nowButton = new QPushButton(this);
73 nowButton->setPixmap(pixmap2);
71 74
72 mDateFrame = new QVBox(0,0,WType_Popup); 75 mDateFrame = new QVBox(0,0,WType_Popup);
@@ -83,4 +86,5 @@ KDateEdit::KDateEdit(QWidget *parent, const char *name, bool withoutDP )
83 connect(mDatePicker,SIGNAL(dateSelected(QDate)),mDateFrame,SLOT(hide())); 86 connect(mDatePicker,SIGNAL(dateSelected(QDate)),mDateFrame,SLOT(hide()));
84 connect(mDateButton,SIGNAL(clicked()),SLOT(toggleDatePicker())); 87 connect(mDateButton,SIGNAL(clicked()),SLOT(toggleDatePicker()));
88 connect(nowButton,SIGNAL(clicked()),SLOT(goToNow()));
85 mDateButton->setFocusPolicy( QWidget::NoFocus ); 89 mDateButton->setFocusPolicy( QWidget::NoFocus );
86 mDateButton->setAutoDefault( false ); 90 mDateButton->setAutoDefault( false );
@@ -133,4 +137,9 @@ void KDateEdit::clear()
133 mDateEdit->blockSignals(b); 137 mDateEdit->blockSignals(b);
134} 138}
139void KDateEdit::goToNow()
140{
141 setDate(QDate::currentDate() );
142 emit setTimeTo( QTime::currentTime() );
143}
135void KDateEdit::setDate(QDate newDate) 144void KDateEdit::setDate(QDate newDate)
136{ 145{
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
88 void dateChanged(QDate); 88 void dateChanged(QDate);
89 void returnPressed(); 89 void returnPressed();
90 void setTimeTo( QTime );
90 public slots: 91 public slots:
91 /** Sets the date. 92 /** Sets the date.
@@ -109,4 +110,5 @@ class KDateEdit : public QHBox
109 void lineEnterPressed(); 110 void lineEnterPressed();
110 void textChanged(const QString &); 111 void textChanged(const QString &);
112 void goToNow();
111 113
112 private: 114 private: