From 90a8280f219f7f2c7f0cc3086a80ad4ae0642d47 Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Tue, 2 Feb 2010 10:24:58 +0100 Subject: [PATCH] QT GUI: define accelerators for res list page movements --- src/qt4gui/rclmain.ui | 9 +++++++++ src/qtgui/rclmain.ui | 19 ++++++++++++++----- src/qtgui/rclmain_w.cpp | 11 +++++------ 3 files changed, 28 insertions(+), 11 deletions(-) diff --git a/src/qt4gui/rclmain.ui b/src/qt4gui/rclmain.ui index 1183cf26..24b95290 100644 --- a/src/qt4gui/rclmain.ui +++ b/src/qt4gui/rclmain.ui @@ -263,6 +263,9 @@ Next page of results + + PgDown + nextPageAction @@ -277,6 +280,9 @@ Go to first page of results + + Shift+Home + firstPageAction @@ -291,6 +297,9 @@ Previous page of results + + PgUp + prevPageAction diff --git a/src/qtgui/rclmain.ui b/src/qtgui/rclmain.ui index f8de4b09..7980f08f 100644 --- a/src/qtgui/rclmain.ui +++ b/src/qtgui/rclmain.ui @@ -87,11 +87,11 @@ allRDB - - - All - - + + + All + + @@ -312,6 +312,9 @@ Next page of results + + PgDown + @@ -326,6 +329,9 @@ Go to first page of results + + Shift+Home, Ctrl+S, Ctrl+Q, Ctrl+S + @@ -340,6 +346,9 @@ Previous page of results + + PgUp + diff --git a/src/qtgui/rclmain_w.cpp b/src/qtgui/rclmain_w.cpp index 435baf16..9390e417 100644 --- a/src/qtgui/rclmain_w.cpp +++ b/src/qtgui/rclmain_w.cpp @@ -1257,12 +1257,11 @@ bool RclMain::eventFilter(QObject *, QEvent *event) if (event->type() == QEvent::KeyPress) { LOGDEB2(("RclMain::eventFilter: keypress\n")); QKeyEvent *ke = (QKeyEvent *)event; - if (ke->key() == Qt::Key_PageDown || ke->key() == Qt::Key_PageUp ) { - // Page up down are sent to the resList where they make sense - QApplication::sendEvent(resList, event); - return true; - } else if (ke->key() == Qt::Key_Home && - (ke->state() & Qt::ShiftButton)) { + // Shift-Home is the shortcut for the 1st result page action, but it is + // filtered by the search entry to mean "select all line". We prefer to + // keep it for the action as it's easy to find another combination to + // select all (ie: home, then shift-end) + if (ke->key() == Qt::Key_Home && (ke->state() & Qt::ShiftButton)) { // Shift-Home -> first page of results resList->resultPageFirst(); return true;