string current_layout;
-LyXView::LyXView()
- : work_area_(0),
+LyXView::LyXView(int id)
+ : id_(id), work_area_(0),
toolbars_(new Toolbars(*this)),
autosave_timeout_(new Timeout(5000)),
dialogs_(new Dialogs(*this)),
}
+// FIXME, there's only one WorkArea per LyXView possible for now.
void LyXView::setWorkArea(WorkArea * work_area)
{
work_area_ = work_area;
-}
-
-
-void LyXView::redrawWorkArea()
-{
- lyxerr[Debug::WORKAREA] << "LyXView::redrawWorkArea" << std::endl;
- work_area_->redraw();
- updateStatusBar();
-}
-
-
-WorkArea * LyXView::workArea()
-{
- return work_area_;
+ work_area_ids_.clear();
+ work_area_ids_.push_back(work_area_->id());
}
connectBuffer(*work_area_->bufferView().buffer());
}
+ if (quitting)
+ return;
+
updateMenubar();
updateToolbars();
updateLayoutChoice();
updateWindowTitle();
- redrawWorkArea();
+ updateStatusBar();
+ work_area_->redraw();
}
connectBuffer(*work_area_->bufferView().buffer());
showErrorList("Parse");
}
- redrawWorkArea();
+ updateStatusBar();
+ work_area_->redraw();
return loaded;
}
if (errorsConnection_.connected())
disconnectBuffer();
+ bufferChangedConnection_ =
+ buf.changed.connect(
+ boost::bind(&WorkArea::redraw, work_area_));
+
errorsConnection_ =
buf.errors.connect(
boost::bind(&LyXView::showErrorList, this, _1));
void LyXView::disconnectBuffer()
{
+ errorsConnection_.disconnect();
+ bufferChangedConnection_.disconnect();
messageConnection_.disconnect();
busyConnection_.disconnect();
titleConnection_.disconnect();
void LyXView::dispatch(FuncRequest const & cmd)
{
+ if (cmd.action == LFUN_WINDOW_CLOSE) {
+ close();
+ closed(id_);
+ return;
+ }
+
theLyXFunc().setLyXView(this);
lyx::dispatch(cmd);
}