author | tille <tille> | 2003-05-10 16:51:45 (UTC) |
---|---|---|
committer | tille <tille> | 2003-05-10 16:51:45 (UTC) |
commit | bb282009a5d37c77c9239d0e78950290f026d7a8 (patch) (unidiff) | |
tree | f77f8299f6cb4393d98e005963b116bab6a27989 | |
parent | 2a37284ab7ea4a29b6e55a84445ad5b2e3d6739b (diff) | |
download | opie-bb282009a5d37c77c9239d0e78950290f026d7a8.zip opie-bb282009a5d37c77c9239d0e78950290f026d7a8.tar.gz opie-bb282009a5d37c77c9239d0e78950290f026d7a8.tar.bz2 |
applnk search
-rw-r--r-- | core/pim/osearch/applnkitem.cpp | 54 | ||||
-rw-r--r-- | core/pim/osearch/applnkitem.h | 37 | ||||
-rw-r--r-- | core/pim/osearch/applnksearch.cpp | 46 | ||||
-rw-r--r-- | core/pim/osearch/applnksearch.h | 35 | ||||
-rw-r--r-- | core/pim/osearch/mainwindow.cpp | 4 | ||||
-rw-r--r-- | core/pim/osearch/mainwindow.h | 2 | ||||
-rw-r--r-- | core/pim/osearch/osearch.pro | 8 |
7 files changed, 183 insertions, 3 deletions
diff --git a/core/pim/osearch/applnkitem.cpp b/core/pim/osearch/applnkitem.cpp new file mode 100644 index 0000000..f45ed68 --- a/dev/null +++ b/core/pim/osearch/applnkitem.cpp | |||
@@ -0,0 +1,54 @@ | |||
1 | // | ||
2 | // | ||
3 | // C++ Implementation: $MODULE$ | ||
4 | // | ||
5 | // Description: | ||
6 | // | ||
7 | // | ||
8 | // Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003 | ||
9 | // | ||
10 | // Copyright: See COPYING file that comes with this distribution | ||
11 | // | ||
12 | // | ||
13 | #include "applnkitem.h" | ||
14 | |||
15 | #include <qpe/applnk.h> | ||
16 | |||
17 | AppLnkItem::AppLnkItem(OListViewItem* parent, AppLnk *app) | ||
18 | : ResultItem(parent) | ||
19 | { | ||
20 | _app = app; | ||
21 | setText(0, _app->name() ); | ||
22 | } | ||
23 | |||
24 | |||
25 | AppLnkItem::~AppLnkItem() | ||
26 | { | ||
27 | } | ||
28 | |||
29 | |||
30 | QString AppLnkItem::toRichText() | ||
31 | { | ||
32 | QString text; | ||
33 | text += "<b><h3>"; | ||
34 | text += _app->name(); | ||
35 | text += "</b></h3><br>"; | ||
36 | text += _app->comment(); | ||
37 | text += "<br><br>`"; | ||
38 | text += _app->exec(); | ||
39 | text += "`"; | ||
40 | return text; | ||
41 | } | ||
42 | |||
43 | void AppLnkItem::editItem() | ||
44 | { | ||
45 | _app->execute(); | ||
46 | } | ||
47 | |||
48 | void AppLnkItem::showItem() | ||
49 | { | ||
50 | /* QCopEnvelope e("QPE/Application/addressbook", "edit(int)"); | ||
51 | e << _contact->uid();*/ | ||
52 | ResultItem::showItem(); | ||
53 | } | ||
54 | |||
diff --git a/core/pim/osearch/applnkitem.h b/core/pim/osearch/applnkitem.h new file mode 100644 index 0000000..b28631a --- a/dev/null +++ b/core/pim/osearch/applnkitem.h | |||
@@ -0,0 +1,37 @@ | |||
1 | // | ||
2 | // | ||
3 | // C++ Interface: $MODULE$ | ||
4 | // | ||
5 | // Description: | ||
6 | // | ||
7 | // | ||
8 | // Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003 | ||
9 | // | ||
10 | // Copyright: See COPYING file that comes with this distribution | ||
11 | // | ||
12 | // | ||
13 | #ifndef APPLNKITEM_H | ||
14 | #define APPLNKITEM_H | ||
15 | |||
16 | #include "resultitem.h" | ||
17 | |||
18 | class AppLnk; | ||
19 | |||
20 | /** | ||
21 | @author Patrick S. Vogt | ||
22 | */ | ||
23 | class AppLnkItem : public ResultItem | ||
24 | { | ||
25 | public: | ||
26 | AppLnkItem(OListViewItem* parent, AppLnk *app); | ||
27 | ~AppLnkItem(); | ||
28 | |||
29 | virtual QString toRichText(); | ||
30 | virtual void editItem(); | ||
31 | virtual void showItem(); | ||
32 | |||
33 | private: | ||
34 | AppLnk *_app; | ||
35 | }; | ||
36 | |||
37 | #endif | ||
diff --git a/core/pim/osearch/applnksearch.cpp b/core/pim/osearch/applnksearch.cpp new file mode 100644 index 0000000..7872ae3 --- a/dev/null +++ b/core/pim/osearch/applnksearch.cpp | |||
@@ -0,0 +1,46 @@ | |||
1 | // | ||
2 | // | ||
3 | // C++ Implementation: $MODULE$ | ||
4 | // | ||
5 | // Description: | ||
6 | // | ||
7 | // | ||
8 | // Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003 | ||
9 | // | ||
10 | // Copyright: See COPYING file that comes with this distribution | ||
11 | // | ||
12 | // | ||
13 | #include "applnksearch.h" | ||
14 | |||
15 | #include <qpe/applnk.h> | ||
16 | #include <qpe/qpeapplication.h> | ||
17 | |||
18 | #include "applnkitem.h" | ||
19 | |||
20 | AppLnkSearch::AppLnkSearch(QListView* parent, QString name): SearchGroup(parent, name) | ||
21 | { | ||
22 | _apps = 0; | ||
23 | } | ||
24 | |||
25 | |||
26 | AppLnkSearch::~AppLnkSearch() | ||
27 | { | ||
28 | delete _apps; | ||
29 | } | ||
30 | |||
31 | |||
32 | void AppLnkSearch::expand() | ||
33 | { | ||
34 | SearchGroup::expand(); | ||
35 | if (_search.isEmpty()) return; | ||
36 | if (!_apps) _apps = new AppLnkSet(QPEApplication::qpeDir()); | ||
37 | QList<AppLnk> appList = _apps->children(); | ||
38 | for ( AppLnk *app = appList.first(); app != 0; app = appList.next() ){ | ||
39 | // if (app->name().contains(_search) || app->comment().contains(_search)) | ||
40 | if ( (_search.match( app->name() ) != -1) | ||
41 | || (_search.match(app->comment()) != -1) | ||
42 | || (_search.match(app->exec()) != -1) ) | ||
43 | new AppLnkItem( this, app ); | ||
44 | } | ||
45 | } | ||
46 | |||
diff --git a/core/pim/osearch/applnksearch.h b/core/pim/osearch/applnksearch.h new file mode 100644 index 0000000..e283cd3 --- a/dev/null +++ b/core/pim/osearch/applnksearch.h | |||
@@ -0,0 +1,35 @@ | |||
1 | // | ||
2 | // | ||
3 | // C++ Interface: $MODULE$ | ||
4 | // | ||
5 | // Description: | ||
6 | // | ||
7 | // | ||
8 | // Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003 | ||
9 | // | ||
10 | // Copyright: See COPYING file that comes with this distribution | ||
11 | // | ||
12 | // | ||
13 | #ifndef APPLNKSEARCH_H | ||
14 | #define APPLNKSEARCH_H | ||
15 | |||
16 | #include "searchgroup.h" | ||
17 | |||
18 | class AppLnkSet; | ||
19 | |||
20 | /** | ||
21 | @author Patrick S. Vogt | ||
22 | */ | ||
23 | class AppLnkSearch : public SearchGroup | ||
24 | { | ||
25 | public: | ||
26 | AppLnkSearch(QListView* parent, QString name); | ||
27 | |||
28 | ~AppLnkSearch(); | ||
29 | |||
30 | virtual void expand(); | ||
31 | private: | ||
32 | AppLnkSet *_apps; | ||
33 | }; | ||
34 | |||
35 | #endif | ||
diff --git a/core/pim/osearch/mainwindow.cpp b/core/pim/osearch/mainwindow.cpp index 3dba3a9..41ce5b6 100644 --- a/core/pim/osearch/mainwindow.cpp +++ b/core/pim/osearch/mainwindow.cpp | |||
@@ -1,177 +1,179 @@ | |||
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 "mainwindow.h" | 13 | #include "mainwindow.h" |
14 | 14 | ||
15 | #include <qpe/qpemenubar.h> | 15 | #include <qpe/qpemenubar.h> |
16 | #include <qpe/qpemessagebox.h> | 16 | #include <qpe/qpemessagebox.h> |
17 | #include <qpe/resource.h> | 17 | #include <qpe/resource.h> |
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 <qaction.h> | 21 | #include <qaction.h> |
22 | #include <qmessagebox.h> | 22 | #include <qmessagebox.h> |
23 | #include <qpopupmenu.h> | 23 | #include <qpopupmenu.h> |
24 | #include <qtoolbutton.h> | 24 | #include <qtoolbutton.h> |
25 | #include <qstring.h> | 25 | #include <qstring.h> |
26 | #include <qlabel.h> | 26 | #include <qlabel.h> |
27 | #include <qfile.h> | 27 | #include <qfile.h> |
28 | #include <qpushbutton.h> | 28 | #include <qpushbutton.h> |
29 | #include <qlayout.h> | 29 | #include <qlayout.h> |
30 | #include <qlineedit.h> | 30 | #include <qlineedit.h> |
31 | #include <qtextbrowser.h> | 31 | #include <qtextbrowser.h> |
32 | 32 | ||
33 | #include "olistview.h" | 33 | #include "olistview.h" |
34 | #include "olistviewitem.h" | 34 | #include "olistviewitem.h" |
35 | #include "resultitem.h" | 35 | #include "resultitem.h" |
36 | #include "adresssearch.h" | 36 | #include "adresssearch.h" |
37 | #include "todosearch.h" | 37 | #include "todosearch.h" |
38 | #include "datebooksearch.h" | 38 | #include "datebooksearch.h" |
39 | 39 | #include "applnksearch.h" | |
40 | 40 | ||
41 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : | 41 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : |
42 | QMainWindow( parent, name, f ), _currentItem(0) | 42 | QMainWindow( parent, name, f ), _currentItem(0) |
43 | { | 43 | { |
44 | setCaption( tr("OSearch") ); | 44 | setCaption( tr("OSearch") ); |
45 | 45 | ||
46 | setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding)); | 46 | setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding)); |
47 | 47 | ||
48 | QFrame *mainFrame = new QFrame( this, "mainFrame" ); | 48 | QFrame *mainFrame = new QFrame( this, "mainFrame" ); |
49 | 49 | ||
50 | mainLayout = new QVBoxLayout( mainFrame ); | 50 | mainLayout = new QVBoxLayout( mainFrame ); |
51 | mainLayout->setSpacing( 0 ); | 51 | mainLayout->setSpacing( 0 ); |
52 | mainLayout->setMargin( 0 ); | 52 | mainLayout->setMargin( 0 ); |
53 | 53 | ||
54 | resultsList = new OListView( mainFrame ); | 54 | resultsList = new OListView( mainFrame ); |
55 | resultsList->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding)); | 55 | resultsList->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding)); |
56 | mainLayout->addWidget( resultsList ); | 56 | mainLayout->addWidget( resultsList ); |
57 | 57 | ||
58 | detailsFrame = new QFrame( mainFrame, "detailsFrame" ); | 58 | detailsFrame = new QFrame( mainFrame, "detailsFrame" ); |
59 | QVBoxLayout *detailsLayout = new QVBoxLayout( detailsFrame ); | 59 | QVBoxLayout *detailsLayout = new QVBoxLayout( detailsFrame ); |
60 | richEdit = new QTextView( detailsFrame ); | 60 | richEdit = new QTextView( detailsFrame ); |
61 | richEdit->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding)); | 61 | richEdit->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding)); |
62 | detailsLayout->addWidget( richEdit, 0 ); | 62 | detailsLayout->addWidget( richEdit, 0 ); |
63 | QHBoxLayout *buttonLayout = new QHBoxLayout( detailsFrame ); | 63 | QHBoxLayout *buttonLayout = new QHBoxLayout( detailsFrame ); |
64 | detailsLayout->addLayout( buttonLayout, 0 ); | 64 | detailsLayout->addLayout( buttonLayout, 0 ); |
65 | QPushButton *buttonShow = new QPushButton( detailsFrame, "Show" ); | 65 | QPushButton *buttonShow = new QPushButton( detailsFrame, "Show" ); |
66 | buttonShow->setText( tr("show") ); | 66 | buttonShow->setText( tr("show") ); |
67 | // buttonShow->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding)); | 67 | // buttonShow->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding)); |
68 | QPushButton *buttonEdit = new QPushButton( detailsFrame, "Edit" ); | 68 | QPushButton *buttonEdit = new QPushButton( detailsFrame, "Edit" ); |
69 | buttonEdit->setText( tr("edit") ); | 69 | buttonEdit->setText( tr("edit") ); |
70 | // buttonEdit->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding)); | 70 | // buttonEdit->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding)); |
71 | buttonLayout->addWidget( buttonShow, 0 ); | 71 | buttonLayout->addWidget( buttonShow, 0 ); |
72 | buttonLayout->addWidget( buttonEdit, 0 ); | 72 | buttonLayout->addWidget( buttonEdit, 0 ); |
73 | 73 | ||
74 | mainLayout->addWidget( detailsFrame, 0 ); | 74 | mainLayout->addWidget( detailsFrame, 0 ); |
75 | detailsFrame->hide(); | 75 | detailsFrame->hide(); |
76 | 76 | ||
77 | adrSearch = new AdressSearch( resultsList, tr("adressbook") ); | 77 | adrSearch = new AdressSearch( resultsList, tr("adressbook") ); |
78 | todoSearch = new TodoSearch( resultsList, tr("todo") ); | 78 | todoSearch = new TodoSearch( resultsList, tr("todo") ); |
79 | datebookSearch = new DatebookSearch( resultsList, tr("datebook") ); | 79 | datebookSearch = new DatebookSearch( resultsList, tr("datebook") ); |
80 | applnkSearch = new AppLnkSearch( resultsList, tr("applications") ); | ||
80 | 81 | ||
81 | makeMenu(); | 82 | makeMenu(); |
82 | setCentralWidget( mainFrame ); | 83 | setCentralWidget( mainFrame ); |
83 | 84 | ||
84 | popupTimer = new QTimer(); | 85 | popupTimer = new QTimer(); |
85 | 86 | ||
86 | connect(popupTimer, SIGNAL(timeout()), SLOT(showPopup())); | 87 | connect(popupTimer, SIGNAL(timeout()), SLOT(showPopup())); |
87 | connect(resultsList, SIGNAL(pressed(QListViewItem*)), SLOT(setCurrent(QListViewItem*))); | 88 | connect(resultsList, SIGNAL(pressed(QListViewItem*)), SLOT(setCurrent(QListViewItem*))); |
88 | connect(resultsList, SIGNAL(clicked(QListViewItem*)), SLOT(stopTimer(QListViewItem*))); | 89 | connect(resultsList, SIGNAL(clicked(QListViewItem*)), SLOT(stopTimer(QListViewItem*))); |
89 | connect(buttonShow, SIGNAL(clicked()), SLOT( showItem() ) ); | 90 | connect(buttonShow, SIGNAL(clicked()), SLOT( showItem() ) ); |
90 | connect(buttonEdit, SIGNAL(clicked()), SLOT( editItem() ) ); | 91 | connect(buttonEdit, SIGNAL(clicked()), SLOT( editItem() ) ); |
91 | 92 | ||
92 | 93 | ||
93 | } | 94 | } |
94 | 95 | ||
95 | void MainWindow::makeMenu() | 96 | void MainWindow::makeMenu() |
96 | { | 97 | { |
97 | // QPEToolBar *toolBar = new QPEToolBar( this ); | 98 | // QPEToolBar *toolBar = new QPEToolBar( this ); |
98 | // QPEMenuBar *menuBar = new QPEMenuBar( toolBar ); | 99 | // QPEMenuBar *menuBar = new QPEMenuBar( toolBar ); |
99 | // QPopupMenu *searchMenu = new QPopupMenu( menuBar ); | 100 | // QPopupMenu *searchMenu = new QPopupMenu( menuBar ); |
100 | // QPopupMenu *viewMenu = new QPopupMenu( menuBar ); | 101 | // QPopupMenu *viewMenu = new QPopupMenu( menuBar ); |
101 | // QPopupMenu *cfgMenu = new QPopupMenu( menuBar ); | 102 | // QPopupMenu *cfgMenu = new QPopupMenu( menuBar ); |
102 | // | 103 | // |
103 | setToolBarsMovable( false ); | 104 | setToolBarsMovable( false ); |
104 | // toolBar->setHorizontalStretchable( true ); | 105 | // toolBar->setHorizontalStretchable( true ); |
105 | // menuBar->insertItem( tr( "Search" ), searchMenu ); | 106 | // menuBar->insertItem( tr( "Search" ), searchMenu ); |
106 | // menuBar->insertItem( tr( "View" ), viewMenu ); | 107 | // menuBar->insertItem( tr( "View" ), viewMenu ); |
107 | // menuBar->insertItem( tr( "Settings" ), cfgMenu ); | 108 | // menuBar->insertItem( tr( "Settings" ), cfgMenu ); |
108 | 109 | ||
109 | //SEARCH | 110 | //SEARCH |
110 | QPEToolBar *searchBar = new QPEToolBar(this); | 111 | QPEToolBar *searchBar = new QPEToolBar(this); |
111 | addToolBar( searchBar, "Search", QMainWindow::Top, TRUE ); | 112 | addToolBar( searchBar, "Search", QMainWindow::Top, TRUE ); |
112 | QLabel *label = new QLabel( tr("Search: "), searchBar ); | 113 | QLabel *label = new QLabel( tr("Search: "), searchBar ); |
113 | // label->setBackgroundMode( PaletteForeground ); | 114 | // label->setBackgroundMode( PaletteForeground ); |
114 | searchBar->setHorizontalStretchable( TRUE ); | 115 | searchBar->setHorizontalStretchable( TRUE ); |
115 | QLineEdit *searchEdit = new QLineEdit( searchBar, "seachEdit" ); | 116 | QLineEdit *searchEdit = new QLineEdit( searchBar, "seachEdit" ); |
116 | searchBar->setStretchableWidget( searchEdit ); | 117 | searchBar->setStretchableWidget( searchEdit ); |
117 | connect( searchEdit, SIGNAL( textChanged( const QString & ) ), | 118 | connect( searchEdit, SIGNAL( textChanged( const QString & ) ), |
118 | this, SLOT( setSearch( const QString & ) ) ); | 119 | this, SLOT( setSearch( const QString & ) ) ); |
119 | 120 | ||
120 | 121 | ||
121 | } | 122 | } |
122 | 123 | ||
123 | MainWindow::~MainWindow() | 124 | MainWindow::~MainWindow() |
124 | { | 125 | { |
125 | } | 126 | } |
126 | 127 | ||
127 | void MainWindow::setCurrent(QListViewItem *item) | 128 | void MainWindow::setCurrent(QListViewItem *item) |
128 | { | 129 | { |
129 | if (!item) return; | 130 | if (!item) return; |
130 | _currentItem = (OListViewItem*)item; | 131 | _currentItem = (OListViewItem*)item; |
131 | //_currentItem = dynamic_cast<OListViewItem*>(item); | 132 | //_currentItem = dynamic_cast<OListViewItem*>(item); |
132 | if (_currentItem->rtti() == OListViewItem::Result){ | 133 | if (_currentItem->rtti() == OListViewItem::Result){ |
133 | ResultItem *res = (ResultItem*)item; | 134 | ResultItem *res = (ResultItem*)item; |
134 | // ResultItem *res = dynamic_cast<ResultItem*>(item); | 135 | // ResultItem *res = dynamic_cast<ResultItem*>(item); |
135 | richEdit->setText( res->toRichText() ); | 136 | richEdit->setText( res->toRichText() ); |
136 | detailsFrame->show(); | 137 | detailsFrame->show(); |
137 | }else detailsFrame->hide(); | 138 | }else detailsFrame->hide(); |
138 | //_currentItem = (OListViewItem*)item; | 139 | //_currentItem = (OListViewItem*)item; |
139 | popupTimer->start( 300 ); | 140 | popupTimer->start( 300 ); |
140 | } | 141 | } |
141 | 142 | ||
142 | void MainWindow::stopTimer(QListViewItem*) | 143 | void MainWindow::stopTimer(QListViewItem*) |
143 | { | 144 | { |
144 | popupTimer->stop(); | 145 | popupTimer->stop(); |
145 | } | 146 | } |
146 | 147 | ||
147 | void MainWindow::showPopup() | 148 | void MainWindow::showPopup() |
148 | { | 149 | { |
149 | qDebug("showPopup"); | 150 | qDebug("showPopup"); |
150 | if (!_item) return; | 151 | if (!_item) return; |
151 | } | 152 | } |
152 | 153 | ||
153 | void MainWindow::setSearch( const QString &key ) | 154 | void MainWindow::setSearch( const QString &key ) |
154 | { | 155 | { |
155 | adrSearch->setSearch(key); | 156 | adrSearch->setSearch(key); |
156 | todoSearch->setSearch(key); | 157 | todoSearch->setSearch(key); |
157 | datebookSearch->setSearch(key); | 158 | datebookSearch->setSearch(key); |
159 | applnkSearch->setSearch(key); | ||
158 | } | 160 | } |
159 | 161 | ||
160 | 162 | ||
161 | void MainWindow::showItem() | 163 | void MainWindow::showItem() |
162 | { | 164 | { |
163 | if (_currentItem->rtti() == OListViewItem::Result){ | 165 | if (_currentItem->rtti() == OListViewItem::Result){ |
164 | ResultItem *res = (ResultItem*)_currentItem; | 166 | ResultItem *res = (ResultItem*)_currentItem; |
165 | // ResultItem *res = dynamic_cast<ResultItem*>(item); | 167 | // ResultItem *res = dynamic_cast<ResultItem*>(item); |
166 | res->showItem(); | 168 | res->showItem(); |
167 | } | 169 | } |
168 | } | 170 | } |
169 | 171 | ||
170 | void MainWindow::editItem() | 172 | void MainWindow::editItem() |
171 | { | 173 | { |
172 | if (_currentItem->rtti() == OListViewItem::Result){ | 174 | if (_currentItem->rtti() == OListViewItem::Result){ |
173 | ResultItem *res = (ResultItem*)_currentItem; | 175 | ResultItem *res = (ResultItem*)_currentItem; |
174 | // ResultItem *res = dynamic_cast<ResultItem*>(item); | 176 | // ResultItem *res = dynamic_cast<ResultItem*>(item); |
175 | res->editItem(); | 177 | res->editItem(); |
176 | } | 178 | } |
177 | } | 179 | } |
diff --git a/core/pim/osearch/mainwindow.h b/core/pim/osearch/mainwindow.h index f7e8f8e..f79504c 100644 --- a/core/pim/osearch/mainwindow.h +++ b/core/pim/osearch/mainwindow.h | |||
@@ -1,69 +1,71 @@ | |||
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 | #ifndef MAINWINDOW_H | 12 | #ifndef MAINWINDOW_H |
13 | #define MAINWINDOW_H | 13 | #define MAINWINDOW_H |
14 | 14 | ||
15 | #include <qmainwindow.h> | 15 | #include <qmainwindow.h> |
16 | #include <qdialog.h> | 16 | #include <qdialog.h> |
17 | #include <qaction.h> | 17 | #include <qaction.h> |
18 | #include <qtimer.h> | 18 | #include <qtimer.h> |
19 | #include <qpopupmenu.h> | 19 | #include <qpopupmenu.h> |
20 | 20 | ||
21 | class QPEToolBar; | 21 | class QPEToolBar; |
22 | class QVBoxLayout; | 22 | class QVBoxLayout; |
23 | class QTextView; | 23 | class QTextView; |
24 | class QFrame; | 24 | class QFrame; |
25 | class QListViewItem; | 25 | class QListViewItem; |
26 | class OListView; | 26 | class OListView; |
27 | class OListViewItem; | 27 | class OListViewItem; |
28 | class AdressSearch; | 28 | class AdressSearch; |
29 | class TodoSearch; | 29 | class TodoSearch; |
30 | class DatebookSearch; | 30 | class DatebookSearch; |
31 | class AppLnkSearch; | ||
31 | 32 | ||
32 | class MainWindow : public QMainWindow | 33 | class MainWindow : public QMainWindow |
33 | { | 34 | { |
34 | Q_OBJECT | 35 | Q_OBJECT |
35 | 36 | ||
36 | 37 | ||
37 | public: | 38 | public: |
38 | MainWindow( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); | 39 | MainWindow( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); |
39 | ~MainWindow(); | 40 | ~MainWindow(); |
40 | 41 | ||
41 | 42 | ||
42 | public slots: | 43 | public slots: |
43 | void setCurrent(QListViewItem*); | 44 | void setCurrent(QListViewItem*); |
44 | void showPopup(); | 45 | void showPopup(); |
45 | void stopTimer( QListViewItem* ); | 46 | void stopTimer( QListViewItem* ); |
46 | void setSearch( const QString& ); | 47 | void setSearch( const QString& ); |
47 | 48 | ||
48 | protected slots: | 49 | protected slots: |
49 | void showItem(); | 50 | void showItem(); |
50 | void editItem(); | 51 | void editItem(); |
51 | 52 | ||
52 | private: | 53 | private: |
53 | OListView *resultsList; | 54 | OListView *resultsList; |
54 | QTextView *richEdit; | 55 | QTextView *richEdit; |
55 | OListViewItem *_currentItem; | 56 | OListViewItem *_currentItem; |
56 | QVBoxLayout *mainLayout; | 57 | QVBoxLayout *mainLayout; |
57 | QFrame *detailsFrame; | 58 | QFrame *detailsFrame; |
58 | OListViewItem *_item; | 59 | OListViewItem *_item; |
59 | QTimer *popupTimer; | 60 | QTimer *popupTimer; |
60 | 61 | ||
61 | AdressSearch *adrSearch; | 62 | AdressSearch *adrSearch; |
62 | TodoSearch *todoSearch; | 63 | TodoSearch *todoSearch; |
63 | DatebookSearch *datebookSearch; | 64 | DatebookSearch *datebookSearch; |
65 | AppLnkSearch *applnkSearch; | ||
64 | 66 | ||
65 | void makeMenu(); | 67 | void makeMenu(); |
66 | }; | 68 | }; |
67 | 69 | ||
68 | #endif | 70 | #endif |
69 | 71 | ||
diff --git a/core/pim/osearch/osearch.pro b/core/pim/osearch/osearch.pro index 397bc83..75e90f2 100644 --- a/core/pim/osearch/osearch.pro +++ b/core/pim/osearch/osearch.pro | |||
@@ -1,32 +1,36 @@ | |||
1 | DEPENDPATH += $(OPIEDIR)/ioclude | 1 | DEPENDPATH += $(OPIEDIR)/ioclude |
2 | LIBS += -lqpe -lopie | 2 | LIBS += -lqpe -lopie |
3 | INTERFACES = | 3 | INTERFACES = |
4 | include ( $(OPIEDIR)/include.pro ) | 4 | include ( $(OPIEDIR)/include.pro ) |
5 | TEMPLATE = app | 5 | TEMPLATE = app |
6 | CONFIG += debug warn_on qt | 6 | CONFIG += debug warn_on qt |
7 | DESTDIR = $(OPIEDIR)/bin | 7 | DESTDIR = $(OPIEDIR)/bin |
8 | TARGET = osearch | 8 | TARGET = osearch |
9 | INCLUDEPATH = $(OPIEDIR)/include | 9 | INCLUDEPATH = $(OPIEDIR)/include |
10 | SOURCES += main.cpp \ | 10 | SOURCES += main.cpp \ |
11 | mainwindow.cpp \ | 11 | mainwindow.cpp \ |
12 | olistview.cpp \ | 12 | olistview.cpp \ |
13 | olistviewitem.cpp \ | 13 | olistviewitem.cpp \ |
14 | adresssearch.cpp \ | 14 | adresssearch.cpp \ |
15 | todosearch.cpp \ | 15 | todosearch.cpp \ |
16 | datebooksearch.cpp \ | 16 | datebooksearch.cpp \ |
17 | searchgroup.cpp \ | 17 | searchgroup.cpp \ |
18 | resultitem.cpp \ | 18 | resultitem.cpp \ |
19 | todoitem.cpp \ | 19 | todoitem.cpp \ |
20 | contactitem.cpp \ | 20 | contactitem.cpp \ |
21 | eventitem.cpp | 21 | eventitem.cpp \ |
22 | applnksearch.cpp \ | ||
23 | applnkitem.cpp | ||
22 | HEADERS += mainwindow.h \ | 24 | HEADERS += mainwindow.h \ |
23 | olistview.h \ | 25 | olistview.h \ |
24 | olistviewitem.h \ | 26 | olistviewitem.h \ |
25 | adresssearch.h \ | 27 | adresssearch.h \ |
26 | todosearch.h \ | 28 | todosearch.h \ |
27 | datebooksearch.h \ | 29 | datebooksearch.h \ |
28 | searchgroup.h \ | 30 | searchgroup.h \ |
29 | resultitem.h \ | 31 | resultitem.h \ |
30 | todoitem.h \ | 32 | todoitem.h \ |
31 | contactitem.h \ | 33 | contactitem.h \ |
32 | eventitem.h | 34 | eventitem.h \ |
35 | applnksearch.h \ | ||
36 | applnkitem.h | ||