Fix bug #3918: Toggle outline button update when clicking x.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29673 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Vincent van Ravesteijn 2009-05-14 23:46:42 +00:00
parent f05504f5ef
commit 54bb684f30
3 changed files with 15 additions and 2 deletions

View File

@ -33,7 +33,7 @@ namespace lyx {
namespace frontend {
GuiToc::GuiToc(GuiView & parent, Qt::DockWidgetArea area, Qt::WindowFlags flags)
: DockView(parent, "toc", qt_("Outline"), area, flags)
: DockView(parent, "toc", qt_("Outline"), area, flags), is_closing_(false)
{
widget_ = new TocWidget(parent, this);
setWidget(widget_);
@ -91,6 +91,15 @@ void GuiToc::enableView(bool enable)
widget_->updateView();
}
void GuiToc::closeEvent(QCloseEvent * event)
{
is_closing_ = true;
((GuiView *)parent())->updateToolbars();
is_closing_ = false;
}
void GuiToc::doDispatch(Cursor & cur, FuncRequest const & cmd)
{
widget_->doDispatch(cur, cmd);

View File

@ -49,6 +49,8 @@ public:
void updateView();
void enableView(bool enable);
bool wantInitialFocus() const { return false; }
void closeEvent(QCloseEvent * event);
bool isClosing() const { return is_closing_; }
public:
/// clean-up on hide.
@ -65,6 +67,8 @@ public:
private:
///
TocWidget * widget_;
///
bool is_closing_;
};
} // namespace frontend

View File

@ -2515,7 +2515,7 @@ bool GuiView::isDialogVisible(string const & name) const
map<string, DialogPtr>::const_iterator it = d.dialogs_.find(name);
if (it == d.dialogs_.end())
return false;
return it->second.get()->isVisibleView();
return it->second.get()->isVisibleView() && !it->second.get()->isClosing();
}