Diffstat (limited to 'core/pim/osearch/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/osearch/mainwindow.cpp | 45 |
1 files changed, 36 insertions, 9 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 @@ #include <qpe/config.h> +#include <qpe/global.h> #include <qaction.h> @@ -86,3 +87,2 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : - makeMenu(); setCentralWidget( mainFrame ); @@ -98,2 +98,3 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : + makeMenu(); @@ -103,2 +104,3 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : actionWildcards->setOn( cfg.readBoolEntry( "wildcards", false ) ); +// actionWholeWordsOnly->setOn( cfg.readBoolEntry( "whole_words_only", false ) ); } @@ -119,3 +121,14 @@ void MainWindow::makeMenu() menuBar->insertItem( tr( "Settings" ), cfgMenu ); + + //SETTINGS MENU cfgMenu->insertItem( tr( "Search" ), searchOptions ); + QPopupMenu *pop; + for (SearchGroup *s = searches.first(); s != 0; s = searches.next() ){ + pop = s->popupMenu(); + if (pop){ + qDebug("inserting settings menu for %s",s->text(0).latin1()); + cfgMenu->insertItem( s->text(0), pop ); + //connect( pop, SIGNAL( activated(int) ), SLOT( optionChanged(int) ) ); + } + } @@ -128,4 +141,7 @@ void MainWindow::makeMenu() searchMenu->insertItem( tr( "Options" ), searchOptions ); + //connect( searchOptions, SIGNAL( activated(int) ), SLOT( optionChanged(int) ) ); //SEARCH OPTIONS + //actionWholeWordsOnly = new QAction( tr("Whole words only"),QString::null, 0, this, 0, true ); + //actionWholeWordsOnly->addTo( searchOptions ); actionCaseSensitiv = new QAction( tr("Case sensitiv"),QString::null, 0, this, 0, true ); @@ -153,2 +169,3 @@ MainWindow::~MainWindow() cfg.writeEntry( "wildcards", actionWildcards->isOn() ); + //cfg.writeEntry( "whole_words_only", actionWholeWordsOnly->isOn() ); } @@ -184,10 +201,5 @@ void MainWindow::setCurrent(QListViewItem *item) _buttonCount = acts.count(); -// buttonShow = new QPushButton( detailsFrame, "Show" ) ; -// buttonShow->setText( "test" ); -// buttonLayout->addWidget( buttonShow, 0 ); -// buttonGroupActions->insert(buttonShow); detailsFrame->show(); }else detailsFrame->hide(); - //_currentItem = (OListViewItem*)item; - popupTimer->start( 300 ); + popupTimer->start( 300, true ); } @@ -202,3 +214,6 @@ void MainWindow::showPopup() qDebug("showPopup"); + popupTimer->stop(); if (!_currentItem) return; + QPopupMenu *pop = _currentItem->popupMenu(); + if (pop) pop->popup( QCursor::pos() ); } @@ -215,3 +230,10 @@ void MainWindow::searchStringChanged() searchTimer->stop(); - QRegExp re( _searchString, actionCaseSensitiv->isOn(), actionWildcards->isOn() ); + QString ss = _searchString; + //ss = Global::stringQuote( _searchString ); +// if (actionWholeWordsOnly->isOn()) +// ss = "\\s"+_searchString+"\\s"; + qDebug(" set searchString >%s<",ss.latin1()); + QRegExp re( ss ); + re.setCaseSensitive( actionCaseSensitiv->isOn() ); + re.setWildcard( actionWildcards->isOn() ); for (SearchGroup *s = searches.first(); s != 0; s = searches.next() ) @@ -228,3 +250,3 @@ void MainWindow::searchAll() -void MainWindow::slotAction( int act) +void MainWindow::slotAction( int act ) { @@ -237 +259,6 @@ void MainWindow::slotAction( int act) +void MainWindow::optionChanged(int i) +{ + qDebug("optionChanged(%i)",i); + searchStringChanged(); +} |