diff options
author | kintel <kintel@b57f626f-c46c-0410-a088-ec61d464b74c> | 2010-02-02 01:01:38 (GMT) |
---|---|---|
committer | kintel <kintel@b57f626f-c46c-0410-a088-ec61d464b74c> | 2010-02-02 01:01:38 (GMT) |
commit | 72886170aa4c25a34eb6f22d1740f381462e1fea (patch) | |
tree | c44b8f8a25cd8671816f0cbbdb76a374eb49033e | |
parent | d8615943fd1ed1efe0d9f0e72907ded5d19efab9 (diff) |
Experimental Apple Event hack; you can now do 'tell application "OpenSCAD" to reload'
git-svn-id: http://svn.clifford.at/openscad/trunk@408 b57f626f-c46c-0410-a088-ec61d464b74c
-rw-r--r-- | Info.plist | 4 | ||||
-rw-r--r-- | OpenSCAD.sdef | 8 | ||||
-rw-r--r-- | src/MainWindow.h | 2 | ||||
-rw-r--r-- | src/openscad.cc | 5 |
4 files changed, 18 insertions, 1 deletions
@@ -31,5 +31,9 @@ <true/> </dict> </array> + <key>NSAppleScriptEnabled</key> + <true/> + <key>OSAScriptingDefinition</key> + <string>OpenSCAD.sdef</string> </dict> </plist> diff --git a/OpenSCAD.sdef b/OpenSCAD.sdef new file mode 100644 index 0000000..c509cbe --- /dev/null +++ b/OpenSCAD.sdef @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE dictionary SYSTEM "file://localhost/System/Library/DTDs/sdef.dtd"> +<dictionary title="OpenSCAD Terminology"> + <suite name="OpenSCAD Suite" code="SCAD" description="AppleScript support for OpenSCAD"> + <command name="reload" code="SCADrelo" description="Reload file in the front window (F4)"> + </command> + </suite> +</dictionary> diff --git a/src/MainWindow.h b/src/MainWindow.h index 1dc2153..3c966b7 100644 --- a/src/MainWindow.h +++ b/src/MainWindow.h @@ -93,7 +93,6 @@ private slots: void preferences(); private slots: - void actionReloadCompile(); void actionCompile(); #ifdef ENABLE_CGAL void actionRenderCGAL(); @@ -141,6 +140,7 @@ public slots: void helpAbout(); void helpManual(); void quit(); + void actionReloadCompile(); }; #endif diff --git a/src/openscad.cc b/src/openscad.cc index 0974a11..0cd7455 100644 --- a/src/openscad.cc +++ b/src/openscad.cc @@ -45,6 +45,7 @@ #include <getopt.h> #ifdef Q_WS_MAC #include "EventFilter.h" +#include "AppleEvents.h" #endif static void help(const char *progname) @@ -247,6 +248,10 @@ int main(int argc, char **argv) } else if (useGUI) { +#ifdef Q_WS_MAC + installAppleEventHandlers(); +#endif + // turn on anti-aliasing QGLFormat f; f.setSampleBuffers(true); |