Patch from Kayvan; fixes to menu shortcuts

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@948 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2000-08-02 09:33:15 +00:00
parent 8b52f51251
commit 644db02921
5 changed files with 81 additions and 68 deletions

View File

@ -1,3 +1,18 @@
2000-08-01 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* src/frontends/xforms/Menubar_pimpl.C (create_submenu): try to
fix handling of shortcuts (many bugs :)
(add_lastfiles): ditto.
* lib/ui/default.ui: fix a few shortcuts.
2000-07-27 Kayvan A. Sylvan <kayvan@sylvan.com>
* Makefile.am: Fix ``rpmdist'' target to return the exit
status of the ``rpm'' command, instead of the last command in
the chain (the ``rm lyx.xpm'' command, which always returns
success).
2000-08-02 Allan Rae <rae@lyx.org>
* src/frontends/xforms/FormUrl.C (FormUrl): Initialise ALL variables.

View File

@ -26,8 +26,8 @@ dist-hook:
rpmdist: dist
ln -s lib/images/lyx.xpm . ; \
rpm -ta ${PACKAGE}-${VERSION}.tar.gz ; \
rm lyx.xpm
rpm -ta ${PACKAGE}-${VERSION}.tar.gz ; saved_status=$$?; \
rm lyx.xpm; exit $$saved_status
bindist:

View File

@ -35,7 +35,7 @@ Menuset
Item "View dvi|d" "buffer-view"
Item "View Postscript|w" "buffer-view-ps"
Item "Update dvi|v" "buffer-typeset"
Item "Update Postscript|u" "buffer-typeset-ps"
Item "Update Postscript|U" "buffer-typeset-ps"
OptItem "Build program|B" "build-program"
Separator
Item "Print...|P" "buffer-print"
@ -154,7 +154,7 @@ Menuset
Item "Emphasize Style|E" "font-emph"
Item "Noun Style|N" "font-noun"
Item "Bold Style|B" "font-bold"
Item "TeX Style|x" "tex-mode"
Item "TeX Style|X" "tex-mode"
Item "Change environment depth|v" "depth-increment"
Item "LaTeX preamble|a" "layout-preamble"
Item "Start of Appendix|x" "appendix"

View File

@ -19,7 +19,7 @@ _("Revert to saved|R");
_("View dvi|d");
_("View Postscript|w");
_("Update dvi|v");
_("Update Postscript|u");
_("Update Postscript|U");
_("Build program|B");
_("Print...|P");
_("Fax...|F");
@ -92,7 +92,7 @@ _("Quotes...|Q");
_("Emphasize Style|E");
_("Noun Style|N");
_("Bold Style|B");
_("TeX Style|x");
_("TeX Style|X");
_("Change environment depth|v");
_("LaTeX preamble|a");
_("Start of Appendix|x");
@ -165,17 +165,18 @@ _("Credits...|e");
_("Version...|V");
_("");
_("A&A");
_("ACT");
_("AT_RISE:");
_("Abstract");
_("Accepted");
_("Acknowledgement");
_("Acknowledgement(s)");
_("Acknowledgement*");
_("Acknowledgement-numbered");
_("Acknowledgement(s)");
_("Acknowledgements");
_("Acknowledgement-unnumbered");
_("Acknowledgements");
_("Acknowledgments");
_("Acnowledgement");
_("ACT");
_("Addchap");
_("Addchap*");
_("Addition");
@ -193,15 +194,15 @@ _("Anlagen");
_("Anrede");
_("Appendices");
_("Appendix");
_("AT_RISE:");
_("Author");
_("AuthorRunning");
_("Author_Email");
_("Author_Running");
_("AuthorRunning");
_("Author_URL");
_("Axiom");
_("Axiom-numbered");
_("Axiom-plain");
_("BLZ");
_("Backaddress");
_("Bank");
_("BankAccount");
@ -209,13 +210,12 @@ _("BankCode");
_("Betreff");
_("Bibliography");
_("Biography");
_("BLZ");
_("Brieftext");
_("CC");
_("CURTAIN");
_("Caption");
_("Case");
_("Case-numbered");
_("CC");
_("cc");
_("CenteredCaption");
_("Chapter");
_("Chapter*");
@ -255,7 +255,6 @@ _("Criterion-plain");
_("CrossList");
_("Current");
_("Current_Address");
_("CURTAIN");
_("Customer");
_("Data");
_("Date");
@ -270,10 +269,10 @@ _("Definition-unnumbered");
_("Description");
_("Dialogue");
_("EMail");
_("EXT.");
_("Email");
_("Encl");
_("Encl.");
_("encl");
_("End_All_Slides");
_("Enumerate");
_("Example");
@ -284,48 +283,43 @@ _("Example-unnumbered");
_("Exercise");
_("Exercise-numbered");
_("Exercise-plain");
_("EXT.");
_("Extratitle");
_("FADE_IN:");
_("FADE_OUT:");
_("Fact");
_("Fact*");
_("Fact-numbered");
_("Fact-plain");
_("Fact-unnumbered");
_("FADE_IN:");
_("FADE_OUT:");
_("FigCaption");
_("first");
_("FirstAuthor");
_("FirstName");
_("FitBitmap");
_("FitFigure");
_("Foilhead");
_("foilhead");
_("Footernote");
_("FourAffiliations");
_("FourAuthors");
_("Gruss");
_("Headnote");
_("HTTP");
_("Headnote");
_("INT.");
_("Idea");
_("IhrSchreiben");
_("IhrZeichen");
_("Institute");
_("Institution");
_("INT.");
_("InvisibleText");
_("Invoice");
_("Itemize");
_("Journal");
_("journal");
_("Keywords");
_("Konto");
_("Labeling");
_("Land");
_("landscape");
_("LandscapeSlide");
_("LaTeX");
_("LaTeX_Title");
_("Labeling");
_("Land");
_("LandscapeSlide");
_("Lemma");
_("Lemma*");
_("Lemma-numbered");
@ -344,10 +338,8 @@ _("MarkBoth");
_("MathLetters");
_("MeinZeichen");
_("Minisec");
_("modying");
_("msnumber");
_("My_Address");
_("MyRef");
_("My_Address");
_("Myref");
_("Name");
_("Narrative");
@ -357,18 +349,18 @@ _("Note");
_("Note*");
_("Note-numbered");
_("Note-plain");
_("Note-unnumbered");
_("NoteToEditor");
_("Notetoeditor");
_("Note-unnumbered");
_("Offprint");
_("Offprints");
_("Offsets");
_("offsets");
_("Oggetto");
_("Opening");
_("Ort");
_("Overlay");
_("PACS");
_("PS");
_("Paragraph");
_("Paragraph*");
_("Paragraph-numbered");
@ -379,8 +371,8 @@ _("Petit");
_("Phone");
_("Place");
_("PlaceFigure");
_("Placefigure");
_("PlaceTable");
_("Placefigure");
_("Placetable");
_("PortraitSlide");
_("PostalCommend");
@ -397,12 +389,11 @@ _("Proposition*");
_("Proposition-numbered");
_("Proposition-plain");
_("Proposition-unnumbered");
_("PS");
_("ps");
_("Publishers");
_("Question");
_("Quotation");
_("Quote");
_("REVTEX_Title");
_("Received");
_("Recieved");
_("Recieved/Accepted");
@ -412,17 +403,17 @@ _("Remark");
_("Remark*");
_("Remark-numbered");
_("Remark-plain");
_("Remarks");
_("Remark-unnumbered");
_("Remarks");
_("RetourAdresse");
_("ReturnAddress");
_("REVTEX_Title");
_("Right_Address");
_("RightHeader");
_("Right_Address");
_("Rotatefoilhead");
_("Running_LaTeX_Title");
_("SCENE");
_("SCENE*");
_("SGML");
_("Scrap");
_("Section");
_("Section*");
@ -430,11 +421,10 @@ _("Section-numbered");
_("Send");
_("Send_To_Address");
_("Seriate");
_("SGML");
_("ShortFoilhead");
_("Shortfoilhead");
_("ShortRotatefoilhead");
_("ShortTitle");
_("Shortfoilhead");
_("Signature");
_("Slide");
_("Slide*");
@ -450,26 +440,26 @@ _("State");
_("Strasse");
_("Street");
_("Style");
_("style");
_("SubSection");
_("SubTitle");
_("Subitle");
_("Subject");
_("Subjectclass");
_("Subparagraph");
_("Subparagraph*");
_("SubSection");
_("Subsection");
_("Subsection*");
_("Subsection-numbered");
_("Subsubsection");
_("Subsubsection*");
_("Subsubsection-numbered");
_("SubTitle");
_("Subtitle");
_("Suggested");
_("Summary");
_("Summary-numbered");
_("Surname");
_("surname");
_("TOC_Author");
_("TOC_Title");
_("TableComments");
_("TableRefs");
_("Telefax");
@ -481,8 +471,8 @@ _("Theorem");
_("Theorem*");
_("Theorem-numbered");
_("Theorem-plain");
_("TheoremTemplate");
_("Theorem-unnumbered");
_("TheoremTemplate");
_("Thesaurus");
_("ThickLine");
_("This");
@ -490,29 +480,39 @@ _("ThreeAffiliations");
_("ThreeAuthors");
_("TickList");
_("Title");
_("Titlehead");
_("Title_Running");
_("TOC_Author");
_("TOC_Title");
_("Titlehead");
_("Town");
_("Transition");
_("Trans_Keywords");
_("Transition");
_("Translated");
_("TranslatedAbstract");
_("Translated_Title");
_("Translator");
_("TwoAffiliations");
_("TwoAuthors");
_("URL");
_("Unterschrift");
_("Uppertitleback");
_("URL");
_("Use");
_("Verbatim");
_("Verse");
_("Verteiler");
_("VisibleText");
_("YourMail");
_("Yourmail");
_("YourRef");
_("Yourmail");
_("Yourref");
_("Zusatz");
_("cc");
_("encl");
_("first");
_("foilhead");
_("journal");
_("landscape");
_("modying");
_("msnumber");
_("offsets");
_("ps");
_("style");
_("surname");

View File

@ -230,15 +230,14 @@ void Menubar::Pimpl::add_lastfiles(int menu, string const & extra_label,
lyxaction.getPseudoAction(LFUN_FILE_OPEN, (*cit));
string label = tostr(ii) + ". "
+ MakeDisplayPath((*cit),30)
+ "%x" + tostr(action);
+ "%x" + tostr(action) + "%h";
if ((cit + 1) == lastfiles->end())
label += extra_label;
string shortcut = tostr(ii) + "#" + tostr(ii);
lyxerr[Debug::GUI] << "shortcut is " << shortcut <<
endl;
int n = fl_addtopup(menu, strpool.add(label));
fl_setpup_shortcut(menu, n, strpool.add(shortcut));
fl_addtopup(menu, strpool.add(label), strpool.add(shortcut));
}
}
@ -355,26 +354,19 @@ int Menubar::Pimpl::create_submenu(Window win, LyXView * view,
// Finally the menu shortcut
string shortcut = item.shortcut();
string xfshortcut;
if (!shortcut.empty()) {
xfshortcut += uppercase(shortcut[0]);
xfshortcut += '#';
xfshortcut += uppercase(shortcut[0]);
xfshortcut += lowercase(shortcut[0]);
xfshortcut += '#';
xfshortcut += lowercase(shortcut[0]);
lyxerr[Debug::GUI] << "shortcut is "
<< xfshortcut << endl;
shortcut += lowercase(shortcut[0]);
label += "%h";
fl_addtopup(menu, strpool.add(label),
strpool.add(xfshortcut));
strpool.add(shortcut));
} else
fl_addtopup(menu, strpool.add(label));
lyxerr[Debug::GUI] << "Command: \""
<< lyxaction.getActionName(item.action())
<< "\", Binding " << accel
<< ", shortcut " << xfshortcut
<< ", shortcut " << shortcut
<< endl;
@ -390,8 +382,14 @@ int Menubar::Pimpl::create_submenu(Window win, LyXView * view,
string label = item.label();
label += extra_label + "%m";
string shortcut = item.shortcut();
int n = fl_addtopup(menu, strpool.add(label), submenu);
fl_setpup_shortcut(menu, n, strpool.add(shortcut));
if (!shortcut.empty()) {
shortcut += lowercase(shortcut[0]);
fl_addtopup(menu, strpool.add(label + "%h"),
submenu, strpool.add(shortcut));
}
else {
fl_addtopup(menu, strpool.add(label), submenu);
}
break;
}