QT GUI: define accelerators for res list page movements

This commit is contained in:
Jean-Francois Dockes 2010-02-02 10:24:58 +01:00
parent 8409e6fcae
commit 90a8280f21
3 changed files with 28 additions and 11 deletions

View File

@ -263,6 +263,9 @@
<property name="toolTip">
<string>Next page of results</string>
</property>
<property name="shortcut">
<string>PgDown</string>
</property>
<property name="name" stdset="0">
<cstring>nextPageAction</cstring>
</property>
@ -277,6 +280,9 @@
<property name="toolTip">
<string>Go to first page of results</string>
</property>
<property name="shortcut">
<string>Shift+Home</string>
</property>
<property name="name" stdset="0">
<cstring>firstPageAction</cstring>
</property>
@ -291,6 +297,9 @@
<property name="toolTip">
<string>Previous page of results</string>
</property>
<property name="shortcut">
<string>PgUp</string>
</property>
<property name="name" stdset="0">
<cstring>prevPageAction</cstring>
</property>

View File

@ -87,11 +87,11 @@
<widget class="QRadioButton">
<property name="name">
<cstring>allRDB</cstring>
</property>
<property name="text">
<string>All</string>
</property>
</widget>
</property>
<property name="text">
<string>All</string>
</property>
</widget>
</widget>
<widget class="ResList">
<property name="name">
@ -312,6 +312,9 @@
<property name="toolTip">
<string>Next page of results</string>
</property>
<property name="accel">
<string>PgDown</string>
</property>
</action>
<action>
<property name="name">
@ -326,6 +329,9 @@
<property name="toolTip">
<string>Go to first page of results</string>
</property>
<property name="accel">
<string>Shift+Home, Ctrl+S, Ctrl+Q, Ctrl+S</string>
</property>
</action>
<action>
<property name="name">
@ -340,6 +346,9 @@
<property name="toolTip">
<string>Previous page of results</string>
</property>
<property name="accel">
<string>PgUp</string>
</property>
</action>
<action>
<property name="name">

View File

@ -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;