mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-05 08:57:35 +00:00
Enable all inset dialogs to be opened from the command line.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8230 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
d43da3679e
commit
d29005d2d1
@ -1,3 +1,8 @@
|
|||||||
|
2003-12-10 Angus Leeming <leeming@lyx.org>
|
||||||
|
|
||||||
|
* lyxfunc.C (dispatch): enable all inset dialogs to be opened with
|
||||||
|
'dialog-show-new-inset <inset name>'
|
||||||
|
|
||||||
2003-12-10 Angus Leeming <leeming@lyx.org>
|
2003-12-10 Angus Leeming <leeming@lyx.org>
|
||||||
|
|
||||||
* buffer.C: up the format to 227.
|
* buffer.C: up the format to 227.
|
||||||
|
@ -51,10 +51,18 @@
|
|||||||
#include "ParagraphParameters.h"
|
#include "ParagraphParameters.h"
|
||||||
#include "undo.h"
|
#include "undo.h"
|
||||||
|
|
||||||
|
#include "insets/insetbox.h"
|
||||||
|
#include "insets/insetbranch.h"
|
||||||
#include "insets/insetcommand.h"
|
#include "insets/insetcommand.h"
|
||||||
|
#include "insets/insetert.h"
|
||||||
#include "insets/insetexternal.h"
|
#include "insets/insetexternal.h"
|
||||||
|
#include "insets/insetfloat.h"
|
||||||
|
#include "insets/insetgraphics.h"
|
||||||
|
#include "insets/insetminipage.h"
|
||||||
|
#include "insets/insetnote.h"
|
||||||
#include "insets/insettabular.h"
|
#include "insets/insettabular.h"
|
||||||
#include "insets/insetvspace.h"
|
#include "insets/insetvspace.h"
|
||||||
|
#include "insets/insetwrap.h"
|
||||||
|
|
||||||
#include "mathed/math_cursor.h"
|
#include "mathed/math_cursor.h"
|
||||||
|
|
||||||
@ -559,6 +567,10 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & ev) const
|
|||||||
code = InsetOld::BIBITEM_CODE;
|
code = InsetOld::BIBITEM_CODE;
|
||||||
else if (ev.argument == "bibtex")
|
else if (ev.argument == "bibtex")
|
||||||
code = InsetOld::BIBTEX_CODE;
|
code = InsetOld::BIBTEX_CODE;
|
||||||
|
else if (ev.argument == "box")
|
||||||
|
code = InsetOld::BOX_CODE;
|
||||||
|
else if (ev.argument == "branch")
|
||||||
|
code = InsetOld::BRANCH_CODE;
|
||||||
else if (ev.argument == "citation")
|
else if (ev.argument == "citation")
|
||||||
code = InsetOld::CITE_CODE;
|
code = InsetOld::CITE_CODE;
|
||||||
else if (ev.argument == "ert")
|
else if (ev.argument == "ert")
|
||||||
@ -577,6 +589,8 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & ev) const
|
|||||||
code = InsetOld::LABEL_CODE;
|
code = InsetOld::LABEL_CODE;
|
||||||
else if (ev.argument == "minipage")
|
else if (ev.argument == "minipage")
|
||||||
code = InsetOld::MINIPAGE_CODE;
|
code = InsetOld::MINIPAGE_CODE;
|
||||||
|
else if (ev.argument == "note")
|
||||||
|
code = InsetOld::NOTE_CODE;
|
||||||
else if (ev.argument == "ref")
|
else if (ev.argument == "ref")
|
||||||
code = InsetOld::REF_CODE;
|
code = InsetOld::REF_CODE;
|
||||||
else if (ev.argument == "toc")
|
else if (ev.argument == "toc")
|
||||||
@ -1237,23 +1251,53 @@ void LyXFunc::dispatch(FuncRequest const & func, bool verbose)
|
|||||||
}
|
}
|
||||||
|
|
||||||
case LFUN_DIALOG_SHOW_NEW_INSET: {
|
case LFUN_DIALOG_SHOW_NEW_INSET: {
|
||||||
string const & name = argument;
|
string const name = func.getArg(0);
|
||||||
string data;
|
string data = trim(func.argument.substr(name.size()));
|
||||||
if (name == "bibitem" ||
|
if (name == "bibitem" ||
|
||||||
name == "bibtex" ||
|
name == "bibtex" ||
|
||||||
name == "include" ||
|
name == "include" ||
|
||||||
name == "index" ||
|
name == "index" ||
|
||||||
name == "ref" ||
|
name == "label" ||
|
||||||
name == "toc" ||
|
name == "ref" ||
|
||||||
name == "url") {
|
name == "toc" ||
|
||||||
|
name == "url") {
|
||||||
InsetCommandParams p(name);
|
InsetCommandParams p(name);
|
||||||
data = InsetCommandMailer::params2string(name, p);
|
data = InsetCommandMailer::params2string(name, p);
|
||||||
|
} else if (name == "box") {
|
||||||
|
// \c data == "Boxed" || "Frameless" etc
|
||||||
|
InsetBoxParams p(data);
|
||||||
|
data = InsetBoxMailer::params2string(p);
|
||||||
|
} else if (name == "branch") {
|
||||||
|
InsetBranchParams p;
|
||||||
|
data = InsetBranchMailer::params2string(p);
|
||||||
} else if (name == "citation") {
|
} else if (name == "citation") {
|
||||||
InsetCommandParams p("cite");
|
InsetCommandParams p("cite");
|
||||||
data = InsetCommandMailer::params2string(name, p);
|
data = InsetCommandMailer::params2string(name, p);
|
||||||
|
} else if (name == "ert") {
|
||||||
|
data = InsetERTMailer::params2string(InsetCollapsable::Open);
|
||||||
|
} else if (name == "external") {
|
||||||
|
InsetExternalParams p;
|
||||||
|
Buffer const & buffer = *owner->buffer();
|
||||||
|
data = InsetExternalMailer::params2string(p, buffer);
|
||||||
|
} else if (name == "float") {
|
||||||
|
InsetFloatParams p;
|
||||||
|
data = InsetFloatMailer::params2string(p);
|
||||||
|
} else if (name == "graphics") {
|
||||||
|
InsetGraphicsParams p;
|
||||||
|
Buffer const & buffer = *owner->buffer();
|
||||||
|
data = InsetGraphicsMailer::params2string(p, buffer);
|
||||||
|
} else if (name == "minipage") {
|
||||||
|
InsetMinipage::Params p;
|
||||||
|
data = InsetMinipageMailer::params2string(p);
|
||||||
|
} else if (name == "note") {
|
||||||
|
InsetNoteParams p;
|
||||||
|
data = InsetNoteMailer::params2string(p);
|
||||||
} else if (name == "vspace") {
|
} else if (name == "vspace") {
|
||||||
VSpace space;
|
VSpace space;
|
||||||
data = InsetVSpaceMailer::params2string(space);
|
data = InsetVSpaceMailer::params2string(space);
|
||||||
|
} else if (name == "wrap") {
|
||||||
|
InsetWrapParams p;
|
||||||
|
data = InsetWrapMailer::params2string(p);
|
||||||
}
|
}
|
||||||
owner->getDialogs().show(name, data, 0);
|
owner->getDialogs().show(name, data, 0);
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user