From 00a7f002dbef8cefdeda07aa92761887024d6ed3 Mon Sep 17 00:00:00 2001 From: Stephan Witt Date: Wed, 29 Jan 2014 19:20:01 +0100 Subject: [PATCH] Fix the missing dynamic menus in general and restore correctly from fullscreen. --- src/frontends/qt4/GuiView.cpp | 2 +- src/frontends/qt4/GuiView.h | 2 +- src/frontends/qt4/Menus.cpp | 27 +++++++++++++++------------ status.20x | 2 ++ 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 6195195252..095c4275fb 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -528,7 +528,7 @@ QVector GuiView::GuiViewPrivate::guiWorkAreas() } -#if defined(Q_WS_MACX) +#if defined(Q_WS_MACX) && defined(QT_MAC_USE_COCOA) QMenuBar * GuiView::menuBar() const { static QMenuBar * globalMenuBar = new QMenuBar(0); diff --git a/src/frontends/qt4/GuiView.h b/src/frontends/qt4/GuiView.h index 02199c1a98..b5ba3d9c44 100644 --- a/src/frontends/qt4/GuiView.h +++ b/src/frontends/qt4/GuiView.h @@ -137,7 +137,7 @@ public: GuiToolbar * makeToolbar(ToolbarInfo const & tbinfo, bool newline); void updateStatusBar(); -#if defined(Q_WS_MACX) +#if defined(Q_WS_MACX) && defined(QT_MAC_USE_COCOA) // We have to share one menu bar, so we must create a menu bar that does not have a parent. // To enforce this we override the QMainWindow::menuBar() implementation. // See https://bugreports.qt-project.org/browse/QTBUG-25399 diff --git a/src/frontends/qt4/Menus.cpp b/src/frontends/qt4/Menus.cpp index 9e90147ba4..4c44be5dc3 100644 --- a/src/frontends/qt4/Menus.cpp +++ b/src/frontends/qt4/Menus.cpp @@ -1355,6 +1355,7 @@ void MenuDefinition::expandBranches(Buffer const * buf) BufferParams const & master_params = buf->masterBuffer()->params(); BufferParams const & params = buf->params(); if (params.branchlist().empty() && master_params.branchlist().empty() ) { + LYXERR(Debug::GUI, "No Branches set for Document"); add(MenuItem(MenuItem::Help, qt_("No Branches Set for Document!"))); return; } @@ -1368,6 +1369,7 @@ void MenuDefinition::expandBranches(Buffer const * buf) label = convert(ii) + ". " + label + char_type('|') + convert(ii); } + LYXERR(Debug::GUI, "Add item for branch " << label); addWithStatusCheck(MenuItem(MenuItem::Command, toqstr(label), FuncRequest(LFUN_BRANCH_INSERT, cit->branch()))); @@ -1737,24 +1739,25 @@ void Menus::Impl::macxMenuBarInit(GuiView * view, QMenuBar * qmb) // the special menu for Menus. Fill it up only once. if (mac_special_menu_.size() == 0) { + LYXERR(Debug::GUI, "Prepare Mac OS X special menu"); for (size_t i = 0 ; i < num_entries ; ++i) { FuncRequest const func(entries[i].action, from_utf8(entries[i].arg)); mac_special_menu_.add(MenuItem(MenuItem::Command, entries[i].label, func)); } - - // add the entries to a QMenu that will eventually be empty - // and therefore invisible. - QMenu * qMenu = qmb->addMenu("special"); - MenuDefinition::const_iterator cit = mac_special_menu_.begin(); - MenuDefinition::const_iterator end = mac_special_menu_.end(); - for (size_t i = 0 ; cit != end ; ++cit, ++i) { - Action * action = new Action(view, QIcon(), cit->label(), - cit->func(), QString(), qMenu); - action->setMenuRole(entries[i].role); - qMenu->addAction(action); - } + } + // add the entries to a QMenu that will eventually be empty + // and therefore invisible. + QMenu * qMenu = qmb->addMenu("special"); + MenuDefinition::const_iterator cit = mac_special_menu_.begin(); + MenuDefinition::const_iterator end = mac_special_menu_.end(); + for (size_t i = 0 ; cit != end ; ++cit, ++i) { + Action * action = new Action(view, QIcon(), cit->label(), + cit->func(), QString(), qMenu); + action->setMenuRole(entries[i].role); + qMenu->addAction(action); + LYXERR(Debug::GUI, "Add special menu item " << cit->label()); } } diff --git a/status.20x b/status.20x index 39e8dcc9c1..61f29f64dd 100644 --- a/status.20x +++ b/status.20x @@ -64,6 +64,8 @@ What's new - Handle undo in `branch-add' function. +- Fix the missing dynamic menus in general and restore correctly from fullscreen. + * DOCUMENTATION AND LOCALIZATION