]> git.lyx.org Git - lyx.git/commitdiff
fix quit problems on Mac
authorPeter Kümmel <syntheticpp@gmx.net>
Sun, 3 Dec 2006 10:05:41 +0000 (10:05 +0000)
committerPeter Kümmel <syntheticpp@gmx.net>
Sun, 3 Dec 2006 10:05:41 +0000 (10:05 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16153 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiView.C
src/frontends/qt4/GuiView.h

index 63769e1f133e463049234f8afe6921790d15e98f..6157421f4545dda3deef720ef1b6cb1e1372196b 100644 (file)
@@ -214,8 +214,28 @@ void GuiView::init()
        updateToolbars();
        updateLayoutChoice();
        updateMenubar();
+
+#ifdef Q_WS_MACX
+       // Qt docs:
+       // "quit or exit        Application Menu | Quit <application name>      
+       // If this entry is not found a default Quit item will be created to call
+       // QApplication::quit()"
+       QMenu * lyxMenu =  menuBar()->addMenu("&LyX");
+       QAction * quitAction = new QAction(tr("&Quit"), this);
+       lyxMenu->addAction(quitAction);
+       connect(quitAction, SIGNAL(triggered()),this, SLOT(macQuit()));
+#endif
+
+}
+
+
+void GuiView::macQuit()
+{
+       // this slot is only called on Mac
+       dispatch(FuncRequest(LFUN_LYX_QUIT));
 }
 
+
 void GuiView::closeEvent(QCloseEvent * close_event)
 {
        theApp()->gui().unregisterView(id());   
index 83c8f6ba1778d0760583428aa5acca8556904cff..778b5d597724d0466384a03cc06633abc289dfeb 100644 (file)
@@ -103,6 +103,9 @@ public Q_SLOTS:
        void normalSizedIcons();
        void bigSizedIcons();
 
+       /// slot needed by the Mac
+       void macQuit();
+
 protected:
        /// make sure we quit cleanly
        virtual void closeEvent(QCloseEvent * e);