summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/TODO1
-rw-r--r--core/pim/addressbook/abtable.cpp10
-rw-r--r--core/pim/addressbook/abtable.h2
-rw-r--r--core/pim/addressbook/addressbook.cpp69
-rw-r--r--core/pim/addressbook/addressbook.h17
-rw-r--r--core/pim/addressbook/addressbook.pro3
-rw-r--r--core/pim/addressbook/ofloatbar.h20
7 files changed, 97 insertions, 25 deletions
diff --git a/core/pim/addressbook/TODO b/core/pim/addressbook/TODO
index 7bc906d..d8720b3 100644
--- a/core/pim/addressbook/TODO
+++ b/core/pim/addressbook/TODO
@@ -14,2 +14,3 @@ Important:
14- Store last settings of combo-boxes 14- Store last settings of combo-boxes
15- Mail-Icon is missing
15 16
diff --git a/core/pim/addressbook/abtable.cpp b/core/pim/addressbook/abtable.cpp
index 91a7171..9297d6a 100644
--- a/core/pim/addressbook/abtable.cpp
+++ b/core/pim/addressbook/abtable.cpp
@@ -637,4 +637,12 @@ void QTable::paintEmptyArea( QPainter *p, int cx, int cy, int cw, int ch )
637void AbTable::slotDoFind( const QString &findString, bool caseSensitive, 637void AbTable::slotDoFind( const QString &findString, bool caseSensitive,
638 bool backwards, int category ) 638 bool backwards, QString cat /* int category */ )
639{ 639{
640 int category = 0;
641 if ( cat.isEmpty() )
642 category = -2; // mCat.id("Contacts", "All");
643 else
644 category = mCat.id("Contacts", cat );
645
646 qWarning ("Found in Category %d", category);
647
640 if ( currFindRow < -1 ) 648 if ( currFindRow < -1 )
diff --git a/core/pim/addressbook/abtable.h b/core/pim/addressbook/abtable.h
index 80c3ca0..a603e17 100644
--- a/core/pim/addressbook/abtable.h
+++ b/core/pim/addressbook/abtable.h
@@ -102,3 +102,3 @@ public slots:
102 void slotDoFind( const QString &str, bool caseSensitive, bool backwards, 102 void slotDoFind( const QString &str, bool caseSensitive, bool backwards,
103 int category ); 103 QString category = QString::null );
104signals: 104signals:
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
75static QString addressbookPersonalVCardName() 71static 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
764void AddressbookWindow::slotSave()
765{
766 save();
767}
768#endif
769
756void AddressbookWindow::slotSettings() 770void AddressbookWindow::slotSettings()
@@ -879,5 +893,16 @@ AbLabel *AddressbookWindow::abView()
879 893
894void AddressbookWindow::slotFindOpen()
895{
896 searchBar->show();
897}
898void AddressbookWindow::slotFindClose()
899{
900 searchBar->hide();
901}
902void AddressbookWindow::slotFindNext()
903{
904}
905
880void AddressbookWindow::slotFind() 906void 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}
diff --git a/core/pim/addressbook/addressbook.h b/core/pim/addressbook/addressbook.h
index bf36407..b7cf355 100644
--- a/core/pim/addressbook/addressbook.h
+++ b/core/pim/addressbook/addressbook.h
@@ -22,2 +22,5 @@
22 22
23// Remove this for OPIE releae 1.0 !
24#define __DEBUG_RELEASE
25
23#include <qmainwindow.h> 26#include <qmainwindow.h>
@@ -25,2 +28,4 @@
25#include <qstringlist.h> 28#include <qstringlist.h>
29#include <qlineedit.h>
30#include "ofloatbar.h"
26 31
@@ -59,2 +64,5 @@ public slots:
59 void setDocument( const QString & ); 64 void setDocument( const QString & );
65#ifdef __DEBUG_RELEASE
66 void slotSave();
67#endif
60 68
@@ -73,3 +81,2 @@ private slots:
73 void beamDone( Ir * ); 81 void beamDone( Ir * );
74 void slotFind();
75 void slotSetCategory( int ); 82 void slotSetCategory( int );
@@ -79,2 +86,7 @@ private slots:
79 86
87 void slotFindOpen();
88 void slotFindClose();
89 void slotFind();
90 void slotFindNext();
91
80private: 92private:
@@ -96,2 +108,5 @@ private:
96 108
109 OFloatBar* searchBar;
110 QLineEdit* searchEdit;
111
97 QAction *actionNew, *actionEdit, *actionTrash, *actionFind, *actionBeam, *actionPersonal, *actionMail; 112 QAction *actionNew, *actionEdit, *actionTrash, *actionFind, *actionBeam, *actionPersonal, *actionMail;
diff --git a/core/pim/addressbook/addressbook.pro b/core/pim/addressbook/addressbook.pro
index 24bdd8c..05aa5ec 100644
--- a/core/pim/addressbook/addressbook.pro
+++ b/core/pim/addressbook/addressbook.pro
@@ -8,3 +8,4 @@ HEADERS = addressbook.h \
8 addresssettings.h \ 8 addresssettings.h \
9 picker.h 9 picker.h \
10 ofloatbar.h
10 SOURCES= main.cpp \ 11 SOURCES= main.cpp \
diff --git a/core/pim/addressbook/ofloatbar.h b/core/pim/addressbook/ofloatbar.h
new file mode 100644
index 0000000..85a0c4f
--- a/dev/null
+++ b/core/pim/addressbook/ofloatbar.h
@@ -0,0 +1,20 @@
1#ifndef __OFLOATBAR_H
2#define __OFLOATBAR_H
3
4#include <qtoolbar.h>
5#include <qevent.h>
6
7class OFloatBar : public QToolBar
8{
9 Q_OBJECT
10 virtual void hideEvent(QHideEvent* e)
11 {
12 /*if (e->spontaneous())*/ emit OnHide();
13 }
14 public:
15 OFloatBar(char* t, QMainWindow* mw, QMainWindow::ToolBarDock td, bool f) : QToolBar(t, mw, td, f) {}
16 signals:
17 void OnHide();
18};
19
20#endif