Diffstat (limited to 'core/pim/osearch/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/osearch/mainwindow.cpp | 50 |
1 files changed, 27 insertions, 23 deletions
diff --git a/core/pim/osearch/mainwindow.cpp b/core/pim/osearch/mainwindow.cpp index 55302cb..95f5967 100644 --- a/core/pim/osearch/mainwindow.cpp +++ b/core/pim/osearch/mainwindow.cpp | |||
@@ -1,63 +1,67 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | * * | 2 | * * |
3 | * This program is free software; you can redistribute it and/or modify * | 3 | * This program is free software; you can redistribute it and/or modify * |
4 | * it under the terms of the GNU General Public License as published by * | 4 | * it under the terms of the GNU General Public License as published by * |
5 | * the Free Software Foundation; either version 2 of the License, or * | 5 | * the Free Software Foundation; either version 2 of the License, or * |
6 | * (at your option) any later version. * | 6 | * (at your option) any later version. * |
7 | * * | 7 | * * |
8 | ***************************************************************************/ | 8 | ***************************************************************************/ |
9 | 9 | ||
10 | // (c) 2002 Patrick S. Vogt <tille@handhelds.org> | 10 | // (c) 2002 Patrick S. Vogt <tille@handhelds.org> |
11 | 11 | ||
12 | 12 | ||
13 | #include "olistview.h" | ||
14 | #include "olistviewitem.h" | ||
15 | #include "resultitem.h" | ||
16 | #include "adresssearch.h" | ||
17 | #include "todosearch.h" | ||
18 | #include "datebooksearch.h" | ||
19 | #include "applnksearch.h" | ||
20 | #include "doclnksearch.h" | ||
21 | #include "mainwindow.h" | ||
13 | 22 | ||
23 | #include <opie2/owait.h> | ||
24 | |||
25 | #include <qpe/qpemessagebox.h> | ||
26 | #include <qpe/resource.h> | ||
27 | #include <qpe/config.h> | ||
28 | |||
29 | #include <qpe/qpeapplication.h> | ||
30 | #include <qpe/config.h> | ||
31 | #include <qpe/global.h> | ||
32 | |||
33 | #include <qtoolbar.h> | ||
14 | #include <qaction.h> | 34 | #include <qaction.h> |
15 | #include <qmessagebox.h> | 35 | #include <qmessagebox.h> |
16 | #include <qpopupmenu.h> | 36 | #include <qpopupmenu.h> |
17 | #include <qtoolbutton.h> | 37 | #include <qtoolbutton.h> |
18 | #include <qstring.h> | 38 | #include <qstring.h> |
19 | #include <qlabel.h> | 39 | #include <qlabel.h> |
20 | #include <qfile.h> | 40 | #include <qfile.h> |
21 | #include <qhbuttongroup.h> | 41 | #include <qhbuttongroup.h> |
22 | #include <qhbox.h> | 42 | #include <qhbox.h> |
23 | #include <qpushbutton.h> | 43 | #include <qpushbutton.h> |
24 | #include <qintdict.h> | 44 | #include <qintdict.h> |
25 | #include <qlayout.h> | 45 | #include <qlayout.h> |
26 | #include <qlineedit.h> | 46 | #include <qlineedit.h> |
27 | #include <qsignalmapper.h> | 47 | #include <qsignalmapper.h> |
28 | #include <qtextbrowser.h> | 48 | #include <qtextbrowser.h> |
29 | #include <qregexp.h> | 49 | #include <qregexp.h> |
30 | #include <qwhatsthis.h> | 50 | #include <qwhatsthis.h> |
31 | #include <qmenubar.h> | 51 | #include <qmenubar.h> |
32 | #include <qpe/qpemessagebox.h> | ||
33 | #include <qpe/resource.h> | ||
34 | #include <qpe/config.h> | ||
35 | #include <qtoolbar.h> | ||
36 | #include <qpe/qpeapplication.h> | ||
37 | #include <qpe/config.h> | ||
38 | #include <qpe/global.h> | ||
39 | #include <opie/owait.h> | ||
40 | 52 | ||
41 | #include "olistview.h" | ||
42 | #include "olistviewitem.h" | ||
43 | #include "resultitem.h" | ||
44 | #include "adresssearch.h" | ||
45 | #include "todosearch.h" | ||
46 | #include "datebooksearch.h" | ||
47 | #include "applnksearch.h" | ||
48 | #include "doclnksearch.h" | ||
49 | #include "mainwindow.h" | ||
50 | 53 | ||
51 | static const char* const image1_data[] = { | 54 | |
55 | static const char* const image1_data[] = { | ||
52 | "14 14 3 1", | 56 | "14 14 3 1", |
53 | ". c None", | 57 | ". c None", |
54 | "# c #000000", | 58 | "# c #000000", |
55 | "a c #ff0000", | 59 | "a c #ff0000", |
56 | "..............", | 60 | "..............", |
57 | "..##.......###", | 61 | "..##.......###", |
58 | ".#aa#....##aa#", | 62 | ".#aa#....##aa#", |
59 | "#aaaa#.##aaaa#", | 63 | "#aaaa#.##aaaa#", |
60 | ".##aaa#aaaaa##", | 64 | ".##aaa#aaaaa##", |
61 | "...#aaaaaaa#..", | 65 | "...#aaaaaaa#..", |
62 | "....#aaaaa#...", | 66 | "....#aaaaa#...", |
63 | "...#aaaaa#....", | 67 | "...#aaaaa#....", |
@@ -169,43 +173,43 @@ void MainWindow::makeMenu() | |||
169 | //SEARCH OPTIONS | 173 | //SEARCH OPTIONS |
170 | //actionWholeWordsOnly = new QAction( tr("Whole words only"),QString::null, 0, this, 0, true ); | 174 | //actionWholeWordsOnly = new QAction( tr("Whole words only"),QString::null, 0, this, 0, true ); |
171 | //actionWholeWordsOnly->addTo( searchOptions ); | 175 | //actionWholeWordsOnly->addTo( searchOptions ); |
172 | actionCaseSensitiv = new QAction( tr("Case sensitiv"),QString::null, 0, this, 0, true ); | 176 | actionCaseSensitiv = new QAction( tr("Case sensitiv"),QString::null, 0, this, 0, true ); |
173 | actionCaseSensitiv->addTo( searchOptions ); | 177 | actionCaseSensitiv->addTo( searchOptions ); |
174 | actionWildcards = new QAction( tr("Use wildcards"),QString::null, 0, this, 0, true ); | 178 | actionWildcards = new QAction( tr("Use wildcards"),QString::null, 0, this, 0, true ); |
175 | actionWildcards->addTo( searchOptions ); | 179 | actionWildcards->addTo( searchOptions ); |
176 | 180 | ||
177 | //SEARCH BAR | 181 | //SEARCH BAR |
178 | LabelEnterText = new QLabel( searchBar, "Label" ); | 182 | LabelEnterText = new QLabel( searchBar, "Label" ); |
179 | LabelEnterText->setAutoMask( FALSE ); | 183 | LabelEnterText->setAutoMask( FALSE ); |
180 | LabelEnterText->setText( tr( "Search for: " ) ); | 184 | LabelEnterText->setText( tr( "Search for: " ) ); |
181 | 185 | ||
182 | addToolBar( searchBar, "Search", QMainWindow::Top, TRUE ); | 186 | addToolBar( searchBar, "Search", QMainWindow::Top, TRUE ); |
183 | QLineEdit *searchEdit = new QLineEdit( searchBar, "seachEdit" ); | 187 | QLineEdit *searchEdit = new QLineEdit( searchBar, "seachEdit" ); |
184 | QWhatsThis::add( searchEdit, tr("Enter your search terms here") ); | 188 | QWhatsThis::add( searchEdit, tr("Enter your search terms here") ); |
185 | searchEdit->setFocus(); | 189 | searchEdit->setFocus(); |
186 | searchBar->setHorizontalStretchable( TRUE ); | 190 | searchBar->setHorizontalStretchable( TRUE ); |
187 | searchBar->setStretchableWidget( searchEdit ); | 191 | searchBar->setStretchableWidget( searchEdit ); |
188 | 192 | ||
189 | //Search button | 193 | //Search button |
190 | SearchAllAction->addTo( searchBar ); | 194 | SearchAllAction->addTo( searchBar ); |
191 | 195 | ||
192 | //image ripped of off opie-login/loginwindow.cpp | 196 | //image ripped of off opie-login/loginwindow.cpp |
193 | QPixmap image1( ( const char** ) image1_data ); | 197 | QPixmap image1( ( const char** ) image1_data ); |
194 | 198 | ||
195 | //Clear text | 199 | //Clear text |
196 | ClearSearchText = new QToolButton( searchBar, "ClearSearchText"); | 200 | ClearSearchText = new QToolButton( searchBar, "ClearSearchText"); |
197 | ClearSearchText->setText( tr( "" ) ); | 201 | ClearSearchText->setText( tr( "" ) ); |
198 | ClearSearchText->setPixmap( image1 ); | 202 | ClearSearchText->setPixmap( image1 ); |
199 | 203 | ||
200 | connect( searchEdit, SIGNAL( textChanged( const QString & ) ),this, SLOT( setSearch( const QString & ) ) ); | 204 | connect( searchEdit, SIGNAL( textChanged( const QString & ) ),this, SLOT( setSearch( const QString & ) ) ); |
201 | connect( ClearSearchText, SIGNAL( clicked() ), searchEdit, SLOT( clear() ) ); | 205 | connect( ClearSearchText, SIGNAL( clicked() ), searchEdit, SLOT( clear() ) ); |
202 | 206 | ||
203 | } | 207 | } |
204 | 208 | ||
205 | MainWindow::~MainWindow() | 209 | MainWindow::~MainWindow() |
206 | { | 210 | { |
207 | Config cfg( "osearch", Config::User ); | 211 | Config cfg( "osearch", Config::User ); |
208 | cfg.setGroup( "search_settings" ); | 212 | cfg.setGroup( "search_settings" ); |
209 | cfg.writeEntry( "caseSensitiv", actionCaseSensitiv->isOn() ); | 213 | cfg.writeEntry( "caseSensitiv", actionCaseSensitiv->isOn() ); |
210 | cfg.writeEntry( "wildcards", actionWildcards->isOn() ); | 214 | cfg.writeEntry( "wildcards", actionWildcards->isOn() ); |
211 | //cfg.writeEntry( "whole_words_only", actionWholeWordsOnly->isOn() ); | 215 | //cfg.writeEntry( "whole_words_only", actionWholeWordsOnly->isOn() ); |