cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From skolbac...@apache.org
Subject cayenne git commit: fix preserving of project path after closing via cmd+q on mac
Date Wed, 12 Aug 2015 15:00:22 GMT
Repository: cayenne
Updated Branches:
  refs/heads/master f9e918daa -> 60479b71f


fix preserving of project path after closing via cmd+q on mac


Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/60479b71
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/60479b71
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/60479b71

Branch: refs/heads/master
Commit: 60479b71fdd3dd145e7f97ec85964a36c74363f7
Parents: f9e918d
Author: Savva Kolbachev <s.kolbachev@gmail.com>
Authored: Wed Aug 12 17:59:44 2015 +0300
Committer: Savva Kolbachev <s.kolbachev@gmail.com>
Committed: Wed Aug 12 17:59:44 2015 +0300

----------------------------------------------------------------------
 .../cayenne/modeler/CayenneModelerController.java      | 13 +++++++++++++
 1 file changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/60479b71/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/CayenneModelerController.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/CayenneModelerController.java
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/CayenneModelerController.java
index ac77093..b7a84b0 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/CayenneModelerController.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/CayenneModelerController.java
@@ -114,6 +114,19 @@ public class CayenneModelerController extends CayenneController {
             }
         });
 
+        // Register a hook to save the window position when quit via the app menu.
+        // This is in Mac OSX only.
+        if (System.getProperty("os.name").startsWith("Mac OS")) {
+            Runnable runner = new Runnable() {
+                @Override
+                public void run() {
+                    PROJECT_STATE_UTIL.saveLastState(projectController);
+                }
+            };
+
+            Runtime.getRuntime().addShutdownHook(new Thread(runner, "Window Prefs Hook"));
+        }
+
         new DropTarget(frame, new DropTargetAdapter() {
 
             public void drop(DropTargetDropEvent dtde) {


Mime
View raw message