summaryrefslogtreecommitdiff
path: root/src/mainwin.cc
diff options
context:
space:
mode:
authordon bright <hugh.m.bright@gmail.com>2013-02-24 03:54:53 (GMT)
committerdon bright <hugh.m.bright@gmail.com>2013-02-24 03:54:53 (GMT)
commitca41979ee514f642c506e4f4d81461f19b587bf2 (patch)
treef31feb004d0b724d5240c8a227c7f0c886939a1b /src/mainwin.cc
parenteff16283358217b43b310269a72e0cb47357a8b3 (diff)
parentabc9da96c89b337377ee62ac29ee54e4e7b0a514 (diff)
Merge branch 'master' of github.com:openscad/openscad into issue11_2
Conflicts: RELEASE_NOTES openscad.pro src/mainwin.cc
Diffstat (limited to 'src/mainwin.cc')
-rw-r--r--src/mainwin.cc24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/mainwin.cc b/src/mainwin.cc
index b603113..0280bbe 100644
--- a/src/mainwin.cc
+++ b/src/mainwin.cc
@@ -49,6 +49,10 @@
#include "ThrownTogetherRenderer.h"
#include "csgtermnormalizer.h"
#include "QGLView.h"
+#include "AutoUpdater.h"
+#ifdef Q_OS_MAC
+#include "CocoaUtils.h"
+#endif
#include <QMenu>
#include <QTime>
@@ -206,6 +210,16 @@ MainWindow::MainWindow(const QString &filename)
animate_panel->hide();
+ // Application menu
+#ifdef DEBUG
+ this->appActionUpdateCheck->setEnabled(false);
+#else
+#ifdef Q_OS_MAC
+ this->appActionUpdateCheck->setMenuRole(QAction::ApplicationSpecificRole);
+ this->appActionUpdateCheck->setEnabled(true);
+ connect(this->appActionUpdateCheck, SIGNAL(triggered()), this, SLOT(actionUpdateCheck()));
+#endif
+#endif
// File menu
connect(this->fileActionNew, SIGNAL(triggered()), this, SLOT(actionNew()));
connect(this->fileActionOpen, SIGNAL(triggered()), this, SLOT(actionOpen()));
@@ -773,6 +787,13 @@ void MainWindow::compileCSG(bool procevents)
}
}
+void MainWindow::actionUpdateCheck()
+{
+ if (AutoUpdater *updater =AutoUpdater::updater()) {
+ updater->checkForUpdates();
+ }
+}
+
void MainWindow::actionNew()
{
#ifdef ENABLE_MDI
@@ -1815,6 +1836,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)
contact: Jan Huwald // Impressum