/**
- * \file qt2/QLMenubar.C
+ * \file qt4/QLMenubar.C
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
#include "support/lstrings.h"
#include "MenuBackend.h"
-#include "support/lstrings.h"
#include "debug.h"
-#ifdef Q_WS_MACX
-#include "kbmap.h"
-#include "QLyXKeySym.h"
-extern boost::scoped_ptr<kb_keymap> toplevel_keymap;
-#endif
-
#include <QMenuBar>
#include <QCursor>
*/
QMenuBar * QLMenubar::menuBar() const
{
-#ifdef Q_WS_MAC
- return menubar_.get();
+#ifdef Q_OS_MACX
+ return mac_menubar_.get();
#else
return owner_->menuBar();
#endif
void QLMenubar::macxMenuBarInit()
{
-#ifdef Q_WS_MACX
- menubar_ = new QMenuBar;
+#ifdef Q_OS_MACX
+ mac_menubar_.reset(new QMenuBar);
// this is the name of the menu that contains our special entries
menubackend_.specialMenu("LyX");
// make sure that the special entries are added to the first
// menu even before this menu has been opened.
- name_map_[menubackend_.getMenubar().begin()->submenuname()]->showing();
+ name_map_[menubackend_.getMenubar().begin()->submenuname()]->update();
#endif
}
#include "frontends/Menubar.h"
#include <map>
+#include <boost/scoped_ptr.hpp>
#include <QObject>
+#include <QMenuBar>
+
+#include "QLPopupMenu.h"
-class QMenuBar;
-class QMenu;
class LyXView;
class MenuBackend;
class Menu;
/// menu controller
MenuBackend & menubackend_;
- typedef std::map<std::string, QMenu *> NameMap;
+ typedef std::map<std::string, QLPopupMenu *> NameMap;
/// name to menu for openByName
NameMap name_map_;
-#ifdef Q_WS_MACX
- boost::scoped_ptr<QMenuBar> menubar_;
-#endif
+ /// MACOS X special menubar.
+ boost::scoped_ptr<QMenuBar> mac_menubar_;
};
} // namespace frontend
QString str;
str.setLength(ls);
- for (size_t i = 0; i < ls; ++i)
+ for (int i = 0; i < ls; ++i)
// Brain-dead MSVC wants at(i) rather than operator[]
str[i] = QChar(encoding->ucs(s[i]));
// HACK: QT3 refuses to show single compose characters
#include <config.h>
+#include <boost/current_function.hpp>
+
// Qt defines a macro 'signals' that clashes with a boost namespace.
// All is well if the namespace is visible first.
#include "QtView.h"
#include "debug.h"
-#ifdef Q_WS_MACX
+#ifdef Q_OS_MACX
#include "kbmap.h"
#include "QLyXKeySym.h"
extern boost::scoped_ptr<kb_keymap> toplevel_keymap;
/// \todo Mac specific binding handling.
void QLPopupMenu::addBinding(string & label, MenuItem const & mi)
{
-#ifndef Q_WS_MACX
+#ifndef Q_OS_MACX
string const binding(mi.binding());
if (!binding.empty()) {
/// \todo Fix Mac specific menu hack
void QLPopupMenu::specialMacXmenuHack()
{
-#ifdef Q_WS_MACX
+#ifdef Q_OS_MACX
/* The qt/mac menu code has a very silly hack that
moves some menu entries that it recognizes by name
(e.g. "Preferences...") to the "LyX" menu. This
static LQApplication app(argc, argv);
-#if QT_VERSION >= 0x030200
// install translation file for Qt built-in dialogs
// These are only installed since Qt 3.2.x
static QTranslator qt_trans(0);
lyxerr[Debug::GUI]
<< "Could not find Qt translations for locale "
<< QTextCodec::locale() << std::endl;
-#endif
-#ifdef Q_WS_MACX
+/*#ifdef Q_WS_MACX
// These translations are meant to break Qt/Mac menu merging
// algorithm on some entries. It lists the menu names that
// should not be moved to the LyX menu
app.installTranslator(&aqua_trans);
#endif
-
+*/
using namespace lyx::graphics;
Image::newImage = boost::bind(&QLImage::newImage);