Permalink
Browse files

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...
1 parent 6c21c1d commit 5ee445339ec9a590ddeb4baf8d45c7150cc063cb @jawi committed Apr 9, 2011
@@ -62,14 +62,17 @@ public NewProjectAction( final IClientController aController )
@Override
public void actionPerformed( final ActionEvent aEvent )
{
+ final Window parent = SwingComponentUtils.getOwningWindow( aEvent );
+
final IClientController controller = getController();
- if ( controller.isProjectChanged() )
+
+ // Issue #62: in case the user does NOT confirm to lose its changes, we
+ // should bail out immediately, otherwise continue normally...
+ if ( controller.isProjectChanged() && //
+ !SwingComponentUtils.askConfirmation( parent,
+ "Current project has been changed.\nDo you really want to lose your changes?" ) )
{
- final Window parent = SwingComponentUtils.getOwningWindow( aEvent );
- if ( SwingComponentUtils.askConfirmation( parent, "Current project is changed.\nReally lose your changes?" ) )
- {
- return;
- }
+ return;
}
controller.createNewProject();
@@ -79,13 +79,13 @@ public void actionPerformed( final ActionEvent aEvent )
final IClientController controller = getController();
- if ( controller.isProjectChanged() )
+ // Issue #62: in case the user does NOT confirm to lose its changes, we
+ // should bail out immediately, otherwise continue normally...
+ if ( controller.isProjectChanged() && //
+ !SwingComponentUtils.askConfirmation( parent,
+ "Current project has been changed.\nDo you really want to lose your changes?" ) )
{
- if ( SwingComponentUtils.askConfirmation( parent,
- "Current project has been changed.\nDo you really want to lose your changes?" ) )
- {
- return;
- }
+ return;
}
final File file = SwingComponentUtils.showFileOpenDialog( parent, OLS_PROJECT_FILTER );

0 comments on commit 5ee4453

Please sign in to comment.