Author: bobtarling
Date: 2010-04-18 07:11:42-0700
New Revision: 18283

Modified:
   trunk/src/argouml-app/src/org/argouml/ui/ProjectBrowser.java
   trunk/src/argouml-app/src/org/argouml/ui/cmd/GenericArgoMenuBar.java

Log:
Issue 6050: Allow Mac users to cancel exit request

Modified: trunk/src/argouml-app/src/org/argouml/ui/ProjectBrowser.java
Url: 
http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/ui/ProjectBrowser.java?view=diff&pathrev=18283&r1=18282&r2=18283
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/ui/ProjectBrowser.java        
(original)
+++ trunk/src/argouml-app/src/org/argouml/ui/ProjectBrowser.java        
2010-04-18 07:11:42-0700
@@ -974,7 +974,7 @@
      * If a save is required then prompt the user if they wish to,
      * save and exit, exit without saving or cancel the exit operation.
      */
-    public void tryExit() {
+    public boolean tryExit() {
         LOG.info("Trying to exit the application");
         if (saveAction != null && saveAction.isEnabled()) {
             LOG.info("A save is needed - prompting the user");
@@ -997,14 +997,15 @@
                         && ProjectManager.getManager().getCurrentProject()
                                 .getURI() != null,
                                 false, true);
-                return;
+                return false;
             } else if (response == JOptionPane.CANCEL_OPTION) {
                 LOG.info("The user cancelled the save dialog");
-                return;
+                return false;
             }
         }
         LOG.info("We will now exit");
         exit();
+        return true;
     }
     
     

Modified: trunk/src/argouml-app/src/org/argouml/ui/cmd/GenericArgoMenuBar.java
Url: 
http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/ui/cmd/GenericArgoMenuBar.java?view=diff&pathrev=18283&r1=18282&r2=18283
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/ui/cmd/GenericArgoMenuBar.java        
(original)
+++ trunk/src/argouml-app/src/org/argouml/ui/cmd/GenericArgoMenuBar.java        
2010-04-18 07:11:42-0700
@@ -1174,9 +1174,9 @@
     /**
      * Internal use only.  Do not use.
      */
-    public void macQuit() {
+    public boolean macQuit() {
         LOG.info("Quit has been chosen on a Mac");
-        exitAction.actionPerformed(null);
+        return ProjectBrowser.getInstance().tryExit();
     }
     
     /**

------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=2588017

To unsubscribe from this discussion, e-mail: 
[[email protected]].

Reply via email to