summaryrefslogtreecommitdiff
path: root/core/pim/addressbook/abtable.cpp
Side-by-side diff
Diffstat (limited to 'core/pim/addressbook/abtable.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/abtable.cpp45
1 files changed, 36 insertions, 9 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
// #endif
lastSortCol( -1 ),
asc( TRUE ),
intFields( order ),
currFindRow( -1 ),
mCat( 0 ),
+ m_inSearch (false),
m_contactdb ("addressbook", 0l, 0l, false) // Handle syncing myself.. !
{
mCat.load( categoryFileName() );
setSelectionMode( NoSelection );
init();
setSorting( TRUE );
@@ -257,20 +258,46 @@ void AbTable::keyPressEvent( QKeyEvent *e )
{
char key = toupper( e->ascii() );
if ( key >= 'A' && key <= 'Z' )
moveTo( key );
- switch( e->key() ) {
- case Qt::Key_Space:
- case Qt::Key_Return:
- case Qt::Key_Enter:
- emit details();
- break;
- default:
- QTable::keyPressEvent( e );
+ if ( m_inSearch ) {
+ // Running in seach-mode, therefore we will interprete
+ // some key differently
+ qWarning("Received key in search mode");
+ switch( e->key() ) {
+ case Qt::Key_Space:
+ case Qt::Key_Return:
+ case Qt::Key_Enter:
+ emit details();
+ break;
+ case Qt::Key_Up:
+ qWarning("a");
+ emit signalSearchBackward();
+ break;
+ case Qt::Key_Down:
+ qWarning("b");
+ emit signalSearchNext();
+ break;
+ default:
+ QTable::keyPressEvent( e );
+ }
+
+ } else {
+ qWarning("Received key in NON search mode");
+
+ switch( e->key() ) {
+ case Qt::Key_Space:
+ case Qt::Key_Return:
+ case Qt::Key_Enter:
+ emit details();
+ break;
+ default:
+ QTable::keyPressEvent( e );
+ }
}
}
void AbTable::moveTo( char c )
{
@@ -680,13 +707,13 @@ void AbTable::slotDoFind( const QString &findString, bool caseSensitive, bool us
currFindRow = -1;
if ( wrapAround )
emit signalWrapAround();
else
emit signalNotFound();
-
+
wrapAround = !wrapAround;
} else {
currFindRow = row;
QTableSelection foundSelection;
foundSelection.init( currFindRow, 0 );
foundSelection.expandTo( currFindRow, numCols() - 1 );