mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 18:08:10 +00:00
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:
parent
4fd6cf680b
commit
c516046c9c
@ -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;
|
||||
|
@ -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.
|
||||
|
@ -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()
|
||||
|
@ -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);
|
||||
|
@ -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.
|
||||
*/
|
||||
|
@ -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.
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user