* Buffer: new changed() boost::signal.
* LyXView:
- redrawWorkArea(): deleted
- bufferChangedConnection_: new signal connection
* LyXFunc: replace LyXView::redrawWorkArea() direct call with Buffer::changed() signal emission.
* WorkArea.C: deleted some comments about redrawWorkArea.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15464
a592a061-630c-0410-9148-
cb99ea01b6c8
/// do we have a paragraph with this id?
bool hasParWithID(int id) const;
/// do we have a paragraph with this id?
bool hasParWithID(int id) const;
+ /// This signal is emitted when the buffer is changed.
+ boost::signal<void()> changed;
/// This signal is emitted when some parsing error shows up.
boost::signal<void(std::string)> errors;
/// This signal is emitted when some message shows up.
/// This signal is emitted when some parsing error shows up.
boost::signal<void(std::string)> errors;
/// This signal is emitted when some message shows up.
-void LyXView::redrawWorkArea()
-{
- lyxerr[Debug::WORKAREA] << "LyXView::redrawWorkArea" << std::endl;
- work_area_->redraw();
- updateStatusBar();
-}
-
-
WorkArea * LyXView::workArea()
{
return work_area_;
WorkArea * LyXView::workArea()
{
return work_area_;
updateToolbars();
updateLayoutChoice();
updateWindowTitle();
updateToolbars();
updateLayoutChoice();
updateWindowTitle();
+ updateStatusBar();
+ work_area_->redraw();
connectBuffer(*work_area_->bufferView().buffer());
showErrorList("Parse");
}
connectBuffer(*work_area_->bufferView().buffer());
showErrorList("Parse");
}
+ updateStatusBar();
+ work_area_->redraw();
if (errorsConnection_.connected())
disconnectBuffer();
if (errorsConnection_.connected())
disconnectBuffer();
+ bufferChangedConnection_ =
+ buf.changed.connect(
+ boost::bind(&WorkArea::redraw, work_area_));
+
errorsConnection_ =
buf.errors.connect(
boost::bind(&LyXView::showErrorList, this, _1));
errorsConnection_ =
buf.errors.connect(
boost::bind(&LyXView::showErrorList, this, _1));
void LyXView::disconnectBuffer()
{
void LyXView::disconnectBuffer()
{
+ errorsConnection_.disconnect();
+ bufferChangedConnection_.disconnect();
messageConnection_.disconnect();
busyConnection_.disconnect();
titleConnection_.disconnect();
messageConnection_.disconnect();
busyConnection_.disconnect();
titleConnection_.disconnect();
/// returns true if this view has the focus.
virtual bool hasFocus() const = 0;
/// returns true if this view has the focus.
virtual bool hasFocus() const = 0;
- /// Temporary method used by the kernel to redraw the work area.
- virtual void redrawWorkArea();
-
/// Temporary method to access the current workArea.
/// This is needed for the gtk frontend.
frontend::WorkArea * workArea();
/// Temporary method to access the current workArea.
/// This is needed for the gtk frontend.
frontend::WorkArea * workArea();
/// dialogs for this view
boost::scoped_ptr<Dialogs> dialogs_;
/// dialogs for this view
boost::scoped_ptr<Dialogs> dialogs_;
+ /// buffer changed signal connection
+ boost::signals::connection bufferChangedConnection_;
/// buffer errors signal connection
boost::signals::connection errorsConnection_;
/// buffer messages signal connection
/// buffer errors signal connection
boost::signals::connection errorsConnection_;
/// buffer messages signal connection
*/
// if (buffer_view_->buffer())
toggleCursor();
*/
// if (buffer_view_->buffer())
toggleCursor();
-
- // uneeded "redraw()" call commented out for now.
- // When/if the call to LyXView::redrawWorkArea() in "lyxfunc.C:1610"
- // is not needed anymore, this line should be uncommented out
- //redraw();
else if (update)
view()->update(Update::FitCursor);
else if (update)
view()->update(Update::FitCursor);
- lyx_view_->redrawWorkArea();
+ view()->buffer()->changed();
+ lyx_view_->updateStatusBar();
// if we executed a mutating lfun, mark the buffer as dirty
if (flag.enabled()
// if we executed a mutating lfun, mark the buffer as dirty
if (flag.enabled()