groovy git commit: GROOVY-8718: handle new quit handler param better

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

groovy git commit: GROOVY-8718: handle new quit handler param better

paulk
Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_5_X dc3918b4f -> 1948d4726


GROOVY-8718: handle new quit handler param better


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/1948d472
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/1948d472
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/1948d472

Branch: refs/heads/GROOVY_2_5_X
Commit: 1948d472612304469b06e71670326283f482809d
Parents: dc3918b
Author: Paul King <[hidden email]>
Authored: Fri Aug 10 14:57:17 2018 +1000
Committer: Paul King <[hidden email]>
Committed: Fri Aug 10 14:58:56 2018 +1000

----------------------------------------------------------------------
 .../groovy-console/src/main/groovy/groovy/ui/Console.groovy   | 7 ++++++-
 .../src/main/groovy/groovy/ui/view/MacOSXMenuBar.groovy       | 2 +-
 2 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/1948d472/subprojects/groovy-console/src/main/groovy/groovy/ui/Console.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-console/src/main/groovy/groovy/ui/Console.groovy b/subprojects/groovy-console/src/main/groovy/groovy/ui/Console.groovy
index 14106bd..0d42d74 100644
--- a/subprojects/groovy-console/src/main/groovy/groovy/ui/Console.groovy
+++ b/subprojects/groovy-console/src/main/groovy/groovy/ui/Console.groovy
@@ -679,7 +679,12 @@ class Console implements CaretListener, HyperlinkListener, ComponentListener, Fo
         runThread?.interrupt()
     }
 
-    void exit(EventObject evt = null, desktopQuitResponse = null) {
+    void exitDesktop(EventObject evt = null, quitResponse = null) {
+        exit(evt)
+        quitResponse.performQuit()
+    }
+
+    void exit(EventObject evt = null) {
         if (askToInterruptScript()) {
             if (askToSaveFile()) {
                 if (frame instanceof Window) {

http://git-wip-us.apache.org/repos/asf/groovy/blob/1948d472/subprojects/groovy-console/src/main/groovy/groovy/ui/view/MacOSXMenuBar.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-console/src/main/groovy/groovy/ui/view/MacOSXMenuBar.groovy b/subprojects/groovy-console/src/main/groovy/groovy/ui/view/MacOSXMenuBar.groovy
index 8b25190..b40e26d 100644
--- a/subprojects/groovy-console/src/main/groovy/groovy/ui/view/MacOSXMenuBar.groovy
+++ b/subprojects/groovy-console/src/main/groovy/groovy/ui/view/MacOSXMenuBar.groovy
@@ -30,7 +30,7 @@ if (!handler) {
 import java.awt.Desktop
 def handler = Desktop.getDesktop()
 handler.setAboutHandler(controller.&showAbout)
-handler.setQuitHandler(controller.&exit)
+handler.setQuitHandler(controller.&exitDesktop)
 handler.setPreferencesHandler(controller.&preferences)
 handler
 """ : """