directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r1059078 - /directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/actions/EditorImportConfigurationAction.java
Date Fri, 14 Jan 2011 17:15:51 GMT
Author: pamarcelot
Date: Fri Jan 14 17:15:51 2011
New Revision: 1059078

URL: http://svn.apache.org/viewvc?rev=1059078&view=rev
Log:
Added another confirmation in the case where the editor has unsaved modifications.

Modified:
    directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/actions/EditorImportConfigurationAction.java

Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/actions/EditorImportConfigurationAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/actions/EditorImportConfigurationAction.java?rev=1059078&r1=1059077&r2=1059078&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/actions/EditorImportConfigurationAction.java
(original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/actions/EditorImportConfigurationAction.java
Fri Jan 14 17:15:51 2011
@@ -97,6 +97,20 @@ public class EditorImportConfigurationAc
     {
         try
         {
+            // Checking if the editor has unsaved modifications
+            if ( editor.isDirty() )
+            {
+                // Requiring a confirmation from the user before discarding the unsaved modifications
+                if ( !MessageDialog
+                    .openConfirm(
+                        editor.getSite().getShell(),
+                        "Unsaved modifications",
+                        "The configuration has unsaved modifications. All recent changes
will be lost. Are you sure you want to continue?" ) )
+                {
+                    return;
+                }
+            }
+
             // The input stream that will be used to load the configuration
             InputStream inputStream = null;
 
@@ -152,7 +166,7 @@ public class EditorImportConfigurationAc
                 return;
             }
 
-            // Requiring  a confirmation from the user
+            // Requiring a confirmation from the user
             if ( !MessageDialog.openConfirm( editor.getSite().getShell(), "Overwrite Existing
Configuration",
                 "Are you sure you want to overwrite the existing configuration with the selected
file?" ) )
             {



Mime
View raw message