}
+// FIXME, there's only one WorkArea per LyXView possible for now.
+WorkArea const * LyXView::currentWorkArea() const
+{
+ return work_area_;
+}
+
+
+// FIXME, there's only one WorkArea per LyXView possible for now.
+WorkArea * LyXView::currentWorkArea()
+{
+ return work_area_;
+}
+
+
Buffer * LyXView::buffer() const
{
BOOST_ASSERT(work_area_);
getDialogs().hideBufferDependent();
work_area_->bufferView().setBuffer(b);
+ // Make sure the TOC is updated before anything else.
+ updateToc();
if (work_area_->bufferView().buffer()) {
// Buffer-dependent dialogs should be updated or
bool loaded = work_area_->bufferView().loadLyXFile(filename, tolastfiles);
+ updateToc();
updateMenubar();
updateToolbars();
updateLayoutChoice();
buf.changed.connect(
boost::bind(&WorkArea::redraw, work_area_));
+ bufferStructureChangedConnection_ =
+ buf.structureChanged.connect(
+ boost::bind(&LyXView::updateToc, this));
+
errorsConnection_ =
buf.errors.connect(
boost::bind(&LyXView::showErrorList, this, _1));
{
errorsConnection_.disconnect();
bufferChangedConnection_.disconnect();
+ bufferStructureChangedConnection_.disconnect();
messageConnection_.disconnect();
busyConnection_.disconnect();
titleConnection_.disconnect();
}
+void LyXView::updateToc()
+{
+ updateDialog("toc", "");
+}
+
+
void LyXView::updateToolbars()
{
BOOST_ASSERT(work_area_);
}
-ToolbarBackend::Flags LyXView::getToolbarState(string const & name)
+ToolbarInfo::Flags LyXView::getToolbarState(string const & name)
{
return toolbars_->getToolbarState(name);
}
void LyXView::autoSave()
{
- lyxerr[Debug::INFO] << "Running autoSave()" << endl;
+ LYXERR(Debug::INFO) << "Running autoSave()" << endl;
if (view()->buffer())
lyx::autoSave(view());
}
setWindowTitle(maximize_title, minimize_title);
+ updateTab();
}
{
Buffer const * buffer_ptr = 0;
if (inset) {
- buffer_ptr = work_area_->bufferView().buffer();
- // No FitCursor:
BOOST_ASSERT(work_area_);
- work_area_->bufferView().update(Update::Force);
- work_area_->redraw();
+ work_area_->scheduleRedraw();
+
+ buffer_ptr = work_area_->bufferView().buffer();
}
return buffer_ptr;
}