Am 22.05.2011 um 16:37 schrieb Stephan Witt: > Am 22.05.2011 um 12:20 schrieb Murat Yildizoglu: > >> Hi again, >> >> I see a strange thing with this new build: I can see several "Reconfigure" >> items in the Lyx menu. Their number even increases : I had two of them and I >> can see three now. Not a big problem, but i prefer to signal it. > > Yes, I can it see too. :( Weird...
It's all very special casing... The menu code is written twice in Qt - one version for Carbon, another one for Cocoa. Very likely they behave different. It looks like the Cocoa implementation adds the Reconfigure menu for every GuiView instance... And the other special menu items are not affected. I made another hack on top of the mac menu hacks. Please, find it attached. JMarc, can you say something about this patch, please? Here it works for me. But don't ask me why. Stephan
Index: src/frontends/qt4/Menus.cpp =================================================================== --- src/frontends/qt4/Menus.cpp (Revision 38827) +++ src/frontends/qt4/Menus.cpp (Arbeitskopie) @@ -1735,8 +1737,9 @@ }; const size_t num_entries = sizeof(entries) / sizeof(entries[0]); + const bool first_call = mac_special_menu_.size() == 0; // the special menu for Menus. Fill it up only once. - if (mac_special_menu_.size() == 0) { + if (first_call) { for (size_t i = 0 ; i < num_entries ; ++i) { FuncRequest const func(entries[i].action, from_utf8(entries[i].arg)); @@ -1751,10 +1754,12 @@ 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); + if (first_call || entries[i].role != QAction::ApplicationSpecificRole) { + Action * action = new Action(view, QIcon(), cit->label(), + cit->func(), QString(), qMenu); + action->setMenuRole(entries[i].role); + qMenu->addAction(action); + } } }