author | zecke <zecke> | 2004-02-18 22:45:27 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-02-18 22:45:27 (UTC) |
commit | f8caabcef314cad5007fec940af48d8cd4612c49 (patch) (unidiff) | |
tree | 3d094ccc98d3c72de7b921900e898ba79133aef3 | |
parent | cfd235730a4619ae9181f0d78d78a7f9360ea49e (diff) | |
download | opie-f8caabcef314cad5007fec940af48d8cd4612c49.zip opie-f8caabcef314cad5007fec940af48d8cd4612c49.tar.gz opie-f8caabcef314cad5007fec940af48d8cd4612c49.tar.bz2 |
Clarify on the start date for searches
-rw-r--r-- | library/findwidget_p.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/library/findwidget_p.cpp b/library/findwidget_p.cpp index 9ecaa40..287e125 100644 --- a/library/findwidget_p.cpp +++ b/library/findwidget_p.cpp | |||
@@ -47,73 +47,74 @@ FindWidget::FindWidget( const QString &appName, QWidget *parent, | |||
47 | // hide junk for the moment... | 47 | // hide junk for the moment... |
48 | lblStartDate->hide(); | 48 | lblStartDate->hide(); |
49 | cmdStartDate->hide(); | 49 | cmdStartDate->hide(); |
50 | QPopupMenu *m1 = new QPopupMenu( this ); | 50 | QPopupMenu *m1 = new QPopupMenu( this ); |
51 | dtPicker = new DateBookMonth( m1, 0, TRUE ); | 51 | dtPicker = new DateBookMonth( m1, 0, TRUE ); |
52 | dtPicker->setDate( mDate.year(), mDate.month(), mDate.day() ); | 52 | dtPicker->setDate( mDate.year(), mDate.month(), mDate.day() ); |
53 | m1->insertItem( dtPicker ); | 53 | m1->insertItem( dtPicker ); |
54 | cmdStartDate->setPopup( m1 ); | 54 | cmdStartDate->setPopup( m1 ); |
55 | cmdStartDate->setText( TimeString::shortDate(mDate) ); | 55 | cmdStartDate->setText( TimeString::shortDate(mDate) ); |
56 | QObject::connect( dtPicker, SIGNAL(dateClicked(int, int, int)), | 56 | QObject::connect( dtPicker, SIGNAL(dateClicked(int, int, int)), |
57 | this, SLOT(slotDateChanged(int, int, int)) ); | 57 | this, SLOT(slotDateChanged(int, int, int)) ); |
58 | 58 | ||
59 | QObject::connect( cmdFind, SIGNAL(clicked()), | 59 | QObject::connect( cmdFind, SIGNAL(clicked()), |
60 | this, SLOT(slotFindClicked()) ); | 60 | this, SLOT(slotFindClicked()) ); |
61 | } | 61 | } |
62 | 62 | ||
63 | FindWidget::~FindWidget() | 63 | FindWidget::~FindWidget() |
64 | { | 64 | { |
65 | } | 65 | } |
66 | 66 | ||
67 | QString FindWidget::findText() const | 67 | QString FindWidget::findText() const |
68 | { | 68 | { |
69 | return txtFind->text(); | 69 | return txtFind->text(); |
70 | } | 70 | } |
71 | 71 | ||
72 | void FindWidget::slotFindClicked() | 72 | void FindWidget::slotFindClicked() |
73 | { | 73 | { |
74 | lblStatus->setText( "" ); | 74 | lblStatus->setText( "" ); |
75 | if ( cmdStartDate->isVisible() ) | 75 | if ( cmdStartDate->isVisible() ) |
76 | emit signalFindClicked( findText(), | 76 | emit signalFindClicked( findText(), |
77 | mDate, | 77 | mDate, |
78 | chkCase->isChecked(), | 78 | chkCase->isChecked(), |
79 | chkBackwards->isChecked(), | 79 | chkBackwards->isChecked(), |
80 | cmbCat->currentCategory() ); | 80 | cmbCat->currentCategory() ); |
81 | else | 81 | else |
82 | emit signalFindClicked( findText(), chkCase->isChecked(), | 82 | emit signalFindClicked( findText(), chkCase->isChecked(), |
83 | chkBackwards->isChecked(), | 83 | chkBackwards->isChecked(), |
84 | cmbCat->currentCategory() ); | 84 | cmbCat->currentCategory() ); |
85 | } | 85 | } |
86 | 86 | ||
87 | void FindWidget::setUseDate( bool show ) | 87 | void FindWidget::setUseDate( bool show ) |
88 | { | 88 | { |
89 | if ( show ) { | 89 | if ( show ) { |
90 | lblStartDate->show(); | 90 | lblStartDate->show(); |
91 | cmdStartDate->show(); | 91 | cmdStartDate->show(); |
92 | } else { | 92 | } else { |
93 | lblStartDate->hide(); | 93 | lblStartDate->hide(); |
94 | cmdStartDate->hide(); | 94 | cmdStartDate->hide(); |
95 | } | 95 | } |
96 | chkBackwards->setDisabled( show ); | 96 | chkBackwards->setDisabled( show ); |
97 | } | 97 | } |
98 | 98 | ||
99 | void FindWidget::setDate( const QDate &dt ) | 99 | void FindWidget::setDate( const QDate &dt ) |
100 | { | 100 | { |
101 | slotDateChanged( dt.year(), dt.month(), dt.day() ); | 101 | slotDateChanged( dt.year(), dt.month(), dt.day() ); |
102 | } | 102 | } |
103 | 103 | ||
104 | void FindWidget::slotNotFound() | 104 | void FindWidget::slotNotFound() |
105 | { | 105 | { |
106 | lblStatus->setText( tr("String Not Found.") ); | 106 | lblStatus->setText( tr("String Not Found.") ); |
107 | } | 107 | } |
108 | 108 | ||
109 | void FindWidget::slotWrapAround() | 109 | void FindWidget::slotWrapAround() |
110 | { | 110 | { |
111 | lblStatus->setText( tr("End reached, starting at beginning") ); | 111 | lblStatus->setText( tr("End reached, starting at %1", "Date using TimeString::shortDate") |
112 | .arg(TimeString::shortDate( mDate ) ) ); | ||
112 | } | 113 | } |
113 | 114 | ||
114 | void FindWidget::slotDateChanged( int year, int month, int day ) | 115 | void FindWidget::slotDateChanged( int year, int month, int day ) |
115 | { | 116 | { |
116 | mDate.setYMD( year, month, day ); | 117 | mDate.setYMD( year, month, day ); |
117 | cmdStartDate->setText( TimeString::shortDate( mDate ) ); | 118 | cmdStartDate->setText( TimeString::shortDate( mDate ) ); |
118 | dtPicker->setDate( year, month, day ); | 119 | dtPicker->setDate( year, month, day ); |
119 | } | 120 | } |