: work_area_(0),
toolbars_(new Toolbars(*this)),
autosave_timeout_(new Timeout(5000)),
- lyxfunc_(new LyXFunc(this)),
dialogs_(new Dialogs(*this)),
controlcommand_(new ControlCommandBuffer(*this))
{
- lyxerr[Debug::INIT] << "Initializing LyXFunc" << endl;
+ // Start autosave timer
+ if (lyxrc.autosave) {
+ autosave_timeout_->timeout.connect(boost::bind(&LyXView::autoSave, this));
+ autosave_timeout_->setTimeout(lyxrc.autosave * 1000);
+ autosave_timeout_->start();
+ }
}
}
-void LyXView::init()
-{
- updateLayoutChoice();
- updateMenubar();
-
- // Start autosave timer
- if (lyxrc.autosave) {
- autosave_timeout_->timeout.connect(boost::bind(&LyXView::autoSave, this));
- autosave_timeout_->setTimeout(lyxrc.autosave * 1000);
- autosave_timeout_->start();
- }
-}
-
-
Buffer * LyXView::buffer() const
{
return work_area_->bufferView().buffer();
timerConnection_.disconnect();
readonlyConnection_.disconnect();
closingConnection_.disconnect();
+ layout_changed_connection_.disconnect();
}
boost::bind(&LyXView::showInsetDialog, this, _1, _2, _3));
update_dialog_connection_ = bv.updateDialog.connect(
boost::bind(&LyXView::updateDialog, this, _1, _2));
+ layout_changed_connection_ = bv.layoutChanged.connect(
+ boost::bind(&Toolbars::setLayout, toolbars_.get(), _1));
}
void LyXView::showInsetDialog(string const & name, string const & data,
InsetBase * inset)
{
- getDialogs().show(name, data, 0);
+ getDialogs().show(name, data, inset);
}
}
-void LyXView::setLayout(string const & layout)
-{
- toolbars_->setLayout(layout);
-}
-
-
void LyXView::updateToolbars()
{
bool const math = work_area_->bufferView().cursor().inMathed();