Show binding associated to the lfun in the tooltip of a toolbar icon.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_6_X@30040 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2009-06-10 14:03:55 +00:00
parent 7ef1378998
commit 3c6e023f62
2 changed files with 24 additions and 13 deletions

View File

@ -32,6 +32,7 @@
#include "Cursor.h"
#include "FuncRequest.h"
#include "FuncStatus.h"
#include "KeyMap.h"
#include "Layout.h"
#include "LyXFunc.h"
#include "LyXRC.h"
@ -730,8 +731,15 @@ void GuiToolbar::setVisibility(int visibility)
Action * GuiToolbar::addItem(ToolbarItem const & item)
{
QString text = toqstr(item.label_);
// Get the keys bound to this action, but keep only the
// first one later
KeyMap::Bindings bindings = theTopLevelKeymap().findBindings(item.func_);
if (bindings.size())
text += " [" + toqstr(bindings.begin()->print(KeySequence::ForGui)) + "]";
Action * act = new Action(&owner_, getIcon(item.func_, false),
toqstr(item.label_), item.func_, toqstr(item.label_), this);
text, item.func_, text, this);
actions_.append(act);
return act;
}

View File

@ -22,18 +22,6 @@ What's new
** Updates:
***********
* DOCUMENTATION AND LOCALIZATION
- New Slovakian translation of the Introduction manual.
- Updated Czech, German, Italian and Spanish localizations of the user
interface.
- Updated English Additional Features manual.
- Updated Intro manual for all languages.
* DOCUMENT INPUT/OUTPUT
- Implement separate chains for Japanese bibliography and index
@ -48,10 +36,25 @@ What's new
warning for this specific master/child constellation over sessions
(bug 3218).
- Tooltips for toolbat buttons now show the main shortcut associated
to the action.
- Tooltips for footnotes and some other insets now wrap, so they can actually
be seen.
* DOCUMENTATION AND LOCALIZATION
- New Slovakian translation of the Introduction manual.
- Updated Czech, German, Italian and Spanish localizations of the user
interface.
- Updated English Additional Features manual.
- Updated Intro manual for all languages.
* WINDOWS INSTALLER