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

View File

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

View File

@ -1257,12 +1257,11 @@ bool RclMain::eventFilter(QObject *, QEvent *event)
if (event->type() == QEvent::KeyPress) { if (event->type() == QEvent::KeyPress) {
LOGDEB2(("RclMain::eventFilter: keypress\n")); LOGDEB2(("RclMain::eventFilter: keypress\n"));
QKeyEvent *ke = (QKeyEvent *)event; QKeyEvent *ke = (QKeyEvent *)event;
if (ke->key() == Qt::Key_PageDown || ke->key() == Qt::Key_PageUp ) { // Shift-Home is the shortcut for the 1st result page action, but it is
// Page up down are sent to the resList where they make sense // filtered by the search entry to mean "select all line". We prefer to
QApplication::sendEvent(resList, event); // keep it for the action as it's easy to find another combination to
return true; // select all (ie: home, then shift-end)
} else if (ke->key() == Qt::Key_Home && if (ke->key() == Qt::Key_Home && (ke->state() & Qt::ShiftButton)) {
(ke->state() & Qt::ShiftButton)) {
// Shift-Home -> first page of results // Shift-Home -> first page of results
resList->resultPageFirst(); resList->resultPageFirst();
return true; return true;