Skip to content
This repository
Browse code

Fixed issue #62: when creating a new project or opening a project whe…

…n the current project was changed, the dialog options were interpreted inverted.
  • Loading branch information...
commit 5ee445339ec9a590ddeb4baf8d45c7150cc063cb 1 parent 6c21c1d
Jan Willem Janssen authored April 09, 2011
15  client/src/main/java/nl/lxtreme/ols/client/action/NewProjectAction.java
@@ -62,14 +62,17 @@ public NewProjectAction( final IClientController aController )
62 62
   @Override
63 63
   public void actionPerformed( final ActionEvent aEvent )
64 64
   {
  65
+    final Window parent = SwingComponentUtils.getOwningWindow( aEvent );
  66
+
65 67
     final IClientController controller = getController();
66  
-    if ( controller.isProjectChanged() )
  68
+
  69
+    // Issue #62: in case the user does NOT confirm to lose its changes, we
  70
+    // should bail out immediately, otherwise continue normally...
  71
+    if ( controller.isProjectChanged() && //
  72
+        !SwingComponentUtils.askConfirmation( parent,
  73
+            "Current project has been changed.\nDo you really want to lose your changes?" ) )
67 74
     {
68  
-      final Window parent = SwingComponentUtils.getOwningWindow( aEvent );
69  
-      if ( SwingComponentUtils.askConfirmation( parent, "Current project is changed.\nReally lose your changes?" ) )
70  
-      {
71  
-        return;
72  
-      }
  75
+      return;
73 76
     }
74 77
 
75 78
     controller.createNewProject();
12  client/src/main/java/nl/lxtreme/ols/client/action/OpenProjectAction.java
@@ -79,13 +79,13 @@ public void actionPerformed( final ActionEvent aEvent )
79 79
 
80 80
     final IClientController controller = getController();
81 81
 
82  
-    if ( controller.isProjectChanged() )
  82
+    // Issue #62: in case the user does NOT confirm to lose its changes, we
  83
+    // should bail out immediately, otherwise continue normally...
  84
+    if ( controller.isProjectChanged() && //
  85
+        !SwingComponentUtils.askConfirmation( parent,
  86
+            "Current project has been changed.\nDo you really want to lose your changes?" ) )
83 87
     {
84  
-      if ( SwingComponentUtils.askConfirmation( parent,
85  
-          "Current project has been changed.\nDo you really want to lose your changes?" ) )
86  
-      {
87  
-        return;
88  
-      }
  88
+      return;
89 89
     }
90 90
 
91 91
     final File file = SwingComponentUtils.showFileOpenDialog( parent, OLS_PROJECT_FILTER );

0 notes on commit 5ee4453

Please sign in to comment.
Something went wrong with that request. Please try again.