mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-23 02:14:50 +00:00
Introducing GuiMenubar::init() to avoid destructing the object in order to re-initialize it.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21694 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
77a89e1486
commit
a37a73e3c9
@ -39,6 +39,12 @@ namespace frontend {
|
||||
|
||||
GuiMenubar::GuiMenubar(LyXView * view, MenuBackend & mbe)
|
||||
: owner_(static_cast<GuiView*>(view)), menubackend_(mbe)
|
||||
{
|
||||
init();
|
||||
}
|
||||
|
||||
|
||||
void GuiMenubar::init()
|
||||
{
|
||||
macxMenuBarInit();
|
||||
|
||||
@ -55,6 +61,9 @@ GuiMenubar::GuiMenubar(LyXView * view, MenuBackend & mbe)
|
||||
<< menubackend_.getMenubar().size());
|
||||
}
|
||||
|
||||
// Clear all menubar contents before filling it.
|
||||
owner_->menuBar()->clear();
|
||||
|
||||
Menu menu;
|
||||
menubackend_.expand(menubackend_.getMenubar(), menu, owner_->buffer());
|
||||
|
||||
|
@ -36,6 +36,9 @@ public:
|
||||
|
||||
~GuiMenubar();
|
||||
|
||||
///
|
||||
void init();
|
||||
|
||||
/// opens a top-level submenu given its name
|
||||
void openByName(QString const & name);
|
||||
|
||||
|
@ -1217,9 +1217,8 @@ void GuiView::resetDialogs()
|
||||
{
|
||||
// Make sure that no LFUN uses any LyXView.
|
||||
theLyXFunc().setLyXView(0);
|
||||
delete d.menubar_;
|
||||
d.toolbars_->init();
|
||||
d.menubar_ = new GuiMenubar(this, menubackend);
|
||||
d.menubar_->init();
|
||||
if (d.layout_)
|
||||
d.layout_->updateContents(true);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user