Diffstat (limited to 'core/pim/addressbook/abtable.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/pim/addressbook/abtable.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
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 | |||
@@ -127,12 +127,13 @@ AbTable::AbTable( const QValueList<int> *order, QWidget *parent, const char *nam | |||
127 | // #endif | 127 | // #endif |
128 | lastSortCol( -1 ), | 128 | lastSortCol( -1 ), |
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 ); |
137 | init(); | 138 | init(); |
138 | setSorting( TRUE ); | 139 | setSorting( TRUE ); |
@@ -257,21 +258,47 @@ void AbTable::keyPressEvent( QKeyEvent *e ) | |||
257 | { | 258 | { |
258 | char key = toupper( e->ascii() ); | 259 | char key = toupper( e->ascii() ); |
259 | 260 | ||
260 | if ( key >= 'A' && key <= 'Z' ) | 261 | if ( key >= 'A' && key <= 'Z' ) |
261 | moveTo( key ); | 262 | moveTo( key ); |
262 | 263 | ||
264 | if ( m_inSearch ) { | ||
265 | // Running in seach-mode, therefore we will interprete | ||
266 | // some key differently | ||
267 | qWarning("Received key in search mode"); | ||
263 | switch( e->key() ) { | 268 | switch( e->key() ) { |
264 | case Qt::Key_Space: | 269 | case Qt::Key_Space: |
265 | case Qt::Key_Return: | 270 | case Qt::Key_Return: |
266 | case Qt::Key_Enter: | 271 | case Qt::Key_Enter: |
267 | emit details(); | 272 | emit details(); |
268 | break; | 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; | ||
269 | default: | 282 | default: |
270 | QTable::keyPressEvent( e ); | 283 | QTable::keyPressEvent( e ); |
271 | } | 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 | } | ||
298 | } | ||
272 | } | 299 | } |
273 | 300 | ||
274 | void AbTable::moveTo( char c ) | 301 | void AbTable::moveTo( char c ) |
275 | { | 302 | { |
276 | 303 | ||
277 | int rows = numRows(); | 304 | int rows = numRows(); |