add Dialogs::visible to avoid the madness of filling unexistent dialogs

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7119 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Alfredo Braunstein 2003-06-06 08:06:24 +00:00
parent 4fd6cf680b
commit c516046c9c
7 changed files with 30 additions and 2 deletions

View 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;

View 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.

View 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()

View 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);

View 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.
*/

View 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.

View 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());
}