Diffstat (limited to 'core/pim/addressbook/ablabel.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/addressbook/ablabel.cpp | 43 |
1 files changed, 40 insertions, 3 deletions
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 | |||
@@ -38,16 +38,53 @@ void AbLabel::init( const OContact &entry ) | |||
38 | { | 38 | { |
39 | ent = entry; | 39 | ent = entry; |
40 | } | 40 | } |
41 | 41 | ||
42 | void AbLabel::sync() | 42 | void AbLabel::sync() |
43 | { | 43 | { |
44 | QString text = ent.toRichText(); | 44 | QString text = ent.toRichText(); |
45 | setText( text ); | 45 | setText( text ); |
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 | } |