+
+void LyXView::connectBuffer(Buffer & buf)
+{
+ if (errorsConnection_.connected())
+ disconnectBuffer();
+
+ BOOST_ASSERT(work_area_);
+ bufferChangedConnection_ =
+ buf.changed.connect(
+ boost::bind(&WorkArea::redraw, work_area_));
+
+ errorsConnection_ =
+ buf.errors.connect(
+ boost::bind(&LyXView::showErrorList, this, _1));
+
+ messageConnection_ =
+ buf.message.connect(
+ boost::bind(&LyXView::message, this, _1));
+
+ busyConnection_ =
+ buf.busy.connect(
+ boost::bind(&LyXView::busy, this, _1));
+
+ titleConnection_ =
+ buf.updateTitles.connect(
+ boost::bind(&LyXView::updateWindowTitle, this));
+
+ timerConnection_ =
+ buf.resetAutosaveTimers.connect(
+ boost::bind(&LyXView::resetAutosaveTimer, this));
+
+ readonlyConnection_ =
+ buf.readonly.connect(
+ boost::bind(&LyXView::showReadonly, this, _1));
+
+ closingConnection_ =
+ buf.closing.connect(
+ boost::bind(&LyXView::setBuffer, this, (Buffer *)0));
+}
+
+
+void LyXView::disconnectBuffer()
+{
+ errorsConnection_.disconnect();
+ bufferChangedConnection_.disconnect();
+ messageConnection_.disconnect();
+ busyConnection_.disconnect();
+ titleConnection_.disconnect();
+ timerConnection_.disconnect();
+ readonlyConnection_.disconnect();
+ closingConnection_.disconnect();
+ layout_changed_connection_.disconnect();
+}
+
+
+void LyXView::connectBufferView(BufferView & bv)
+{
+ show_dialog_connection_ = bv.showDialog.connect(
+ boost::bind(&LyXView::showDialog, this, _1));
+ show_dialog_with_data_connection_ = bv.showDialogWithData.connect(
+ boost::bind(&LyXView::showDialogWithData, this, _1, _2));
+ show_inset_dialog_connection_ = bv.showInsetDialog.connect(
+ 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::disconnectBufferView()
+{
+ show_dialog_connection_.disconnect();
+ show_dialog_with_data_connection_.disconnect();
+ show_inset_dialog_connection_.disconnect();
+ update_dialog_connection_.disconnect();
+}
+
+
+void LyXView::showErrorList(string const & error_type)
+{
+ ErrorList & el = buffer()->errorList(error_type);
+ if (!el.empty()) {
+ getDialogs().show("errorlist", error_type);