* make sure the Mac special menu item are only created once per QMenuBar.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23754 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Stefan Schimanski 2008-03-15 02:58:05 +00:00
parent a8455831f0
commit f9f0b26bd3
4 changed files with 11 additions and 9 deletions

View File

@ -746,7 +746,7 @@ bool GuiApplication::searchMenu(FuncRequest const & func,
void GuiApplication::initGlobalMenu()
{
if (global_menubar_)
menus().fillMenuBar(global_menubar_, 0);
menus().fillMenuBar(global_menubar_, 0, true);
}

View File

@ -283,7 +283,7 @@ GuiView::GuiView(int id)
theLyXFunc().setLyXView(this);
// Fill up the menu bar.
guiApp->menus().fillMenuBar(menuBar(), this);
guiApp->menus().fillMenuBar(menuBar(), this, true);
setCentralWidget(d.stack_widget_);

View File

@ -1461,15 +1461,17 @@ bool Menus::searchMenu(FuncRequest const & func,
}
void Menus::fillMenuBar(QMenuBar * qmb, GuiView * view)
void Menus::fillMenuBar(QMenuBar * qmb, GuiView * view, bool initial)
{
// Clear all menubar contents before filling it.
qmb->clear();
if (initial) {
#ifdef Q_WS_MACX
// setup special mac specific menu item
d->macxMenuBarInit(view, qmb);
// setup special mac specific menu item
d->macxMenuBarInit(view, qmb);
#endif
} else {
// Clear all menubar contents before filling it.
qmb->clear();
}
LYXERR(Debug::GUI, "populating menu bar" << fromqstr(d->menubar_.name()));

View File

@ -64,7 +64,7 @@ public:
bool searchMenu(FuncRequest const & func,
std::vector<docstring> & names) const;
///
void fillMenuBar(QMenuBar * qmb, GuiView * view);
void fillMenuBar(QMenuBar * qmb, GuiView * view, bool initial = false);
/// \return a top-level submenu given its name.
Menu * menu(QString const & name, GuiView & view);