author | tille <tille> | 2003-05-14 16:54:01 (UTC) |
---|---|---|
committer | tille <tille> | 2003-05-14 16:54:01 (UTC) |
commit | dabb32d52954874ffd8c79de3a82923dde5b27af (patch) (unidiff) | |
tree | e116b2e1b15c84a25a39fc2b9f2bad498570e9f7 | |
parent | 6bc6d8eb1051335e99416f5a8311788b40c7476a (diff) | |
download | opie-dabb32d52954874ffd8c79de3a82923dde5b27af.zip opie-dabb32d52954874ffd8c79de3a82923dde5b27af.tar.gz opie-dabb32d52954874ffd8c79de3a82923dde5b27af.tar.bz2 |
added settings
-rw-r--r-- | core/pim/osearch/mainwindow.cpp | 28 |
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 | |||
@@ -18,6 +18,7 @@ | |||
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 <qaction.h> | 22 | #include <qaction.h> |
22 | #include <qmessagebox.h> | 23 | #include <qmessagebox.h> |
23 | #include <qpopupmenu.h> | 24 | #include <qpopupmenu.h> |
@@ -95,6 +96,11 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : | |||
95 | connect(resultsList, SIGNAL(clicked(QListViewItem*)), SLOT(stopTimer(QListViewItem*))); | 96 | connect(resultsList, SIGNAL(clicked(QListViewItem*)), SLOT(stopTimer(QListViewItem*))); |
96 | connect(buttonGroupActions, SIGNAL(clicked(int)), SLOT( slotAction(int) ) ); | 97 | connect(buttonGroupActions, SIGNAL(clicked(int)), SLOT( slotAction(int) ) ); |
97 | 98 | ||
99 | |||
100 | Config cfg( "osearch", Config::User ); | ||
101 | cfg.setGroup( "search_settings" ); | ||
102 | actionCaseSensitiv->setOn( cfg.readBoolEntry( "caseSensitiv", false ) ); | ||
103 | actionWildcards->setOn( cfg.readBoolEntry( "wildcards", false ) ); | ||
98 | } | 104 | } |
99 | 105 | ||
100 | void MainWindow::makeMenu() | 106 | void MainWindow::makeMenu() |
@@ -104,24 +110,30 @@ void MainWindow::makeMenu() | |||
104 | QPEMenuBar *menuBar = new QPEMenuBar( toolBar ); | 110 | QPEMenuBar *menuBar = new QPEMenuBar( toolBar ); |
105 | QPopupMenu *searchMenu = new QPopupMenu( menuBar ); | 111 | QPopupMenu *searchMenu = new QPopupMenu( menuBar ); |
106 | // QPopupMenu *viewMenu = new QPopupMenu( menuBar ); | 112 | // QPopupMenu *viewMenu = new QPopupMenu( menuBar ); |
107 | // QPopupMenu *cfgMenu = new QPopupMenu( menuBar ); | 113 | QPopupMenu *cfgMenu = new QPopupMenu( menuBar ); |
108 | // | 114 | QPopupMenu *searchOptions = new QPopupMenu( cfgMenu ); |
115 | |||
109 | setToolBarsMovable( false ); | 116 | setToolBarsMovable( false ); |
110 | toolBar->setHorizontalStretchable( true ); | 117 | toolBar->setHorizontalStretchable( true ); |
111 | menuBar->insertItem( tr( "Search" ), searchMenu ); | 118 | menuBar->insertItem( tr( "Search" ), searchMenu ); |
112 | // menuBar->insertItem( tr( "View" ), viewMenu ); | 119 | menuBar->insertItem( tr( "Settings" ), cfgMenu ); |
113 | // menuBar->insertItem( tr( "Settings" ), cfgMenu ); | 120 | cfgMenu->insertItem( tr( "Search" ), searchOptions ); |
121 | |||
114 | 122 | ||
115 | //SEARCH | 123 | //SEARCH |
116 | SearchAllAction = new QAction( tr("Search all"),QString::null, 0, this, 0 ); | 124 | SearchAllAction = new QAction( tr("Search all"),QString::null, 0, this, 0 ); |
117 | SearchAllAction->setIconSet( Resource::loadIconSet( "find" ) ); | 125 | SearchAllAction->setIconSet( Resource::loadIconSet( "find" ) ); |
118 | connect( SearchAllAction, SIGNAL(activated()), this, SLOT(searchAll()) ); | 126 | connect( SearchAllAction, SIGNAL(activated()), this, SLOT(searchAll()) ); |
119 | SearchAllAction->addTo( searchMenu ); | 127 | SearchAllAction->addTo( searchMenu ); |
128 | searchMenu->insertItem( tr( "Options" ), searchOptions ); | ||
129 | |||
130 | //SEARCH OPTIONS | ||
120 | actionCaseSensitiv = new QAction( tr("Case sensitiv"),QString::null, 0, this, 0, true ); | 131 | actionCaseSensitiv = new QAction( tr("Case sensitiv"),QString::null, 0, this, 0, true ); |
121 | actionCaseSensitiv->addTo( searchMenu ); | 132 | actionCaseSensitiv->addTo( searchOptions ); |
122 | actionWildcards = new QAction( tr("Use wildcards"),QString::null, 0, this, 0, true ); | 133 | actionWildcards = new QAction( tr("Use wildcards"),QString::null, 0, this, 0, true ); |
123 | actionWildcards->addTo( searchMenu ); | 134 | actionWildcards->addTo( searchOptions ); |
124 | 135 | ||
136 | //SEARCH BAR | ||
125 | addToolBar( searchBar, "Search", QMainWindow::Top, TRUE ); | 137 | addToolBar( searchBar, "Search", QMainWindow::Top, TRUE ); |
126 | QLineEdit *searchEdit = new QLineEdit( searchBar, "seachEdit" ); | 138 | QLineEdit *searchEdit = new QLineEdit( searchBar, "seachEdit" ); |
127 | searchEdit->setFocus(); | 139 | searchEdit->setFocus(); |
@@ -135,6 +147,10 @@ void MainWindow::makeMenu() | |||
135 | 147 | ||
136 | MainWindow::~MainWindow() | 148 | MainWindow::~MainWindow() |
137 | { | 149 | { |
150 | Config cfg( "osearch", Config::User ); | ||
151 | cfg.setGroup( "search_settings" ); | ||
152 | cfg.writeEntry( "caseSensitiv", actionCaseSensitiv->isOn() ); | ||
153 | cfg.writeEntry( "wildcards", actionWildcards->isOn() ); | ||
138 | } | 154 | } |
139 | 155 | ||
140 | void MainWindow::setCurrent(QListViewItem *item) | 156 | void MainWindow::setCurrent(QListViewItem *item) |