Diffstat (limited to 'core/pim/addressbook/addressbook.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/pim/addressbook/addressbook.cpp | 67 |
1 files changed, 47 insertions, 20 deletions
diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp index 82a1b57..8335d8b 100644 --- a/core/pim/addressbook/addressbook.cpp +++ b/core/pim/addressbook/addressbook.cpp @@ -70,6 +70,2 @@ -// Remove this for OPIE releae 1.0 ! -#define __DEBUG_RELEASE - - static QString addressbookPersonalVCardName() @@ -142,8 +138,2 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, #endif - - - - - -#ifndef MAKE_FOR_SHARP_ROM a = new QAction( tr( "Find" ), Resource::loadPixmap( "mag" ), @@ -151,7 +141,24 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, actionFind = a; - connect( a, SIGNAL(activated()), this, SLOT(slotFind()) ); + connect( a, SIGNAL(activated()), this, SLOT( slotFindOpen()) ); a->addTo( edit ); a->addTo( listTools ); -#endif + // Much better search widget, taken from QTReader.. (se) + searchBar = new OFloatBar( "Search", this, QMainWindow::Top, TRUE ); + searchBar->setHorizontalStretchable( TRUE ); + searchBar->hide(); + searchEdit = new QLineEdit( searchBar, "searchEdit" ); +// QFont f("unifont", 16 /*, QFont::Bold*/); +// searchEdit->setFont( f ); + searchBar->setStretchableWidget( searchEdit ); + connect( searchEdit, SIGNAL( returnPressed( ) ), + this, SLOT( slotFind( ) ) ); + + a = new QAction( tr( "Find Next" ), Resource::loadPixmap( "next" ), QString::null, 0, this, 0 ); + connect( a, SIGNAL( activated() ), this, SLOT( slotFindNext() ) ); + a->addTo( searchBar ); + + a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); + connect( a, SIGNAL( activated() ), this, SLOT( slotFindClose() ) ); + a->addTo( searchBar ); @@ -200,3 +207,3 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, a = new QAction( tr( "Save all Data"), QString::null, 0, 0 ); - connect( a, SIGNAL( activated() ), this, SLOT( save() ) ); + connect( a, SIGNAL( activated() ), this , SLOT( slotSave() ) ); a->addTo( edit ); @@ -755,2 +762,9 @@ bool AddressbookWindow::save() +#ifdef __DEBUG_RELEASE +void AddressbookWindow::slotSave() +{ + save(); +} +#endif + void AddressbookWindow::slotSettings() @@ -879,5 +893,16 @@ AbLabel *AddressbookWindow::abView() +void AddressbookWindow::slotFindOpen() +{ + searchBar->show(); +} +void AddressbookWindow::slotFindClose() +{ + searchBar->hide(); +} +void AddressbookWindow::slotFindNext() +{ +} + void AddressbookWindow::slotFind() { -#ifndef MAKE_FOR_SHARP_ROM if ( centralWidget() == abView() ) @@ -885,8 +910,11 @@ void AddressbookWindow::slotFind() - FindDialog frmFind( "Contacts", this ); - QObject::connect( &frmFind, SIGNAL(signalFindClicked(const QString &, bool, bool, int)), abList, SLOT(slotDoFind( const QString&,bool,bool,int))); - QObject::connect( abList, SIGNAL(signalNotFound()), &frmFind, SLOT(slotNotFound()) ); - QObject::connect( abList, SIGNAL(signalWrapAround()), &frmFind, SLOT(slotWrapAround()) ); +// FindDialog frmFind( "Contacts", this ); +// QObject::connect( abList, SIGNAL(signalNotFound()), &frmFind, SLOT(slotNotFound()) ); +// QObject::connect( abList, SIGNAL(signalWrapAround()), &frmFind, SLOT(slotWrapAround()) ); +// frmFind.exec(); + + // QStringList categories = abList->categories(); + // abList->setShowCategory( book, cat ); + abList->slotDoFind( searchEdit->text(), false, false); - frmFind.exec(); @@ -896,3 +924,2 @@ void AddressbookWindow::slotFind() abList->clearFindRow(); -#endif } |