Hello,

Could someone commit this please? It contains compilation fixes for MacOSX as reported by Bennet. There is still a problem with Dialog.C:275 which does not recognize ControlRef although it is included.

Thanks in advance.

Abdel.

PS: I'll update the changelog after the previous patch is applied.

PS for Bennet: Please verify that you can open "ControlRef.h" and that it is not empty. It could be also that CONTROLREF_H is defined elsewhere. Please do a

grep -r 'CONTROLREF_H' src

for the top-level lyx directory. If you find nothing, just comment out line 275 for now.
Index: D:/msys/home/yns/src/lyx-svn/trunk/src/frontends/qt4/lyx_gui.C
===================================================================
--- D:/msys/home/yns/src/lyx-svn/trunk/src/frontends/qt4/lyx_gui.C      
(revision 13339)
+++ D:/msys/home/yns/src/lyx-svn/trunk/src/frontends/qt4/lyx_gui.C      
(working copy)
@@ -160,7 +160,6 @@
 
        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);
@@ -176,9 +175,8 @@
                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
@@ -194,7 +192,7 @@
 
        app.installTranslator(&aqua_trans);
 #endif
-
+*/
        using namespace lyx::graphics;
 
        Image::newImage = boost::bind(&QLImage::newImage);
Index: D:/msys/home/yns/src/lyx-svn/trunk/src/frontends/qt4/QLMenubar.C
===================================================================
--- D:/msys/home/yns/src/lyx-svn/trunk/src/frontends/qt4/QLMenubar.C    
(revision 13339)
+++ D:/msys/home/yns/src/lyx-svn/trunk/src/frontends/qt4/QLMenubar.C    
(working copy)
@@ -1,5 +1,5 @@
 /**
- * \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.
  *
@@ -21,16 +21,9 @@
 #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>
 
@@ -156,8 +149,8 @@
 */
 QMenuBar * QLMenubar::menuBar() const
 {
-#ifdef Q_WS_MAC
-       return menubar_.get();
+#ifdef Q_OS_MACX
+       return mac_menubar_.get();
 #else
        return owner_->menuBar();
 #endif
@@ -165,14 +158,14 @@
 
 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
 }
 
Index: D:/msys/home/yns/src/lyx-svn/trunk/src/frontends/qt4/QLMenubar.h
===================================================================
--- D:/msys/home/yns/src/lyx-svn/trunk/src/frontends/qt4/QLMenubar.h    
(revision 13339)
+++ D:/msys/home/yns/src/lyx-svn/trunk/src/frontends/qt4/QLMenubar.h    
(working copy)
@@ -15,12 +15,14 @@
 
 #include "frontends/Menubar.h"
 
-#include <map>
+#include <map>
+#include <boost/scoped_ptr.hpp>
 
 #include <QObject>
+#include <QMenuBar>
 
-class QMenuBar;
-class QMenu;
+#include "QLPopupMenu.h"
+
 class LyXView;
 class MenuBackend;
 class Menu;
@@ -58,7 +60,7 @@
 //     void updateMenu();
 
 private:
-       /// Initialize specific MACOS X menubar
+       /// Initialize specific MACOS X menubar.
        void QLMenubar::macxMenuBarInit();
 
        /// owning view
@@ -67,14 +69,13 @@
        /// 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
Index: D:/msys/home/yns/src/lyx-svn/trunk/src/frontends/qt4/QLPainter.C
===================================================================
--- D:/msys/home/yns/src/lyx-svn/trunk/src/frontends/qt4/QLPainter.C    
(revision 13339)
+++ D:/msys/home/yns/src/lyx-svn/trunk/src/frontends/qt4/QLPainter.C    
(working copy)
@@ -265,7 +265,7 @@
 
        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
Index: D:/msys/home/yns/src/lyx-svn/trunk/src/frontends/qt4/QLPopupMenu.C
===================================================================
--- D:/msys/home/yns/src/lyx-svn/trunk/src/frontends/qt4/QLPopupMenu.C  
(revision 13339)
+++ D:/msys/home/yns/src/lyx-svn/trunk/src/frontends/qt4/QLPopupMenu.C  
(working copy)
@@ -10,7 +10,9 @@
  */
 
 #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"
@@ -26,7 +28,7 @@
 #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;
@@ -145,7 +147,7 @@
 /// \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()) {
@@ -175,7 +177,7 @@
 /// \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

Reply via email to