Make M-x show the minibuffer

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8686 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
John Levon 2004-04-21 00:19:27 +00:00
parent 0aea071705
commit 3bcf40e96d
13 changed files with 70 additions and 13 deletions

View File

@ -1,3 +1,8 @@
2004-04-21 John Levon <levon@movementarian.org>
* ui/default.ui:
* ui/stdtoolbars.ui: add a non-GUI name for toolbars
2004-04-20 Angus Leeming <leeming@lyx.org> 2004-04-20 Angus Leeming <leeming@lyx.org>
* configure.m4: change the lyxpreview_to_bitmap_command to the * configure.m4: change the lyxpreview_to_bitmap_command to the

View File

@ -29,9 +29,9 @@ Include "stdtoolbars.ui"
# right: the toolbar should be at the right of the window # right: the toolbar should be at the right of the window
# #
Toolbars Toolbars
"Standard" "on,top" "standard" "on,top"
"Extra" "on,top" "extra" "on,top"
"Table" "off,bottom" "table" "off,bottom"
"Math" "off,bottom" "math" "off,bottom"
"Command Buffer" "off,bottom" "minibuffer" "off,bottom"
End End

View File

@ -11,7 +11,7 @@
# A Toolbar starts like : # A Toolbar starts like :
# #
# Toolbar "Name" # Toolbar "name" "GUI Name"
# #
# Only four commands are allowed inside the begin_toolbar and end_toolbar # Only four commands are allowed inside the begin_toolbar and end_toolbar
# directives: # directives:
@ -36,7 +36,7 @@
# #
# This is the default toolbar: # This is the default toolbar:
Toolbar "Standard" Toolbar "standard" "Standard"
Layouts Layouts
Item "New document" "buffer-new" Item "New document" "buffer-new"
Item "Open document" "file-open" Item "Open document" "file-open"
@ -59,7 +59,7 @@ Toolbar "Standard"
Item "Insert table" "tabular-insert 4 4" Item "Insert table" "tabular-insert 4 4"
End End
Toolbar "Extra" Toolbar "extra" "Extra"
Item "Numbered list" "layout Enumerate" Item "Numbered list" "layout Enumerate"
Item "Itemized list" "layout Itemize" Item "Itemized list" "layout Itemize"
Item "List" "layout List" Item "List" "layout List"
@ -88,7 +88,7 @@ Toolbar "Extra"
Item "Thesaurus" "thesaurus-entry" Item "Thesaurus" "thesaurus-entry"
End End
Toolbar "Table" Toolbar "table" "Table"
Item "Add row" "tabular-feature append-row" Item "Add row" "tabular-feature append-row"
Item "Add column" "tabular-feature append-column" Item "Add column" "tabular-feature append-column"
Item "Delete row" "tabular-feature delete-row" Item "Delete row" "tabular-feature delete-row"
@ -114,7 +114,7 @@ Toolbar "Table"
Item "Set multi-column" "tabular-feature multicolumn" Item "Set multi-column" "tabular-feature multicolumn"
End End
Toolbar "Math" Toolbar "math" "Math"
Item "Show math panel" "dialog-show mathpanel" Item "Show math panel" "dialog-show mathpanel"
Item "Set display mode" "math-display" Item "Set display mode" "math-display"
Item "Subscript" "math-subscript" Item "Subscript" "math-subscript"
@ -138,6 +138,6 @@ Toolbar "Math"
Item "Delete column" "tabular-feature delete-column" Item "Delete column" "tabular-feature delete-column"
End End
Toolbar "Command Buffer" Toolbar "minibuffer" "Command Buffer"
Minibuffer Minibuffer
End End

View File

@ -187,6 +187,8 @@ src/output_plaintext.C
src/paragraph.C src/paragraph.C
src/rowpainter.C src/rowpainter.C
src/support/globbing.C src/support/globbing.C
src/support/path_defines.C
src/tex2lyx/lengthcommon.C
src/text.C src/text.C
src/text2.C src/text2.C
src/text3.C src/text3.C

View File

@ -1,3 +1,11 @@
2004-04-21 John Levon <levon@movementarian.org>
* 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 <lasgouttes@lyx.org> 2004-04-18 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
* LaTeX.C (runMakeIndex, runBibTeX): quote correctly file name * LaTeX.C (runMakeIndex, runBibTeX): quote correctly file name

View File

@ -75,6 +75,13 @@ void ToolbarBackend::read(LyXLex & lex)
Toolbar tb; Toolbar tb;
tb.name = lex.getString(); 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; bool quit = false;

View File

@ -54,8 +54,10 @@ public:
/// a toolbar /// a toolbar
struct Toolbar { struct Toolbar {
/// toolbar UI name /// toolbar name
std::string name; std::string name;
/// toolbar GUI name
std::string gui_name;
/// toolbar contents /// toolbar contents
Items items; Items items;
/// flags /// flags

View File

@ -1,3 +1,8 @@
2004-04-21 John Levon <levon@movementarian.org>
* Toolbar.h:
* Toolbar.C: add display()
2004-04-19 John Levon <levon@movementarian.org> 2004-04-19 John Levon <levon@movementarian.org>
* screen.C: re-show the cursor after a full expose * screen.C: re-show the cursor after a full expose

View File

@ -16,6 +16,8 @@
#include "LyXAction.h" #include "LyXAction.h"
#include "ToolbarBackend.h" #include "ToolbarBackend.h"
using std::string;
using std::endl;
Toolbar::Toolbar() Toolbar::Toolbar()
: last_textclass_(-1) : 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) void Toolbar::update(bool in_math, bool in_table)
{ {
update(); update();

View File

@ -35,6 +35,9 @@ public:
/// update the state of the toolbars /// update the state of the toolbars
void update(bool in_math, bool in_table); 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 /// update the layout combox
virtual void setLayout(std::string const & layout) = 0; virtual void setLayout(std::string const & layout) = 0;
/** /**

View File

@ -1,3 +1,7 @@
2004-04-21 John Levon <levon@movementarian.org>
* QLToolbar.C: use GUI name for tooltip
2004-04-19 Angus Leeming <leeming@lyx.org> 2004-04-19 Angus Leeming <leeming@lyx.org>
* QPref.C: * QPref.C:

View File

@ -212,7 +212,8 @@ QMainWindow::ToolBarDock getPosition(ToolbarBackend::Flags const & flags)
void QLToolbar::add(ToolbarBackend::Toolbar const & tb) 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 // give visual separation between adjacent toolbars
qtb->addSeparator(); qtb->addSeparator();

View File

@ -631,6 +631,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd, bool verbose)
break; break;
case LFUN_EXEC_COMMAND: case LFUN_EXEC_COMMAND:
owner->getToolbar().display("minibuffer", true);
owner->focus_command_buffer(); owner->focus_command_buffer();
break; break;