summaryrefslogtreecommitdiff
authordrw <drw>2004-04-06 15:42:02 (UTC)
committer drw <drw>2004-04-06 15:42:02 (UTC)
commite97648cdac8aba383e69e87c2d60644eb3bcc18d (patch) (unidiff)
treec85c0edba53e01966320fc64559b27cdbfc7ae50
parentf55329d69e2dd21085294916b3ba49ea529214e0 (diff)
downloadopie-e97648cdac8aba383e69e87c2d60644eb3bcc18d.zip
opie-e97648cdac8aba383e69e87c2d60644eb3bcc18d.tar.gz
opie-e97648cdac8aba383e69e87c2d60644eb3bcc18d.tar.bz2
Some spelling and capitalization fixes for menu items
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/osearch/datebooksearch.cpp4
-rw-r--r--core/pim/osearch/doclnksearch.cpp2
-rw-r--r--core/pim/osearch/mainwindow.cpp2
-rw-r--r--core/pim/osearch/todosearch.cpp2
4 files changed, 5 insertions, 5 deletions
diff --git a/core/pim/osearch/datebooksearch.cpp b/core/pim/osearch/datebooksearch.cpp
index 34cf0ce..1b44be2 100644
--- a/core/pim/osearch/datebooksearch.cpp
+++ b/core/pim/osearch/datebooksearch.cpp
@@ -1,93 +1,93 @@
1// 1//
2// 2//
3// C++ Implementation: $MODULE$ 3// C++ Implementation: $MODULE$
4// 4//
5// Description: 5// Description:
6// 6//
7// 7//
8// Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003 8// Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003
9// 9//
10// Copyright: See COPYING file that comes with this distribution 10// Copyright: See COPYING file that comes with this distribution
11// 11//
12// 12//
13#include "datebooksearch.h" 13#include "datebooksearch.h"
14#include "eventitem.h" 14#include "eventitem.h"
15 15
16#include <opie2/odebug.h> 16#include <opie2/odebug.h>
17#include <opie2/opimevent.h> 17#include <opie2/opimevent.h>
18#include <opie2/opimrecurrence.h> 18#include <opie2/opimrecurrence.h>
19 19
20#include <qpe/resource.h> 20#include <qpe/resource.h>
21#include <qpe/config.h> 21#include <qpe/config.h>
22 22
23#include <qaction.h> 23#include <qaction.h>
24#include <qpopupmenu.h> 24#include <qpopupmenu.h>
25 25
26 26
27 27
28DatebookSearch::DatebookSearch(QListView* parent, QString name) 28DatebookSearch::DatebookSearch(QListView* parent, QString name)
29: SearchGroup(parent, name), _dates(0), _popupMenu(0) 29: SearchGroup(parent, name), _dates(0), _popupMenu(0)
30{ 30{
31 QIconSet is = Resource::loadIconSet( "datebook/DateBookSmall" ); 31 QIconSet is = Resource::loadIconSet( "datebook/DateBookSmall" );
32 setPixmap( 0, is.pixmap( QIconSet::Large, true ) ); 32 setPixmap( 0, is.pixmap( QIconSet::Large, true ) );
33 actionShowPastEvents = new QAction( QObject::tr("show past events"),QString::null, 0, 0, 0, true ); 33 actionShowPastEvents = new QAction( QObject::tr("Show past events"),QString::null, 0, 0, 0, true );
34 actionSearchInDates = new QAction( QObject::tr("search in dates"),QString::null, 0, 0, 0, true ); 34 actionSearchInDates = new QAction( QObject::tr("Search in dates"),QString::null, 0, 0, 0, true );
35 Config cfg( "osearch", Config::User ); 35 Config cfg( "osearch", Config::User );
36 cfg.setGroup( "datebook_settings" ); 36 cfg.setGroup( "datebook_settings" );
37 actionShowPastEvents->setOn( cfg.readBoolEntry( "show_past_events", false ) ); 37 actionShowPastEvents->setOn( cfg.readBoolEntry( "show_past_events", false ) );
38 actionSearchInDates->setOn( cfg.readBoolEntry( "search_in_dates", true ) ); 38 actionSearchInDates->setOn( cfg.readBoolEntry( "search_in_dates", true ) );
39} 39}
40 40
41DatebookSearch::~DatebookSearch() 41DatebookSearch::~DatebookSearch()
42{ 42{
43 odebug << "SAVE DATEBOOK SEARCH CONFIG" << oendl; 43 odebug << "SAVE DATEBOOK SEARCH CONFIG" << oendl;
44 Config cfg( "osearch", Config::User ); 44 Config cfg( "osearch", Config::User );
45 cfg.setGroup( "datebook_settings" ); 45 cfg.setGroup( "datebook_settings" );
46 cfg.writeEntry( "show_past_events", actionShowPastEvents->isOn() ); 46 cfg.writeEntry( "show_past_events", actionShowPastEvents->isOn() );
47 cfg.writeEntry( "search_in_dates", actionSearchInDates->isOn() ); 47 cfg.writeEntry( "search_in_dates", actionSearchInDates->isOn() );
48 delete _dates; 48 delete _dates;
49 delete _popupMenu; 49 delete _popupMenu;
50 delete actionShowPastEvents; 50 delete actionShowPastEvents;
51 delete actionSearchInDates; 51 delete actionSearchInDates;
52} 52}
53 53
54 54
55void DatebookSearch::load() 55void DatebookSearch::load()
56{ 56{
57 _dates = new ODateBookAccess(); 57 _dates = new ODateBookAccess();
58 _dates->load(); 58 _dates->load();
59} 59}
60 60
61int DatebookSearch::search() 61int DatebookSearch::search()
62{ 62{
63 OPimRecordList<OPimEvent> results = _dates->matchRegexp(_search); 63 OPimRecordList<OPimEvent> results = _dates->matchRegexp(_search);
64 for (uint i = 0; i < results.count(); i++) 64 for (uint i = 0; i < results.count(); i++)
65 insertItem( new OPimEvent( results[i] ) ); 65 insertItem( new OPimEvent( results[i] ) );
66 return _resultCount; 66 return _resultCount;
67} 67}
68 68
69void DatebookSearch::insertItem( void *rec ) 69void DatebookSearch::insertItem( void *rec )
70{ 70{
71 OPimEvent *ev = (OPimEvent*)rec; 71 OPimEvent *ev = (OPimEvent*)rec;
72 if ( !actionShowPastEvents->isOn() && 72 if ( !actionShowPastEvents->isOn() &&
73 ev->endDateTime() < QDateTime::currentDateTime() && 73 ev->endDateTime() < QDateTime::currentDateTime() &&
74 !ev->recurrence().doesRecur() 74 !ev->recurrence().doesRecur()
75 ) return; 75 ) return;
76 if ( !actionSearchInDates->isOn() && ( 76 if ( !actionSearchInDates->isOn() && (
77 ev->lastHitField() == Qtopia::StartDateTime || 77 ev->lastHitField() == Qtopia::StartDateTime ||
78 ev->lastHitField() == Qtopia::EndDateTime ) 78 ev->lastHitField() == Qtopia::EndDateTime )
79 ) return; 79 ) return;
80 new EventItem( this, ev ); 80 new EventItem( this, ev );
81 _resultCount++; 81 _resultCount++;
82} 82}
83 83
84QPopupMenu* DatebookSearch::popupMenu() 84QPopupMenu* DatebookSearch::popupMenu()
85{ 85{
86 if (!_popupMenu){ 86 if (!_popupMenu){
87 _popupMenu = new QPopupMenu( 0 ); 87 _popupMenu = new QPopupMenu( 0 );
88 actionShowPastEvents->addTo( _popupMenu ); 88 actionShowPastEvents->addTo( _popupMenu );
89 actionSearchInDates->addTo( _popupMenu ); 89 actionSearchInDates->addTo( _popupMenu );
90 } 90 }
91 return _popupMenu; 91 return _popupMenu;
92} 92}
93 93
diff --git a/core/pim/osearch/doclnksearch.cpp b/core/pim/osearch/doclnksearch.cpp
index 3f0d223..4631dce 100644
--- a/core/pim/osearch/doclnksearch.cpp
+++ b/core/pim/osearch/doclnksearch.cpp
@@ -1,98 +1,98 @@
1// 1//
2// 2//
3// C++ Implementation: $MODULE$ 3// C++ Implementation: $MODULE$
4// 4//
5// Description: 5// Description:
6// 6//
7// 7//
8// Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003 8// Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003
9// 9//
10// Copyright: See COPYING file that comes with this distribution 10// Copyright: See COPYING file that comes with this distribution
11// 11//
12// 12//
13 13
14 14
15#include "doclnkitem.h" 15#include "doclnkitem.h"
16#include "doclnksearch.h" 16#include "doclnksearch.h"
17 17
18#include <opie2/owait.h> 18#include <opie2/owait.h>
19 19
20#include <qpe/applnk.h> 20#include <qpe/applnk.h>
21#include <qpe/config.h> 21#include <qpe/config.h>
22#include <qpe/resource.h> 22#include <qpe/resource.h>
23#include <qpe/qpeapplication.h> 23#include <qpe/qpeapplication.h>
24 24
25#include <qaction.h> 25#include <qaction.h>
26#include <qfile.h> 26#include <qfile.h>
27#include <qpopupmenu.h> 27#include <qpopupmenu.h>
28#include <qtextstream.h> 28#include <qtextstream.h>
29 29
30 30
31DocLnkSearch::DocLnkSearch(QListView* parent, QString name) 31DocLnkSearch::DocLnkSearch(QListView* parent, QString name)
32: AppLnkSearch(parent, name), _popupMenu(0) 32: AppLnkSearch(parent, name), _popupMenu(0)
33{ 33{
34 QIconSet is = Resource::loadIconSet( "osearch/documentsSmall" ); 34 QIconSet is = Resource::loadIconSet( "osearch/documentsSmall" );
35 setPixmap( 0, is.pixmap( QIconSet::Automatic, true ) ); 35 setPixmap( 0, is.pixmap( QIconSet::Automatic, true ) );
36 36
37 actionSearchInFiles = new QAction( QObject::tr("search content"),QString::null, 0, 0, 0, true ); 37 actionSearchInFiles = new QAction( QObject::tr("Search content"),QString::null, 0, 0, 0, true );
38 Config cfg( "osearch", Config::User ); 38 Config cfg( "osearch", Config::User );
39 cfg.setGroup( "doclnk_settings" ); 39 cfg.setGroup( "doclnk_settings" );
40 actionSearchInFiles->setOn( cfg.readBoolEntry( "search_content", false ) ); 40 actionSearchInFiles->setOn( cfg.readBoolEntry( "search_content", false ) );
41} 41}
42 42
43 43
44DocLnkSearch::~DocLnkSearch() 44DocLnkSearch::~DocLnkSearch()
45{ 45{
46 Config cfg( "osearch", Config::User ); 46 Config cfg( "osearch", Config::User );
47 cfg.setGroup( "doclnk_settings" ); 47 cfg.setGroup( "doclnk_settings" );
48 cfg.writeEntry( "search_content", actionSearchInFiles->isOn() ); 48 cfg.writeEntry( "search_content", actionSearchInFiles->isOn() );
49} 49}
50 50
51void DocLnkSearch::load() 51void DocLnkSearch::load()
52{ 52{
53 _apps = new DocLnkSet(QPEApplication::documentDir()); 53 _apps = new DocLnkSet(QPEApplication::documentDir());
54} 54}
55 55
56bool DocLnkSearch::searchFile( AppLnk *app ) 56bool DocLnkSearch::searchFile( AppLnk *app )
57{ 57{
58 if (!actionSearchInFiles->isOn()) return false; 58 if (!actionSearchInFiles->isOn()) return false;
59 DocLnk *doc = (DocLnk*)app; 59 DocLnk *doc = (DocLnk*)app;
60 bool found = false; 60 bool found = false;
61 if ( doc->type().contains( "text" ) ){ 61 if ( doc->type().contains( "text" ) ){
62#ifdef NEW_OWAIT 62#ifdef NEW_OWAIT
63 QString ouput = QObject::tr("searching %1").arg(doc->file()); 63 QString ouput = QObject::tr("searching %1").arg(doc->file());
64 OWait( output ); 64 OWait( output );
65#endif 65#endif
66 QFile f(doc->file()); 66 QFile f(doc->file());
67 if ( f.open(IO_ReadOnly) ) { 67 if ( f.open(IO_ReadOnly) ) {
68 QTextStream t( &f ); 68 QTextStream t( &f );
69 while ( !t.eof() ) 69 while ( !t.eof() )
70 if (_search.match( t.readLine()) != -1) { 70 if (_search.match( t.readLine()) != -1) {
71 found = true; 71 found = true;
72 break; 72 break;
73 } 73 }
74 } 74 }
75 f.close(); 75 f.close();
76 } 76 }
77 return found; 77 return found;
78} 78}
79 79
80void DocLnkSearch::insertItem( void *rec ) 80void DocLnkSearch::insertItem( void *rec )
81{ 81{
82 (void)new DocLnkItem( this, (DocLnk*)rec ); 82 (void)new DocLnkItem( this, (DocLnk*)rec );
83 _resultCount++; 83 _resultCount++;
84} 84}
85 85
86 86
87QPopupMenu* DocLnkSearch::popupMenu() 87QPopupMenu* DocLnkSearch::popupMenu()
88{ 88{
89 if (!_popupMenu){ 89 if (!_popupMenu){
90 _popupMenu = new QPopupMenu( 0 ); 90 _popupMenu = new QPopupMenu( 0 );
91 actionSearchInFiles->addTo( _popupMenu ); 91 actionSearchInFiles->addTo( _popupMenu );
92 } 92 }
93 return _popupMenu; 93 return _popupMenu;
94 //(void) new DocLnkItem( this, (DocLnk*)rec ); 94 //(void) new DocLnkItem( this, (DocLnk*)rec );
95 // rec is undeclared here 95 // rec is undeclared here
96#warning FIXME 96#warning FIXME
97 _resultCount++; 97 _resultCount++;
98} 98}
diff --git a/core/pim/osearch/mainwindow.cpp b/core/pim/osearch/mainwindow.cpp
index 3edc8de..798e1f1 100644
--- a/core/pim/osearch/mainwindow.cpp
+++ b/core/pim/osearch/mainwindow.cpp
@@ -1,318 +1,318 @@
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" 13#include "olistview.h"
14#include "olistviewitem.h" 14#include "olistviewitem.h"
15#include "resultitem.h" 15#include "resultitem.h"
16#include "adresssearch.h" 16#include "adresssearch.h"
17#include "todosearch.h" 17#include "todosearch.h"
18#include "datebooksearch.h" 18#include "datebooksearch.h"
19#include "applnksearch.h" 19#include "applnksearch.h"
20#include "doclnksearch.h" 20#include "doclnksearch.h"
21#include "mainwindow.h" 21#include "mainwindow.h"
22 22
23#include <opie2/odebug.h> 23#include <opie2/odebug.h>
24#include <opie2/owait.h> 24#include <opie2/owait.h>
25 25
26#include <qpe/qpemessagebox.h> 26#include <qpe/qpemessagebox.h>
27#include <qpe/resource.h> 27#include <qpe/resource.h>
28#include <qpe/config.h> 28#include <qpe/config.h>
29 29
30 30
31#include <qpe/qpeapplication.h> 31#include <qpe/qpeapplication.h>
32#include <qpe/global.h> 32#include <qpe/global.h>
33 33
34#include <qtoolbar.h> 34#include <qtoolbar.h>
35#include <qaction.h> 35#include <qaction.h>
36#include <qmessagebox.h> 36#include <qmessagebox.h>
37#include <qpopupmenu.h> 37#include <qpopupmenu.h>
38#include <qtoolbutton.h> 38#include <qtoolbutton.h>
39#include <qstring.h> 39#include <qstring.h>
40#include <qlabel.h> 40#include <qlabel.h>
41#include <qfile.h> 41#include <qfile.h>
42#include <qhbuttongroup.h> 42#include <qhbuttongroup.h>
43#include <qhbox.h> 43#include <qhbox.h>
44#include <qpushbutton.h> 44#include <qpushbutton.h>
45#include <qintdict.h> 45#include <qintdict.h>
46#include <qlayout.h> 46#include <qlayout.h>
47#include <qlineedit.h> 47#include <qlineedit.h>
48#include <qsignalmapper.h> 48#include <qsignalmapper.h>
49#include <qtextbrowser.h> 49#include <qtextbrowser.h>
50#include <qregexp.h> 50#include <qregexp.h>
51#include <qwhatsthis.h> 51#include <qwhatsthis.h>
52#include <qmenubar.h> 52#include <qmenubar.h>
53 53
54 54
55 55
56static const char* const image1_data[] = { 56static const char* const image1_data[] = {
57"14 14 3 1", 57"14 14 3 1",
58". c None", 58". c None",
59"# c #000000", 59"# c #000000",
60"a c #ff0000", 60"a c #ff0000",
61"..............", 61"..............",
62"..##.......###", 62"..##.......###",
63".#aa#....##aa#", 63".#aa#....##aa#",
64"#aaaa#.##aaaa#", 64"#aaaa#.##aaaa#",
65".##aaa#aaaaa##", 65".##aaa#aaaaa##",
66"...#aaaaaaa#..", 66"...#aaaaaaa#..",
67"....#aaaaa#...", 67"....#aaaaa#...",
68"...#aaaaa#....", 68"...#aaaaa#....",
69"..#aaaaaaa#...", 69"..#aaaaaaa#...",
70".#aaaaaaaaa#..", 70".#aaaaaaaaa#..",
71"#aaaa###aaaa#.", 71"#aaaa###aaaa#.",
72"#aaa#..##aaa#.", 72"#aaa#..##aaa#.",
73"#aaa#...#aa#..", 73"#aaa#...#aa#..",
74".###.....##..."}; 74".###.....##..."};
75 75
76 76
77MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : 77MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) :
78 QMainWindow( parent, name, f ), _currentItem(0) 78 QMainWindow( parent, name, f ), _currentItem(0)
79{ 79{
80 setCaption( tr("OSearch") ); 80 setCaption( tr("OSearch") );
81 81
82 setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding)); 82 setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
83 83
84 QFrame *mainFrame = new QFrame( this, "mainFrame" ); 84 QFrame *mainFrame = new QFrame( this, "mainFrame" );
85 mainFrame->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding)); 85 mainFrame->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
86 86
87 mainLayout = new QVBoxLayout( mainFrame ); 87 mainLayout = new QVBoxLayout( mainFrame );
88 mainLayout->setSpacing( 0 ); 88 mainLayout->setSpacing( 0 );
89 mainLayout->setMargin( 3 ); 89 mainLayout->setMargin( 3 );
90 90
91 resultsList = new OListView( mainFrame ); 91 resultsList = new OListView( mainFrame );
92 resultsList->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding)); 92 resultsList->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
93 mainLayout->addWidget( resultsList ); 93 mainLayout->addWidget( resultsList );
94 94
95 detailsFrame = new QFrame( mainFrame, "detailsFrame" ); 95 detailsFrame = new QFrame( mainFrame, "detailsFrame" );
96 QVBoxLayout *detailsLayout = new QVBoxLayout( detailsFrame ); 96 QVBoxLayout *detailsLayout = new QVBoxLayout( detailsFrame );
97 richEdit = new QTextView( detailsFrame ); 97 richEdit = new QTextView( detailsFrame );
98 QWhatsThis::add( richEdit, tr("The details of the current result") ); 98 QWhatsThis::add( richEdit, tr("The details of the current result") );
99 richEdit->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding)); 99 richEdit->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
100 detailsLayout->addWidget( richEdit ); 100 detailsLayout->addWidget( richEdit );
101 101
102 buttonBox = new QHBox( mainFrame, "Button Box" ); 102 buttonBox = new QHBox( mainFrame, "Button Box" );
103 103
104 _buttonCount = 0; 104 _buttonCount = 0;
105 105
106 mainLayout->addWidget( detailsFrame ); 106 mainLayout->addWidget( detailsFrame );
107 mainLayout->addWidget( buttonBox ); 107 mainLayout->addWidget( buttonBox );
108 detailsFrame->hide(); 108 detailsFrame->hide();
109 buttonBox->hide(); 109 buttonBox->hide();
110 110
111 searches.append( new AppLnkSearch( resultsList, tr("Applications") ) ); 111 searches.append( new AppLnkSearch( resultsList, tr("Applications") ) );
112 searches.append( new DocLnkSearch( resultsList, tr("Documents") ) ); 112 searches.append( new DocLnkSearch( resultsList, tr("Documents") ) );
113 searches.append( new TodoSearch( resultsList, tr("Todo List") ) ); 113 searches.append( new TodoSearch( resultsList, tr("Todo List") ) );
114 searches.append( new DatebookSearch( resultsList, tr("Calendar") ) ); 114 searches.append( new DatebookSearch( resultsList, tr("Calendar") ) );
115 searches.append( new AdressSearch( resultsList, tr("Contacts") ) ); 115 searches.append( new AdressSearch( resultsList, tr("Contacts") ) );
116 116
117 setCentralWidget( mainFrame ); 117 setCentralWidget( mainFrame );
118 118
119 popupTimer = new QTimer(); 119 popupTimer = new QTimer();
120 searchTimer = new QTimer(); 120 searchTimer = new QTimer();
121 121
122 connect(popupTimer, SIGNAL(timeout()), SLOT(showPopup())); 122 connect(popupTimer, SIGNAL(timeout()), SLOT(showPopup()));
123 connect(searchTimer, SIGNAL(timeout()), SLOT(searchStringChanged())); 123 connect(searchTimer, SIGNAL(timeout()), SLOT(searchStringChanged()));
124 connect(resultsList, SIGNAL(pressed(QListViewItem*)), SLOT(setCurrent(QListViewItem*))); 124 connect(resultsList, SIGNAL(pressed(QListViewItem*)), SLOT(setCurrent(QListViewItem*)));
125 connect(resultsList, SIGNAL(clicked(QListViewItem*)), SLOT(stopTimer(QListViewItem*))); 125 connect(resultsList, SIGNAL(clicked(QListViewItem*)), SLOT(stopTimer(QListViewItem*)));
126 126
127 signalMapper = new QSignalMapper( this ); 127 signalMapper = new QSignalMapper( this );
128 128
129 connect(signalMapper, SIGNAL(mapped(int)), SLOT( slotAction(int) ) ); 129 connect(signalMapper, SIGNAL(mapped(int)), SLOT( slotAction(int) ) );
130 130
131 makeMenu(); 131 makeMenu();
132 132
133 Config cfg( "osearch", Config::User ); 133 Config cfg( "osearch", Config::User );
134 cfg.setGroup( "search_settings" ); 134 cfg.setGroup( "search_settings" );
135 actionCaseSensitiv->setOn( cfg.readBoolEntry( "caseSensitiv", false ) ); 135 actionCaseSensitiv->setOn( cfg.readBoolEntry( "caseSensitiv", false ) );
136 actionWildcards->setOn( cfg.readBoolEntry( "wildcards", false ) ); 136 actionWildcards->setOn( cfg.readBoolEntry( "wildcards", false ) );
137// actionWholeWordsOnly->setOn( cfg.readBoolEntry( "whole_words_only", false ) ); 137// actionWholeWordsOnly->setOn( cfg.readBoolEntry( "whole_words_only", false ) );
138} 138}
139 139
140void MainWindow::makeMenu() 140void MainWindow::makeMenu()
141{ 141{
142 QToolBar *toolBar = new QToolBar( this ); 142 QToolBar *toolBar = new QToolBar( this );
143 QToolBar *searchBar = new QToolBar(this); 143 QToolBar *searchBar = new QToolBar(this);
144 QMenuBar *menuBar = new QMenuBar( toolBar ); 144 QMenuBar *menuBar = new QMenuBar( toolBar );
145 QPopupMenu *searchMenu = new QPopupMenu( menuBar ); 145 QPopupMenu *searchMenu = new QPopupMenu( menuBar );
146// QPopupMenu *viewMenu = new QPopupMenu( menuBar ); 146// QPopupMenu *viewMenu = new QPopupMenu( menuBar );
147 QPopupMenu *cfgMenu = new QPopupMenu( menuBar ); 147 QPopupMenu *cfgMenu = new QPopupMenu( menuBar );
148 QPopupMenu *searchOptions = new QPopupMenu( cfgMenu ); 148 QPopupMenu *searchOptions = new QPopupMenu( cfgMenu );
149 149
150 setToolBarsMovable( false ); 150 setToolBarsMovable( false );
151 toolBar->setHorizontalStretchable( true ); 151 toolBar->setHorizontalStretchable( true );
152 menuBar->insertItem( tr( "Search" ), searchMenu ); 152 menuBar->insertItem( tr( "Search" ), searchMenu );
153 menuBar->insertItem( tr( "Settings" ), cfgMenu ); 153 menuBar->insertItem( tr( "Settings" ), cfgMenu );
154 154
155 //SETTINGS MENU 155 //SETTINGS MENU
156 cfgMenu->insertItem( tr( "Search" ), searchOptions ); 156 cfgMenu->insertItem( tr( "Search" ), searchOptions );
157 QPopupMenu *pop; 157 QPopupMenu *pop;
158 for (SearchGroup *s = searches.first(); s != 0; s = searches.next() ){ 158 for (SearchGroup *s = searches.first(); s != 0; s = searches.next() ){
159 pop = s->popupMenu(); 159 pop = s->popupMenu();
160 if (pop){ 160 if (pop){
161 cfgMenu->insertItem( s->text(0), pop ); 161 cfgMenu->insertItem( s->text(0), pop );
162 } 162 }
163 } 163 }
164 164
165 165
166 //SEARCH 166 //SEARCH
167 SearchAllAction = new QAction( tr("Search all"),QString::null, 0, this, 0 ); 167 SearchAllAction = new QAction( tr("Search all"),QString::null, 0, this, 0 );
168 SearchAllAction->setIconSet( Resource::loadIconSet( "find" ) ); 168 SearchAllAction->setIconSet( Resource::loadIconSet( "find" ) );
169 // QWhatsThis::add( SearchAllAction, tr("Search everything...") ); 169 // QWhatsThis::add( SearchAllAction, tr("Search everything...") );
170 connect( SearchAllAction, SIGNAL(activated()), this, SLOT(searchAll()) ); 170 connect( SearchAllAction, SIGNAL(activated()), this, SLOT(searchAll()) );
171 SearchAllAction->addTo( searchMenu ); 171 SearchAllAction->addTo( searchMenu );
172 searchMenu->insertItem( tr( "Options" ), searchOptions ); 172 searchMenu->insertItem( tr( "Options" ), searchOptions );
173 173
174 //SEARCH OPTIONS 174 //SEARCH OPTIONS
175 //actionWholeWordsOnly = new QAction( tr("Whole words only"),QString::null, 0, this, 0, true ); 175 //actionWholeWordsOnly = new QAction( tr("Whole words only"),QString::null, 0, this, 0, true );
176 //actionWholeWordsOnly->addTo( searchOptions ); 176 //actionWholeWordsOnly->addTo( searchOptions );
177 actionCaseSensitiv = new QAction( tr("Case sensitiv"),QString::null, 0, this, 0, true ); 177 actionCaseSensitiv = new QAction( tr("Case sensitive"),QString::null, 0, this, 0, true );
178 actionCaseSensitiv->addTo( searchOptions ); 178 actionCaseSensitiv->addTo( searchOptions );
179 actionWildcards = new QAction( tr("Use wildcards"),QString::null, 0, this, 0, true ); 179 actionWildcards = new QAction( tr("Use wildcards"),QString::null, 0, this, 0, true );
180 actionWildcards->addTo( searchOptions ); 180 actionWildcards->addTo( searchOptions );
181 181
182 //SEARCH BAR 182 //SEARCH BAR
183 LabelEnterText = new QLabel( searchBar, "Label" ); 183 LabelEnterText = new QLabel( searchBar, "Label" );
184 LabelEnterText->setAutoMask( FALSE ); 184 LabelEnterText->setAutoMask( FALSE );
185 LabelEnterText->setText( tr( "Search for: " ) ); 185 LabelEnterText->setText( tr( "Search for: " ) );
186 186
187 addToolBar( searchBar, "Search", QMainWindow::Top, TRUE ); 187 addToolBar( searchBar, "Search", QMainWindow::Top, TRUE );
188 QLineEdit *searchEdit = new QLineEdit( searchBar, "seachEdit" ); 188 QLineEdit *searchEdit = new QLineEdit( searchBar, "seachEdit" );
189 QWhatsThis::add( searchEdit, tr("Enter your search terms here") ); 189 QWhatsThis::add( searchEdit, tr("Enter your search terms here") );
190 searchEdit->setFocus(); 190 searchEdit->setFocus();
191 searchBar->setHorizontalStretchable( TRUE ); 191 searchBar->setHorizontalStretchable( TRUE );
192 searchBar->setStretchableWidget( searchEdit ); 192 searchBar->setStretchableWidget( searchEdit );
193 193
194 //Search button 194 //Search button
195 SearchAllAction->addTo( searchBar ); 195 SearchAllAction->addTo( searchBar );
196 196
197 //image ripped of off opie-login/loginwindow.cpp 197 //image ripped of off opie-login/loginwindow.cpp
198 QPixmap image1( ( const char** ) image1_data ); 198 QPixmap image1( ( const char** ) image1_data );
199 199
200 //Clear text 200 //Clear text
201 ClearSearchText = new QToolButton( searchBar, "ClearSearchText"); 201 ClearSearchText = new QToolButton( searchBar, "ClearSearchText");
202 ClearSearchText->setText( tr( "" ) ); 202 ClearSearchText->setText( tr( "" ) );
203 ClearSearchText->setPixmap( image1 ); 203 ClearSearchText->setPixmap( image1 );
204 204
205 connect( searchEdit, SIGNAL( textChanged(const QString&) ),this, SLOT( setSearch(const QString&) ) ); 205 connect( searchEdit, SIGNAL( textChanged(const QString&) ),this, SLOT( setSearch(const QString&) ) );
206 connect( ClearSearchText, SIGNAL( clicked() ), searchEdit, SLOT( clear() ) ); 206 connect( ClearSearchText, SIGNAL( clicked() ), searchEdit, SLOT( clear() ) );
207 207
208} 208}
209 209
210MainWindow::~MainWindow() 210MainWindow::~MainWindow()
211{ 211{
212 Config cfg( "osearch", Config::User ); 212 Config cfg( "osearch", Config::User );
213 cfg.setGroup( "search_settings" ); 213 cfg.setGroup( "search_settings" );
214 cfg.writeEntry( "caseSensitiv", actionCaseSensitiv->isOn() ); 214 cfg.writeEntry( "caseSensitiv", actionCaseSensitiv->isOn() );
215 cfg.writeEntry( "wildcards", actionWildcards->isOn() ); 215 cfg.writeEntry( "wildcards", actionWildcards->isOn() );
216 //cfg.writeEntry( "whole_words_only", actionWholeWordsOnly->isOn() ); 216 //cfg.writeEntry( "whole_words_only", actionWholeWordsOnly->isOn() );
217} 217}
218 218
219void MainWindow::setCurrent(QListViewItem *item) 219void MainWindow::setCurrent(QListViewItem *item)
220{ 220{
221 if (!item) return; 221 if (!item) return;
222 _currentItem = (OListViewItem*)item; 222 _currentItem = (OListViewItem*)item;
223 //_currentItem = dynamic_cast<OListViewItem*>(item); 223 //_currentItem = dynamic_cast<OListViewItem*>(item);
224 if (_currentItem->rtti() == OListViewItem::Result){ 224 if (_currentItem->rtti() == OListViewItem::Result){
225 ResultItem *res = (ResultItem*)item; 225 ResultItem *res = (ResultItem*)item;
226 // ResultItem *res = dynamic_cast<ResultItem*>(item); 226 // ResultItem *res = dynamic_cast<ResultItem*>(item);
227 richEdit->setText( res->toRichText() ); 227 richEdit->setText( res->toRichText() );
228 QIntDict<QString> acts = res->actions(); 228 QIntDict<QString> acts = res->actions();
229 QButton *button; 229 QButton *button;
230 for (uint i = 0; i < acts.count(); i++){ 230 for (uint i = 0; i < acts.count(); i++){
231 button = buttonMap[i]; 231 button = buttonMap[i];
232 if (!button) { 232 if (!button) {
233 owarn << " no button for " << *acts[i] << oendl; 233 owarn << " no button for " << *acts[i] << oendl;
234 button = new QPushButton( buttonBox ); 234 button = new QPushButton( buttonBox );
235 buttonMap.insert( i, button ); 235 buttonMap.insert( i, button );
236 signalMapper->setMapping(button, i ); 236 signalMapper->setMapping(button, i );
237 connect(button, SIGNAL(clicked() ), signalMapper, SLOT(map() ) ); 237 connect(button, SIGNAL(clicked() ), signalMapper, SLOT(map() ) );
238 } 238 }
239 button->setText( *acts[i] ); 239 button->setText( *acts[i] );
240 button->show(); 240 button->show();
241 } 241 }
242 for (uint i = acts.count(); i < _buttonCount; i++){ 242 for (uint i = acts.count(); i < _buttonCount; i++){
243 button = buttonMap[i]; 243 button = buttonMap[i];
244 if (button) button->hide(); 244 if (button) button->hide();
245 } 245 }
246 _buttonCount = acts.count(); 246 _buttonCount = acts.count();
247 detailsFrame->show(); 247 detailsFrame->show();
248 buttonBox->show(); 248 buttonBox->show();
249 249
250 }else { 250 }else {
251 detailsFrame->hide(); 251 detailsFrame->hide();
252 buttonBox->hide(); 252 buttonBox->hide();
253 } 253 }
254 popupTimer->start( 300, true ); 254 popupTimer->start( 300, true );
255} 255}
256 256
257void MainWindow::stopTimer(QListViewItem*) 257void MainWindow::stopTimer(QListViewItem*)
258{ 258{
259 popupTimer->stop(); 259 popupTimer->stop();
260} 260}
261 261
262void MainWindow::showPopup() 262void MainWindow::showPopup()
263{ 263{
264 popupTimer->stop(); 264 popupTimer->stop();
265 if (!_currentItem) return; 265 if (!_currentItem) return;
266 QPopupMenu *pop = _currentItem->popupMenu(); 266 QPopupMenu *pop = _currentItem->popupMenu();
267 if (pop) pop->popup( QCursor::pos() ); 267 if (pop) pop->popup( QCursor::pos() );
268} 268}
269 269
270void MainWindow::setSearch( const QString &key ) 270void MainWindow::setSearch( const QString &key )
271{ 271{
272 searchTimer->stop(); 272 searchTimer->stop();
273 _searchString = key; 273 _searchString = key;
274 searchTimer->start( 300 ); 274 searchTimer->start( 300 );
275} 275}
276 276
277void MainWindow::searchStringChanged() 277void MainWindow::searchStringChanged()
278{ 278{
279#ifdef NEW_OWAIT 279#ifdef NEW_OWAIT
280 OWait("setting search string"); 280 OWait("setting search string");
281#endif 281#endif
282 searchTimer->stop(); 282 searchTimer->stop();
283 QString ss = _searchString; 283 QString ss = _searchString;
284 //ss = Global::stringQuote( _searchString ); 284 //ss = Global::stringQuote( _searchString );
285 //if (actionWholeWordsOnly->isOn()) 285 //if (actionWholeWordsOnly->isOn())
286 // ss = "\\s"+_searchString+"\\s"; 286 // ss = "\\s"+_searchString+"\\s";
287 //Opie:Core::odebug << " set searchString >" << ss << "<" << oendl; 287 //Opie:Core::odebug << " set searchString >" << ss << "<" << oendl;
288 QRegExp re( ss ); 288 QRegExp re( ss );
289 re.setCaseSensitive( actionCaseSensitiv->isOn() ); 289 re.setCaseSensitive( actionCaseSensitiv->isOn() );
290 re.setWildcard( actionWildcards->isOn() ); 290 re.setWildcard( actionWildcards->isOn() );
291 for (SearchGroup *s = searches.first(); s != 0; s = searches.next() ) 291 for (SearchGroup *s = searches.first(); s != 0; s = searches.next() )
292 s->setSearch( re ); 292 s->setSearch( re );
293} 293}
294 294
295void MainWindow::searchAll() 295void MainWindow::searchAll()
296{ 296{
297#ifdef NEW_OWAIT 297#ifdef NEW_OWAIT
298 OWait("searching..."); 298 OWait("searching...");
299#endif 299#endif
300 for (SearchGroup *s = searches.first(); s != 0; s = searches.next() ){ 300 for (SearchGroup *s = searches.first(); s != 0; s = searches.next() ){
301 s->doSearch(); 301 s->doSearch();
302 //resultsList->repaint(); 302 //resultsList->repaint();
303 } 303 }
304} 304}
305 305
306void MainWindow::slotAction( int act ) 306void MainWindow::slotAction( int act )
307{ 307{
308 if ( _currentItem && _currentItem->rtti() == OListViewItem::Result){ 308 if ( _currentItem && _currentItem->rtti() == OListViewItem::Result){
309 ResultItem *res = (ResultItem*)_currentItem; 309 ResultItem *res = (ResultItem*)_currentItem;
310 // ResultItem *res = dynamic_cast<ResultItem*>(item); 310 // ResultItem *res = dynamic_cast<ResultItem*>(item);
311 res->action(act); 311 res->action(act);
312 } 312 }
313} 313}
314 314
315void MainWindow::optionChanged(int ) 315void MainWindow::optionChanged(int )
316{ 316{
317 searchStringChanged(); 317 searchStringChanged();
318} 318}
diff --git a/core/pim/osearch/todosearch.cpp b/core/pim/osearch/todosearch.cpp
index 1839566..48fa909 100644
--- a/core/pim/osearch/todosearch.cpp
+++ b/core/pim/osearch/todosearch.cpp
@@ -1,79 +1,79 @@
1// 1//
2// 2//
3// C++ Implementation: $MODULE$ 3// C++ Implementation: $MODULE$
4// 4//
5// Description: 5// Description:
6// 6//
7// 7//
8// Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003 8// Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003
9// 9//
10// Copyright: See COPYING file that comes with this distribution 10// Copyright: See COPYING file that comes with this distribution
11// 11//
12// 12//
13#include "todosearch.h" 13#include "todosearch.h"
14#include "todoitem.h" 14#include "todoitem.h"
15 15
16#include <qpe/resource.h> 16#include <qpe/resource.h>
17#include <qpe/config.h> 17#include <qpe/config.h>
18 18
19#include <qaction.h> 19#include <qaction.h>
20#include <qpopupmenu.h> 20#include <qpopupmenu.h>
21 21
22using namespace Opie; 22using namespace Opie;
23TodoSearch::TodoSearch(QListView* parent, QString name) 23TodoSearch::TodoSearch(QListView* parent, QString name)
24: SearchGroup(parent, name), _todos(0), _popupMenu(0) 24: SearchGroup(parent, name), _todos(0), _popupMenu(0)
25{ 25{
26 //AppLnkSet als(QPEApplication::qpeDir()); 26 //AppLnkSet als(QPEApplication::qpeDir());
27 //setPixmap( 0, als.findExec("todolist")->pixmap() ); 27 //setPixmap( 0, als.findExec("todolist")->pixmap() );
28 QIconSet is = Resource::loadIconSet( "todo/TodoListSmall" ); 28 QIconSet is = Resource::loadIconSet( "todo/TodoListSmall" );
29 setPixmap( 0, is.pixmap( QIconSet::Large, true ) ); 29 setPixmap( 0, is.pixmap( QIconSet::Large, true ) );
30 actionShowCompleted = new QAction( QObject::tr("show completed tasks"),QString::null, 0, 0, 0, true ); 30 actionShowCompleted = new QAction( QObject::tr("Show completed tasks"),QString::null, 0, 0, 0, true );
31 Config cfg( "osearch", Config::User ); 31 Config cfg( "osearch", Config::User );
32 cfg.setGroup( "todo_settings" ); 32 cfg.setGroup( "todo_settings" );
33 actionShowCompleted->setOn( cfg.readBoolEntry( "show_completed_tasks", false ) ); 33 actionShowCompleted->setOn( cfg.readBoolEntry( "show_completed_tasks", false ) );
34 34
35} 35}
36 36
37 37
38TodoSearch::~TodoSearch() 38TodoSearch::~TodoSearch()
39{ 39{
40 Config cfg( "osearch", Config::User ); 40 Config cfg( "osearch", Config::User );
41 cfg.setGroup( "todo_settings" ); 41 cfg.setGroup( "todo_settings" );
42 cfg.writeEntry( "show_completed_tasks", actionShowCompleted->isOn() ); 42 cfg.writeEntry( "show_completed_tasks", actionShowCompleted->isOn() );
43 delete _popupMenu; 43 delete _popupMenu;
44 delete actionShowCompleted; 44 delete actionShowCompleted;
45 delete _todos; 45 delete _todos;
46} 46}
47 47
48 48
49void TodoSearch::load() 49void TodoSearch::load()
50{ 50{
51 _todos = new OPimTodoAccess(); 51 _todos = new OPimTodoAccess();
52 _todos->load(); 52 _todos->load();
53} 53}
54 54
55int TodoSearch::search() 55int TodoSearch::search()
56{ 56{
57 OPimRecordList<OPimTodo> results = _todos->matchRegexp(_search); 57 OPimRecordList<OPimTodo> results = _todos->matchRegexp(_search);
58 for (uint i = 0; i < results.count(); i++) 58 for (uint i = 0; i < results.count(); i++)
59 insertItem( new OPimTodo( results[i] )); 59 insertItem( new OPimTodo( results[i] ));
60 return _resultCount; 60 return _resultCount;
61} 61}
62 62
63void TodoSearch::insertItem( void *rec ) 63void TodoSearch::insertItem( void *rec )
64{ 64{
65 OPimTodo *todo = (OPimTodo*)rec; 65 OPimTodo *todo = (OPimTodo*)rec;
66 if (!actionShowCompleted->isOn() && 66 if (!actionShowCompleted->isOn() &&
67 todo->isCompleted() ) return; 67 todo->isCompleted() ) return;
68 (void)new TodoItem( this, todo ); 68 (void)new TodoItem( this, todo );
69 _resultCount++; 69 _resultCount++;
70} 70}
71 71
72QPopupMenu* TodoSearch::popupMenu() 72QPopupMenu* TodoSearch::popupMenu()
73{ 73{
74 if (!_popupMenu){ 74 if (!_popupMenu){
75 _popupMenu = new QPopupMenu( 0 ); 75 _popupMenu = new QPopupMenu( 0 );
76 actionShowCompleted->addTo( _popupMenu ); 76 actionShowCompleted->addTo( _popupMenu );
77 } 77 }
78 return _popupMenu; 78 return _popupMenu;
79} 79}