summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/osearch/mainwindow.cpp28
1 files changed, 22 insertions, 6 deletions
diff --git a/core/pim/osearch/mainwindow.cpp b/core/pim/osearch/mainwindow.cpp
index 093ca54..b80c637 100644
--- a/core/pim/osearch/mainwindow.cpp
+++ b/core/pim/osearch/mainwindow.cpp
@@ -19,4 +19,5 @@
#include <qpe/qpetoolbar.h>
#include <qpe/qpeapplication.h>
+#include <qpe/config.h>
#include <qaction.h>
#include <qmessagebox.h>
@@ -96,4 +97,9 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) :
connect(buttonGroupActions, SIGNAL(clicked(int)), SLOT( slotAction(int) ) );
+
+ Config cfg( "osearch", Config::User );
+ cfg.setGroup( "search_settings" );
+ actionCaseSensitiv->setOn( cfg.readBoolEntry( "caseSensitiv", false ) );
+ actionWildcards->setOn( cfg.readBoolEntry( "wildcards", false ) );
}
@@ -105,11 +111,13 @@ void MainWindow::makeMenu()
QPopupMenu *searchMenu = new QPopupMenu( menuBar );
// QPopupMenu *viewMenu = new QPopupMenu( menuBar );
-// QPopupMenu *cfgMenu = new QPopupMenu( menuBar );
-//
+ QPopupMenu *cfgMenu = new QPopupMenu( menuBar );
+ QPopupMenu *searchOptions = new QPopupMenu( cfgMenu );
+
setToolBarsMovable( false );
toolBar->setHorizontalStretchable( true );
menuBar->insertItem( tr( "Search" ), searchMenu );
-// menuBar->insertItem( tr( "View" ), viewMenu );
-// menuBar->insertItem( tr( "Settings" ), cfgMenu );
+ menuBar->insertItem( tr( "Settings" ), cfgMenu );
+ cfgMenu->insertItem( tr( "Search" ), searchOptions );
+
//SEARCH
@@ -118,9 +126,13 @@ void MainWindow::makeMenu()
connect( SearchAllAction, SIGNAL(activated()), this, SLOT(searchAll()) );
SearchAllAction->addTo( searchMenu );
+ searchMenu->insertItem( tr( "Options" ), searchOptions );
+
+ //SEARCH OPTIONS
actionCaseSensitiv = new QAction( tr("Case sensitiv"),QString::null, 0, this, 0, true );
- actionCaseSensitiv->addTo( searchMenu );
+ actionCaseSensitiv->addTo( searchOptions );
actionWildcards = new QAction( tr("Use wildcards"),QString::null, 0, this, 0, true );
- actionWildcards->addTo( searchMenu );
+ actionWildcards->addTo( searchOptions );
+ //SEARCH BAR
addToolBar( searchBar, "Search", QMainWindow::Top, TRUE );
QLineEdit *searchEdit = new QLineEdit( searchBar, "seachEdit" );
@@ -136,4 +148,8 @@ void MainWindow::makeMenu()
MainWindow::~MainWindow()
{
+ Config cfg( "osearch", Config::User );
+ cfg.setGroup( "search_settings" );
+ cfg.writeEntry( "caseSensitiv", actionCaseSensitiv->isOn() );
+ cfg.writeEntry( "wildcards", actionWildcards->isOn() );
}