]> git.lyx.org Git - features.git/commitdiff
add Dialogs::visible to avoid the madness of filling unexistent dialogs
authorAlfredo Braunstein <abraunst@lyx.org>
Fri, 6 Jun 2003 08:06:24 +0000 (08:06 +0000)
committerAlfredo Braunstein <abraunst@lyx.org>
Fri, 6 Jun 2003 08:06:24 +0000 (08:06 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7119 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferView_pimpl.C
src/ChangeLog
src/frontends/ChangeLog
src/frontends/Dialogs.C
src/frontends/Dialogs.h
src/insets/ChangeLog
src/insets/mailinset.C

index d167010f8ed9f39a8cbb46a3863c64f421d6eff5..04f1f311a31311191264c2540c3df7761e233420 100644 (file)
@@ -1148,6 +1148,8 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev_in)
        }
 
        case LFUN_PARAGRAPH_UPDATE: {
+               if (!bv_->owner()->getDialogs().visible("paragraph"))
+                       break;
                Paragraph const * par = &*bv_->getLyXText()->cursor.par();
                if (!par)
                        break;
index d467c94718fe6282659e3c1c33a504d1e3e08b98..35fff47a8f2b2ff2dbff941dc693d126f3575a94 100644 (file)
@@ -1,3 +1,7 @@
+2003-06-06  Alfredo Braunstein  <abraunst@libero.it>
+
+       * BufferView_pimpl.C (dispatch): use Dialogs::visible
+       
 2003-06-04  Angus Leeming  <leeming@lyx.org>
 
        * buffer.C: bump format to 224.
index 6001e4226c8c1d4c3f8bbf507d7fd5902d586320..ffad45d1ac6855f854bcd95d111883822573fd0c 100644 (file)
@@ -1,3 +1,7 @@
+2003-06-06  Alfredo Braunstein  <abraunst@libero.it>
+
+       * Dialogs.[Ch] (visible): added.
+       
 2003-06-03  John Levon  <levon@movementarian.org>
 
        * lyx_gui.h: add sync_events()
index 8f31720b854685ee83f12e384ab243fabcc901cc..82cac2cb640a12b04ae042691fe7b550ac513b8b 100644 (file)
@@ -110,6 +110,16 @@ void Dialogs::show(string const & name, string const & data, InsetBase * inset)
 }
 
 
+bool Dialogs::visible(string const & name) const
+{
+       std::map<string, DialogPtr>::const_iterator it =
+               dialogs_.find(name);
+       if (it == dialogs_.end())
+               return false;
+       return it->second.get()->isVisible();
+}
+
+
 void Dialogs::update(string const & name, string const & data)
 {
        Dialog * dialog = find(name);
index 1aa3eea30dfade217d40f3182bceee343e899b2f..60e0fef371eceda33fe269aec1786c8f678868c4 100644 (file)
@@ -119,6 +119,9 @@ public:
        */
        void update(string const & name, string const & data);
 
+       /// is the dialog currently visible?
+       bool visible(string const & name) const;
+
        /** All Dialogs of the given \param name will be closed if they are
            connected to the given \param inset.
        */
index 5c98849ab356c9d5e1977c57d5ea76cde1a91468..04ae9437da56a02e886c37789b95317738fb950a 100644 (file)
@@ -1,3 +1,7 @@
+2003-06-06  Alfredo Braunstein  <abraunst@libero.it>
+
+       * mailinset.C (updateDialog): use Dialogs::visible
+
 2003-06-04  Angus Leeming  <leeming@lyx.org>
 
        * graphicinset.C (draw): add a comment for the #if 0 block.
index b7563a0cb0be205cc713634c1ba56c29a229922b..8eb06f9964eae877497711e7ff426156c50a3ddb 100644 (file)
@@ -29,8 +29,9 @@ void MailInset::showDialog(BufferView * bv) const
 
 void MailInset::updateDialog(BufferView * bv) const
 {
-       lyx::Assert(bv);
-       bv->owner()->getDialogs().update(name(), inset2string());
+       lyx::Assert(bv);        
+       if(bv->owner()->getDialogs().visible(name()))
+               bv->owner()->getDialogs().update(name(), inset2string());
 }