-rw-r--r-- | core/pim/osearch/adresssearch.cpp | 3 | ||||
-rw-r--r-- | core/pim/osearch/contactitem.cpp | 2 | ||||
-rw-r--r-- | core/pim/osearch/mainwindow.cpp | 24 |
3 files changed, 16 insertions, 13 deletions
diff --git a/core/pim/osearch/adresssearch.cpp b/core/pim/osearch/adresssearch.cpp index 252fb40..2cd545f 100644 --- a/core/pim/osearch/adresssearch.cpp +++ b/core/pim/osearch/adresssearch.cpp @@ -1,42 +1,43 @@ // // // C++ Implementation: $MODULE$ // // Description: // // // Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003 // // Copyright: See COPYING file that comes with this distribution // // #include "adresssearch.h" -#include <opie/ocontactaccess.h> #include <qstring.h> #include <qiconset.h> +#include <qwhatsthis.h> #include <qpe/resource.h> +#include <opie/ocontactaccess.h> #include "contactitem.h" AdressSearch::AdressSearch(QListView* parent, QString name): SearchGroup(parent, 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 );*/ } AdressSearch::~AdressSearch() { delete _contacts; } void AdressSearch::load() { diff --git a/core/pim/osearch/contactitem.cpp b/core/pim/osearch/contactitem.cpp index 68e0cd4..c4738ae 100644 --- a/core/pim/osearch/contactitem.cpp +++ b/core/pim/osearch/contactitem.cpp @@ -21,50 +21,48 @@ ContactItem::ContactItem(OListViewItem* parent, OContact *contact) : ResultItem(parent) { _contact = contact; setText(0, _contact->toShortText()); setIcon(); } void ContactItem::setIcon() { QPixmap icon; switch ( _contact->lastHitField() ) { case -1: icon = Resource::loadPixmap( "reset" ); break; case Qtopia::BusinessPhone: icon = Resource::loadPixmap( "addressbook/phonework" ); break; case Qtopia::BusinessFax: icon = Resource::loadPixmap( "addressbook/faxwork" ); break; case Qtopia::BusinessMobile: icon = Resource::loadPixmap( "addressbook/mobilework" ); break; case Qtopia::DefaultEmail: - icon = Resource::loadPixmap( "addressbook/email" ); - break; case Qtopia::Emails: icon = Resource::loadPixmap( "addressbook/email" ); break; case Qtopia::HomePhone: icon = Resource::loadPixmap( "addressbook/phonehome" ); break; case Qtopia::HomeFax: icon = Resource::loadPixmap( "addressbook/faxhome" ); break; case Qtopia::HomeMobile: icon = Resource::loadPixmap( "addressbook/mobilehome" ); break; case Qtopia::HomeWebPage: icon = Resource::loadPixmap( "addressbook/webpagehome" ); break; case Qtopia::BusinessWebPage: icon = Resource::loadPixmap( "addressbook/webpagework" ); break; case Qtopia::Title: case Qtopia::JobTitle: case Qtopia::FirstName: case Qtopia::MiddleName: case Qtopia::LastName: case Qtopia::Suffix: diff --git a/core/pim/osearch/mainwindow.cpp b/core/pim/osearch/mainwindow.cpp index 2936b17..c6934db 100644 --- a/core/pim/osearch/mainwindow.cpp +++ b/core/pim/osearch/mainwindow.cpp @@ -1,92 +1,94 @@ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ // (c) 2002 Patrick S. Vogt <tille@handhelds.org> -#include "mainwindow.h" -#include <qpe/qpemenubar.h> -#include <qpe/qpemessagebox.h> -#include <qpe/resource.h> -#include <qpe/config.h> -#include <qpe/qpetoolbar.h> -#include <qpe/qpeapplication.h> -#include <qpe/config.h> -#include <qpe/global.h> -#include <opie/owait.h> #include <qaction.h> #include <qmessagebox.h> #include <qpopupmenu.h> #include <qtoolbutton.h> #include <qstring.h> #include <qlabel.h> #include <qfile.h> #include <qhbuttongroup.h> #include <qpushbutton.h> #include <qintdict.h> #include <qlayout.h> #include <qlineedit.h> #include <qtextbrowser.h> #include <qregexp.h> +#include <qwhatsthis.h> +#include <qpe/qpemenubar.h> +#include <qpe/qpemessagebox.h> +#include <qpe/resource.h> +#include <qpe/config.h> +#include <qpe/qpetoolbar.h> +#include <qpe/qpeapplication.h> +#include <qpe/config.h> +#include <qpe/global.h> +#include <opie/owait.h> #include "olistview.h" #include "olistviewitem.h" #include "resultitem.h" #include "adresssearch.h" #include "todosearch.h" #include "datebooksearch.h" #include "applnksearch.h" #include "doclnksearch.h" +#include "mainwindow.h" MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : QMainWindow( parent, name, f ), _currentItem(0) { setCaption( tr("OSearch") ); setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding)); QFrame *mainFrame = new QFrame( this, "mainFrame" ); mainFrame->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding)); mainLayout = new QVBoxLayout( mainFrame ); mainLayout->setSpacing( 0 ); mainLayout->setMargin( 0 ); resultsList = new OListView( mainFrame ); resultsList->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding)); mainLayout->addWidget( resultsList ); detailsFrame = new QFrame( mainFrame, "detailsFrame" ); QVBoxLayout *detailsLayout = new QVBoxLayout( detailsFrame ); richEdit = new QTextView( detailsFrame ); + QWhatsThis::add( richEdit, tr("The details of the current result") ); richEdit->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding)); detailsLayout->addWidget( richEdit ); buttonGroupActions = new QHButtonGroup( this ); buttonGroupActions->hide(); _buttonCount = 0; buttonLayout = new QHBoxLayout( detailsFrame ); detailsLayout->addLayout( buttonLayout ); mainLayout->addWidget( detailsFrame ); detailsFrame->hide(); searches.append( new AppLnkSearch( resultsList, tr("applications") ) ); searches.append( new DocLnkSearch( resultsList, tr("documents") ) ); searches.append( new TodoSearch( resultsList, tr("todo") ) ); searches.append( new DatebookSearch( resultsList, tr("datebook") ) ); searches.append( new AdressSearch( resultsList, tr("adressbook") ) ); setCentralWidget( mainFrame ); popupTimer = new QTimer(); searchTimer = new QTimer(); @@ -113,63 +115,65 @@ void MainWindow::makeMenu() QPopupMenu *searchMenu = new QPopupMenu( menuBar ); // QPopupMenu *viewMenu = new QPopupMenu( menuBar ); QPopupMenu *cfgMenu = new QPopupMenu( menuBar ); QPopupMenu *searchOptions = new QPopupMenu( cfgMenu ); setToolBarsMovable( false ); toolBar->setHorizontalStretchable( true ); menuBar->insertItem( tr( "Search" ), searchMenu ); menuBar->insertItem( tr( "Settings" ), cfgMenu ); //SETTINGS MENU cfgMenu->insertItem( tr( "Search" ), searchOptions ); QPopupMenu *pop; for (SearchGroup *s = searches.first(); s != 0; s = searches.next() ){ pop = s->popupMenu(); if (pop){ cfgMenu->insertItem( s->text(0), pop ); } } //SEARCH SearchAllAction = new QAction( tr("Search all"),QString::null, 0, this, 0 ); SearchAllAction->setIconSet( Resource::loadIconSet( "find" ) ); + // QWhatsThis::add( SearchAllAction, tr("Search everything...") ); connect( SearchAllAction, SIGNAL(activated()), this, SLOT(searchAll()) ); SearchAllAction->addTo( searchMenu ); searchMenu->insertItem( tr( "Options" ), searchOptions ); //SEARCH OPTIONS //actionWholeWordsOnly = new QAction( tr("Whole words only"),QString::null, 0, this, 0, true ); //actionWholeWordsOnly->addTo( searchOptions ); actionCaseSensitiv = new QAction( tr("Case sensitiv"),QString::null, 0, this, 0, true ); actionCaseSensitiv->addTo( searchOptions ); actionWildcards = new QAction( tr("Use wildcards"),QString::null, 0, this, 0, true ); actionWildcards->addTo( searchOptions ); //SEARCH BAR addToolBar( searchBar, "Search", QMainWindow::Top, TRUE ); QLineEdit *searchEdit = new QLineEdit( searchBar, "seachEdit" ); + QWhatsThis::add( searchEdit, tr("Enter your search terms here") ); searchEdit->setFocus(); searchBar->setHorizontalStretchable( TRUE ); searchBar->setStretchableWidget( searchEdit ); SearchAllAction->addTo( searchBar ); connect( searchEdit, SIGNAL( textChanged( const QString & ) ), this, SLOT( setSearch( const QString & ) ) ); } MainWindow::~MainWindow() { Config cfg( "osearch", Config::User ); cfg.setGroup( "search_settings" ); cfg.writeEntry( "caseSensitiv", actionCaseSensitiv->isOn() ); cfg.writeEntry( "wildcards", actionWildcards->isOn() ); //cfg.writeEntry( "whole_words_only", actionWholeWordsOnly->isOn() ); } void MainWindow::setCurrent(QListViewItem *item) { if (!item) return; _currentItem = (OListViewItem*)item; // _currentItem = dynamic_cast<OListViewItem*>(item); if (_currentItem->rtti() == OListViewItem::Result){ |