From 1d1669c331a5cbd8360b38d4244e050f0ca8b87d Mon Sep 17 00:00:00 2001 From: Angus Leeming Date: Sun, 2 Feb 2003 00:48:38 +0000 Subject: [PATCH] fix bug 850 (fix confirmed by John) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6015 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/controllers/ChangeLog | 7 +++++++ src/frontends/controllers/ControlTabular.C | 9 ++------- src/frontends/controllers/ViewBase.h | 2 ++ src/frontends/qt2/ChangeLog | 4 ++++ src/frontends/qt2/Qt2Base.C | 6 ++++++ src/frontends/qt2/Qt2Base.h | 4 +++- src/frontends/xforms/ChangeLog | 4 ++++ src/frontends/xforms/FormBase.C | 6 ++++++ src/frontends/xforms/FormBase.h | 2 ++ 9 files changed, 36 insertions(+), 8 deletions(-) diff --git a/src/frontends/controllers/ChangeLog b/src/frontends/controllers/ChangeLog index 0814620aa8..41907bffd5 100644 --- a/src/frontends/controllers/ChangeLog +++ b/src/frontends/controllers/ChangeLog @@ -1,3 +1,10 @@ +2003-01-31 Angus Leeming + + * ViewBase.h: add an isVisible() pure virtual method. + + * ControlTabular.C (updateInset): don't build the dialog here. + Instead, do nothing if the dialog is invisible. + 2003-01-15 Dekel Tsur * ControlSpellchecker.[Ch]: Remove XForms RTL hacks. diff --git a/src/frontends/controllers/ControlTabular.C b/src/frontends/controllers/ControlTabular.C index 6ec3ec5572..4c4c5ea627 100644 --- a/src/frontends/controllers/ControlTabular.C +++ b/src/frontends/controllers/ControlTabular.C @@ -44,15 +44,10 @@ void ControlTabular::showInset(InsetTabular * inset) void ControlTabular::updateInset(InsetTabular * inset) { + if (!view().isVisible()) + return; lyx::Assert(inset); - connectInset(inset); - - if (!dialog_built_) { - view().build(); - dialog_built_ = true; - } - update(); } diff --git a/src/frontends/controllers/ViewBase.h b/src/frontends/controllers/ViewBase.h index f20e16a563..a3c3217a15 100644 --- a/src/frontends/controllers/ViewBase.h +++ b/src/frontends/controllers/ViewBase.h @@ -38,6 +38,8 @@ public: virtual void show() = 0; /// Update dialog before/whilst showing it. virtual void update() = 0; + /// + virtual bool isVisible() const = 0; /** Defaults to nothing. Can be used by the controller, however, to * indicate to the view that something has changed and that the diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index 713272d319..c88b2e005b 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,7 @@ +2003-01-31 Angus Leeming + + * Qt2Base.[Ch]: instantiate the isVisible() virtual method. + 2003-01-30 Angus Leeming * Dialogs2.C (createIndex): enable ControlCommand to create an diff --git a/src/frontends/qt2/Qt2Base.C b/src/frontends/qt2/Qt2Base.C index 94f63475f9..8b21830209 100644 --- a/src/frontends/qt2/Qt2Base.C +++ b/src/frontends/qt2/Qt2Base.C @@ -38,6 +38,12 @@ Qt2BC & Qt2Base::bc() } +bool Qt2Base::isVisible() const +{ + return form() && form()->isVisible(); +} + + void Qt2Base::show() { if (!form()) { diff --git a/src/frontends/qt2/Qt2Base.h b/src/frontends/qt2/Qt2Base.h index 2491a9895c..0db44a8692 100644 --- a/src/frontends/qt2/Qt2Base.h +++ b/src/frontends/qt2/Qt2Base.h @@ -44,6 +44,8 @@ protected: virtual void show(); /// update the dialog's contents virtual void update_contents() = 0; + /// + virtual bool isVisible() const; /// the dialog has changed contents virtual void changed(); @@ -72,7 +74,7 @@ protected slots: // Close button clicked void slotClose(); private: - /// Pointer to the actual instantiation of xform's form + /// Pointer to the actual instantiation of the Qt dialog virtual QDialog * form() const = 0; private: diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index 955800bf2e..b51c86539d 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,7 @@ +2003-01-31 Angus Leeming + + * FormBase.[Ch]: instantiate the isVisible() virtual method. + 2003-01-30 Angus Leeming * Dialogs2.C (createIndex): enable ControlCommand to create an diff --git a/src/frontends/xforms/FormBase.C b/src/frontends/xforms/FormBase.C index 391dfc1faf..2f327d0ac8 100644 --- a/src/frontends/xforms/FormBase.C +++ b/src/frontends/xforms/FormBase.C @@ -65,6 +65,12 @@ FormBase::~FormBase() } +bool FormBase::isVisible() const +{ + return form() && form()->visible; +} + + Tooltips & FormBase::tooltips() { return *tooltips_; diff --git a/src/frontends/xforms/FormBase.h b/src/frontends/xforms/FormBase.h index 7907ac6e4e..c5e982ea0e 100644 --- a/src/frontends/xforms/FormBase.h +++ b/src/frontends/xforms/FormBase.h @@ -66,6 +66,8 @@ protected: virtual void hide(); /// Create the dialog if necessary, update it and display it. virtual void show(); + /// + virtual bool isVisible() const; /** Prepare the way to: * 1. display feedback as the mouse moves over ob. This feedback will