mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 18:08:10 +00:00
jmarc's shortcut patch
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5681 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
d4ee5b69d0
commit
4e18f2cccd
@ -1,3 +1,9 @@
|
||||
2002-11-20 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
|
||||
|
||||
* QLPopupMenu.C (getLabel): show labels for menu entries
|
||||
|
||||
* qlkey.h (string_to_qkey): add support for KP_xxx keysyms
|
||||
|
||||
2002-11-20 John Levon <levon@movementarian.org>
|
||||
|
||||
* ui/QDelimiterDialog.ui: geometry fix
|
||||
|
@ -14,19 +14,23 @@
|
||||
#pragma implementation
|
||||
#endif
|
||||
|
||||
#include "support/lstrings.h"
|
||||
#include "MenuBackend.h"
|
||||
#include "lyxfunc.h"
|
||||
#include "kbmap.h"
|
||||
#include "debug.h"
|
||||
|
||||
|
||||
#include "QtView.h"
|
||||
|
||||
#include "QLPopupMenu.h"
|
||||
|
||||
#include "support/lstrings.h"
|
||||
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
|
||||
using std::pair;
|
||||
using std::make_pair;
|
||||
|
||||
|
||||
extern boost::scoped_ptr<kb_keymap> toplevel_keymap;
|
||||
|
||||
namespace {
|
||||
|
||||
string const getLabel(MenuItem const & mi)
|
||||
@ -41,6 +45,21 @@ string const getLabel(MenuItem const & mi)
|
||||
if (pos == string::npos)
|
||||
return label;
|
||||
label.insert(pos, "&");
|
||||
|
||||
if (mi.kind() == MenuItem::Command) {
|
||||
// FIXME: backend should do this
|
||||
string const accel(toplevel_keymap->findbinding(mi.action()));
|
||||
|
||||
if (!accel.empty()) {
|
||||
label += "\t" + accel.substr(1, accel.find(']') - 1);
|
||||
}
|
||||
|
||||
lyxerr[Debug::GUI] << "Label: " << mi.label()
|
||||
<< " Shortcut: " << mi.shortcut()
|
||||
<< " Accel: " << accel << endl;
|
||||
} else
|
||||
lyxerr[Debug::GUI] << "Label: " << mi.label()
|
||||
<< " Shortcut: " << mi.shortcut() << endl;
|
||||
|
||||
return label;
|
||||
}
|
||||
|
@ -57,7 +57,9 @@ int string_to_qkey(string const & str)
|
||||
if (str == "Return") return Qt::Key_Return;
|
||||
if (str == "KP_Enter") return Qt::Key_Enter; // correct ?
|
||||
if (str == "Insert") return Qt::Key_Insert;
|
||||
if (str == "KP_Insert") return Qt::Key_Insert;
|
||||
if (str == "Delete") return Qt::Key_Delete;
|
||||
if (str == "KP_Delete") return Qt::Key_Delete;
|
||||
if (str == "Pause") return Qt::Key_Pause;
|
||||
if (str == "Print") return Qt::Key_Print;
|
||||
if (str == "Sys_Req") return Qt::Key_SysReq;
|
||||
@ -69,6 +71,14 @@ int string_to_qkey(string const & str)
|
||||
if (str == "Down") return Qt::Key_Down;
|
||||
if (str == "Prior") return Qt::Key_Prior;
|
||||
if (str == "Next") return Qt::Key_Next;
|
||||
if (str == "KP_Home") return Qt::Key_Home;
|
||||
if (str == "KP_End") return Qt::Key_End;
|
||||
if (str == "KP_Left") return Qt::Key_Left;
|
||||
if (str == "KP_Up") return Qt::Key_Up;
|
||||
if (str == "KP_Right") return Qt::Key_Right;
|
||||
if (str == "KP_Down") return Qt::Key_Down;
|
||||
if (str == "KP_Prior") return Qt::Key_Prior;
|
||||
if (str == "KP_Next") return Qt::Key_Next;
|
||||
if (str == "Shift_L") return Qt::Key_Shift;
|
||||
if (str == "Control_L") return Qt::Key_Control;
|
||||
if (str == "Alt_L") return Qt::Key_Meta; // correct ?
|
||||
|
Loading…
Reference in New Issue
Block a user