mirror of https://github.com/vitalif/openscad
Support Sparkle's Install on Quit
parent
a7b80d64dd
commit
4bd23c9091
|
@ -323,11 +323,12 @@ macx {
|
|||
src/EventFilter.h \
|
||||
src/AutoUpdater.h \
|
||||
src/SparkleAutoUpdater.h \
|
||||
src/CocoaInitializer.h
|
||||
src/CocoaInitializer.h \
|
||||
src/CocoaUtils.h
|
||||
SOURCES += src/AppleEvents.cc \
|
||||
src/AutoUpdater.cc
|
||||
OBJECTIVE_SOURCES += src/SparkleAutoUpdater.mm \
|
||||
src/CocoaInitializer.mm
|
||||
src/CocoaUtils.mm
|
||||
}
|
||||
|
||||
isEmpty(PREFIX):PREFIX = /usr/local
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
#ifndef COCOAUTILS_H_
|
||||
#define COCOAUTILS_H_
|
||||
|
||||
class CocoaUtils
|
||||
{
|
||||
public:
|
||||
static void endApplication();
|
||||
};
|
||||
|
||||
#endif
|
|
@ -0,0 +1,9 @@
|
|||
#include "CocoaUtils.h"
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
void CocoaUtils::endApplication()
|
||||
{
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
postNotificationName:@"NSApplicationWillTerminateNotification"
|
||||
object:nil];
|
||||
}
|
|
@ -49,6 +49,9 @@
|
|||
#include "ThrownTogetherRenderer.h"
|
||||
#include "csgtermnormalizer.h"
|
||||
#include "AutoUpdater.h"
|
||||
#ifdef Q_OS_MAC
|
||||
#include "CocoaUtils.h"
|
||||
#endif
|
||||
|
||||
#include <QMenu>
|
||||
#include <QTime>
|
||||
|
@ -1843,6 +1846,9 @@ void MainWindow::quit()
|
|||
QApplication::sendEvent(QApplication::instance(), &ev);
|
||||
if (ev.isAccepted()) QApplication::instance()->quit();
|
||||
// FIXME: Cancel any CGAL calculations
|
||||
#ifdef Q_OS_MAC
|
||||
CocoaUtils::endApplication();
|
||||
#endif
|
||||
}
|
||||
|
||||
void MainWindow::consoleOutput(const std::string &msg, void *userdata)
|
||||
|
|
Loading…
Reference in New Issue