summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--library/findwidget_p.cpp3
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
@@ -15,105 +15,106 @@
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#include "findwidget_p.h" 21#include "findwidget_p.h"
22 22
23#include <qpe/categories.h> 23#include <qpe/categories.h>
24#include <qpe/categoryselect.h> 24#include <qpe/categoryselect.h>
25#include <qpe/datebookmonth.h> 25#include <qpe/datebookmonth.h>
26#include <qpe/timestring.h> 26#include <qpe/timestring.h>
27 27
28#include <qcheckbox.h> 28#include <qcheckbox.h>
29#include <qlabel.h> 29#include <qlabel.h>
30#include <qlineedit.h> 30#include <qlineedit.h>
31#include <qmessagebox.h> 31#include <qmessagebox.h>
32#include <qpushbutton.h> 32#include <qpushbutton.h>
33#include <qpopupmenu.h> 33#include <qpopupmenu.h>
34#include <qtoolbutton.h> 34#include <qtoolbutton.h>
35 35
36FindWidget::FindWidget( const QString &appName, QWidget *parent, 36FindWidget::FindWidget( const QString &appName, QWidget *parent,
37 const char *name ) 37 const char *name )
38 : FindWidgetBase( parent, name ), 38 : FindWidgetBase( parent, name ),
39 mStrApp( appName ), 39 mStrApp( appName ),
40 mDate( QDate::currentDate() ) 40 mDate( QDate::currentDate() )
41{ 41{
42 setMaximumSize( sizeHint() ); 42 setMaximumSize( sizeHint() );
43 QArray<int> vl(0); 43 QArray<int> vl(0);
44 cmbCat->setCategories( vl, mStrApp ); 44 cmbCat->setCategories( vl, mStrApp );
45 cmbCat->setRemoveCategoryEdit( TRUE ); 45 cmbCat->setRemoveCategoryEdit( TRUE );
46 cmbCat->setAllCategories( TRUE ); 46 cmbCat->setAllCategories( TRUE );
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
63FindWidget::~FindWidget() 63FindWidget::~FindWidget()
64{ 64{
65} 65}
66 66
67QString FindWidget::findText() const 67QString FindWidget::findText() const
68{ 68{
69 return txtFind->text(); 69 return txtFind->text();
70} 70}
71 71
72void FindWidget::slotFindClicked() 72void 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
87void FindWidget::setUseDate( bool show ) 87void 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
99void FindWidget::setDate( const QDate &dt ) 99void 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
104void FindWidget::slotNotFound() 104void FindWidget::slotNotFound()
105{ 105{
106 lblStatus->setText( tr("String Not Found.") ); 106 lblStatus->setText( tr("String Not Found.") );
107} 107}
108 108
109void FindWidget::slotWrapAround() 109void 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
114void FindWidget::slotDateChanged( int year, int month, int day ) 115void 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}