From 3bcf40e96d29e9a75db0f6d6fa933ea8f124f6e3 Mon Sep 17 00:00:00 2001 From: John Levon Date: Wed, 21 Apr 2004 00:19:27 +0000 Subject: [PATCH] Make M-x show the minibuffer git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8686 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/ChangeLog | 5 +++++ lib/ui/default.ui | 10 +++++----- lib/ui/stdtoolbars.ui | 12 ++++++------ po/POTFILES.in | 2 ++ src/ChangeLog | 8 ++++++++ src/ToolbarBackend.C | 7 +++++++ src/ToolbarBackend.h | 4 +++- src/frontends/ChangeLog | 5 +++++ src/frontends/Toolbar.C | 19 +++++++++++++++++++ src/frontends/Toolbar.h | 3 +++ src/frontends/qt2/ChangeLog | 4 ++++ src/frontends/qt2/QLToolbar.C | 3 ++- src/lyxfunc.C | 1 + 13 files changed, 70 insertions(+), 13 deletions(-) diff --git a/lib/ChangeLog b/lib/ChangeLog index 652a1aa19e..a9a4e84bad 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,8 @@ +2004-04-21 John Levon + + * ui/default.ui: + * ui/stdtoolbars.ui: add a non-GUI name for toolbars + 2004-04-20 Angus Leeming * configure.m4: change the lyxpreview_to_bitmap_command to the diff --git a/lib/ui/default.ui b/lib/ui/default.ui index 1318a2cb67..ec3a61769d 100644 --- a/lib/ui/default.ui +++ b/lib/ui/default.ui @@ -29,9 +29,9 @@ Include "stdtoolbars.ui" # right: the toolbar should be at the right of the window # Toolbars - "Standard" "on,top" - "Extra" "on,top" - "Table" "off,bottom" - "Math" "off,bottom" - "Command Buffer" "off,bottom" + "standard" "on,top" + "extra" "on,top" + "table" "off,bottom" + "math" "off,bottom" + "minibuffer" "off,bottom" End diff --git a/lib/ui/stdtoolbars.ui b/lib/ui/stdtoolbars.ui index c281f641d0..31fab8bb32 100644 --- a/lib/ui/stdtoolbars.ui +++ b/lib/ui/stdtoolbars.ui @@ -11,7 +11,7 @@ # A Toolbar starts like : # -# Toolbar "Name" +# Toolbar "name" "GUI Name" # # Only four commands are allowed inside the begin_toolbar and end_toolbar # directives: @@ -36,7 +36,7 @@ # # This is the default toolbar: -Toolbar "Standard" +Toolbar "standard" "Standard" Layouts Item "New document" "buffer-new" Item "Open document" "file-open" @@ -59,7 +59,7 @@ Toolbar "Standard" Item "Insert table" "tabular-insert 4 4" End -Toolbar "Extra" +Toolbar "extra" "Extra" Item "Numbered list" "layout Enumerate" Item "Itemized list" "layout Itemize" Item "List" "layout List" @@ -88,7 +88,7 @@ Toolbar "Extra" Item "Thesaurus" "thesaurus-entry" End -Toolbar "Table" +Toolbar "table" "Table" Item "Add row" "tabular-feature append-row" Item "Add column" "tabular-feature append-column" Item "Delete row" "tabular-feature delete-row" @@ -114,7 +114,7 @@ Toolbar "Table" Item "Set multi-column" "tabular-feature multicolumn" End -Toolbar "Math" +Toolbar "math" "Math" Item "Show math panel" "dialog-show mathpanel" Item "Set display mode" "math-display" Item "Subscript" "math-subscript" @@ -138,6 +138,6 @@ Toolbar "Math" Item "Delete column" "tabular-feature delete-column" End -Toolbar "Command Buffer" +Toolbar "minibuffer" "Command Buffer" Minibuffer End diff --git a/po/POTFILES.in b/po/POTFILES.in index 2f914c2342..6e837e3f78 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -187,6 +187,8 @@ src/output_plaintext.C src/paragraph.C src/rowpainter.C src/support/globbing.C +src/support/path_defines.C +src/tex2lyx/lengthcommon.C src/text.C src/text2.C src/text3.C diff --git a/src/ChangeLog b/src/ChangeLog index 76ed58e393..48cfe8b025 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2004-04-21 John Levon + + * ToolbarBackend.h: + * ToolbarBackend.C: make "name" be a programmatic name + and a gui_name field. + + * lyxfunc.C: display the minibuffer on M-x + 2004-04-18 Jean-Marc Lasgouttes * LaTeX.C (runMakeIndex, runBibTeX): quote correctly file name diff --git a/src/ToolbarBackend.C b/src/ToolbarBackend.C index cebf1262bd..41338d58c2 100644 --- a/src/ToolbarBackend.C +++ b/src/ToolbarBackend.C @@ -75,6 +75,13 @@ void ToolbarBackend::read(LyXLex & lex) Toolbar tb; tb.name = lex.getString(); + lex.next(true); + if (!lex.isOK()) { + lyxerr << "ToolbarBackend::read: Malformed toolbar " + "description " << lex.getString() << endl; + return; + } + tb.gui_name = lex.getString(); bool quit = false; diff --git a/src/ToolbarBackend.h b/src/ToolbarBackend.h index 873da4df31..8169ea910a 100644 --- a/src/ToolbarBackend.h +++ b/src/ToolbarBackend.h @@ -54,8 +54,10 @@ public: /// a toolbar struct Toolbar { - /// toolbar UI name + /// toolbar name std::string name; + /// toolbar GUI name + std::string gui_name; /// toolbar contents Items items; /// flags diff --git a/src/frontends/ChangeLog b/src/frontends/ChangeLog index abd5a264ab..554c2c0599 100644 --- a/src/frontends/ChangeLog +++ b/src/frontends/ChangeLog @@ -1,3 +1,8 @@ +2004-04-21 John Levon + + * Toolbar.h: + * Toolbar.C: add display() + 2004-04-19 John Levon * screen.C: re-show the cursor after a full expose diff --git a/src/frontends/Toolbar.C b/src/frontends/Toolbar.C index d83e149af1..1674f5ee7e 100644 --- a/src/frontends/Toolbar.C +++ b/src/frontends/Toolbar.C @@ -16,6 +16,8 @@ #include "LyXAction.h" #include "ToolbarBackend.h" +using std::string; +using std::endl; Toolbar::Toolbar() : last_textclass_(-1) @@ -39,6 +41,23 @@ void Toolbar::init() } +void Toolbar::display(string const & name, bool show) +{ + ToolbarBackend::Toolbars::const_iterator cit = toolbarbackend.begin(); + ToolbarBackend::Toolbars::const_iterator end = toolbarbackend.end(); + + for (; cit != end; ++cit) { + if (cit->name == name) { + displayToolbar(*cit, show); + return; + } + } + + lyxerr[Debug::GUI] << "Toolbar::display: no toolbar named " + << name << endl; +} + + void Toolbar::update(bool in_math, bool in_table) { update(); diff --git a/src/frontends/Toolbar.h b/src/frontends/Toolbar.h index e6d23cac6d..8338ee08c0 100644 --- a/src/frontends/Toolbar.h +++ b/src/frontends/Toolbar.h @@ -35,6 +35,9 @@ public: /// update the state of the toolbars void update(bool in_math, bool in_table); + /// show/hide the named toolbar + void display(std::string const & name, bool show); + /// update the layout combox virtual void setLayout(std::string const & layout) = 0; /** diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index 7c0e106948..014a0556d5 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,7 @@ +2004-04-21 John Levon + + * QLToolbar.C: use GUI name for tooltip + 2004-04-19 Angus Leeming * QPref.C: diff --git a/src/frontends/qt2/QLToolbar.C b/src/frontends/qt2/QLToolbar.C index 07fa9829e7..d3a5c9dde6 100644 --- a/src/frontends/qt2/QLToolbar.C +++ b/src/frontends/qt2/QLToolbar.C @@ -212,7 +212,8 @@ QMainWindow::ToolBarDock getPosition(ToolbarBackend::Flags const & flags) void QLToolbar::add(ToolbarBackend::Toolbar const & tb) { - QToolBar * qtb = new QToolBar(qt_(tb.name), owner_, getPosition(tb.flags)); + QToolBar * qtb = new QToolBar(qt_(tb.gui_name), owner_, + getPosition(tb.flags)); // give visual separation between adjacent toolbars qtb->addSeparator(); diff --git a/src/lyxfunc.C b/src/lyxfunc.C index 42d09b4fbc..244a858dbc 100644 --- a/src/lyxfunc.C +++ b/src/lyxfunc.C @@ -631,6 +631,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd, bool verbose) break; case LFUN_EXEC_COMMAND: + owner->getToolbar().display("minibuffer", true); owner->focus_command_buffer(); break;