author | zautrix <zautrix> | 2005-02-16 22:38:07 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-02-16 22:38:07 (UTC) |
commit | 0eca506b6b4c7d7ef52bcecc5ad64193698dc3f3 (patch) (unidiff) | |
tree | 5bc6d924f1a71cc04cb8f1ee0001fce7cde0fa71 | |
parent | f33a37a0f7c9b37cfea1346ed373ce1c27c1d6ba (diff) | |
download | kdepimpi-0eca506b6b4c7d7ef52bcecc5ad64193698dc3f3.zip kdepimpi-0eca506b6b4c7d7ef52bcecc5ad64193698dc3f3.tar.gz kdepimpi-0eca506b6b4c7d7ef52bcecc5ad64193698dc3f3.tar.bz2 |
added today but to datepicker
-rw-r--r-- | bin/kdepim/WhatsNew.txt | 2 | ||||
-rw-r--r-- | libkdepim/kdatepicker.cpp | 12 | ||||
-rw-r--r-- | libkdepim/kdatepicker.h | 2 |
3 files changed, 15 insertions, 1 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index 3d8edfc..62c8447 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt | |||
@@ -7,4 +7,6 @@ Fixed a problem in dependency info in the ipk files for the Zaurus. | |||
7 | Added icon for the stealth new week view and made navigation more user friendly in monthview by adding a prev/next week button to the navigator bar. | 7 | Added icon for the stealth new week view and made navigation more user friendly in monthview by adding a prev/next week button to the navigator bar. |
8 | 8 | ||
9 | Added a "go today" button to the datepicker. | ||
10 | |||
9 | 11 | ||
10 | ********** VERSION 2.0.7 ************ | 12 | ********** VERSION 2.0.7 ************ |
diff --git a/libkdepim/kdatepicker.cpp b/libkdepim/kdatepicker.cpp index c13734f..77793c4 100644 --- a/libkdepim/kdatepicker.cpp +++ b/libkdepim/kdatepicker.cpp | |||
@@ -48,4 +48,5 @@ KDatePicker::KDatePicker(QWidget *parent, QDate dt, const char *name) | |||
48 | selectMonth(new QToolButton(this)), | 48 | selectMonth(new QToolButton(this)), |
49 | selectYear(new QToolButton(this)), | 49 | selectYear(new QToolButton(this)), |
50 | todayBut(new QToolButton(this)), | ||
50 | //line(new QLineEdit(this)), | 51 | //line(new QLineEdit(this)), |
51 | val(new KDateValidator(this)) | 52 | val(new KDateValidator(this)) |
@@ -67,4 +68,5 @@ KDatePicker::KDatePicker(QWidget *parent, QDate dt, const char *name) | |||
67 | monthForward->setPixmap(SmallIcon("1rightarrowB")); | 68 | monthForward->setPixmap(SmallIcon("1rightarrowB")); |
68 | monthBackward->setPixmap(SmallIcon("1leftarrowB")); | 69 | monthBackward->setPixmap(SmallIcon("1leftarrowB")); |
70 | todayBut->setPixmap(SmallIcon("today")); | ||
69 | setDate(dt); // set button texts | 71 | setDate(dt); // set button texts |
70 | connect(table, SIGNAL(dateChanged(QDate)), SLOT(dateChangedSlot(QDate))); | 72 | connect(table, SIGNAL(dateChanged(QDate)), SLOT(dateChangedSlot(QDate))); |
@@ -76,4 +78,5 @@ KDatePicker::KDatePicker(QWidget *parent, QDate dt, const char *name) | |||
76 | connect(selectMonth, SIGNAL(clicked()), SLOT(selectMonthClicked())); | 78 | connect(selectMonth, SIGNAL(clicked()), SLOT(selectMonthClicked())); |
77 | connect(selectYear, SIGNAL(clicked()), SLOT(selectYearClicked())); | 79 | connect(selectYear, SIGNAL(clicked()), SLOT(selectYearClicked())); |
80 | connect(todayBut, SIGNAL(clicked()), SLOT(goToday())); | ||
78 | //connect(line, SIGNAL(returnPressed()), SLOT(lineEnterPressed())); | 81 | //connect(line, SIGNAL(returnPressed()), SLOT(lineEnterPressed())); |
79 | connect(lineDate, SIGNAL(dateChanged(QDate)), SLOT(slotSetDate(QDate))); | 82 | connect(lineDate, SIGNAL(dateChanged(QDate)), SLOT(slotSetDate(QDate))); |
@@ -137,5 +140,7 @@ KDatePicker::resizeEvent(QResizeEvent*) | |||
137 | sizes[0]=lineDate->sizeHint(); | 140 | sizes[0]=lineDate->sizeHint(); |
138 | //line->setGeometry(0, height()-sizes[0].height(), width(), sizes[0].height()); | 141 | //line->setGeometry(0, height()-sizes[0].height(), width(), sizes[0].height()); |
139 | lineDate->setGeometry(0, height()-sizes[0].height(), width(), sizes[0].height()); | 142 | int todaywid = todayBut->sizeHint().width(); |
143 | todayBut->setGeometry(0, height()-sizes[0].height(),todaywid, sizes[0].height()); | ||
144 | lineDate->setGeometry(0+todaywid, height()-sizes[0].height(), width()-todaywid, sizes[0].height()); | ||
140 | // ----- adjust the table: | 145 | // ----- adjust the table: |
141 | table->setGeometry(0, buttonHeight, width(), | 146 | table->setGeometry(0, buttonHeight, width(), |
@@ -171,4 +176,9 @@ KDatePicker::date() const | |||
171 | } | 176 | } |
172 | 177 | ||
178 | void KDatePicker::goToday() | ||
179 | { | ||
180 | slotSetDate( QDate::currentDate() ); | ||
181 | |||
182 | } | ||
173 | void KDatePicker::slotSetDate( QDate date ) | 183 | void KDatePicker::slotSetDate( QDate date ) |
174 | { | 184 | { |
diff --git a/libkdepim/kdatepicker.h b/libkdepim/kdatepicker.h index 6625357..3db9a89 100644 --- a/libkdepim/kdatepicker.h +++ b/libkdepim/kdatepicker.h | |||
@@ -108,4 +108,5 @@ protected: | |||
108 | /// the resize event | 108 | /// the resize event |
109 | void resizeEvent(QResizeEvent*); | 109 | void resizeEvent(QResizeEvent*); |
110 | QToolButton *todayBut; | ||
110 | /// the year forward button | 111 | /// the year forward button |
111 | QToolButton *yearForward; | 112 | QToolButton *yearForward; |
@@ -142,4 +143,5 @@ protected slots: | |||
142 | void lineEnterPressed(); | 143 | void lineEnterPressed(); |
143 | void slotSetDate(QDate); | 144 | void slotSetDate(QDate); |
145 | void goToday(); | ||
144 | signals: | 146 | signals: |
145 | /** This signal is emitted each time the selected date is changed. | 147 | /** This signal is emitted each time the selected date is changed. |