summaryrefslogtreecommitdiff
authortille <tille>2003-05-13 13:46:19 (UTC)
committer tille <tille>2003-05-13 13:46:19 (UTC)
commitba4bb8e673fba43ae7a232942dea14d166991530 (patch) (side-by-side diff)
treee775ad637d5256eb1412e576c1bd5e77ed50406d
parent1461a41433a732e3a615508e5de23f8acd91de6a (diff)
downloadopie-ba4bb8e673fba43ae7a232942dea14d166991530.zip
opie-ba4bb8e673fba43ae7a232942dea14d166991530.tar.gz
opie-ba4bb8e673fba43ae7a232942dea14d166991530.tar.bz2
icons ;)
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/osearch/adresssearch.cpp10
-rw-r--r--core/pim/osearch/applnkitem.cpp1
-rw-r--r--core/pim/osearch/applnksearch.cpp7
-rw-r--r--core/pim/osearch/datebooksearch.cpp5
-rw-r--r--core/pim/osearch/doclnkitem.cpp1
-rw-r--r--core/pim/osearch/doclnksearch.cpp6
-rw-r--r--core/pim/osearch/mainwindow.cpp22
-rw-r--r--core/pim/osearch/mainwindow.h10
-rw-r--r--core/pim/osearch/searchgroup.cpp31
-rw-r--r--core/pim/osearch/searchgroup.h9
-rw-r--r--core/pim/osearch/todosearch.cpp7
11 files changed, 86 insertions, 23 deletions
diff --git a/core/pim/osearch/adresssearch.cpp b/core/pim/osearch/adresssearch.cpp
index 69ad9ef..252fb40 100644
--- a/core/pim/osearch/adresssearch.cpp
+++ b/core/pim/osearch/adresssearch.cpp
@@ -16,5 +16,6 @@
#include <qstring.h>
+#include <qiconset.h>
+#include <qpe/resource.h>
#include "contactitem.h"
-//#include <qdir.h>
@@ -24,2 +25,9 @@ AdressSearch::AdressSearch(QListView* parent, QString name):
_contacts = 0;
+ QIconSet is = Resource::loadIconSet( "addressbook/AddressBook" );
+ setPixmap( 0, is.pixmap( QIconSet::Small, true ) );
+/* QPixmap pix = Resource::loadPixmap( "addressbook/AddressBook" );
+ QImage img = pix.convertToImage();
+ img.smoothScale( 14, 14 );
+ pix.convertFromImage( img );
+ setPixmap( 0, pix );*/
}
diff --git a/core/pim/osearch/applnkitem.cpp b/core/pim/osearch/applnkitem.cpp
index 0d04be6..2c4a4cb 100644
--- a/core/pim/osearch/applnkitem.cpp
+++ b/core/pim/osearch/applnkitem.cpp
@@ -23,2 +23,3 @@ AppLnkItem::AppLnkItem(OListViewItem* parent, AppLnk *app)
setText(0, _app->name() );
+ setPixmap(0, _app->pixmap() );
}
diff --git a/core/pim/osearch/applnksearch.cpp b/core/pim/osearch/applnksearch.cpp
index acf650a..d5b181b 100644
--- a/core/pim/osearch/applnksearch.cpp
+++ b/core/pim/osearch/applnksearch.cpp
@@ -16,2 +16,4 @@
#include <qpe/qpeapplication.h>
+#include <qiconset.h>
+#include <qpe/resource.h>
@@ -22,2 +24,5 @@ AppLnkSearch::AppLnkSearch(QListView* parent, QString name): SearchGroup(parent,
_apps = 0;
+ QIconSet is = Resource::loadIconSet( "osearch/applications" );
+ //QIconSet is = Resource::loadIconSet( "AppsIcon" );
+ setPixmap( 0, is.pixmap( QIconSet::Small, true ) );
}
@@ -47,2 +52,3 @@ int AppLnkSearch::search()
}
+ qApp->processEvents( 100 );
}
@@ -58,3 +64,2 @@ void AppLnkSearch::setSearch(QRegExp re)
{
- expanded = false;
setOpen( false );
diff --git a/core/pim/osearch/datebooksearch.cpp b/core/pim/osearch/datebooksearch.cpp
index 68699fa..7aabcea 100644
--- a/core/pim/osearch/datebooksearch.cpp
+++ b/core/pim/osearch/datebooksearch.cpp
@@ -18,2 +18,4 @@
#include <opie/odatebookaccess.h>
+#include <qiconset.h>
+#include <qpe/resource.h>
@@ -23,2 +25,5 @@ DatebookSearch::DatebookSearch(QListView* parent, QString name)
_dates = 0;
+ QIconSet is = Resource::loadIconSet( "datebook/DateBook" );
+ setPixmap( 0, is.pixmap( QIconSet::Small, true ) );
+
}
diff --git a/core/pim/osearch/doclnkitem.cpp b/core/pim/osearch/doclnkitem.cpp
index 95402b9..a1d0384 100644
--- a/core/pim/osearch/doclnkitem.cpp
+++ b/core/pim/osearch/doclnkitem.cpp
@@ -25,2 +25,3 @@ DocLnkItem::DocLnkItem(OListViewItem* parent, DocLnk *app)
setText(0, _doc->name() );
+ setPixmap(0, _doc->pixmap() );
}
diff --git a/core/pim/osearch/doclnksearch.cpp b/core/pim/osearch/doclnksearch.cpp
index f2a60e9..123eaa0 100644
--- a/core/pim/osearch/doclnksearch.cpp
+++ b/core/pim/osearch/doclnksearch.cpp
@@ -4,3 +4,3 @@
//
-// Description:
+// Description:
//
@@ -16,2 +16,4 @@
#include <qpe/qpeapplication.h>
+#include <qiconset.h>
+#include <qpe/resource.h>
@@ -22,2 +24,4 @@ DocLnkSearch::DocLnkSearch(QListView* parent, QString name)
{
+ QIconSet is = Resource::loadIconSet( "osearch/documents" );
+ setPixmap( 0, is.pixmap( QIconSet::Small, true ) );
}
diff --git a/core/pim/osearch/mainwindow.cpp b/core/pim/osearch/mainwindow.cpp
index e15cc7e..33a24bc 100644
--- a/core/pim/osearch/mainwindow.cpp
+++ b/core/pim/osearch/mainwindow.cpp
@@ -89,4 +89,6 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) :
popupTimer = new QTimer();
+ searchTimer = new QTimer();
connect(popupTimer, SIGNAL(timeout()), SLOT(showPopup()));
+ connect(searchTimer, SIGNAL(timeout()), SLOT(searchStringChanged()));
connect(resultsList, SIGNAL(pressed(QListViewItem*)), SLOT(setCurrent(QListViewItem*)));
@@ -113,5 +115,6 @@ void MainWindow::makeMenu()
//SEARCH
- QAction *action = new QAction( tr("Search all"),QString::null, 0, this, 0 );
- connect( action, SIGNAL(activated()), this, SLOT(searchAll()) );
- action->addTo( searchMenu );
+ SearchAllAction = new QAction( tr("Search all"),QString::null, 0, this, 0 );
+ SearchAllAction->setIconSet( Resource::loadIconSet( "find" ) );
+ connect( SearchAllAction, SIGNAL(activated()), this, SLOT(searchAll()) );
+ SearchAllAction->addTo( searchMenu );
actionCaseSensitiv = new QAction( tr("Case sensitiv"),QString::null, 0, this, 0, true );
@@ -125,2 +128,3 @@ void MainWindow::makeMenu()
searchBar->setStretchableWidget( searchEdit );
+ SearchAllAction->addTo( searchBar );
connect( searchEdit, SIGNAL( textChanged( const QString & ) ),
@@ -186,3 +190,11 @@ void MainWindow::setSearch( const QString &key )
{
- QRegExp re( key, actionCaseSensitiv->isOn(), actionWildcards->isOn() );
+ searchTimer->stop();
+ _searchString = key;
+ searchTimer->start( 300 );
+}
+
+void MainWindow::searchStringChanged()
+{
+ searchTimer->stop();
+ QRegExp re( _searchString, actionCaseSensitiv->isOn(), actionWildcards->isOn() );
for (SearchGroup *s = searches.first(); s != 0; s = searches.next() )
@@ -193,5 +205,5 @@ void MainWindow::searchAll()
{
- bool openState;
for (SearchGroup *s = searches.first(); s != 0; s = searches.next() ){
s->doSearch();
+ //resultsList->repaint();
}
diff --git a/core/pim/osearch/mainwindow.h b/core/pim/osearch/mainwindow.h
index 2773205..939762e 100644
--- a/core/pim/osearch/mainwindow.h
+++ b/core/pim/osearch/mainwindow.h
@@ -45,4 +45,2 @@ public slots:
void setCurrent(QListViewItem*);
- void showPopup();
- void stopTimer( QListViewItem* );
void setSearch( const QString& );
@@ -52,3 +50,6 @@ protected slots:
void slotAction(int);
-
+ void showPopup();
+ void stopTimer( QListViewItem* );
+ void searchStringChanged();
+
private:
@@ -61,5 +62,8 @@ private:
QTimer *popupTimer;
+ QTimer *searchTimer;
+ QString _searchString;
QList<SearchGroup> searches;
QHButtonGroup *buttonGroupActions;
+ QAction *SearchAllAction;
QAction *actionCaseSensitiv;
diff --git a/core/pim/osearch/searchgroup.cpp b/core/pim/osearch/searchgroup.cpp
index 3159984..490deea 100644
--- a/core/pim/osearch/searchgroup.cpp
+++ b/core/pim/osearch/searchgroup.cpp
@@ -15,2 +15,4 @@
#include <qregexp.h>
+// #include <qapplication.h>
+// #include <opie/owait.h>
@@ -23,3 +25,2 @@ SearchGroup::SearchGroup(QListView* parent, QString name)
loaded = false;
- expanded = false;
}
@@ -34,2 +35,3 @@ void SearchGroup::expand()
{
+ //expanded = true;
clearList();
@@ -37,7 +39,8 @@ void SearchGroup::expand()
OListViewItem *dummy = new OListViewItem( this, "searching...");
- setOpen( expanded );
- if (!loaded) load();
- int res_count = search();
+ setOpen( true );
+ repaint();
+ int res_count = realSearch();
setText(0, _name + " - " + _search.pattern() + " (" + QString::number( res_count ) + ")");
delete dummy;
+ repaint();
}
@@ -48,5 +51,5 @@ void SearchGroup::doSearch()
if (_search.isEmpty()) return;
- if (!loaded) load();
- int res_count = search();
+ int res_count = realSearch();
setText(0, _name + " - " + _search.pattern() + " (" + QString::number( res_count ) + ")");
+// repaint();
}
@@ -57,3 +60,2 @@ void SearchGroup::clearList()
QListViewItem *toDel;
-
while ( item != 0 ) {
@@ -63,3 +65,2 @@ void SearchGroup::clearList()
}
- expanded = true;
}
@@ -70,3 +71,3 @@ void SearchGroup::setSearch(QRegExp re)
_search = re;
- if (expanded) expand();
+ if (isOpen()) expand();
else new OListViewItem( this, "searching...");
@@ -74 +75,13 @@ void SearchGroup::setSearch(QRegExp re)
+int SearchGroup::realSearch()
+{
+ //emit isSearching( tr(" Searching for %s in %s" ).arg( _search.pattern().latin1()).arg( _name ) );
+/* OWait *wait = new OWait( qApp->mainWidget(), "test" );
+ wait->show();*/
+ if (!loaded) load();
+ int count = search();
+/* wait->hide();
+ delete wait;*/
+ return count;
+}
+
diff --git a/core/pim/osearch/searchgroup.h b/core/pim/osearch/searchgroup.h
index bf5dc67..32f32e0 100644
--- a/core/pim/osearch/searchgroup.h
+++ b/core/pim/osearch/searchgroup.h
@@ -22,4 +22,5 @@ class QRegExp;
*/
-class SearchGroup : public OListViewItem
+class SearchGroup : public OListViewItem //, QObject
{
+//Q_OBJECT
public:
@@ -34,2 +35,5 @@ public:
+// signals:
+// isSearching(QString);
+
protected:
@@ -41,4 +45,5 @@ protected:
QString _name;
- bool expanded;
bool loaded;
+private:
+ int realSearch();
};
diff --git a/core/pim/osearch/todosearch.cpp b/core/pim/osearch/todosearch.cpp
index 6a73530..c9fa61a 100644
--- a/core/pim/osearch/todosearch.cpp
+++ b/core/pim/osearch/todosearch.cpp
@@ -16,3 +16,4 @@
#include <opie/otodo.h>
-
+#include <qiconset.h>
+#include <qpe/resource.h>
#include "todoitem.h"
@@ -23,2 +24,6 @@ TodoSearch::TodoSearch(QListView* parent, QString name)
_todos = 0;
+// AppLnkSet als(QPEApplication::qpeDir());
+// setPixmap( 0, als.findExec("todolist")->pixmap() );
+ QIconSet is = Resource::loadIconSet( "todo/TodoList" );
+ setPixmap( 0, is.pixmap( QIconSet::Small, true ) );
}