author | eilers <eilers> | 2002-10-21 16:29:20 (UTC) |
---|---|---|
committer | eilers <eilers> | 2002-10-21 16:29:20 (UTC) |
commit | 507afe645a86191815a2f85380a452ab6797e383 (patch) (unidiff) | |
tree | e69293f25af3d6d8e2125b0f92a097615ddb0a38 /core | |
parent | 71c7800e8ae5dc2d701242828ceb8c11bcd96fbe (diff) | |
download | opie-507afe645a86191815a2f85380a452ab6797e383.zip opie-507afe645a86191815a2f85380a452ab6797e383.tar.gz opie-507afe645a86191815a2f85380a452ab6797e383.tar.bz2 |
Some usability updates in picker and find..
-rw-r--r-- | core/pim/addressbook/TODO | 7 | ||||
-rw-r--r-- | core/pim/addressbook/ablabel.cpp | 43 | ||||
-rw-r--r-- | core/pim/addressbook/abtable.cpp | 45 | ||||
-rw-r--r-- | core/pim/addressbook/abtable.h | 7 | ||||
-rw-r--r-- | core/pim/addressbook/addressbook.cpp | 70 | ||||
-rw-r--r-- | core/pim/addressbook/addressbook.h | 7 | ||||
-rw-r--r-- | core/pim/addressbook/picker.cpp | 24 | ||||
-rw-r--r-- | core/pim/addressbook/picker.h | 3 |
8 files changed, 164 insertions, 42 deletions
diff --git a/core/pim/addressbook/TODO b/core/pim/addressbook/TODO index 4daa2a8..796dc49 100644 --- a/core/pim/addressbook/TODO +++ b/core/pim/addressbook/TODO | |||
@@ -5,12 +5,13 @@ Urgent: | |||
5 | - Font menu is invisible using german translation | 5 | - Font menu is invisible using german translation |
6 | 6 | ||
7 | Important: | 7 | Important: |
8 | 8 | ||
9 | - Picker: Activated letter schould be more visible | 9 | - Cursor keys should work in detail-view (ablabel) |
10 | - "What's this" should be added | 10 | - "What's this" should be added |
11 | - Store last settings of combo-boxes | 11 | - Store last settings of combo-boxes |
12 | - Mail-Icon is missing | 12 | - Mail-Icon is missing |
13 | - Overview window cleanup needed.. | ||
13 | - Finishing of new View functions (List, Phonebook...) | 14 | - Finishing of new View functions (List, Phonebook...) |
14 | - The names of the countries are sorted by there english names, only.. | 15 | - The names of the countries are sorted by there english names, only.. |
15 | Even if they are translated.. :S | 16 | Even if they are translated.. :S |
16 | - Reload if contacts were changed externally | 17 | - Reload if contacts were changed externally |
@@ -29,5 +30,7 @@ Should be Fixed (not absolute sure, need further validation): | |||
29 | Fixed: | 30 | Fixed: |
30 | - Syncing: abtable not reloaded after sync. | 31 | - Syncing: abtable not reloaded after sync. |
31 | - Find widget should be replaced by something like | 32 | - Find widget should be replaced by something like |
32 | qpdf has. | 33 | qpdf has. |
33 | - Adding a configuration dialog \ No newline at end of file | 34 | - Adding a configuration dialog |
35 | - Picker: Activated letter schould be more visible | ||
36 | - Advanced handling of cursor keys (search..) | ||
diff --git a/core/pim/addressbook/ablabel.cpp b/core/pim/addressbook/ablabel.cpp index cf1e39f..ea80700 100644 --- a/core/pim/addressbook/ablabel.cpp +++ b/core/pim/addressbook/ablabel.cpp | |||
@@ -46,8 +46,45 @@ void AbLabel::sync() | |||
46 | } | 46 | } |
47 | 47 | ||
48 | void AbLabel::keyPressEvent( QKeyEvent *e ) | 48 | void AbLabel::keyPressEvent( QKeyEvent *e ) |
49 | { | 49 | { |
50 | if ( e->key() == Qt::Key_F33 ) { | 50 | // Commonly handled keys |
51 | emit okPressed(); | 51 | switch( e->key() ) { |
52 | } | 52 | case Qt::Key_Left: |
53 | qWarning( "Left.."); | ||
54 | case Qt::Key_F33: | ||
55 | qWarning( "OK.."); | ||
56 | emit okPressed(); | ||
57 | break; | ||
58 | } | ||
59 | |||
60 | |||
61 | if ( /* m_inSearch */ false ) { | ||
62 | // Running in seach-mode, therefore we will interprete | ||
63 | // some key differently | ||
64 | qWarning("Received key in search mode"); | ||
65 | switch( e->key() ) { | ||
66 | case Qt::Key_Up: | ||
67 | qWarning("a"); | ||
68 | // emit signalSearchBackward(); | ||
69 | break; | ||
70 | case Qt::Key_Down: | ||
71 | qWarning("b"); | ||
72 | // emit signalSearchNext(); | ||
73 | break; | ||
74 | } | ||
75 | |||
76 | } else { | ||
77 | qWarning("Received key in NON search mode"); | ||
78 | |||
79 | switch( e->key() ) { | ||
80 | case Qt::Key_Up: | ||
81 | qWarning("a"); | ||
82 | // emit signalSearchBackward(); | ||
83 | break; | ||
84 | case Qt::Key_Down: | ||
85 | qWarning("b"); | ||
86 | // emit signalSearchNext(); | ||
87 | break; | ||
88 | } | ||
89 | } | ||
53 | } | 90 | } |
diff --git a/core/pim/addressbook/abtable.cpp b/core/pim/addressbook/abtable.cpp index d4dcf7b..97b26db 100644 --- a/core/pim/addressbook/abtable.cpp +++ b/core/pim/addressbook/abtable.cpp | |||
@@ -129,8 +129,9 @@ AbTable::AbTable( const QValueList<int> *order, QWidget *parent, const char *nam | |||
129 | asc( TRUE ), | 129 | asc( TRUE ), |
130 | intFields( order ), | 130 | intFields( order ), |
131 | currFindRow( -1 ), | 131 | currFindRow( -1 ), |
132 | mCat( 0 ), | 132 | mCat( 0 ), |
133 | m_inSearch (false), | ||
133 | m_contactdb ("addressbook", 0l, 0l, false) // Handle syncing myself.. ! | 134 | m_contactdb ("addressbook", 0l, 0l, false) // Handle syncing myself.. ! |
134 | { | 135 | { |
135 | mCat.load( categoryFileName() ); | 136 | mCat.load( categoryFileName() ); |
136 | setSelectionMode( NoSelection ); | 137 | setSelectionMode( NoSelection ); |
@@ -259,16 +260,42 @@ void AbTable::keyPressEvent( QKeyEvent *e ) | |||
259 | 260 | ||
260 | if ( key >= 'A' && key <= 'Z' ) | 261 | if ( key >= 'A' && key <= 'Z' ) |
261 | moveTo( key ); | 262 | moveTo( key ); |
262 | 263 | ||
263 | switch( e->key() ) { | 264 | if ( m_inSearch ) { |
264 | case Qt::Key_Space: | 265 | // Running in seach-mode, therefore we will interprete |
265 | case Qt::Key_Return: | 266 | // some key differently |
266 | case Qt::Key_Enter: | 267 | qWarning("Received key in search mode"); |
267 | emit details(); | 268 | switch( e->key() ) { |
268 | break; | 269 | case Qt::Key_Space: |
269 | default: | 270 | case Qt::Key_Return: |
270 | QTable::keyPressEvent( e ); | 271 | case Qt::Key_Enter: |
272 | emit details(); | ||
273 | break; | ||
274 | case Qt::Key_Up: | ||
275 | qWarning("a"); | ||
276 | emit signalSearchBackward(); | ||
277 | break; | ||
278 | case Qt::Key_Down: | ||
279 | qWarning("b"); | ||
280 | emit signalSearchNext(); | ||
281 | break; | ||
282 | default: | ||
283 | QTable::keyPressEvent( e ); | ||
284 | } | ||
285 | |||
286 | } else { | ||
287 | qWarning("Received key in NON search mode"); | ||
288 | |||
289 | switch( e->key() ) { | ||
290 | case Qt::Key_Space: | ||
291 | case Qt::Key_Return: | ||
292 | case Qt::Key_Enter: | ||
293 | emit details(); | ||
294 | break; | ||
295 | default: | ||
296 | QTable::keyPressEvent( e ); | ||
297 | } | ||
271 | } | 298 | } |
272 | } | 299 | } |
273 | 300 | ||
274 | void AbTable::moveTo( char c ) | 301 | void AbTable::moveTo( char c ) |
@@ -682,9 +709,9 @@ void AbTable::slotDoFind( const QString &findString, bool caseSensitive, bool us | |||
682 | if ( wrapAround ) | 709 | if ( wrapAround ) |
683 | emit signalWrapAround(); | 710 | emit signalWrapAround(); |
684 | else | 711 | else |
685 | emit signalNotFound(); | 712 | emit signalNotFound(); |
686 | 713 | ||
687 | wrapAround = !wrapAround; | 714 | wrapAround = !wrapAround; |
688 | } else { | 715 | } else { |
689 | currFindRow = row; | 716 | currFindRow = row; |
690 | QTableSelection foundSelection; | 717 | QTableSelection foundSelection; |
diff --git a/core/pim/addressbook/abtable.h b/core/pim/addressbook/abtable.h index b445874..35a1e9e 100644 --- a/core/pim/addressbook/abtable.h +++ b/core/pim/addressbook/abtable.h | |||
@@ -97,16 +97,21 @@ public: | |||
97 | void setPaintingEnabled( bool e ); | 97 | void setPaintingEnabled( bool e ); |
98 | 98 | ||
99 | QString showBook() const; | 99 | QString showBook() const; |
100 | 100 | ||
101 | void inSearch() { m_inSearch = true; } | ||
102 | void offSearch() { m_inSearch = false; } | ||
103 | |||
101 | public slots: | 104 | public slots: |
102 | void slotDoFind( const QString &str, bool caseSensitive, bool useRegExp, bool backwards, | 105 | void slotDoFind( const QString &str, bool caseSensitive, bool useRegExp, bool backwards, |
103 | QString category = QString::null ); | 106 | QString category = QString::null ); |
104 | signals: | 107 | signals: |
105 | void empty( bool ); | 108 | void empty( bool ); |
106 | void details(); | 109 | void details(); |
107 | void signalNotFound(); | 110 | void signalNotFound(); |
108 | void signalWrapAround(); | 111 | void signalWrapAround(); |
112 | void signalSearchBackward(); // Signalled if backward search is requested | ||
113 | void signalSearchNext(); // Singalled if forward search is requested | ||
109 | 114 | ||
110 | protected: | 115 | protected: |
111 | virtual void keyPressEvent( QKeyEvent *e ); | 116 | virtual void keyPressEvent( QKeyEvent *e ); |
112 | 117 | ||
@@ -147,8 +152,10 @@ private: | |||
147 | 152 | ||
148 | QString showBk; | 153 | QString showBk; |
149 | bool columnVisible; | 154 | bool columnVisible; |
150 | 155 | ||
156 | bool m_inSearch; | ||
157 | |||
151 | OContactAccess m_contactdb; | 158 | OContactAccess m_contactdb; |
152 | 159 | ||
153 | }; | 160 | }; |
154 | #endif // ABTABLE_H | 161 | #endif // ABTABLE_H |
diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp index f7e4c95..3466801 100644 --- a/core/pim/addressbook/addressbook.cpp +++ b/core/pim/addressbook/addressbook.cpp | |||
@@ -77,15 +77,22 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, | |||
77 | WFlags f ) | 77 | WFlags f ) |
78 | : QMainWindow( parent, name, f ), | 78 | : QMainWindow( parent, name, f ), |
79 | abEditor(0), | 79 | abEditor(0), |
80 | useRegExp(false), | 80 | useRegExp(false), |
81 | DoSignalWrapAround(false), | 81 | doNotifyWrapAround(true), |
82 | caseSensitive(false), | 82 | caseSensitive(false), |
83 | bAbEditFirstTime(TRUE), | 83 | bAbEditFirstTime(TRUE), |
84 | syncing(FALSE) | 84 | syncing(FALSE) |
85 | { | 85 | { |
86 | isLoading = true; | 86 | isLoading = true; |
87 | 87 | ||
88 | // Read Config settings | ||
89 | Config cfg("AddressBook"); | ||
90 | cfg.setGroup("Search"); | ||
91 | useRegExp = cfg.readBoolEntry( "useRegExp" ); | ||
92 | caseSensitive = cfg.readBoolEntry( "caseSensitive" ); | ||
93 | doNotifyWrapAround = cfg.readBoolEntry( "doNotifyWrapAround" ); | ||
94 | |||
88 | initFields(); | 95 | initFields(); |
89 | 96 | ||
90 | setCaption( tr("Contacts") ); | 97 | setCaption( tr("Contacts") ); |
91 | setIcon( Resource::loadPixmap( "AddressBook" ) ); | 98 | setIcon( Resource::loadPixmap( "AddressBook" ) ); |
@@ -160,9 +167,9 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, | |||
160 | 167 | ||
161 | a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); | 168 | a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); |
162 | connect( a, SIGNAL( activated() ), this, SLOT( slotFindClose() ) ); | 169 | connect( a, SIGNAL( activated() ), this, SLOT( slotFindClose() ) ); |
163 | a->addTo( searchBar ); | 170 | a->addTo( searchBar ); |
164 | 171 | ||
165 | a = new QAction( tr( "Write Mail To" ), Resource::loadPixmap( "qtmail/reply" ), | 172 | a = new QAction( tr( "Write Mail To" ), Resource::loadPixmap( "qtmail/reply" ), |
166 | QString::null, 0, this, 0 ); | 173 | QString::null, 0, this, 0 ); |
167 | //a->setEnabled( FALSE ); we got support for it now :) zecke | 174 | //a->setEnabled( FALSE ); we got support for it now :) zecke |
168 | actionMail = a; | 175 | actionMail = a; |
@@ -222,9 +229,15 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, | |||
222 | vb->addWidget(abList); | 229 | vb->addWidget(abList); |
223 | // abList->setHScrollBarMode( QScrollView::AlwaysOff ); | 230 | // abList->setHScrollBarMode( QScrollView::AlwaysOff ); |
224 | connect( abList, SIGNAL( empty( bool ) ), this, SLOT( listIsEmpty( bool ) ) ); | 231 | connect( abList, SIGNAL( empty( bool ) ), this, SLOT( listIsEmpty( bool ) ) ); |
225 | connect( abList, SIGNAL( details() ), this, SLOT( slotListView() ) ); | 232 | connect( abList, SIGNAL( details() ), this, SLOT( slotListView() ) ); |
226 | connect( abList, SIGNAL(currentChanged(int,int)), this, SLOT(slotUpdateToolbar()) ); | 233 | connect( abList, SIGNAL( currentChanged(int,int) ), this, SLOT( slotUpdateToolbar() ) ); |
234 | connect( abList, SIGNAL( signalSearchNext() ), this, SLOT( slotFindNext() ) ); | ||
235 | connect( abList, SIGNAL( signalSearchBackward() ), this, SLOT( slotFindPrevious() ) ); | ||
236 | |||
237 | // Maybe we should react on Wraparound and notfound ? | ||
238 | QObject::connect( abList, SIGNAL(signalNotFound()), this, SLOT(slotNotFound()) ); | ||
239 | QObject::connect( abList, SIGNAL(signalWrapAround()), this, SLOT(slotWrapAround()) ); | ||
227 | 240 | ||
228 | mView = 0; | 241 | mView = 0; |
229 | 242 | ||
230 | abList->load(); | 243 | abList->load(); |
@@ -257,15 +270,8 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, | |||
257 | 270 | ||
258 | // qDebug("adressbook contrsuction: t=%d", t.elapsed() ); | 271 | // qDebug("adressbook contrsuction: t=%d", t.elapsed() ); |
259 | 272 | ||
260 | abList->setCurrentCell( 0, 0 ); | 273 | abList->setCurrentCell( 0, 0 ); |
261 | |||
262 | // Read Config settings | ||
263 | Config cfg("AddressBook"); | ||
264 | cfg.setGroup("Search"); | ||
265 | useRegExp = cfg.readBoolEntry( "useRegExp" ); | ||
266 | caseSensitive = cfg.readBoolEntry( "caseSensitive" ); | ||
267 | DoSignalWrapAround = cfg.readBoolEntry( "signalWrapAround" ); | ||
268 | 274 | ||
269 | isLoading = false; | 275 | isLoading = false; |
270 | } | 276 | } |
271 | 277 | ||
@@ -274,15 +280,15 @@ void AddressbookWindow::slotConfig() | |||
274 | { | 280 | { |
275 | ConfigDlg* dlg = new ConfigDlg( this, "Config" ); | 281 | ConfigDlg* dlg = new ConfigDlg( this, "Config" ); |
276 | dlg -> setUseRegExp ( useRegExp ); | 282 | dlg -> setUseRegExp ( useRegExp ); |
277 | dlg -> setBeCaseSensitive( caseSensitive ); | 283 | dlg -> setBeCaseSensitive( caseSensitive ); |
278 | dlg -> setSignalWrapAround( DoSignalWrapAround ); | 284 | dlg -> setSignalWrapAround( doNotifyWrapAround ); |
279 | dlg -> showMaximized(); | 285 | dlg -> showMaximized(); |
280 | if ( dlg -> exec() ) { | 286 | if ( dlg -> exec() ) { |
281 | qWarning ("Config Dialog accepted !"); | 287 | qWarning ("Config Dialog accepted !"); |
282 | useRegExp = dlg -> useRegExp(); | 288 | useRegExp = dlg -> useRegExp(); |
283 | caseSensitive = dlg -> beCaseSensitive(); | 289 | caseSensitive = dlg -> beCaseSensitive(); |
284 | DoSignalWrapAround = dlg -> signalWrapAround(); | 290 | doNotifyWrapAround = dlg -> signalWrapAround(); |
285 | } | 291 | } |
286 | 292 | ||
287 | delete dlg; | 293 | delete dlg; |
288 | } | 294 | } |
@@ -372,9 +378,9 @@ AddressbookWindow::~AddressbookWindow() | |||
372 | 378 | ||
373 | cfg.setGroup("Search"); | 379 | cfg.setGroup("Search"); |
374 | cfg.writeEntry("useRegExp", useRegExp); | 380 | cfg.writeEntry("useRegExp", useRegExp); |
375 | cfg.writeEntry("caseSensitive", caseSensitive); | 381 | cfg.writeEntry("caseSensitive", caseSensitive); |
376 | cfg.writeEntry("signalWrapAround", DoSignalWrapAround); | 382 | cfg.writeEntry("doNotifyWrapAround", doNotifyWrapAround); |
377 | } | 383 | } |
378 | 384 | ||
379 | void AddressbookWindow::slotUpdateToolbar() | 385 | void AddressbookWindow::slotUpdateToolbar() |
380 | { | 386 | { |
@@ -655,11 +661,9 @@ void AddressbookWindow::slotPersonalView() | |||
655 | // we just turned it off | 661 | // we just turned it off |
656 | setCaption( tr("Contacts") ); | 662 | setCaption( tr("Contacts") ); |
657 | actionNew->setEnabled(TRUE); | 663 | actionNew->setEnabled(TRUE); |
658 | actionTrash->setEnabled(TRUE); | 664 | actionTrash->setEnabled(TRUE); |
659 | #ifndef MAKE_FOR_SHARP_ROM | ||
660 | actionFind->setEnabled(TRUE); | 665 | actionFind->setEnabled(TRUE); |
661 | #endif | ||
662 | slotUpdateToolbar(); // maybe some of the above could be moved there | 666 | slotUpdateToolbar(); // maybe some of the above could be moved there |
663 | showList(); | 667 | showList(); |
664 | return; | 668 | return; |
665 | } | 669 | } |
@@ -927,26 +931,36 @@ AbLabel *AddressbookWindow::abView() | |||
927 | 931 | ||
928 | void AddressbookWindow::slotFindOpen() | 932 | void AddressbookWindow::slotFindOpen() |
929 | { | 933 | { |
930 | searchBar->show(); | 934 | searchBar->show(); |
935 | abList -> inSearch(); | ||
931 | searchEdit->setFocus(); | 936 | searchEdit->setFocus(); |
932 | } | 937 | } |
933 | void AddressbookWindow::slotFindClose() | 938 | void AddressbookWindow::slotFindClose() |
934 | { | 939 | { |
935 | searchBar->hide(); | 940 | searchBar->hide(); |
941 | abList -> offSearch(); | ||
936 | abList->setFocus(); | 942 | abList->setFocus(); |
937 | } | 943 | } |
938 | void AddressbookWindow::slotFindNext() | 944 | void AddressbookWindow::slotFindNext() |
939 | { | 945 | { |
940 | if ( centralWidget() == abView() ) | 946 | if ( centralWidget() == abView() ) |
941 | showList(); | 947 | showList(); |
942 | 948 | ||
943 | // Maybe we should react on Wraparound and notfound ? | ||
944 | // QObject::connect( abList, SIGNAL(signalNotFound()), &frmFind, SLOT(slotNotFound()) ); | ||
945 | // QObject::connect( abList, SIGNAL(signalWrapAround()), &frmFind, SLOT(slotWrapAround()) ); | ||
946 | |||
947 | abList->slotDoFind( searchEdit->text(), caseSensitive, useRegExp, false); | 949 | abList->slotDoFind( searchEdit->text(), caseSensitive, useRegExp, false); |
948 | 950 | ||
951 | searchEdit->clearFocus(); | ||
952 | abList->setFocus(); | ||
953 | if ( abList->numSelections() ) | ||
954 | abList->clearSelection(); | ||
955 | |||
956 | } | ||
957 | void AddressbookWindow::slotFindPrevious() | ||
958 | { | ||
959 | if ( centralWidget() == abView() ) | ||
960 | showList(); | ||
961 | |||
962 | abList->slotDoFind( searchEdit->text(), caseSensitive, useRegExp, true); | ||
949 | 963 | ||
950 | if ( abList->numSelections() ) | 964 | if ( abList->numSelections() ) |
951 | abList->clearSelection(); | 965 | abList->clearSelection(); |
952 | 966 | ||
@@ -958,8 +972,26 @@ void AddressbookWindow::slotFind() | |||
958 | abList->clearFindRow(); | 972 | abList->clearFindRow(); |
959 | slotFindNext(); | 973 | slotFindNext(); |
960 | } | 974 | } |
961 | 975 | ||
976 | void AddressbookWindow::slotNotFound() | ||
977 | { | ||
978 | qWarning("Got notfound signal !"); | ||
979 | QMessageBox::information( this, tr( "Not Found" ), | ||
980 | tr( "Unable to find a contact for this" ) + "\n" | ||
981 | + tr( "search pattern !" ) ); | ||
982 | |||
983 | |||
984 | } | ||
985 | void AddressbookWindow::slotWrapAround() | ||
986 | { | ||
987 | qWarning("Got wrap signal !"); | ||
988 | if ( doNotifyWrapAround ) | ||
989 | QMessageBox::information( this, tr( "End of list" ), | ||
990 | tr( "End of list. Wrap around now.. !" ) + "\n" ); | ||
991 | |||
992 | } | ||
993 | |||
962 | void AddressbookWindow::slotSetCategory( int c ) | 994 | void AddressbookWindow::slotSetCategory( int c ) |
963 | { | 995 | { |
964 | 996 | ||
965 | QString cat, book; | 997 | QString cat, book; |
diff --git a/core/pim/addressbook/addressbook.h b/core/pim/addressbook/addressbook.h index 18b083f..299ed70 100644 --- a/core/pim/addressbook/addressbook.h +++ b/core/pim/addressbook/addressbook.h | |||
@@ -61,8 +61,10 @@ public slots: | |||
61 | void flush(); | 61 | void flush(); |
62 | void reload(); | 62 | void reload(); |
63 | void appMessage(const QCString &, const QByteArray &); | 63 | void appMessage(const QCString &, const QByteArray &); |
64 | void setDocument( const QString & ); | 64 | void setDocument( const QString & ); |
65 | void slotFindNext(); | ||
66 | void slotFindPrevious(); | ||
65 | #ifdef __DEBUG_RELEASE | 67 | #ifdef __DEBUG_RELEASE |
66 | void slotSave(); | 68 | void slotSave(); |
67 | #endif | 69 | #endif |
68 | 70 | ||
@@ -86,9 +88,10 @@ private slots: | |||
86 | 88 | ||
87 | void slotFindOpen(); | 89 | void slotFindOpen(); |
88 | void slotFindClose(); | 90 | void slotFindClose(); |
89 | void slotFind(); | 91 | void slotFind(); |
90 | void slotFindNext(); | 92 | void slotNotFound(); |
93 | void slotWrapAround(); | ||
91 | 94 | ||
92 | void slotConfig(); | 95 | void slotConfig(); |
93 | 96 | ||
94 | private: | 97 | private: |
@@ -111,9 +114,9 @@ private: | |||
111 | // Searching stuff | 114 | // Searching stuff |
112 | OFloatBar* searchBar; | 115 | OFloatBar* searchBar; |
113 | QLineEdit* searchEdit; | 116 | QLineEdit* searchEdit; |
114 | bool useRegExp; | 117 | bool useRegExp; |
115 | bool DoSignalWrapAround; | 118 | bool doNotifyWrapAround; |
116 | bool caseSensitive; | 119 | bool caseSensitive; |
117 | 120 | ||
118 | QAction *actionNew, *actionEdit, *actionTrash, *actionFind, *actionBeam, *actionPersonal, *actionMail; | 121 | QAction *actionNew, *actionEdit, *actionTrash, *actionFind, *actionBeam, *actionPersonal, *actionMail; |
119 | 122 | ||
diff --git a/core/pim/addressbook/picker.cpp b/core/pim/addressbook/picker.cpp index a165451..7f4acb0 100644 --- a/core/pim/addressbook/picker.cpp +++ b/core/pim/addressbook/picker.cpp | |||
@@ -74,20 +74,29 @@ void PickerLabel::clearLetter() | |||
74 | currentLetter = 0; | 74 | currentLetter = 0; |
75 | 75 | ||
76 | } | 76 | } |
77 | 77 | ||
78 | void PickerLabel::mouseReleaseEvent( QMouseEvent *e ) | 78 | void PickerLabel::mousePressEvent( QMouseEvent* e ) |
79 | { | ||
80 | // If one pickerlabel is was, and an other is now selected, we | ||
81 | // have to simulate the releaseevent.. Otherwise the new label | ||
82 | // will not get a highlighted letter.. | ||
83 | // Maybe there is a more intelligent solution, but this works and I am tired.. (se) | ||
84 | if ( ( currentLetter == 0 ) && ( lastLetter != '\0' ) ) mouseReleaseEvent( e ); | ||
85 | } | ||
86 | |||
87 | void PickerLabel::mouseReleaseEvent( QMouseEvent* /* e */ ) | ||
79 | { | 88 | { |
80 | QString tmpStr; | 89 | QString tmpStr; |
81 | 90 | ||
82 | if (lastLetter != letter1 && lastLetter != letter2 && lastLetter != letter3 && lastLetter != '\0') | 91 | if (lastLetter != letter1 && lastLetter != letter2 && lastLetter != letter3 && lastLetter != '\0') |
83 | QTimer::singleShot( 0, this, SLOT(emitClearSignal()) ); | 92 | QTimer::singleShot( 0, this, SLOT(emitClearSignal()) ); |
84 | 93 | ||
85 | switch (currentLetter) { | 94 | switch (currentLetter) { |
86 | case 0: | 95 | case 0: |
87 | tmpStr = "<qt><font color=\"#7F0000\">"; | 96 | tmpStr = "<qt><u><font color=\"#7F0000\">"; |
88 | tmpStr += letter1; | 97 | tmpStr += letter1; |
89 | tmpStr += "</font>"; | 98 | tmpStr += "</font></u>"; |
90 | tmpStr += letter2; | 99 | tmpStr += letter2; |
91 | tmpStr += letter3; | 100 | tmpStr += letter3; |
92 | tmpStr += "</qt>"; | 101 | tmpStr += "</qt>"; |
93 | 102 | ||
@@ -100,11 +109,11 @@ void PickerLabel::mouseReleaseEvent( QMouseEvent *e ) | |||
100 | 109 | ||
101 | case 1: | 110 | case 1: |
102 | tmpStr = "<qt>"; | 111 | tmpStr = "<qt>"; |
103 | tmpStr += letter1; | 112 | tmpStr += letter1; |
104 | tmpStr += "<font color=\"#7F0000\">"; | 113 | tmpStr += "<u><font color=\"#7F0000\">"; |
105 | tmpStr += letter2; | 114 | tmpStr += letter2; |
106 | tmpStr += "</font>"; | 115 | tmpStr += "</font></u>"; |
107 | tmpStr += letter3; | 116 | tmpStr += letter3; |
108 | tmpStr += "</qt>"; | 117 | tmpStr += "</qt>"; |
109 | 118 | ||
110 | setText(tmpStr); | 119 | setText(tmpStr); |
@@ -117,11 +126,11 @@ void PickerLabel::mouseReleaseEvent( QMouseEvent *e ) | |||
117 | case 2: | 126 | case 2: |
118 | tmpStr = "<qt>"; | 127 | tmpStr = "<qt>"; |
119 | tmpStr += letter1; | 128 | tmpStr += letter1; |
120 | tmpStr += letter2; | 129 | tmpStr += letter2; |
121 | tmpStr += "<font color=\"#7F0000\">"; | 130 | tmpStr += "<u><font color=\"#7F0000\">"; |
122 | tmpStr += letter3; | 131 | tmpStr += letter3; |
123 | tmpStr += "</font></qt>"; | 132 | tmpStr += "</font></u></qt>"; |
124 | 133 | ||
125 | setText(tmpStr); | 134 | setText(tmpStr); |
126 | 135 | ||
127 | currentLetter++; | 136 | currentLetter++; |
@@ -223,7 +232,8 @@ void LetterPicker::clear() | |||
223 | } | 232 | } |
224 | 233 | ||
225 | void LetterPicker::newLetter( char letter ) | 234 | void LetterPicker::newLetter( char letter ) |
226 | { | 235 | { |
236 | qWarning("LetterClicked"); | ||
227 | emit letterClicked( letter ); | 237 | emit letterClicked( letter ); |
228 | 238 | ||
229 | } | 239 | } |
diff --git a/core/pim/addressbook/picker.h b/core/pim/addressbook/picker.h index de5bd9d..d76d582 100644 --- a/core/pim/addressbook/picker.h +++ b/core/pim/addressbook/picker.h | |||
@@ -30,8 +30,9 @@ Q_OBJECT | |||
30 | 30 | ||
31 | protected: | 31 | protected: |
32 | 32 | ||
33 | void mouseReleaseEvent( QMouseEvent *e ); | 33 | void mouseReleaseEvent( QMouseEvent *e ); |
34 | void mousePressEvent( QMouseEvent *e ); | ||
34 | 35 | ||
35 | private: | 36 | private: |
36 | 37 | ||
37 | int currentLetter; | 38 | int currentLetter; |
@@ -47,8 +48,9 @@ class LetterPicker: public QFrame { | |||
47 | Q_OBJECT | 48 | Q_OBJECT |
48 | public: | 49 | public: |
49 | LetterPicker( QWidget *parent = 0, const char *name = 0 ); | 50 | LetterPicker( QWidget *parent = 0, const char *name = 0 ); |
50 | ~LetterPicker(); | 51 | ~LetterPicker(); |
52 | |||
51 | 53 | ||
52 | public slots: | 54 | public slots: |
53 | void clear(); | 55 | void clear(); |
54 | 56 | ||
@@ -56,8 +58,9 @@ Q_OBJECT | |||
56 | void letterClicked( char ); | 58 | void letterClicked( char ); |
57 | 59 | ||
58 | private: | 60 | private: |
59 | PickerLabel *lblABC, *lblDEF, *lblGHI, *lblJKL, *lblMNO, *lblPQR, *lblSTU, *lblVWX, *lblYZ; | 61 | PickerLabel *lblABC, *lblDEF, *lblGHI, *lblJKL, *lblMNO, *lblPQR, *lblSTU, *lblVWX, *lblYZ; |
62 | PickerLabel *lastLabel; | ||
60 | 63 | ||
61 | private slots: | 64 | private slots: |
62 | void newLetter( char letter ); | 65 | void newLetter( char letter ); |
63 | }; | 66 | }; |