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> 2000-08-02 Allan Rae <rae@lyx.org>
* src/frontends/xforms/FormUrl.C (FormUrl): Initialise ALL variables. * src/frontends/xforms/FormUrl.C (FormUrl): Initialise ALL variables.

View File

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

View File

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

View File

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