author | tille <tille> | 2003-05-13 13:46:19 (UTC) |
---|---|---|
committer | tille <tille> | 2003-05-13 13:46:19 (UTC) |
commit | ba4bb8e673fba43ae7a232942dea14d166991530 (patch) (unidiff) | |
tree | e775ad637d5256eb1412e576c1bd5e77ed50406d /core/pim/osearch/mainwindow.cpp | |
parent | 1461a41433a732e3a615508e5de23f8acd91de6a (diff) | |
download | opie-ba4bb8e673fba43ae7a232942dea14d166991530.zip opie-ba4bb8e673fba43ae7a232942dea14d166991530.tar.gz opie-ba4bb8e673fba43ae7a232942dea14d166991530.tar.bz2 |
icons ;)
Diffstat (limited to 'core/pim/osearch/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/osearch/mainwindow.cpp | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/core/pim/osearch/mainwindow.cpp b/core/pim/osearch/mainwindow.cpp index e15cc7e..33a24bc 100644 --- a/core/pim/osearch/mainwindow.cpp +++ b/core/pim/osearch/mainwindow.cpp | |||
@@ -87,8 +87,10 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : | |||
87 | setCentralWidget( mainFrame ); | 87 | setCentralWidget( mainFrame ); |
88 | 88 | ||
89 | popupTimer = new QTimer(); | 89 | popupTimer = new QTimer(); |
90 | searchTimer = new QTimer(); | ||
90 | 91 | ||
91 | connect(popupTimer, SIGNAL(timeout()), SLOT(showPopup())); | 92 | connect(popupTimer, SIGNAL(timeout()), SLOT(showPopup())); |
93 | connect(searchTimer, SIGNAL(timeout()), SLOT(searchStringChanged())); | ||
92 | connect(resultsList, SIGNAL(pressed(QListViewItem*)), SLOT(setCurrent(QListViewItem*))); | 94 | connect(resultsList, SIGNAL(pressed(QListViewItem*)), SLOT(setCurrent(QListViewItem*))); |
93 | connect(resultsList, SIGNAL(clicked(QListViewItem*)), SLOT(stopTimer(QListViewItem*))); | 95 | connect(resultsList, SIGNAL(clicked(QListViewItem*)), SLOT(stopTimer(QListViewItem*))); |
94 | connect(buttonGroupActions, SIGNAL(clicked(int)), SLOT( slotAction(int) ) ); | 96 | connect(buttonGroupActions, SIGNAL(clicked(int)), SLOT( slotAction(int) ) ); |
@@ -111,9 +113,10 @@ void MainWindow::makeMenu() | |||
111 | // menuBar->insertItem( tr( "Settings" ), cfgMenu ); | 113 | // menuBar->insertItem( tr( "Settings" ), cfgMenu ); |
112 | 114 | ||
113 | //SEARCH | 115 | //SEARCH |
114 | QAction *action = new QAction( tr("Search all"),QString::null, 0, this, 0 ); | 116 | SearchAllAction = new QAction( tr("Search all"),QString::null, 0, this, 0 ); |
115 | connect( action, SIGNAL(activated()), this, SLOT(searchAll()) ); | 117 | SearchAllAction->setIconSet( Resource::loadIconSet( "find" ) ); |
116 | action->addTo( searchMenu ); | 118 | connect( SearchAllAction, SIGNAL(activated()), this, SLOT(searchAll()) ); |
119 | SearchAllAction->addTo( searchMenu ); | ||
117 | actionCaseSensitiv = new QAction( tr("Case sensitiv"),QString::null, 0, this, 0, true ); | 120 | actionCaseSensitiv = new QAction( tr("Case sensitiv"),QString::null, 0, this, 0, true ); |
118 | actionCaseSensitiv->addTo( searchMenu ); | 121 | actionCaseSensitiv->addTo( searchMenu ); |
119 | actionWildcards = new QAction( tr("Use wildcards"),QString::null, 0, this, 0, true ); | 122 | actionWildcards = new QAction( tr("Use wildcards"),QString::null, 0, this, 0, true ); |
@@ -123,6 +126,7 @@ void MainWindow::makeMenu() | |||
123 | QLineEdit *searchEdit = new QLineEdit( searchBar, "seachEdit" ); | 126 | QLineEdit *searchEdit = new QLineEdit( searchBar, "seachEdit" ); |
124 | searchBar->setHorizontalStretchable( TRUE ); | 127 | searchBar->setHorizontalStretchable( TRUE ); |
125 | searchBar->setStretchableWidget( searchEdit ); | 128 | searchBar->setStretchableWidget( searchEdit ); |
129 | SearchAllAction->addTo( searchBar ); | ||
126 | connect( searchEdit, SIGNAL( textChanged( const QString & ) ), | 130 | connect( searchEdit, SIGNAL( textChanged( const QString & ) ), |
127 | this, SLOT( setSearch( const QString & ) ) ); | 131 | this, SLOT( setSearch( const QString & ) ) ); |
128 | 132 | ||
@@ -184,16 +188,24 @@ void MainWindow::showPopup() | |||
184 | 188 | ||
185 | void MainWindow::setSearch( const QString &key ) | 189 | void MainWindow::setSearch( const QString &key ) |
186 | { | 190 | { |
187 | QRegExp re( key, actionCaseSensitiv->isOn(), actionWildcards->isOn() ); | 191 | searchTimer->stop(); |
192 | _searchString = key; | ||
193 | searchTimer->start( 300 ); | ||
194 | } | ||
195 | |||
196 | void MainWindow::searchStringChanged() | ||
197 | { | ||
198 | searchTimer->stop(); | ||
199 | QRegExp re( _searchString, actionCaseSensitiv->isOn(), actionWildcards->isOn() ); | ||
188 | for (SearchGroup *s = searches.first(); s != 0; s = searches.next() ) | 200 | for (SearchGroup *s = searches.first(); s != 0; s = searches.next() ) |
189 | s->setSearch( re ); | 201 | s->setSearch( re ); |
190 | } | 202 | } |
191 | 203 | ||
192 | void MainWindow::searchAll() | 204 | void MainWindow::searchAll() |
193 | { | 205 | { |
194 | bool openState; | ||
195 | for (SearchGroup *s = searches.first(); s != 0; s = searches.next() ){ | 206 | for (SearchGroup *s = searches.first(); s != 0; s = searches.next() ){ |
196 | s->doSearch(); | 207 | s->doSearch(); |
208 | //resultsList->repaint(); | ||
197 | } | 209 | } |
198 | } | 210 | } |
199 | 211 | ||