Diffstat (limited to 'core/pim/osearch/mainwindow.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/pim/osearch/mainwindow.cpp | 43 |
1 files changed, 35 insertions, 8 deletions
diff --git a/core/pim/osearch/mainwindow.cpp b/core/pim/osearch/mainwindow.cpp index b80c637..89ab690 100644 --- a/core/pim/osearch/mainwindow.cpp +++ b/core/pim/osearch/mainwindow.cpp | |||
@@ -21,2 +21,3 @@ | |||
21 | #include <qpe/config.h> | 21 | #include <qpe/config.h> |
22 | #include <qpe/global.h> | ||
22 | #include <qaction.h> | 23 | #include <qaction.h> |
@@ -86,3 +87,2 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : | |||
86 | 87 | ||
87 | makeMenu(); | ||
88 | setCentralWidget( mainFrame ); | 88 | setCentralWidget( mainFrame ); |
@@ -98,2 +98,3 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : | |||
98 | 98 | ||
99 | makeMenu(); | ||
99 | 100 | ||
@@ -103,2 +104,3 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : | |||
103 | actionWildcards->setOn( cfg.readBoolEntry( "wildcards", false ) ); | 104 | actionWildcards->setOn( cfg.readBoolEntry( "wildcards", false ) ); |
105 | // actionWholeWordsOnly->setOn( cfg.readBoolEntry( "whole_words_only", false ) ); | ||
104 | } | 106 | } |
@@ -119,3 +121,14 @@ void MainWindow::makeMenu() | |||
119 | menuBar->insertItem( tr( "Settings" ), cfgMenu ); | 121 | menuBar->insertItem( tr( "Settings" ), cfgMenu ); |
122 | |||
123 | //SETTINGS MENU | ||
120 | cfgMenu->insertItem( tr( "Search" ), searchOptions ); | 124 | cfgMenu->insertItem( tr( "Search" ), searchOptions ); |
125 | QPopupMenu *pop; | ||
126 | for (SearchGroup *s = searches.first(); s != 0; s = searches.next() ){ | ||
127 | pop = s->popupMenu(); | ||
128 | if (pop){ | ||
129 | qDebug("inserting settings menu for %s",s->text(0).latin1()); | ||
130 | cfgMenu->insertItem( s->text(0), pop ); | ||
131 | //connect( pop, SIGNAL( activated(int) ), SLOT( optionChanged(int) ) ); | ||
132 | } | ||
133 | } | ||
121 | 134 | ||
@@ -128,4 +141,7 @@ void MainWindow::makeMenu() | |||
128 | searchMenu->insertItem( tr( "Options" ), searchOptions ); | 141 | searchMenu->insertItem( tr( "Options" ), searchOptions ); |
142 | //connect( searchOptions, SIGNAL( activated(int) ), SLOT( optionChanged(int) ) ); | ||
129 | 143 | ||
130 | //SEARCH OPTIONS | 144 | //SEARCH OPTIONS |
145 | //actionWholeWordsOnly = new QAction( tr("Whole words only"),QString::null, 0, this, 0, true ); | ||
146 | //actionWholeWordsOnly->addTo( searchOptions ); | ||
131 | actionCaseSensitiv = new QAction( tr("Case sensitiv"),QString::null, 0, this, 0, true ); | 147 | actionCaseSensitiv = new QAction( tr("Case sensitiv"),QString::null, 0, this, 0, true ); |
@@ -153,2 +169,3 @@ MainWindow::~MainWindow() | |||
153 | cfg.writeEntry( "wildcards", actionWildcards->isOn() ); | 169 | cfg.writeEntry( "wildcards", actionWildcards->isOn() ); |
170 | //cfg.writeEntry( "whole_words_only", actionWholeWordsOnly->isOn() ); | ||
154 | } | 171 | } |
@@ -184,10 +201,5 @@ void MainWindow::setCurrent(QListViewItem *item) | |||
184 | _buttonCount = acts.count(); | 201 | _buttonCount = acts.count(); |
185 | // buttonShow = new QPushButton( detailsFrame, "Show" ) ; | ||
186 | // buttonShow->setText( "test" ); | ||
187 | // buttonLayout->addWidget( buttonShow, 0 ); | ||
188 | // buttonGroupActions->insert(buttonShow); | ||
189 | detailsFrame->show(); | 202 | detailsFrame->show(); |
190 | }else detailsFrame->hide(); | 203 | }else detailsFrame->hide(); |
191 | //_currentItem = (OListViewItem*)item; | 204 | popupTimer->start( 300, true ); |
192 | popupTimer->start( 300 ); | ||
193 | } | 205 | } |
@@ -202,3 +214,6 @@ void MainWindow::showPopup() | |||
202 | qDebug("showPopup"); | 214 | qDebug("showPopup"); |
215 | popupTimer->stop(); | ||
203 | if (!_currentItem) return; | 216 | if (!_currentItem) return; |
217 | QPopupMenu *pop = _currentItem->popupMenu(); | ||
218 | if (pop) pop->popup( QCursor::pos() ); | ||
204 | } | 219 | } |
@@ -215,3 +230,10 @@ void MainWindow::searchStringChanged() | |||
215 | searchTimer->stop(); | 230 | searchTimer->stop(); |
216 | QRegExp re( _searchString, actionCaseSensitiv->isOn(), actionWildcards->isOn() ); | 231 | QString ss = _searchString; |
232 | //ss = Global::stringQuote( _searchString ); | ||
233 | //if (actionWholeWordsOnly->isOn()) | ||
234 | // ss = "\\s"+_searchString+"\\s"; | ||
235 | qDebug(" set searchString >%s<",ss.latin1()); | ||
236 | QRegExp re( ss ); | ||
237 | re.setCaseSensitive( actionCaseSensitiv->isOn() ); | ||
238 | re.setWildcard( actionWildcards->isOn() ); | ||
217 | for (SearchGroup *s = searches.first(); s != 0; s = searches.next() ) | 239 | for (SearchGroup *s = searches.first(); s != 0; s = searches.next() ) |
@@ -237 +259,6 @@ void MainWindow::slotAction( int act) | |||
237 | 259 | ||
260 | void MainWindow::optionChanged(int i) | ||
261 | { | ||
262 | qDebug("optionChanged(%i)",i); | ||
263 | searchStringChanged(); | ||
264 | } | ||