mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
fix quit problems on Mac
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16153 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
48fb157414
commit
f6cf871deb
@ -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());
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user