port the minipage dialog to the new scheme. Various other small changes

in the inset mailers and in the controllers.
Enable the include dialog to be lauched for a new inset (should please John ;-)


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6374 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Angus Leeming 2003-03-07 14:08:10 +00:00
parent 9973bb7aa1
commit e22ee4208d
62 changed files with 496 additions and 571 deletions

View File

@ -1,3 +1,8 @@
2003-03-07 Angus Leeming <leeming@lyx.org>
* lyxfunc.C (dispatch): add "include" to LFUN_SHOW_NEW_INSET and
remove "ert".
2003-03-06 Lars Gullik Bjønnes <larsbj@gullik.net> 2003-03-06 Lars Gullik Bjønnes <larsbj@gullik.net>
* ParagraphList.C (front): new function * ParagraphList.C (front): new function

View File

@ -1,3 +1,8 @@
2003-03-07 Angus Leeming <leeming@lyx.org>
* Dialogs.h: remove showMinipage, updateMinipage.
* guiapi.[Ch]: remove gui_showMinipage, gui_updateMinipage.
2003-03-06 Alfredo Braunstein <abraunst@libero.it> 2003-03-06 Alfredo Braunstein <abraunst@libero.it>
* screen.C: use LyXText::top_y() instead of LyXText::first_y * screen.C: use LyXText::top_y() instead of LyXText::first_y

View File

@ -25,7 +25,6 @@ class LyXView;
class InsetGraphics; class InsetGraphics;
class InsetInfo; class InsetInfo;
class InsetMinipage;
class Paragraph; class Paragraph;
class InsetTabular; class InsetTabular;
@ -96,10 +95,6 @@ public:
/// show the merge changes dialog /// show the merge changes dialog
void showMergeChanges(); void showMergeChanges();
/// ///
void showMinipage(InsetMinipage *);
///
void updateMinipage(InsetMinipage *);
///
void showParagraph(); void showParagraph();
/// ///
void updateParagraph(); void updateParagraph();

View File

@ -1,3 +1,21 @@
2003-03-07 Angus Leeming <leeming@lyx.org>
* ControlBibitem.[Ch]:
* ControlIndex.[Ch]:
* ControlLabel.[Ch]:
* ControlUrl.[Ch]: removed.
* Makefile.am: remove files.
* ControlERT.C (dispatchParams):
* ControlExternal.C (dispatchParams):
* ControlFloat.C (dispatchParams):
* ControlInclude.C (dispatchParams):
* ControlWrap.C (dispatchParams): no need to pass name to Mailer
anymore.
* ControlMinipage.[Ch]: rewrite to use the Dialog-based scheme.
2003-03-05 Angus Leeming <leeming@lyx.org> 2003-03-05 Angus Leeming <leeming@lyx.org>
* ControlWrap.[Ch]: rewrite to use the Dialog-based scheme. * ControlWrap.[Ch]: rewrite to use the Dialog-based scheme.

View File

@ -1,19 +0,0 @@
/**
* \file ControlBibitem.C
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author John Levon
* \author Angus Leeming
*
* Full author contact details are available in file CREDITS
*/
#include <config.h>
#include "ControlBibitem.h"
ControlBibitem::ControlBibitem(Dialog & d)
: ControlCommand(d, "bibitem")
{}

View File

@ -1,27 +0,0 @@
// -*- C++ -*-
/**
* \file ControlBibitem.h
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author John Levon
* \author Angus Leeming
*
* Full author contact details are available in file CREDITS
*/
#ifndef CONTROLBIBITEM_H
#define CONTROLBIBITEM_H
#include "ControlCommand.h"
/** A controller for Bibitem dialogs.
*/
class ControlBibitem : public ControlCommand {
public:
///
ControlBibitem(Dialog &);
};
#endif // CONTROLBIBITEM_H

View File

@ -34,6 +34,6 @@ void ControlERT::clearParams()
void ControlERT::dispatchParams() void ControlERT::dispatchParams()
{ {
string const lfun = InsetERTMailer::params2string("ert", status_); string const lfun = InsetERTMailer::params2string(status_);
kernel().dispatch(FuncRequest(LFUN_INSET_APPLY, lfun)); kernel().dispatch(FuncRequest(LFUN_INSET_APPLY, lfun));
} }

View File

@ -46,8 +46,7 @@ void ControlExternal::clearParams()
void ControlExternal::dispatchParams() void ControlExternal::dispatchParams()
{ {
InsetExternal::Params p = params(); string const lfun = InsetExternalMailer::params2string(params());
string const lfun = InsetExternalMailer::params2string("external", p);
kernel().dispatch(FuncRequest(LFUN_INSET_APPLY, lfun)); kernel().dispatch(FuncRequest(LFUN_INSET_APPLY, lfun));
} }

View File

@ -36,6 +36,6 @@ void ControlFloat::clearParams()
void ControlFloat::dispatchParams() void ControlFloat::dispatchParams()
{ {
string const lfun = InsetFloatMailer::params2string("float", params()); string const lfun = InsetFloatMailer::params2string(params());
kernel().dispatch(FuncRequest(LFUN_INSET_APPLY, lfun)); kernel().dispatch(FuncRequest(LFUN_INSET_APPLY, lfun));
} }

View File

@ -48,7 +48,7 @@ void ControlInclude::clearParams()
void ControlInclude::dispatchParams() void ControlInclude::dispatchParams()
{ {
InsetInclude::Params p = params(); InsetInclude::Params p = params();
string const lfun = InsetIncludeMailer::params2string("include", p); string const lfun = InsetIncludeMailer::params2string(p);
kernel().dispatch(FuncRequest(LFUN_INSET_APPLY, lfun)); kernel().dispatch(FuncRequest(LFUN_INSET_APPLY, lfun));
} }

View File

@ -1,19 +0,0 @@
/**
* \file ControlIndex.C
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author Angus Leeming
*
* Full author contact details are available in file CREDITS
*/
#include <config.h>
#include "ControlIndex.h"
ControlIndex::ControlIndex(Dialog & d)
: ControlCommand(d, "index")
{}

View File

@ -1,26 +0,0 @@
// -*- C++ -*-
/**
* \file ControlIndex.h
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author Angus Leeming
*
* Full author contact details are available in file CREDITS
*/
#ifndef CONTROLINDEX_H
#define CONTROLINDEX_H
#include "ControlCommand.h"
/** A controller for Index dialogs.
*/
class ControlIndex : public ControlCommand {
public:
///
ControlIndex(Dialog &);
};
#endif // CONTROLINDEX_H

View File

@ -1,19 +0,0 @@
/**
* \file ControlLabel.C
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author Angus Leeming
*
* Full author contact details are available in file CREDITS
*/
#include <config.h>
#include "ControlLabel.h"
ControlLabel::ControlLabel(Dialog & d)
: ControlCommand(d, "label")
{}

View File

@ -1,26 +0,0 @@
// -*- C++ -*-
/**
* \file ControlLabel.h
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author Angus Leeming
*
* Full author contact details are available in file CREDITS
*/
#ifndef CONTROLLABEL_H
#define CONTROLLABEL_H
#include "ControlCommand.h"
/** A controller for Label dialogs.
*/
class ControlLabel : public ControlCommand {
public:
///
ControlLabel(Dialog &);
};
#endif // CONTROLLABEL_H

View File

@ -11,53 +11,31 @@
#include <config.h> #include <config.h>
#include "ControlMinipage.h" #include "ControlMinipage.h"
#include "BufferView.h" #include "funcrequest.h"
ControlMinipage::ControlMinipage(LyXView & lv, Dialogs & d) ControlMinipage::ControlMinipage(Dialog & parent)
: ControlInset<InsetMinipage, MinipageParams>(lv, d) : Dialog::Controller(parent)
{} {}
void ControlMinipage::applyParamsToInset() void ControlMinipage::initialiseParams(string const & data)
{ {
inset()->pageWidth(params().pageWidth); InsetMinipage::Params params;
inset()->pos(params().pos); InsetMinipageMailer::string2params(data, params);
params_.reset(new InsetMinipage::Params(params));
bufferview()->updateInset(inset(), true);
} }
void ControlMinipage::applyParamsNoInset() void ControlMinipage::clearParams()
{ {
params_.reset();
} }
MinipageParams const ControlMinipage::getParams(InsetMinipage const & inset) void ControlMinipage::dispatchParams()
{ {
return MinipageParams(inset); string const lfun = InsetMinipageMailer::params2string(params());
} kernel().dispatch(FuncRequest(LFUN_INSET_APPLY, lfun));
MinipageParams::MinipageParams()
: pos(InsetMinipage::top)
{}
MinipageParams::MinipageParams(InsetMinipage const & inset)
: pageWidth(inset.pageWidth()), pos(inset.pos())
{}
bool operator==(MinipageParams const & p1, MinipageParams const & p2)
{
return (p1.pageWidth == p2.pageWidth && p1.pos == p2.pos);
}
bool operator!=(MinipageParams const & p1, MinipageParams const & p2)
{
return !(p1 == p2);
} }

View File

@ -13,49 +13,28 @@
#ifndef CONTROLMINIPAGE_H #ifndef CONTROLMINIPAGE_H
#define CONTROLMINIPAGE_H #define CONTROLMINIPAGE_H
#include <vector> #include "Dialog.h"
#include "insets/insetminipage.h"
class ControlMinipage : public Dialog::Controller {
#include "ControlInset.h"
#include "insets/insetminipage.h" // InsetMinipage::Position
/** This should be moved back into insetminipage.h and InsetMinipage should
contain an instance of it. */
struct MinipageParams {
///
MinipageParams();
///
MinipageParams(InsetMinipage const &);
///
LyXLength pageWidth;
///
InsetMinipage::Position pos;
};
///
bool operator==(MinipageParams const &, MinipageParams const &);
///
bool operator!=(MinipageParams const &, MinipageParams const &);
/** A controller for Minipage dialogs.
*/
class ControlMinipage : public ControlInset<InsetMinipage, MinipageParams> {
public: public:
/// ///
ControlMinipage(LyXView &, Dialogs &); ControlMinipage(Dialog &);
private:
/// Dispatch the changed parameters to the kernel.
virtual void applyParamsToInset();
/// ///
virtual void applyParamsNoInset(); virtual void initialiseParams(string const & data);
/// get the parameters from the string passed to createInset. /// clean-up on hide.
virtual MinipageParams const getParams(string const &) virtual void clearParams();
{ return MinipageParams(); } /// clean-up on hide.
/// get the parameters from the inset passed to showInset. virtual void dispatchParams();
virtual MinipageParams const getParams(InsetMinipage const &); ///
virtual bool isBufferDependent() const { return true; }
///
InsetMinipage::Params & params() { return *params_.get(); }
///
InsetMinipage::Params const & params() const { return *params_.get(); }
private:
///
boost::scoped_ptr<InsetMinipage::Params> params_;
}; };
#endif #endif

View File

@ -1,19 +0,0 @@
/**
* \file ControlUrl.C
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author Angus Leeming
*
* Full author contact details are available in file CREDITS
*/
#include <config.h>
#include "ControlUrl.h"
ControlUrl::ControlUrl(Dialog & d)
: ControlCommand(d, "url")
{}

View File

@ -1,27 +0,0 @@
// -*- C++ -*-
/**
* \file ControlUrl.h
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author Angus Leeming
*
* Full author contact details are available in file CREDITS
*/
#ifndef CONTROLURL_H
#define CONTROLURL_H
#include "ControlCommand.h"
/** A controller for the Url Dialog.
*/
class ControlUrl : public ControlCommand
{
public:
///
ControlUrl(Dialog &);
};
#endif // CONTROLURL_H

View File

@ -37,6 +37,6 @@ void ControlWrap::clearParams()
void ControlWrap::dispatchParams() void ControlWrap::dispatchParams()
{ {
string const lfun = InsetWrapMailer::params2string("wrap", params()); string const lfun = InsetWrapMailer::params2string(params());
kernel().dispatch(FuncRequest(LFUN_INSET_APPLY, lfun)); kernel().dispatch(FuncRequest(LFUN_INSET_APPLY, lfun));
} }

View File

@ -27,8 +27,6 @@ libcontrollers_la_SOURCES= \
ButtonPolicies.h \ ButtonPolicies.h \
ControlAboutlyx.C \ ControlAboutlyx.C \
ControlAboutlyx.h \ ControlAboutlyx.h \
ControlBibitem.C \
ControlBibitem.h \
ControlBibtex.C \ ControlBibtex.C \
ControlBibtex.h \ ControlBibtex.h \
ControlButtons.C \ ControlButtons.C \
@ -64,11 +62,7 @@ libcontrollers_la_SOURCES= \
ControlGraphics.h \ ControlGraphics.h \
ControlInclude.C \ ControlInclude.C \
ControlInclude.h \ ControlInclude.h \
ControlIndex.C \
ControlIndex.h \
ControlInset.h \ ControlInset.h \
ControlLabel.C \
ControlLabel.h \
ControlLog.C \ ControlLog.C \
ControlLog.h \ ControlLog.h \
ControlMath.C \ ControlMath.C \
@ -103,8 +97,6 @@ libcontrollers_la_SOURCES= \
ControlThesaurus.h \ ControlThesaurus.h \
ControlToc.C \ ControlToc.C \
ControlToc.h \ ControlToc.h \
ControlUrl.C \
ControlUrl.h \
ControlVCLog.C \ ControlVCLog.C \
ControlVCLog.h \ ControlVCLog.h \
ControlWrap.C \ ControlWrap.C \

View File

@ -75,18 +75,6 @@ void gui_ShowMathPanel(Dialogs & d)
} }
void gui_ShowMinipage(InsetMinipage * im, Dialogs & d)
{
d.showMinipage(im);
}
void gui_UpdateMinipage(InsetMinipage * im, Dialogs & d)
{
d.updateMinipage(im);
}
void gui_ShowParagraph(Dialogs & d) void gui_ShowParagraph(Dialogs & d)
{ {
d.showParagraph(); d.showParagraph();

View File

@ -17,7 +17,6 @@
class Dialogs; class Dialogs;
class InsetGraphics; class InsetGraphics;
class InsetMinipage;
class InsetTabular; class InsetTabular;
extern "C" { extern "C" {
@ -33,8 +32,6 @@ void gui_ShowForks(Dialogs &);
void gui_ShowGraphics(InsetGraphics *, Dialogs &); void gui_ShowGraphics(InsetGraphics *, Dialogs &);
void gui_ShowLogFile(Dialogs &); void gui_ShowLogFile(Dialogs &);
void gui_ShowMathPanel(Dialogs &); void gui_ShowMathPanel(Dialogs &);
void gui_ShowMinipage(InsetMinipage *, Dialogs &);
void gui_UpdateMinipage(InsetMinipage *, Dialogs &);
void gui_ShowParagraph(Dialogs &); void gui_ShowParagraph(Dialogs &);
void gui_UpdateParagraph(Dialogs &); void gui_UpdateParagraph(Dialogs &);
void gui_ShowPreamble(Dialogs &); void gui_ShowPreamble(Dialogs &);

View File

@ -1,3 +1,20 @@
2003-03-07 Angus Leeming <leeming@lyx.org>
* Dialogs.C:
* Dialogs2.C:
* Dialogs_impl.h: remove minipage dialog.
* Dialogs3.C: add minipage dialog. No longer use the bibitem, include,
label or url controllers; use ControlCommand instead.
* QBibitem.[Ch]:
* QIndex.[Ch]:
* QURL.[Ch]: changes due to use of ControlCommand, above
* QBibitemDialog.C: no need to include controller.
* QMinipage.[Ch]: changes to use the new Dialog-based scheme.
2003-03-06 Alfredo Braunstein <abraunst@libero.it> 2003-03-06 Alfredo Braunstein <abraunst@libero.it>
* qscreen.C: use LyXText::top_y() instead of LyXText::first_y * qscreen.C: use LyXText::top_y() instead of LyXText::first_y

View File

@ -33,7 +33,6 @@ Dialogs::Impl::Impl(LyXView & lv, Dialogs & d)
file(lv, d), file(lv, d),
graphics(lv, d), graphics(lv, d),
logfile(lv, d), logfile(lv, d),
minipage(lv, d),
paragraph(lv, d), paragraph(lv, d),
prefs(lv, d), prefs(lv, d),
print(lv, d), print(lv, d),

View File

@ -76,18 +76,6 @@ void Dialogs::showMathPanel()
} }
void Dialogs::showMinipage(InsetMinipage * im)
{
pimpl_->minipage.controller().showInset(im);
}
void Dialogs::updateMinipage(InsetMinipage * im)
{
pimpl_->minipage.controller().showInset(im);
}
void Dialogs::showParagraph() void Dialogs::showParagraph()
{ {
pimpl_->paragraph.controller().show(); pimpl_->paragraph.controller().show();

View File

@ -13,7 +13,6 @@
#include "Dialogs.h" #include "Dialogs.h"
#include "Dialog.h" #include "Dialog.h"
#include "ControlBibitem.h"
#include "ControlBibtex.h" #include "ControlBibtex.h"
#include "ControlCitation.h" #include "ControlCitation.h"
#include "ControlError.h" #include "ControlError.h"
@ -21,11 +20,9 @@
#include "ControlExternal.h" #include "ControlExternal.h"
#include "ControlFloat.h" #include "ControlFloat.h"
#include "ControlInclude.h" #include "ControlInclude.h"
#include "ControlIndex.h" #include "ControlMinipage.h"
#include "ControlLabel.h"
#include "ControlRef.h" #include "ControlRef.h"
#include "ControlToc.h" #include "ControlToc.h"
#include "ControlUrl.h"
#include "ControlWrap.h" #include "ControlWrap.h"
#include "QBibitem.h" #include "QBibitem.h"
@ -50,6 +47,8 @@
#include "QIncludeDialog.h" #include "QIncludeDialog.h"
#include "QIndex.h" #include "QIndex.h"
#include "QIndexDialog.h" #include "QIndexDialog.h"
#include "QMinipage.h"
#include "QMinipageDialog.h"
#include "QRef.h" #include "QRef.h"
#include "QRefDialog.h" #include "QRefDialog.h"
#include "QToc.h" #include "QToc.h"
@ -80,8 +79,8 @@ namespace {
char const * const dialognames[] = { "bibitem", "bibtex", "citation", char const * const dialognames[] = { "bibitem", "bibtex", "citation",
"error", "ert", "external", "float", "error", "ert", "external", "float",
"include", "index", "label", "ref", "include", "index", "label", "minipage",
"toc", "url", "wrap" }; "ref", "toc", "url", "wrap" };
char const * const * const end_dialognames = char const * const * const end_dialognames =
dialognames + (sizeof(dialognames) / sizeof(char *)); dialognames + (sizeof(dialognames) / sizeof(char *));
@ -114,7 +113,7 @@ Dialog * Dialogs::build(string const & name)
Dialog * dialog = new Dialog(lyxview_, name); Dialog * dialog = new Dialog(lyxview_, name);
if (name == "bibitem") { if (name == "bibitem") {
dialog->setController(new ControlBibitem(*dialog)); dialog->setController(new ControlCommand(*dialog, name));
dialog->setView(new QBibitem(*dialog)); dialog->setView(new QBibitem(*dialog));
dialog->setButtonController(new OkCancelReadOnlyBC); dialog->setButtonController(new OkCancelReadOnlyBC);
} else if (name == "bibtex") { } else if (name == "bibtex") {
@ -146,17 +145,21 @@ Dialog * Dialogs::build(string const & name)
dialog->setView(new QInclude(*dialog)); dialog->setView(new QInclude(*dialog));
dialog->setButtonController(new OkApplyCancelReadOnlyBC); dialog->setButtonController(new OkApplyCancelReadOnlyBC);
} else if (name == "index") { } else if (name == "index") {
dialog->setController(new ControlIndex(*dialog)); dialog->setController(new ControlCommand(*dialog, name));
dialog->setView(new QIndex(*dialog, dialog->setView(new QIndex(*dialog,
qt_("LyX: Insert Index Entry"), qt_("LyX: Insert Index Entry"),
qt_("&Keyword"))); qt_("&Keyword")));
dialog->setButtonController(new NoRepeatedApplyReadOnlyBC); dialog->setButtonController(new NoRepeatedApplyReadOnlyBC);
} else if (name == "label") { } else if (name == "label") {
dialog->setController(new ControlLabel(*dialog)); dialog->setController(new ControlCommand(*dialog, name));
dialog->setView(new QIndex(*dialog, dialog->setView(new QIndex(*dialog,
qt_("LyX: Insert Label"), qt_("LyX: Insert Label"),
qt_("&Label"))); qt_("&Label")));
dialog->setButtonController(new NoRepeatedApplyReadOnlyBC); dialog->setButtonController(new NoRepeatedApplyReadOnlyBC);
} else if (name == "minipage") {
dialog->setController(new ControlMinipage(*dialog));
dialog->setView(new QMinipage(*dialog));
dialog->setButtonController(new NoRepeatedApplyReadOnlyBC);
} else if (name == "ref") { } else if (name == "ref") {
dialog->setController(new ControlRef(*dialog)); dialog->setController(new ControlRef(*dialog));
dialog->setView(new QRef(*dialog)); dialog->setView(new QRef(*dialog));
@ -166,7 +169,7 @@ Dialog * Dialogs::build(string const & name)
dialog->setView(new QToc(*dialog)); dialog->setView(new QToc(*dialog));
dialog->setButtonController(new OkCancelBC); dialog->setButtonController(new OkCancelBC);
} else if (name == "url") { } else if (name == "url") {
dialog->setController(new ControlUrl(*dialog)); dialog->setController(new ControlCommand(*dialog, name));
dialog->setView(new QURL(*dialog)); dialog->setView(new QURL(*dialog));
dialog->setButtonController(new NoRepeatedApplyReadOnlyBC); dialog->setButtonController(new NoRepeatedApplyReadOnlyBC);
} else if (name == "wrap") { } else if (name == "wrap") {

View File

@ -22,7 +22,6 @@
#include "ControlGraphics.h" #include "ControlGraphics.h"
#include "insets/insetgraphicsParams.h" #include "insets/insetgraphicsParams.h"
#include "ControlLog.h" #include "ControlLog.h"
#include "ControlMinipage.h"
#include "ControlParagraph.h" #include "ControlParagraph.h"
#include "ControlPrefs.h" #include "ControlPrefs.h"
#include "ControlPrint.h" #include "ControlPrint.h"
@ -52,8 +51,6 @@
#include "QGraphicsDialog.h" #include "QGraphicsDialog.h"
#include "QLog.h" #include "QLog.h"
#include "QLogDialog.h" #include "QLogDialog.h"
#include "QMinipage.h"
#include "QMinipageDialog.h"
#include "QParagraph.h" #include "QParagraph.h"
#include "QParagraphDialog.h" #include "QParagraphDialog.h"
#include "QPrefs.h" #include "QPrefs.h"
@ -109,9 +106,6 @@ GraphicsDialog;
typedef GUI<ControlLog, QLog, OkCancelPolicy, Qt2BC> typedef GUI<ControlLog, QLog, OkCancelPolicy, Qt2BC>
LogFileDialog; LogFileDialog;
typedef GUI<ControlMinipage, QMinipage, NoRepeatedApplyReadOnlyPolicy, Qt2BC>
MinipageDialog;
typedef GUI<ControlParagraph, QParagraph, OkApplyCancelReadOnlyPolicy, Qt2BC> typedef GUI<ControlParagraph, QParagraph, OkApplyCancelReadOnlyPolicy, Qt2BC>
ParagraphDialog; ParagraphDialog;
@ -158,7 +152,6 @@ struct Dialogs::Impl {
FileDialog file; FileDialog file;
GraphicsDialog graphics; GraphicsDialog graphics;
LogFileDialog logfile; LogFileDialog logfile;
MinipageDialog minipage;
ParagraphDialog paragraph; ParagraphDialog paragraph;
PrefsDialog prefs; PrefsDialog prefs;
PrintDialog print; PrintDialog print;

View File

@ -13,7 +13,7 @@
#include "support/lstrings.h" #include "support/lstrings.h"
#include "ControlBibitem.h" #include "ControlCommand.h"
#include "qt_helpers.h" #include "qt_helpers.h"
#include "debug.h" #include "debug.h"
@ -24,7 +24,7 @@
#include "QBibitem.h" #include "QBibitem.h"
#include "Qt2BC.h" #include "Qt2BC.h"
typedef QController<ControlBibitem, QView<QBibitemDialog> > base_class; typedef QController<ControlCommand, QView<QBibitemDialog> > base_class;
QBibitem::QBibitem(Dialog & parent) QBibitem::QBibitem(Dialog & parent)

View File

@ -15,11 +15,11 @@
#include "QDialogView.h" #include "QDialogView.h"
class ControlBibitem; class ControlCommand;
class QBibitemDialog; class QBibitemDialog;
class QBibitem class QBibitem
: public QController<ControlBibitem, QView<QBibitemDialog> > : public QController<ControlCommand, QView<QBibitemDialog> >
{ {
public: public:
friend class QBibitemDialog; friend class QBibitemDialog;

View File

@ -10,9 +10,6 @@
#include <config.h> #include <config.h>
#include "ControlBibitem.h"
#include <qpushbutton.h> #include <qpushbutton.h>
#include <qlineedit.h> #include <qlineedit.h>

View File

@ -11,7 +11,7 @@
#include <config.h> #include <config.h>
#include "ControlIndex.h" #include "ControlCommand.h"
#include "qt_helpers.h" #include "qt_helpers.h"
#include "QIndexDialog.h" #include "QIndexDialog.h"

View File

@ -26,11 +26,11 @@
#include <qcombobox.h> #include <qcombobox.h>
#include <qlineedit.h> #include <qlineedit.h>
typedef Qt2CB<ControlMinipage, Qt2DB<QMinipageDialog> > base_class; typedef QController<ControlMinipage, QView<QMinipageDialog> > base_class;
QMinipage::QMinipage() QMinipage::QMinipage(Dialog & parent)
: base_class(qt_("LyX: Minipage Settings")) : base_class(parent, qt_("LyX: Minipage Settings"))
{ {
} }
@ -57,9 +57,9 @@ void QMinipage::apply()
if (dialog_->widthED->text().isEmpty()) if (dialog_->widthED->text().isEmpty())
unit = LyXLength::UNIT_NONE; unit = LyXLength::UNIT_NONE;
MinipageParams & params = controller().params(); InsetMinipage::Params & params = controller().params();
params.pageWidth = LyXLength(value, unit); params.width = LyXLength(value, unit);
switch (dialog_->valignCO->currentItem()) { switch (dialog_->valignCO->currentItem()) {
case 0: case 0:
@ -90,9 +90,9 @@ string const numtostr(double val)
void QMinipage::update_contents() void QMinipage::update_contents()
{ {
MinipageParams const & params = controller().params(); InsetMinipage::Params const & params = controller().params();
LyXLength len(params.pageWidth); LyXLength len(params.width);
dialog_->widthED->setText(toqstr(numtostr(len.value()))); dialog_->widthED->setText(toqstr(numtostr(len.value())));
dialog_->unitsLC->setCurrentItem(len.unit()); dialog_->unitsLC->setCurrentItem(len.unit());
lyxerr << "width " << numtostr(len.value()) lyxerr << "width " << numtostr(len.value())

View File

@ -13,20 +13,21 @@
#define QMINIPAGE_H #define QMINIPAGE_H
#include "Qt2Base.h" #include "QDialogView.h"
class ControlMinipage; class ControlMinipage;
class QMinipageDialog; class QMinipageDialog;
/// ///
class QMinipage class QMinipage
: public Qt2CB<ControlMinipage, Qt2DB<QMinipageDialog> > : public QController<ControlMinipage, QView<QMinipageDialog> >
{ {
public: public:
/// ///
friend class QMinipageDialog; friend class QMinipageDialog;
/// ///
QMinipage(); QMinipage(Dialog &);
private: private:
/// Apply changes /// Apply changes
virtual void apply(); virtual void apply();

View File

@ -10,8 +10,7 @@
#include <config.h> #include <config.h>
#include "ControlCommand.h"
#include "ControlUrl.h"
#include "debug.h" #include "debug.h"
#include "qt_helpers.h" #include "qt_helpers.h"
@ -23,8 +22,7 @@
#include <qpushbutton.h> #include <qpushbutton.h>
#include <qlineedit.h> #include <qlineedit.h>
typedef QController<ControlUrl, QView<QURLDialog> > base_class; typedef QController<ControlCommand, QView<QURLDialog> > base_class;
QURL::QURL(Dialog & parent) QURL::QURL(Dialog & parent)
: base_class(parent, qt_("LyX: Insert URL")) : base_class(parent, qt_("LyX: Insert URL"))

View File

@ -15,12 +15,12 @@
#include "QDialogView.h" #include "QDialogView.h"
class ControlUrl; class ControlCommand;
class QURLDialog; class QURLDialog;
class QURL : class QURL :
public QController<ControlUrl, QView<QURLDialog> > public QController<ControlCommand, QView<QURLDialog> >
{ {
public: public:
friend class QURLDialog; friend class QURLDialog;

View File

@ -1,3 +1,18 @@
2003-03-07 Angus Leeming <leeming@lyx.org>
* Dialogs.C:
* Dialogs2.C:
* Dialogs_impl.h: remove minipage dialog.
* Dialogs3.C: add minipage dialog. No longer use the bibitem, include,
label or url controllers; use ControlCommand instead.
* FormBibitem.[Ch]:
* FormIndex.[Ch]: changes due to use of ControlCommand, above
* FormMinipage.[Ch]:
* forms/form_minipage.fd: changes to use the new Dialog-based scheme.
2003-03-06 Alfredo Braunstein <abraunst@libero.it> 2003-03-06 Alfredo Braunstein <abraunst@libero.it>
* xscreen.C: use LyXText::top_y() instead of LyXText::first_y * xscreen.C: use LyXText::top_y() instead of LyXText::first_y

View File

@ -35,7 +35,6 @@ Dialogs::Impl::Impl(LyXView & lv, Dialogs & d)
graphics(lv, d), graphics(lv, d),
logfile(lv, d), logfile(lv, d),
mathpanel(lv, d), mathpanel(lv, d),
minipage(lv, d),
paragraph(lv, d), paragraph(lv, d),
preamble(lv, d), preamble(lv, d),
preferences(lv, d), preferences(lv, d),

View File

@ -75,18 +75,6 @@ void Dialogs::showMathPanel()
} }
void Dialogs::showMinipage(InsetMinipage * im)
{
pimpl_->minipage.controller().showInset(im);
}
void Dialogs::updateMinipage(InsetMinipage * im)
{
pimpl_->minipage.controller().showInset(im);
}
void Dialogs::showParagraph() void Dialogs::showParagraph()
{ {
pimpl_->paragraph.controller().show(); pimpl_->paragraph.controller().show();

View File

@ -15,57 +15,45 @@
#include "Tooltips.h" #include "Tooltips.h"
#include "ControlBibitem.h" #include "ControlBibtex.h"
#include "ControlCitation.h"
#include "ControlCommand.h"
#include "ControlError.h"
#include "ControlERT.h"
#include "ControlExternal.h"
#include "ControlFloat.h"
#include "ControlInclude.h"
#include "ControlMinipage.h"
#include "ControlRef.h"
#include "ControlToc.h"
#include "ControlWrap.h"
#include "FormBibitem.h" #include "FormBibitem.h"
#include "forms/form_bibitem.h" #include "forms/form_bibitem.h"
#include "ControlBibtex.h"
#include "FormBibtex.h" #include "FormBibtex.h"
#include "forms/form_bibtex.h" #include "forms/form_bibtex.h"
#include "ControlCitation.h"
#include "FormCitation.h" #include "FormCitation.h"
#include "forms/form_citation.h" #include "forms/form_citation.h"
#include "ControlError.h"
#include "FormError.h" #include "FormError.h"
#include "forms/form_error.h" #include "forms/form_error.h"
#include "ControlERT.h"
#include "FormERT.h" #include "FormERT.h"
#include "forms/form_ert.h" #include "forms/form_ert.h"
#include "ControlExternal.h"
#include "FormExternal.h" #include "FormExternal.h"
#include "forms/form_external.h" #include "forms/form_external.h"
#include "ControlFloat.h"
#include "FormFloat.h" #include "FormFloat.h"
#include "forms/form_float.h" #include "forms/form_float.h"
#include "ControlInclude.h"
#include "FormInclude.h" #include "FormInclude.h"
#include "forms/form_include.h" #include "forms/form_include.h"
#include "FormMinipage.h"
#include "ControlIndex.h" #include "forms/form_minipage.h"
#include "ControlLabel.h"
#include "FormText.h"
#include "forms/form_text.h"
#include "ControlRef.h"
#include "FormRef.h" #include "FormRef.h"
#include "forms/form_ref.h" #include "forms/form_ref.h"
#include "FormText.h"
#include "ControlToc.h" #include "forms/form_text.h"
#include "FormToc.h" #include "FormToc.h"
#include "forms/form_toc.h" #include "forms/form_toc.h"
#include "ControlUrl.h"
#include "FormUrl.h" #include "FormUrl.h"
#include "forms/form_url.h" #include "forms/form_url.h"
#include "ControlWrap.h"
#include "FormWrap.h" #include "FormWrap.h"
#include "forms/form_wrap.h" #include "forms/form_wrap.h"
@ -95,8 +83,8 @@ namespace {
// "url", "wrap" }; // "url", "wrap" };
char const * const dialognames[] = { "bibitem", "bibtex", "citation", char const * const dialognames[] = { "bibitem", "bibtex", "citation",
"error", "ert", "external", "float", "error", "ert", "external", "float",
"include", "index", "label", "ref", "include", "index", "label", "minipage",
"toc", "url", "wrap" }; "ref", "toc", "url", "wrap" };
char const * const * const end_dialognames = char const * const * const end_dialognames =
dialognames + (sizeof(dialognames) / sizeof(char *)); dialognames + (sizeof(dialognames) / sizeof(char *));
@ -129,7 +117,7 @@ Dialog * Dialogs::build(string const & name)
Dialog * dialog = new Dialog(lyxview_, name); Dialog * dialog = new Dialog(lyxview_, name);
if (name == "bibitem") { if (name == "bibitem") {
dialog->setController(new ControlBibitem(*dialog)); dialog->setController(new ControlCommand(*dialog, name));
dialog->setView(new FormBibitem(*dialog)); dialog->setView(new FormBibitem(*dialog));
dialog->setButtonController(new OkCancelReadOnlyBC); dialog->setButtonController(new OkCancelReadOnlyBC);
} else if (name == "bibtex") { } else if (name == "bibtex") {
@ -161,15 +149,19 @@ Dialog * Dialogs::build(string const & name)
dialog->setView(new FormInclude(*dialog)); dialog->setView(new FormInclude(*dialog));
dialog->setButtonController(new OkApplyCancelReadOnlyBC); dialog->setButtonController(new OkApplyCancelReadOnlyBC);
} else if (name == "index") { } else if (name == "index") {
dialog->setController(new ControlIndex(*dialog)); dialog->setController(new ControlCommand(*dialog, name));
dialog->setView(new FormText(*dialog, dialog->setView(new FormText(*dialog,
_("Index"), _("Keyword:|#K"))); _("Index"), _("Keyword:|#K")));
dialog->setButtonController(new NoRepeatedApplyReadOnlyBC); dialog->setButtonController(new NoRepeatedApplyReadOnlyBC);
} else if (name == "label") { } else if (name == "label") {
dialog->setController(new ControlLabel(*dialog)); dialog->setController(new ControlCommand(*dialog, name));
dialog->setView(new FormText(*dialog, dialog->setView(new FormText(*dialog,
_("Label"), _("Label:|#L"))); _("Label"), _("Label:|#L")));
dialog->setButtonController(new NoRepeatedApplyReadOnlyBC); dialog->setButtonController(new NoRepeatedApplyReadOnlyBC);
} else if (name == "minipage") {
dialog->setController(new ControlMinipage(*dialog));
dialog->setView(new FormMinipage(*dialog));
dialog->setButtonController(new NoRepeatedApplyReadOnlyBC);
} else if (name == "ref") { } else if (name == "ref") {
dialog->setController(new ControlRef(*dialog)); dialog->setController(new ControlRef(*dialog));
dialog->setView(new FormRef(*dialog)); dialog->setView(new FormRef(*dialog));
@ -179,7 +171,7 @@ Dialog * Dialogs::build(string const & name)
dialog->setView(new FormToc(*dialog)); dialog->setView(new FormToc(*dialog));
dialog->setButtonController(new OkCancelBC); dialog->setButtonController(new OkCancelBC);
} else if (name == "url") { } else if (name == "url") {
dialog->setController(new ControlUrl(*dialog)); dialog->setController(new ControlCommand(*dialog, name));
dialog->setView(new FormUrl(*dialog)); dialog->setView(new FormUrl(*dialog));
dialog->setButtonController(new NoRepeatedApplyReadOnlyBC); dialog->setButtonController(new NoRepeatedApplyReadOnlyBC);
} else if (name == "wrap") { } else if (name == "wrap") {

View File

@ -55,10 +55,6 @@
#include "FormMathsPanel.h" #include "FormMathsPanel.h"
#include "forms/form_maths_panel.h" #include "forms/form_maths_panel.h"
#include "ControlMinipage.h"
#include "FormMinipage.h"
#include "forms/form_minipage.h"
#include "ControlParagraph.h" #include "ControlParagraph.h"
#include "FormParagraph.h" #include "FormParagraph.h"
#include "forms/form_paragraph.h" #include "forms/form_paragraph.h"
@ -135,9 +131,6 @@ LogFileDialog;
typedef GUI<ControlMath, FormMathsPanel, OkCancelReadOnlyPolicy, xformsBC> typedef GUI<ControlMath, FormMathsPanel, OkCancelReadOnlyPolicy, xformsBC>
MathPanelDialog; MathPanelDialog;
typedef GUI<ControlMinipage, FormMinipage, NoRepeatedApplyReadOnlyPolicy, xformsBC>
MinipageDialog;
typedef GUI<ControlParagraph, FormParagraph, OkApplyCancelReadOnlyPolicy, xformsBC> typedef GUI<ControlParagraph, FormParagraph, OkApplyCancelReadOnlyPolicy, xformsBC>
ParagraphDialog; ParagraphDialog;
@ -188,7 +181,6 @@ struct Dialogs::Impl {
GraphicsDialog graphics; GraphicsDialog graphics;
LogFileDialog logfile; LogFileDialog logfile;
MathPanelDialog mathpanel; MathPanelDialog mathpanel;
MinipageDialog minipage;
ParagraphDialog paragraph; ParagraphDialog paragraph;
PreambleDialog preamble; PreambleDialog preamble;
PreferencesDialog preferences; PreferencesDialog preferences;

View File

@ -12,7 +12,7 @@
#include <config.h> #include <config.h>
#include "xformsBC.h" #include "xformsBC.h"
#include "ControlBibitem.h" #include "ControlCommand.h"
#include "FormBibitem.h" #include "FormBibitem.h"
#include "Tooltips.h" #include "Tooltips.h"
#include "forms/form_bibitem.h" #include "forms/form_bibitem.h"
@ -20,7 +20,7 @@
#include "gettext.h" #include "gettext.h"
#include "support/lstrings.h" // compare #include "support/lstrings.h" // compare
typedef FormController<ControlBibitem, FormView<FD_bibitem> > base_class; typedef FormController<ControlCommand, FormView<FD_bibitem> > base_class;
FormBibitem::FormBibitem(Dialog & parent) FormBibitem::FormBibitem(Dialog & parent)
: base_class(parent, _("Bibliography Entry")) : base_class(parent, _("Bibliography Entry"))

View File

@ -16,13 +16,13 @@
#include "FormDialogView.h" #include "FormDialogView.h"
class ControlBibitem; class ControlCommand;
struct FD_bibitem; struct FD_bibitem;
/** /**
* For bibliography entry editing * For bibliography entry editing
*/ */
class FormBibitem : public FormController<ControlBibitem, FormView<FD_bibitem> > { class FormBibitem : public FormController<ControlCommand, FormView<FD_bibitem> > {
public: public:
/// ///
FormBibitem(Dialog &); FormBibitem(Dialog &);

View File

@ -21,10 +21,10 @@
#include "xforms_helpers.h" #include "xforms_helpers.h"
#include FORMS_H_LOCATION #include FORMS_H_LOCATION
typedef FormCB<ControlMinipage, FormDB<FD_minipage> > base_class; typedef FormController<ControlMinipage, FormView<FD_minipage> > base_class;
FormMinipage::FormMinipage() FormMinipage::FormMinipage(Dialog & parent)
: base_class(_("Minipage Options")) : base_class(parent, _("Minipage Options"))
{} {}
@ -57,7 +57,7 @@ void FormMinipage::build()
void FormMinipage::apply() void FormMinipage::apply()
{ {
controller().params().pageWidth = controller().params().width =
LyXLength(getLengthFromWidgets(dialog_->input_width, LyXLength(getLengthFromWidgets(dialog_->input_width,
dialog_->choice_width_units)); dialog_->choice_width_units));
@ -72,7 +72,7 @@ void FormMinipage::apply()
void FormMinipage::update() void FormMinipage::update()
{ {
LyXLength len(controller().params().pageWidth); LyXLength len(controller().params().width);
fl_set_input(dialog_->input_width, tostr(len.value()).c_str()); fl_set_input(dialog_->input_width, tostr(len.value()).c_str());
fl_set_choice(dialog_->choice_width_units, len.unit() + 1); fl_set_choice(dialog_->choice_width_units, len.unit() + 1);

View File

@ -12,8 +12,7 @@
#ifndef FORMMINIPAGE_H #ifndef FORMMINIPAGE_H
#define FORMMINIPAGE_H #define FORMMINIPAGE_H
#include "FormDialogView.h"
#include "FormBase.h"
class ControlMinipage; class ControlMinipage;
struct FD_minipage; struct FD_minipage;
@ -22,10 +21,10 @@ struct FD_minipage;
Dialog. Dialog.
*/ */
class FormMinipage class FormMinipage
: public FormCB<ControlMinipage, FormDB<FD_minipage> > { : public FormController<ControlMinipage, FormView<FD_minipage> > {
public: public:
/// ///
FormMinipage(); FormMinipage(Dialog &);
private: private:
/// Set the Params variable for the Controller. /// Set the Params variable for the Controller.
virtual void apply(); virtual void apply();

View File

@ -13,12 +13,12 @@
#include "xformsBC.h" #include "xformsBC.h"
#include "ControlUrl.h" #include "ControlCommand.h"
#include "FormUrl.h" #include "FormUrl.h"
#include "forms/form_url.h" #include "forms/form_url.h"
#include FORMS_H_LOCATION #include FORMS_H_LOCATION
typedef FormController<ControlUrl, FormView<FD_url> > base_class; typedef FormController<ControlCommand, FormView<FD_url> > base_class;
FormUrl::FormUrl(Dialog & parent) FormUrl::FormUrl(Dialog & parent)
: base_class(parent, _("Url")) : base_class(parent, _("Url"))

View File

@ -15,12 +15,12 @@
#include "FormDialogView.h" #include "FormDialogView.h"
class ControlUrl; class ControlCommand;
struct FD_url; struct FD_url;
/** This class provides an XForms implementation of the Url Dialog. /** This class provides an XForms implementation of the Url Dialog.
*/ */
class FormUrl : public FormController<ControlUrl, FormView<FD_url> > { class FormUrl : public FormController<ControlCommand, FormView<FD_url> > {
public: public:
/// ///
FormUrl(Dialog &); FormUrl(Dialog &);

View File

@ -81,7 +81,7 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: input_width name: input_width
callback: C_FormBaseInputCB callback: C_FormDialogView_InputCB
argument: 0 argument: 0
-------------------- --------------------
@ -99,7 +99,7 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: choice_width_units name: choice_width_units
callback: C_FormBaseInputCB callback: C_FormDialogView_InputCB
argument: 0 argument: 0
-------------------- --------------------
@ -135,7 +135,7 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: radio_top name: radio_top
callback: C_FormBaseInputCB callback: C_FormDialogView_InputCB
argument: 0 argument: 0
-------------------- --------------------
@ -153,7 +153,7 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: radio_middle name: radio_middle
callback: C_FormBaseInputCB callback: C_FormDialogView_InputCB
argument: 0 argument: 0
-------------------- --------------------
@ -171,7 +171,7 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: radio_bottom name: radio_bottom
callback: C_FormBaseInputCB callback: C_FormDialogView_InputCB
argument: 0 argument: 0
-------------------- --------------------
@ -207,7 +207,7 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: button_close name: button_close
callback: C_FormBaseCancelCB callback: C_FormDialogView_CancelCB
argument: 0 argument: 0
-------------------- --------------------
@ -225,7 +225,7 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: button_apply name: button_apply
callback: C_FormBaseApplyCB callback: C_FormDialogView_ApplyCB
argument: 0 argument: 0
-------------------- --------------------
@ -243,7 +243,7 @@ shortcut: ^M
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: button_ok name: button_ok
callback: C_FormBaseOKCB callback: C_FormDialogView_OKCB
argument: 0 argument: 0
-------------------- --------------------
@ -261,7 +261,7 @@ shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: button_restore name: button_restore
callback: C_FormBaseRestoreCB callback: C_FormDialogView_RestoreCB
argument: 0 argument: 0
-------------------- --------------------

View File

@ -1,3 +1,20 @@
2003-03-07 Angus Leeming <leeming@lyx.org>
* insetcommand.C (string2params):
* insetexternal.C (string2params):
* insetfloat.C (string2params):
* insetinclude.C (string2params):
* insetwrap.C (string2params): use LyXLeX more.
* insetert.[Ch]:
* insetexternal.[Ch]:
* insetfloat.[Ch]:
* insetinclude.[Ch]:
* insetwrap.[Ch]: change Mailer::name_ to be static.
* insetminipage.[Ch]: define a new class InsetMinipageMailer and use
it to communicate with the frontend dialogs.
2003-03-06 Alfredo Braunstein <abraunst@libero.it> 2003-03-06 Alfredo Braunstein <abraunst@libero.it>
* insettext.C: * insettext.C:

View File

@ -101,16 +101,15 @@ void InsetCommandMailer::string2params(string const & in,
params.setContents(string()); params.setContents(string());
params.setOptions(string()); params.setOptions(string());
string name; istringstream data(in);
string body = split(in, name, ' ');
if (body.empty())
return;
istringstream data(body);
LyXLex lex(0,0); LyXLex lex(0,0);
lex.setStream(data); lex.setStream(data);
if (lex.isOK()) {
lex.next();
string const name = lex.getString();
}
params.read(lex); params.read(lex);
} }

View File

@ -740,14 +740,16 @@ void InsetERT::update(BufferView * bv, LyXFont const & font,
} }
string const InsetERTMailer::name_("ert");
InsetERTMailer::InsetERTMailer(InsetERT & inset) InsetERTMailer::InsetERTMailer(InsetERT & inset)
: name_("ert"), inset_(inset) : inset_(inset)
{} {}
string const InsetERTMailer::inset2string() const string const InsetERTMailer::inset2string() const
{ {
return params2string(name(), inset_.status()); return params2string(inset_.status());
} }
@ -767,7 +769,7 @@ void InsetERTMailer::string2params(string const & in,
string const string const
InsetERTMailer::params2string(string const & name, InsetERT::ERTStatus status) InsetERTMailer::params2string(InsetERT::ERTStatus status)
{ {
return name + ' ' + tostr(status); return name_ + ' ' + tostr(status);
} }

View File

@ -167,11 +167,10 @@ public:
/// ///
static void string2params(string const &, InsetERT::ERTStatus &); static void string2params(string const &, InsetERT::ERTStatus &);
/// ///
static string const params2string(string const & name, static string const params2string(InsetERT::ERTStatus);
InsetERT::ERTStatus);
private: private:
/// ///
string const name_; static string const name_;
/// ///
InsetERT & inset_; InsetERT & inset_;
}; };

View File

@ -360,15 +360,16 @@ bool operator!=(InsetExternal::Params const & left,
} }
string const InsetExternalMailer::name_("external");
InsetExternalMailer::InsetExternalMailer(InsetExternal & inset) InsetExternalMailer::InsetExternalMailer(InsetExternal & inset)
: name_("external"), inset_(inset) : inset_(inset)
{} {}
string const InsetExternalMailer::inset2string() const string const InsetExternalMailer::inset2string() const
{ {
return params2string(inset_.params());
return params2string(name(), inset_.params());
} }
@ -377,21 +378,25 @@ void InsetExternalMailer::string2params(string const & in,
{ {
params = InsetExternal::Params(); params = InsetExternal::Params();
string name; istringstream data(in);
string body = split(in, name, ' '); LyXLex lex(0,0);
lex.setStream(data);
if (name != "external" || body.empty()) if (lex.isOK()) {
return; lex.next();
string const token = lex.getString();
if (token != name_)
return;
}
// This is part of the inset proper that is usually swallowed // This is part of the inset proper that is usually swallowed
// by Buffer::readInset // by Buffer::readInset
body = split(body, name, ' '); if (lex.isOK()) {
if (name != "External") lex.next();
return; string const token = lex.getString();
if (token != "External")
istringstream data(body); return;
LyXLex lex(0,0); }
lex.setStream(data);
InsetExternal inset; InsetExternal inset;
inset.read(0, lex); inset.read(0, lex);
@ -400,13 +405,12 @@ void InsetExternalMailer::string2params(string const & in,
string const string const
InsetExternalMailer::params2string(string const & name, InsetExternalMailer::params2string(InsetExternal::Params const & params)
InsetExternal::Params const & params)
{ {
InsetExternal inset; InsetExternal inset;
inset.setFromParams(params); inset.setFromParams(params);
ostringstream data; ostringstream data;
data << name << ' '; data << name_ << ' ';
inset.write(0, data); inset.write(0, data);
data << "\\end_inset\n"; data << "\\end_inset\n";

View File

@ -143,11 +143,10 @@ public:
/// ///
static void string2params(string const &, InsetExternal::Params &); static void string2params(string const &, InsetExternal::Params &);
/// ///
static string const params2string(string const & name, static string const params2string(InsetExternal::Params const &);
InsetExternal::Params const &);
private: private:
/// ///
string const name_; static string const name_;
/// ///
InsetExternal & inset_; InsetExternal & inset_;
}; };

View File

@ -395,14 +395,16 @@ void InsetFloat::addToToc(toc::TocList & toclist, Buffer const * buf) const
} }
string const InsetFloatMailer::name_("float");
InsetFloatMailer::InsetFloatMailer(InsetFloat & inset) InsetFloatMailer::InsetFloatMailer(InsetFloat & inset)
: name_("float"), inset_(inset) : inset_(inset)
{} {}
string const InsetFloatMailer::inset2string() const string const InsetFloatMailer::inset2string() const
{ {
return params2string(name(), inset_.params()); return params2string(inset_.params());
} }
@ -411,32 +413,35 @@ void InsetFloatMailer::string2params(string const & in,
{ {
params = InsetFloatParams(); params = InsetFloatParams();
string name; istringstream data(in);
string body = split(in, name, ' '); LyXLex lex(0,0);
lex.setStream(data);
if (name != "float" || body.empty()) if (lex.isOK()) {
return; lex.next();
string const token = lex.getString();
if (token != name_)
return;
}
// This is part of the inset proper that is usually swallowed // This is part of the inset proper that is usually swallowed
// by Buffer::readInset // by Buffer::readInset
body = split(body, name, '\n'); if (lex.isOK()) {
if (!prefixIs(name, "Float ")) lex.next();
return; string const token = lex.getString();
if (token != "Float" || !lex.eatLine())
istringstream data(body); return;
LyXLex lex(0,0); }
lex.setStream(data);
params.read(lex); params.read(lex);
} }
string const string const
InsetFloatMailer::params2string(string const & name, InsetFloatMailer::params2string(InsetFloatParams const & params)
InsetFloatParams const & params)
{ {
ostringstream data; ostringstream data;
data << name << ' '; data << name_ << ' ';
params.write(data); params.write(data);
return data.str(); return data.str();

View File

@ -108,11 +108,10 @@ public:
/// ///
static void string2params(string const &, InsetFloatParams &); static void string2params(string const &, InsetFloatParams &);
/// ///
static string const params2string(string const & name, static string const params2string(InsetFloatParams const &);
InsetFloatParams const &);
private: private:
/// ///
string const name_; static string const name_;
/// ///
InsetFloat & inset_; InsetFloat & inset_;
}; };

View File

@ -610,14 +610,16 @@ void InsetInclude::PreviewImpl::restartLoading()
} }
string const InsetIncludeMailer::name_("include");
InsetIncludeMailer::InsetIncludeMailer(InsetInclude & inset) InsetIncludeMailer::InsetIncludeMailer(InsetInclude & inset)
: name_("include"), inset_(inset) : inset_(inset)
{} {}
string const InsetIncludeMailer::inset2string() const string const InsetIncludeMailer::inset2string() const
{ {
return params2string(name(), inset_.params()); return params2string(inset_.params());
} }
@ -626,21 +628,25 @@ void InsetIncludeMailer::string2params(string const & in,
{ {
params = InsetInclude::Params(); params = InsetInclude::Params();
string name; istringstream data(in);
string body = split(in, name, ' '); LyXLex lex(0,0);
lex.setStream(data);
if (name != "include" || body.empty()) if (lex.isOK()) {
return; lex.next();
string const token = lex.getString();
if (token != name_)
return;
}
// This is part of the inset proper that is usually swallowed // This is part of the inset proper that is usually swallowed
// by Buffer::readInset // by Buffer::readInset
body = split(body, name, ' '); if (lex.isOK()) {
if (name != "Include") lex.next();
return; string const token = lex.getString();
if (token != "Include")
istringstream data(body); return;
LyXLex lex(0,0); }
lex.setStream(data);
InsetInclude inset(params); InsetInclude inset(params);
inset.read(0, lex); inset.read(0, lex);
@ -649,13 +655,12 @@ void InsetIncludeMailer::string2params(string const & in,
string const string const
InsetIncludeMailer::params2string(string const & name, InsetIncludeMailer::params2string(InsetInclude::Params const & params)
InsetInclude::Params const & params)
{ {
InsetInclude inset(params); InsetInclude inset(params);
inset.set(params); inset.set(params);
ostringstream data; ostringstream data;
data << name << ' '; data << name_ << ' ';
inset.write(0, data); inset.write(0, data);
data << "\\end_inset\n"; data << "\\end_inset\n";

View File

@ -164,11 +164,10 @@ public:
/// ///
static void string2params(string const &, InsetInclude::Params &); static void string2params(string const &, InsetInclude::Params &);
/// ///
static string const params2string(string const & name, static string const params2string(InsetInclude::Params const &);
InsetInclude::Params const &);
private: private:
/// ///
string const name_; static string const name_;
/// ///
InsetInclude & inset_; InsetInclude & inset_;
}; };

View File

@ -13,18 +13,21 @@
#include "insetminipage.h" #include "insetminipage.h"
#include "insettext.h"
#include "BufferView.h"
#include "debug.h"
#include "funcrequest.h"
#include "gettext.h" #include "gettext.h"
#include "lyxfont.h" #include "lyxfont.h"
#include "BufferView.h" #include "lyxlex.h"
#include "lyxtext.h"
#include "frontends/LyXView.h" #include "frontends/LyXView.h"
#include "frontends/Dialogs.h" #include "frontends/Dialogs.h"
#include "lyxtext.h"
#include "insets/insettext.h"
#include "support/LOstream.h" #include "support/LOstream.h"
#include "support/lstrings.h" #include "support/lstrings.h"
#include "debug.h"
#include "gettext.h"
#include "lyxlex.h"
using std::ostream; using std::ostream;
using std::endl; using std::endl;
@ -59,8 +62,7 @@ using std::endl;
// (Lgb) // (Lgb)
InsetMinipage::InsetMinipage(BufferParams const & bp) InsetMinipage::InsetMinipage(BufferParams const & bp)
: InsetCollapsable(bp), pos_(center), : InsetCollapsable(bp)
inner_pos_(inner_center), width_(100, LyXLength::PCW)
{ {
setLabel(_("minipage")); setLabel(_("minipage"));
LyXFont font(LyXFont::ALL_SANE); LyXFont font(LyXFont::ALL_SANE);
@ -86,9 +88,7 @@ InsetMinipage::InsetMinipage(BufferParams const & bp)
InsetMinipage::InsetMinipage(InsetMinipage const & in, bool same_id) InsetMinipage::InsetMinipage(InsetMinipage const & in, bool same_id)
: InsetCollapsable(in, same_id), : InsetCollapsable(in, same_id), params_(in.params_)
pos_(in.pos_), inner_pos_(in.inner_pos_),
height_(in.height_), width_(in.width_)
{} {}
@ -100,29 +100,53 @@ Inset * InsetMinipage::clone(Buffer const &, bool same_id) const
InsetMinipage::~InsetMinipage() InsetMinipage::~InsetMinipage()
{ {
hideDialog(); InsetMinipageMailer mailer(*this);
mailer.hideDialog();
} }
void InsetMinipage::write(Buffer const * buf, ostream & os) const dispatch_result InsetMinipage::localDispatch(FuncRequest const & cmd)
{ {
os << getInsetName() << '\n' Inset::RESULT result = UNDISPATCHED;
<< "position " << pos_ << '\n'
<< "inner_position " << inner_pos_ << '\n' switch (cmd.action) {
<< "height \"" << height_.asString() << "\"\n" case LFUN_INSET_MODIFY: {
<< "width \"" << width_.asString() << "\"\n"; InsetMinipage::Params params;
InsetCollapsable::write(buf, os); InsetMinipageMailer::string2params(cmd.argument, params);
params_.pos = params.pos;
params_.width = params.width;
cmd.view()->updateInset(this, true);
result = DISPATCHED;
}
break;
default:
result = InsetCollapsable::localDispatch(cmd);
}
return result;
} }
void InsetMinipage::read(Buffer const * buf, LyXLex & lex) void InsetMinipage::Params::write(ostream & os) const
{
os << "Minipage" << '\n'
<< "position " << pos << '\n'
<< "inner_position " << inner_pos << '\n'
<< "height \"" << height.asString() << "\"\n"
<< "width \"" << width.asString() << "\"\n";
}
void InsetMinipage::Params::read(LyXLex & lex)
{ {
if (lex.isOK()) { if (lex.isOK()) {
lex.next(); lex.next();
string const token = lex.getString(); string const token = lex.getString();
if (token == "position") { if (token == "position") {
lex.next(); lex.next();
pos_ = static_cast<Position>(lex.getInteger()); pos = static_cast<Position>(lex.getInteger());
} else { } else {
lyxerr << "InsetMinipage::Read: Missing 'position'-tag!" lyxerr << "InsetMinipage::Read: Missing 'position'-tag!"
<< endl; << endl;
@ -135,7 +159,7 @@ void InsetMinipage::read(Buffer const * buf, LyXLex & lex)
string const token = lex.getString(); string const token = lex.getString();
if (token == "inner_position") { if (token == "inner_position") {
lex.next(); lex.next();
inner_pos_ = static_cast<InnerPosition>(lex.getInteger()); inner_pos = static_cast<InnerPosition>(lex.getInteger());
} else { } else {
lyxerr << "InsetMinipage::Read: Missing 'inner_position'-tag!" lyxerr << "InsetMinipage::Read: Missing 'inner_position'-tag!"
<< endl; << endl;
@ -148,7 +172,7 @@ void InsetMinipage::read(Buffer const * buf, LyXLex & lex)
string const token = lex.getString(); string const token = lex.getString();
if (token == "height") { if (token == "height") {
lex.next(); lex.next();
height_ = LyXLength(lex.getString()); height = LyXLength(lex.getString());
} else { } else {
lyxerr << "InsetMinipage::Read: Missing 'height'-tag!" lyxerr << "InsetMinipage::Read: Missing 'height'-tag!"
<< endl; << endl;
@ -161,7 +185,7 @@ void InsetMinipage::read(Buffer const * buf, LyXLex & lex)
string const token = lex.getString(); string const token = lex.getString();
if (token == "width") { if (token == "width") {
lex.next(); lex.next();
width_ = LyXLength(lex.getString()); width = LyXLength(lex.getString());
} else { } else {
lyxerr << "InsetMinipage::Read: Missing 'width'-tag!" lyxerr << "InsetMinipage::Read: Missing 'width'-tag!"
<< endl; << endl;
@ -169,6 +193,19 @@ void InsetMinipage::read(Buffer const * buf, LyXLex & lex)
lex.pushToken(token); lex.pushToken(token);
} }
} }
}
void InsetMinipage::write(Buffer const * buf, ostream & os) const
{
params_.write(os);
InsetCollapsable::write(buf, os);
}
void InsetMinipage::read(Buffer const * buf, LyXLex & lex)
{
params_.read(lex);
InsetCollapsable::read(buf, lex); InsetCollapsable::read(buf, lex);
} }
@ -180,7 +217,7 @@ int InsetMinipage::ascent(BufferView * bv, LyXFont const & font) const
else { else {
// Take placement into account. // Take placement into account.
int i = 0; int i = 0;
switch (pos_) { switch (params_.pos) {
case top: case top:
i = InsetCollapsable::ascent(bv, font); i = InsetCollapsable::ascent(bv, font);
break; break;
@ -204,7 +241,7 @@ int InsetMinipage::descent(BufferView * bv, LyXFont const & font) const
else { else {
// Take placement into account. // Take placement into account.
int i = 0; int i = 0;
switch (pos_) { switch (params_.pos) {
case top: case top:
i = InsetCollapsable::descent(bv, font); i = InsetCollapsable::descent(bv, font);
break; break;
@ -231,7 +268,7 @@ int InsetMinipage::latex(Buffer const * buf,
ostream & os, bool fragile, bool fp) const ostream & os, bool fragile, bool fp) const
{ {
string s_pos; string s_pos;
switch (pos_) { switch (params_.pos) {
case top: case top:
s_pos += 't'; s_pos += 't';
break; break;
@ -243,7 +280,7 @@ int InsetMinipage::latex(Buffer const * buf,
break; break;
} }
os << "\\begin{minipage}[" << s_pos << "]{" os << "\\begin{minipage}[" << s_pos << "]{"
<< width_.asLatexString() << "}%\n"; << params_.width.asLatexString() << "}%\n";
int i = inset.latex(buf, os, fragile, fp); int i = inset.latex(buf, os, fragile, fp);
@ -263,14 +300,14 @@ bool InsetMinipage::insetAllowed(Inset::Code code) const
InsetMinipage::Position InsetMinipage::pos() const InsetMinipage::Position InsetMinipage::pos() const
{ {
return pos_; return params_.pos;
} }
void InsetMinipage::pos(InsetMinipage::Position p) void InsetMinipage::pos(InsetMinipage::Position p)
{ {
if (pos_ != p) { if (params_.pos != p) {
pos_ = p; params_.pos = p;
need_update = FULL; need_update = FULL;
} }
} }
@ -278,26 +315,26 @@ void InsetMinipage::pos(InsetMinipage::Position p)
InsetMinipage::InnerPosition InsetMinipage::innerPos() const InsetMinipage::InnerPosition InsetMinipage::innerPos() const
{ {
return inner_pos_; return params_.inner_pos;
} }
void InsetMinipage::innerPos(InsetMinipage::InnerPosition ip) void InsetMinipage::innerPos(InsetMinipage::InnerPosition ip)
{ {
inner_pos_ = ip; params_.inner_pos = ip;
} }
LyXLength const & InsetMinipage::pageHeight() const LyXLength const & InsetMinipage::pageHeight() const
{ {
return height_; return params_.height;
} }
void InsetMinipage::pageHeight(LyXLength const & ll) void InsetMinipage::pageHeight(LyXLength const & ll)
{ {
if (height_ != ll) { if (params_.height != ll) {
height_ = ll; params_.height = ll;
need_update = FULL; need_update = FULL;
} }
} }
@ -305,14 +342,14 @@ void InsetMinipage::pageHeight(LyXLength const & ll)
LyXLength const & InsetMinipage::pageWidth() const LyXLength const & InsetMinipage::pageWidth() const
{ {
return width_; return params_.width;
} }
void InsetMinipage::pageWidth(LyXLength const & ll) void InsetMinipage::pageWidth(LyXLength const & ll)
{ {
if (ll != width_) { if (ll != params_.width) {
width_ = ll; params_.width = ll;
need_update = FULL; need_update = FULL;
} }
} }
@ -320,8 +357,12 @@ void InsetMinipage::pageWidth(LyXLength const & ll)
bool InsetMinipage::showInsetDialog(BufferView * bv) const bool InsetMinipage::showInsetDialog(BufferView * bv) const
{ {
if (!inset.showInsetDialog(bv)) if (!inset.showInsetDialog(bv)) {
bv->owner()->getDialogs().showMinipage(const_cast<InsetMinipage *>(this)); InsetMinipage * tmp = const_cast<InsetMinipage *>(this);
InsetMinipageMailer mailer(*tmp);
mailer.showDialog();
}
return true; return true;
} }
@ -333,7 +374,7 @@ int InsetMinipage::getMaxWidth(BufferView * bv, UpdatableInset const * inset)
static_cast<UpdatableInset*>(owner())->getMaxWidth(bv, inset) < 0) { static_cast<UpdatableInset*>(owner())->getMaxWidth(bv, inset) < 0) {
return -1; return -1;
} }
if (!width_.zero()) { if (!params_.width.zero()) {
int ww1 = latexTextWidth(bv); int ww1 = latexTextWidth(bv);
int ww2 = InsetCollapsable::getMaxWidth(bv, inset); int ww2 = InsetCollapsable::getMaxWidth(bv, inset);
if (ww2 > 0 && ww2 < ww1) { if (ww2 > 0 && ww2 < ww1) {
@ -348,5 +389,65 @@ int InsetMinipage::getMaxWidth(BufferView * bv, UpdatableInset const * inset)
int InsetMinipage::latexTextWidth(BufferView * bv) const int InsetMinipage::latexTextWidth(BufferView * bv) const
{ {
return width_.inPixels(InsetCollapsable::latexTextWidth(bv)); return params_.width.inPixels(InsetCollapsable::latexTextWidth(bv));
}
InsetMinipage::Params::Params()
: pos(center),
inner_pos(inner_center),
width(100, LyXLength::PCW)
{}
string const InsetMinipageMailer:: name_("minipage");
InsetMinipageMailer::InsetMinipageMailer(InsetMinipage & inset)
: inset_(inset)
{}
string const InsetMinipageMailer::inset2string() const
{
return params2string(inset_.params());
}
void InsetMinipageMailer::string2params(string const & in,
InsetMinipage::Params & params)
{
params = InsetMinipage::Params();
istringstream data(in);
LyXLex lex(0,0);
lex.setStream(data);
if (lex.isOK()) {
lex.next();
string const token = lex.getString();
if (token != "minipage")
return;
}
// This is part of the inset proper that is usually swallowed
// by Buffer::readInset
if (lex.isOK()) {
lex.next();
string const token = lex.getString();
if (token != "Minipage")
return;
}
params.read(lex);
}
string const
InsetMinipageMailer::params2string(InsetMinipage::Params const & params)
{
ostringstream data;
data << name_ << ' ';
params.write(data);
return data.str();
} }

View File

@ -17,8 +17,6 @@
#include "insetcollapsable.h" #include "insetcollapsable.h"
#include "lyxlength.h" #include "lyxlength.h"
#include <boost/signals/signal0.hpp>
/** The minipage inset /** The minipage inset
*/ */
@ -37,6 +35,25 @@ public:
inner_bottom, inner_bottom,
inner_stretch inner_stretch
}; };
///
struct Params {
///
Params();
///
Position pos;
///
InnerPosition inner_pos;
///
LyXLength height;
///
LyXLength width;
///
void write(std::ostream & os) const;
///
void read(LyXLex & lex);
};
/// ///
InsetMinipage(BufferParams const &); InsetMinipage(BufferParams const &);
/// ///
@ -44,6 +61,8 @@ public:
/// ///
~InsetMinipage(); ~InsetMinipage();
/// ///
virtual dispatch_result localDispatch(FuncRequest const & cmd);
///
void write(Buffer const * buf, std::ostream & os) const; void write(Buffer const * buf, std::ostream & os) const;
/// ///
void read(Buffer const * buf, LyXLex & lex); void read(Buffer const * buf, LyXLex & lex);
@ -78,8 +97,6 @@ public:
/// ///
void pageWidth(LyXLength const &); void pageWidth(LyXLength const &);
/// ///
boost::signal0<void> hideDialog;
///
int getMaxWidth(BufferView *, UpdatableInset const *) const; int getMaxWidth(BufferView *, UpdatableInset const *) const;
/// ///
bool needFullRow() const { return false; } bool needFullRow() const { return false; }
@ -91,16 +108,38 @@ public:
bool showInsetDialog(BufferView *) const; bool showInsetDialog(BufferView *) const;
/// ///
int latexTextWidth(BufferView *) const; int latexTextWidth(BufferView *) const;
///
void params(Params const & p) { params_ = p; }
///
Params const & params() const { return params_; }
private: private:
/// ///
Position pos_; Params params_;
};
#include "mailinset.h"
class InsetMinipageMailer : public MailInset {
public:
/// ///
InnerPosition inner_pos_; InsetMinipageMailer(InsetMinipage & inset);
/// ///
LyXLength height_; virtual Inset & inset() const { return inset_; }
/// ///
LyXLength width_; virtual string const & name() const { return name_; }
///
virtual string const inset2string() const;
///
static void string2params(string const &, InsetMinipage::Params &);
///
static string const params2string(InsetMinipage::Params const &);
private:
///
static string const name_;
///
InsetMinipage & inset_;
}; };
#endif #endif

View File

@ -310,14 +310,16 @@ void InsetWrap::addToToc(toc::TocList & toclist, Buffer const * buf) const
} }
string const InsetWrapMailer::name_("wrap");
InsetWrapMailer::InsetWrapMailer(InsetWrap & inset) InsetWrapMailer::InsetWrapMailer(InsetWrap & inset)
: name_("wrap"), inset_(inset) : inset_(inset)
{} {}
string const InsetWrapMailer::inset2string() const string const InsetWrapMailer::inset2string() const
{ {
return params2string(name(), inset_.params()); return params2string(inset_.params());
} }
@ -326,32 +328,35 @@ void InsetWrapMailer::string2params(string const & in,
{ {
params = InsetWrapParams(); params = InsetWrapParams();
string name; istringstream data(in);
string body = split(in, name, ' '); LyXLex lex(0,0);
lex.setStream(data);
if (name != "wrap" || body.empty()) if (lex.isOK()) {
return; lex.next();
string const token = lex.getString();
if (token != name_)
return;
}
// This is part of the inset proper that is usually swallowed // This is part of the inset proper that is usually swallowed
// by Buffer::readInset // by Buffer::readInset
body = split(body, name, '\n'); if (lex.isOK()) {
if (!prefixIs(name, "Wrap ")) lex.next();
return; string const token = lex.getString();
if (token != "Wrap" || !lex.eatLine())
istringstream data(body); return;
LyXLex lex(0,0); }
lex.setStream(data);
params.read(lex); params.read(lex);
} }
string const string const
InsetWrapMailer::params2string(string const & name, InsetWrapMailer::params2string(InsetWrapParams const & params)
InsetWrapParams const & params)
{ {
ostringstream data; ostringstream data;
data << name << ' '; data << name_ << ' ';
params.write(data); params.write(data);
return data.str(); return data.str();

View File

@ -105,11 +105,10 @@ public:
/// ///
static void string2params(string const &, InsetWrapParams &); static void string2params(string const &, InsetWrapParams &);
/// ///
static string const params2string(string const & name, static string const params2string(InsetWrapParams const &);
InsetWrapParams const &);
private: private:
/// ///
string const name_; static string const name_;
/// ///
InsetWrap & inset_; InsetWrap & inset_;
}; };

View File

@ -1350,6 +1350,7 @@ void LyXFunc::dispatch(FuncRequest const & ev, bool verbose)
string data; string data;
if (name == "bibitem" || if (name == "bibitem" ||
name == "bibtex" || name == "bibtex" ||
name == "include" ||
name == "index" || name == "index" ||
name == "ref" || name == "ref" ||
name == "toc" || name == "toc" ||
@ -1359,9 +1360,6 @@ void LyXFunc::dispatch(FuncRequest const & ev, bool verbose)
} 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(name,
InsetERT::Open);
} }
owner->getDialogs().show(name, data, 0); owner->getDialogs().show(name, data, 0);
} }