Transfer global mac menu bar initialization to GuiApplication ctor.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22305 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2007-12-26 09:54:48 +00:00
parent 6f57240133
commit 4803a77708
5 changed files with 6 additions and 12 deletions

View File

@ -404,7 +404,7 @@ void Menu::checkShortcuts() const
}
bool Menu::searchFunc(FuncRequest & func, stack<docstring> & names)
bool Menu::searchFunc(FuncRequest & func, stack<docstring> & names) const
{
const_iterator m = begin();
const_iterator m_end = end();

View File

@ -190,7 +190,7 @@ public:
// search for func in this menu iteratively, and put menu
// names in a stack.
bool searchFunc(FuncRequest & func, std::stack<docstring> & names);
bool searchFunc(FuncRequest & func, std::stack<docstring> & names) const;
private:
friend class MenuBackend;

View File

@ -51,6 +51,7 @@
#include <QFileOpenEvent>
#include <QLocale>
#include <QLibraryInfo>
#include <QMenuBar>
#include <QPixmapCache>
#include <QRegExp>
#include <QSessionManager>
@ -170,6 +171,8 @@ GuiApplication::GuiApplication(int & argc, char ** argv)
<< fromqstr(language_name));
#ifdef Q_WS_MACX
// all windows in a Mac application share the same menu bar.
QMenuBar *menuBar = new QMenuBar(0);
// This allows to translate the strings that appear in the LyX menu.
addMenuTranslator();
#endif

View File

@ -98,11 +98,7 @@ void GuiMenubar::init()
}
GuiMenubar::~GuiMenubar() {
#ifdef Q_WS_MACX
delete mac_menubar_;
#endif
}
GuiMenubar::~GuiMenubar() {}
void GuiMenubar::openByName(QString const & name)
{
@ -137,8 +133,6 @@ void GuiMenubar::openByName(QString const & name)
void GuiMenubar::macxMenuBarInit()
{
mac_menubar_ = new QMenuBar;
/* Since Qt 4.2, the qt/mac menu code has special code for
specifying the role of a menu entry. However, it does not
work very well with our scheme of creating menus on demand,

View File

@ -56,9 +56,6 @@ private:
/// name to menu for openByName
NameMap name_map_;
/// MACOS X special menubar.
QMenuBar * mac_menubar_;
};
} // namespace frontend