author | eilers <eilers> | 2002-10-18 15:42:57 (UTC) |
---|---|---|
committer | eilers <eilers> | 2002-10-18 15:42:57 (UTC) |
commit | 47e60a8dc20f46dd00b9405f7fde122792018627 (patch) (unidiff) | |
tree | b109ca9e9c200e7e47c0e61e8f2e86ba6bf4a37f /core/pim/addressbook/addressbook.cpp | |
parent | c16dcab3fe45ae7193cbdfb2f62bf7e5482d449b (diff) | |
download | opie-47e60a8dc20f46dd00b9405f7fde122792018627.zip opie-47e60a8dc20f46dd00b9405f7fde122792018627.tar.gz opie-47e60a8dc20f46dd00b9405f7fde122792018627.tar.bz2 |
First attempt of new find entry field.. It still needs some finetuning !
Diffstat (limited to 'core/pim/addressbook/addressbook.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/addressbook/addressbook.cpp | 69 |
1 files changed, 48 insertions, 21 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 @@ | |||
70 | 70 | ||
71 | // Remove this for OPIE releae 1.0 ! | ||
72 | #define __DEBUG_RELEASE | ||
73 | |||
74 | |||
75 | static QString addressbookPersonalVCardName() | 71 | static QString addressbookPersonalVCardName() |
@@ -142,8 +138,2 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, | |||
142 | #endif | 138 | #endif |
143 | |||
144 | |||
145 | |||
146 | |||
147 | |||
148 | #ifndef MAKE_FOR_SHARP_ROM | ||
149 | a = new QAction( tr( "Find" ), Resource::loadPixmap( "mag" ), | 139 | a = new QAction( tr( "Find" ), Resource::loadPixmap( "mag" ), |
@@ -151,7 +141,24 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, | |||
151 | actionFind = a; | 141 | actionFind = a; |
152 | connect( a, SIGNAL(activated()), this, SLOT(slotFind()) ); | 142 | connect( a, SIGNAL(activated()), this, SLOT( slotFindOpen()) ); |
153 | a->addTo( edit ); | 143 | a->addTo( edit ); |
154 | a->addTo( listTools ); | 144 | a->addTo( listTools ); |
155 | #endif | 145 | |
156 | 146 | // Much better search widget, taken from QTReader.. (se) | |
147 | searchBar = new OFloatBar( "Search", this, QMainWindow::Top, TRUE ); | ||
148 | searchBar->setHorizontalStretchable( TRUE ); | ||
149 | searchBar->hide(); | ||
150 | searchEdit = new QLineEdit( searchBar, "searchEdit" ); | ||
151 | // QFont f("unifont", 16 /*, QFont::Bold*/); | ||
152 | // searchEdit->setFont( f ); | ||
153 | searchBar->setStretchableWidget( searchEdit ); | ||
154 | connect( searchEdit, SIGNAL( returnPressed( ) ), | ||
155 | this, SLOT( slotFind( ) ) ); | ||
156 | |||
157 | a = new QAction( tr( "Find Next" ), Resource::loadPixmap( "next" ), QString::null, 0, this, 0 ); | ||
158 | connect( a, SIGNAL( activated() ), this, SLOT( slotFindNext() ) ); | ||
159 | a->addTo( searchBar ); | ||
160 | |||
161 | a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); | ||
162 | connect( a, SIGNAL( activated() ), this, SLOT( slotFindClose() ) ); | ||
163 | a->addTo( searchBar ); | ||
157 | 164 | ||
@@ -200,3 +207,3 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, | |||
200 | a = new QAction( tr( "Save all Data"), QString::null, 0, 0 ); | 207 | a = new QAction( tr( "Save all Data"), QString::null, 0, 0 ); |
201 | connect( a, SIGNAL( activated() ), this, SLOT( save() ) ); | 208 | connect( a, SIGNAL( activated() ), this , SLOT( slotSave() ) ); |
202 | a->addTo( edit ); | 209 | a->addTo( edit ); |
@@ -755,2 +762,9 @@ bool AddressbookWindow::save() | |||
755 | 762 | ||
763 | #ifdef __DEBUG_RELEASE | ||
764 | void AddressbookWindow::slotSave() | ||
765 | { | ||
766 | save(); | ||
767 | } | ||
768 | #endif | ||
769 | |||
756 | void AddressbookWindow::slotSettings() | 770 | void AddressbookWindow::slotSettings() |
@@ -879,5 +893,16 @@ AbLabel *AddressbookWindow::abView() | |||
879 | 893 | ||
894 | void AddressbookWindow::slotFindOpen() | ||
895 | { | ||
896 | searchBar->show(); | ||
897 | } | ||
898 | void AddressbookWindow::slotFindClose() | ||
899 | { | ||
900 | searchBar->hide(); | ||
901 | } | ||
902 | void AddressbookWindow::slotFindNext() | ||
903 | { | ||
904 | } | ||
905 | |||
880 | void AddressbookWindow::slotFind() | 906 | void AddressbookWindow::slotFind() |
881 | { | 907 | { |
882 | #ifndef MAKE_FOR_SHARP_ROM | ||
883 | if ( centralWidget() == abView() ) | 908 | if ( centralWidget() == abView() ) |
@@ -885,8 +910,11 @@ void AddressbookWindow::slotFind() | |||
885 | 910 | ||
886 | FindDialog frmFind( "Contacts", this ); | 911 | // FindDialog frmFind( "Contacts", this ); |
887 | QObject::connect( &frmFind, SIGNAL(signalFindClicked(const QString &, bool, bool, int)), abList, SLOT(slotDoFind( const QString&,bool,bool,int))); | 912 | // QObject::connect( abList, SIGNAL(signalNotFound()), &frmFind, SLOT(slotNotFound()) ); |
888 | QObject::connect( abList, SIGNAL(signalNotFound()), &frmFind, SLOT(slotNotFound()) ); | 913 | // QObject::connect( abList, SIGNAL(signalWrapAround()), &frmFind, SLOT(slotWrapAround()) ); |
889 | QObject::connect( abList, SIGNAL(signalWrapAround()), &frmFind, SLOT(slotWrapAround()) ); | 914 | // frmFind.exec(); |
915 | |||
916 | // QStringList categories = abList->categories(); | ||
917 | // abList->setShowCategory( book, cat ); | ||
918 | abList->slotDoFind( searchEdit->text(), false, false); | ||
890 | 919 | ||
891 | frmFind.exec(); | ||
892 | 920 | ||
@@ -896,3 +924,2 @@ void AddressbookWindow::slotFind() | |||
896 | abList->clearFindRow(); | 924 | abList->clearFindRow(); |
897 | #endif | ||
898 | } | 925 | } |