From 7a20fd33a2eab302bae7057f758d9fafcc3e716c Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Sun, 18 Feb 2007 15:09:18 +0000 Subject: [PATCH] make the year popup selector working again, and looking like the kdatepicker one svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=634846 --- extdate/extdatepicker.cpp | 4 +++- extdate/extdatetbl.cpp | 7 +++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/extdate/extdatepicker.cpp b/extdate/extdatepicker.cpp index 99830db..2bce5d7 100644 --- a/extdate/extdatepicker.cpp +++ b/extdate/extdatepicker.cpp @@ -374,7 +374,7 @@ ExtDatePicker::selectYearClicked() { // const ExtCalendarSystem * calendar = KGlobal::locale()->calendar(); - if (selectYear->isChecked()) + if (!selectYear->isChecked()) { return; } @@ -382,6 +382,7 @@ ExtDatePicker::selectYearClicked() int year; KPopupFrame* popup = new KPopupFrame(this); ExtDateInternalYearSelector* picker = new ExtDateInternalYearSelector(popup); + picker->setYear(d->calendar->year(table->getDate())); // ----- picker->resize(picker->sizeHint()); popup->setMainWidget(picker); @@ -406,6 +407,7 @@ ExtDatePicker::selectYearClicked() KNotification::beep(); } delete popup; + selectYear->setChecked(false); } void diff --git a/extdate/extdatetbl.cpp b/extdate/extdatetbl.cpp index a3e10a0..021e9d7 100644 --- a/extdate/extdatetbl.cpp +++ b/extdate/extdatetbl.cpp @@ -891,7 +891,7 @@ KPopupFrame::KPopupFrame(QWidget* parent) result(0), // rejected main(0) { - setFrameShape(QFrame::NoFrame); + setFrameStyle(QFrame::Box | QFrame::Raised); setMidLineWidth(2); } @@ -951,6 +951,9 @@ KPopupFrame::popup(const QPoint &pos) if (y < d.y()) y = 0; + if (QLineEdit *edit = qobject_cast(main)) + edit->selectAll(); + // Pop the thingy up. move(x, y); show(); @@ -960,7 +963,7 @@ int KPopupFrame::exec(const QPoint& pos) { popup(pos); - repaint(); + update(); qApp->enter_loop(); hide(); return result; -- 2.47.3