Diffstat (limited to 'core/pim/osearch/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/osearch/mainwindow.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/core/pim/osearch/mainwindow.cpp b/core/pim/osearch/mainwindow.cpp index 89ab690..6070fdf 100644 --- a/core/pim/osearch/mainwindow.cpp +++ b/core/pim/osearch/mainwindow.cpp | |||
@@ -11,24 +11,25 @@ | |||
11 | 11 | ||
12 | 12 | ||
13 | #include "mainwindow.h" | 13 | #include "mainwindow.h" |
14 | 14 | ||
15 | #include <qpe/qpemenubar.h> | 15 | #include <qpe/qpemenubar.h> |
16 | #include <qpe/qpemessagebox.h> | 16 | #include <qpe/qpemessagebox.h> |
17 | #include <qpe/resource.h> | 17 | #include <qpe/resource.h> |
18 | #include <qpe/config.h> | 18 | #include <qpe/config.h> |
19 | #include <qpe/qpetoolbar.h> | 19 | #include <qpe/qpetoolbar.h> |
20 | #include <qpe/qpeapplication.h> | 20 | #include <qpe/qpeapplication.h> |
21 | #include <qpe/config.h> | 21 | #include <qpe/config.h> |
22 | #include <qpe/global.h> | 22 | #include <qpe/global.h> |
23 | #include <opie/owait.h> | ||
23 | #include <qaction.h> | 24 | #include <qaction.h> |
24 | #include <qmessagebox.h> | 25 | #include <qmessagebox.h> |
25 | #include <qpopupmenu.h> | 26 | #include <qpopupmenu.h> |
26 | #include <qtoolbutton.h> | 27 | #include <qtoolbutton.h> |
27 | #include <qstring.h> | 28 | #include <qstring.h> |
28 | #include <qlabel.h> | 29 | #include <qlabel.h> |
29 | #include <qfile.h> | 30 | #include <qfile.h> |
30 | #include <qhbuttongroup.h> | 31 | #include <qhbuttongroup.h> |
31 | #include <qpushbutton.h> | 32 | #include <qpushbutton.h> |
32 | #include <qintdict.h> | 33 | #include <qintdict.h> |
33 | #include <qlayout.h> | 34 | #include <qlayout.h> |
34 | #include <qlineedit.h> | 35 | #include <qlineedit.h> |
@@ -202,55 +203,60 @@ void MainWindow::setCurrent(QListViewItem *item) | |||
202 | detailsFrame->show(); | 203 | detailsFrame->show(); |
203 | }else detailsFrame->hide(); | 204 | }else detailsFrame->hide(); |
204 | popupTimer->start( 300, true ); | 205 | popupTimer->start( 300, true ); |
205 | } | 206 | } |
206 | 207 | ||
207 | void MainWindow::stopTimer(QListViewItem*) | 208 | void MainWindow::stopTimer(QListViewItem*) |
208 | { | 209 | { |
209 | popupTimer->stop(); | 210 | popupTimer->stop(); |
210 | } | 211 | } |
211 | 212 | ||
212 | void MainWindow::showPopup() | 213 | void MainWindow::showPopup() |
213 | { | 214 | { |
214 | qDebug("showPopup"); | ||
215 | popupTimer->stop(); | 215 | popupTimer->stop(); |
216 | if (!_currentItem) return; | 216 | if (!_currentItem) return; |
217 | QPopupMenu *pop = _currentItem->popupMenu(); | 217 | QPopupMenu *pop = _currentItem->popupMenu(); |
218 | if (pop) pop->popup( QCursor::pos() ); | 218 | if (pop) pop->popup( QCursor::pos() ); |
219 | } | 219 | } |
220 | 220 | ||
221 | void MainWindow::setSearch( const QString &key ) | 221 | void MainWindow::setSearch( const QString &key ) |
222 | { | 222 | { |
223 | searchTimer->stop(); | 223 | searchTimer->stop(); |
224 | _searchString = key; | 224 | _searchString = key; |
225 | searchTimer->start( 300 ); | 225 | searchTimer->start( 300 ); |
226 | } | 226 | } |
227 | 227 | ||
228 | void MainWindow::searchStringChanged() | 228 | void MainWindow::searchStringChanged() |
229 | { | 229 | { |
230 | #ifdef NEW_OWAIT | ||
231 | OWait("setting search string"); | ||
232 | #endif | ||
230 | searchTimer->stop(); | 233 | searchTimer->stop(); |
231 | QString ss = _searchString; | 234 | QString ss = _searchString; |
232 | //ss = Global::stringQuote( _searchString ); | 235 | //ss = Global::stringQuote( _searchString ); |
233 | //if (actionWholeWordsOnly->isOn()) | 236 | //if (actionWholeWordsOnly->isOn()) |
234 | // ss = "\\s"+_searchString+"\\s"; | 237 | // ss = "\\s"+_searchString+"\\s"; |
235 | qDebug(" set searchString >%s<",ss.latin1()); | 238 | //qDebug(" set searchString >%s<",ss.latin1()); |
236 | QRegExp re( ss ); | 239 | QRegExp re( ss ); |
237 | re.setCaseSensitive( actionCaseSensitiv->isOn() ); | 240 | re.setCaseSensitive( actionCaseSensitiv->isOn() ); |
238 | re.setWildcard( actionWildcards->isOn() ); | 241 | re.setWildcard( actionWildcards->isOn() ); |
239 | for (SearchGroup *s = searches.first(); s != 0; s = searches.next() ) | 242 | for (SearchGroup *s = searches.first(); s != 0; s = searches.next() ) |
240 | s->setSearch( re ); | 243 | s->setSearch( re ); |
241 | } | 244 | } |
242 | 245 | ||
243 | void MainWindow::searchAll() | 246 | void MainWindow::searchAll() |
244 | { | 247 | { |
248 | #ifdef NEW_OWAIT | ||
249 | OWait("searching..."); | ||
250 | #endif | ||
245 | for (SearchGroup *s = searches.first(); s != 0; s = searches.next() ){ | 251 | for (SearchGroup *s = searches.first(); s != 0; s = searches.next() ){ |
246 | s->doSearch(); | 252 | s->doSearch(); |
247 | //resultsList->repaint(); | 253 | //resultsList->repaint(); |
248 | } | 254 | } |
249 | } | 255 | } |
250 | 256 | ||
251 | void MainWindow::slotAction( int act ) | 257 | void MainWindow::slotAction( int act ) |
252 | { | 258 | { |
253 | if (_currentItem->rtti() == OListViewItem::Result){ | 259 | if (_currentItem->rtti() == OListViewItem::Result){ |
254 | ResultItem *res = (ResultItem*)_currentItem; | 260 | ResultItem *res = (ResultItem*)_currentItem; |
255 | // ResultItem *res = dynamic_cast<ResultItem*>(item); | 261 | // ResultItem *res = dynamic_cast<ResultItem*>(item); |
256 | res->action(act); | 262 | res->action(act); |