--Boundary-00=_KRmO/C3/gwvVfQy Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: quoted-printable Content-Description: clearsigned data Content-Disposition: inline =2D----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The subject says it. The attached patch adds a "Today" button in the bottom= =20 area of the datepicker. If OK, please commit, I have no CVS right. Thanks, =2D --=20 Best regards/Sch=F6ne Gr=FC=DFe Martin Public key at: http://blackhole.pca.dfn.de:11371/pks/lookup?op=3Dget&search=3D0x8DFB0F86 =2D----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE/OmRKHmdPoI37D4YRAhweAJ43uymABjyLVsVRPnwlE6X8wwx6UwCfTJEe z2hjj3JZvLlHVZqFiJjOd0o=3D =3D9Ste =2D----END PGP SIGNATURE----- --Boundary-00=_KRmO/C3/gwvVfQy Content-Type: application/octet-stream; name="patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="patch" Index: kdatepicker.cpp =================================================================== RCS file: /home/kde/kdelibs/kdeui/kdatepicker.cpp,v retrieving revision 1.60 diff -u -3 -p -r1.60 kdatepicker.cpp --- kdatepicker.cpp 17 Jul 2003 21:02:04 -0000 1.60 +++ kdatepicker.cpp 13 Aug 2003 16:13:11 -0000 @@ -45,11 +45,12 @@ class KDatePicker::KDatePickerPrivate { public: - KDatePickerPrivate() : closeButton(0L), selectWeek(0L), navigationLayout(0) {} + KDatePickerPrivate() : closeButton(0L), selectWeek(0L), todayButton(0), navigationLayout(0) {} KToolBar *tb; QToolButton *closeButton; QToolButton *selectWeek; + QToolButton *todayButton; QBoxLayout *navigationLayout; }; @@ -95,6 +96,9 @@ void KDatePicker::init( const QDate &dt d->selectWeek = new QToolButton( this ); d->selectWeek->setAutoRaise(true); + d->todayButton = new QToolButton(this); + d->todayButton->setAutoRaise(true); + d->todayButton->setText(i18n("Today")); QToolTip::add(yearForward, i18n("Next year")); QToolTip::add(yearBackward, i18n("Previous year")); @@ -103,6 +107,7 @@ void KDatePicker::init( const QDate &dt QToolTip::add(d->selectWeek, i18n("Select a week")); QToolTip::add(selectMonth, i18n("Select a month")); QToolTip::add(selectYear, i18n("Select a year")); + QToolTip::add(d->todayButton, i18n("Select the current day")); // ----- setFontSize(fontsize); @@ -120,6 +125,7 @@ void KDatePicker::init( const QDate &dt connect(yearForward, SIGNAL(clicked()), SLOT(yearForwardClicked())); connect(yearBackward, SIGNAL(clicked()), SLOT(yearBackwardClicked())); connect(d->selectWeek, SIGNAL(clicked()), SLOT(selectWeekClicked())); + connect(d->todayButton, SIGNAL(clicked()), SLOT(todayButtonClicked())); connect(selectMonth, SIGNAL(clicked()), SLOT(selectMonthClicked())); connect(selectYear, SIGNAL(clicked()), SLOT(selectYearClicked())); connect(line, SIGNAL(returnPressed()), SLOT(lineEnterPressed())); @@ -134,6 +140,7 @@ void KDatePicker::init( const QDate &dt QBoxLayout * bottomLayout = new QHBoxLayout(topLayout); bottomLayout->addWidget(line); + bottomLayout->addWidget(d->todayButton); bottomLayout->addWidget(d->selectWeek); } @@ -395,6 +402,12 @@ KDatePicker::lineEnterPressed() KNotifyClient::beep(); kdDebug(298) << "KDatePicker::lineEnterPressed: invalid date entered." << endl; } +} + +void +KDatePicker::todayButtonClicked() +{ + setDate(QDate::currentDate()); } QSize Index: kdatepicker.h =================================================================== RCS file: /home/kde/kdelibs/kdeui/kdatepicker.h,v retrieving revision 1.34 diff -u -3 -p -r1.34 kdatepicker.h --- kdatepicker.h 15 Feb 2003 03:14:01 -0000 1.34 +++ kdatepicker.h 13 Aug 2003 16:13:11 -0000 @@ -188,6 +188,8 @@ protected slots: void selectMonthClicked(); void selectYearClicked(); void lineEnterPressed(); + /// @since 3.2 + void todayButtonClicked(); signals: /** This signal is emitted each time the selected date is changed. * Usually, this does not mean that the date has been entered, --Boundary-00=_KRmO/C3/gwvVfQy Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe << --Boundary-00=_KRmO/C3/gwvVfQy--