diff options
Diffstat (limited to 'scripting')
3 files changed, 39 insertions, 6 deletions
diff --git a/scripting/java/org/openoffice/netbeans/modules/office/nodes/OfficeDocumentChildren.java b/scripting/java/org/openoffice/netbeans/modules/office/nodes/OfficeDocumentChildren.java index f7b9e0be3038..17f1bf36be47 100644 --- a/scripting/java/org/openoffice/netbeans/modules/office/nodes/OfficeDocumentChildren.java +++ b/scripting/java/org/openoffice/netbeans/modules/office/nodes/OfficeDocumentChildren.java @@ -2,9 +2,9 @@ * * $RCSfile: OfficeDocumentChildren.java,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: toconnor $ $Date: 2003-02-21 16:24:14 $ + * last change: $Author: toconnor $ $Date: 2003-06-06 17:11:03 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -71,6 +71,8 @@ import org.openide.actions.*; import org.openide.util.actions.SystemAction; import org.openide.util.HelpCtx; +import org.openoffice.netbeans.modules.office.options.OfficeSettings; +import org.openoffice.netbeans.modules.office.utils.NagDialog; import org.openoffice.netbeans.modules.office.actions.OfficeDocumentCookie; public class OfficeDocumentChildren extends Children.Keys @@ -155,6 +157,23 @@ public class OfficeDocumentChildren extends Children.Keys } public void destroy() throws IOException { + OfficeSettings settings = OfficeSettings.getDefault(); + String message = "If you already have this document open in " + + "Office, please close it before continuing. Click OK to " + + "delete this parcel."; + + if (settings.getWarnBeforeParcelDelete() == true) { + NagDialog warning = NagDialog.createConfirmationDialog( + message, "Show this message in future", true); + + boolean result = warning.show(); + + if (warning.getState() == false) + settings.setWarnBeforeParcelDelete(false); + + if (result == false) + return; + } super.destroy(); document.removeParcel(name); } diff --git a/scripting/java/org/openoffice/netbeans/modules/office/options/OfficeSettings.java b/scripting/java/org/openoffice/netbeans/modules/office/options/OfficeSettings.java index 6aefb423de96..d41134360fe6 100644 --- a/scripting/java/org/openoffice/netbeans/modules/office/options/OfficeSettings.java +++ b/scripting/java/org/openoffice/netbeans/modules/office/options/OfficeSettings.java @@ -2,9 +2,9 @@ * * $RCSfile: OfficeSettings.java,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: toconnor $ $Date: 2003-02-20 11:56:16 $ + * last change: $Author: toconnor $ $Date: 2003-06-06 17:11:02 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -83,6 +83,7 @@ public class OfficeSettings extends SystemOption { public static final String OFFICE_DIRECTORY = "OfficeDirectory"; public static final String WARN_BEFORE_DOC_DEPLOY = "WarnBeforeDocDeploy"; + public static final String WARN_BEFORE_PARCEL_DELETE = "WarnBeforeParcelDelete"; public static final String WARN_AFTER_DIR_DEPLOY = "WarnAfterDirDeploy"; public static final String WARN_BEFORE_MOUNT = "WarnBeforeMount"; @@ -90,6 +91,7 @@ public class OfficeSettings extends SystemOption { super.initialize(); setWarnBeforeDocDeploy(true); + setWarnBeforeParcelDelete(true); setWarnAfterDirDeploy(true); setWarnBeforeMount(true); @@ -139,6 +141,14 @@ public class OfficeSettings extends SystemOption { putProperty(WARN_BEFORE_DOC_DEPLOY, new Boolean(value), true); } + public boolean getWarnBeforeParcelDelete() { + return ((Boolean)getProperty(WARN_BEFORE_PARCEL_DELETE)).booleanValue(); + } + + public void setWarnBeforeParcelDelete(boolean value) { + putProperty(WARN_BEFORE_PARCEL_DELETE, new Boolean(value), true); + } + public boolean getWarnAfterDirDeploy() { return ((Boolean)getProperty(WARN_AFTER_DIR_DEPLOY)).booleanValue(); } diff --git a/scripting/java/org/openoffice/netbeans/modules/office/options/OfficeSettingsBeanInfo.java b/scripting/java/org/openoffice/netbeans/modules/office/options/OfficeSettingsBeanInfo.java index b652cd61617a..f93e7b975a19 100644 --- a/scripting/java/org/openoffice/netbeans/modules/office/options/OfficeSettingsBeanInfo.java +++ b/scripting/java/org/openoffice/netbeans/modules/office/options/OfficeSettingsBeanInfo.java @@ -2,9 +2,9 @@ * * $RCSfile: OfficeSettingsBeanInfo.java,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: toconnor $ $Date: 2003-02-24 12:53:43 $ + * last change: $Author: toconnor $ $Date: 2003-06-06 17:11:02 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -91,6 +91,10 @@ public class OfficeSettingsBeanInfo extends SimpleBeanInfo { OfficeSettings.class, "get" + OfficeSettings.WARN_BEFORE_DOC_DEPLOY, "set" + OfficeSettings.WARN_BEFORE_DOC_DEPLOY), + new PropertyDescriptor(OfficeSettings.WARN_BEFORE_PARCEL_DELETE, + OfficeSettings.class, + "get" + OfficeSettings.WARN_BEFORE_PARCEL_DELETE, + "set" + OfficeSettings.WARN_BEFORE_PARCEL_DELETE), new PropertyDescriptor(OfficeSettings.WARN_AFTER_DIR_DEPLOY, OfficeSettings.class, "get" + OfficeSettings.WARN_AFTER_DIR_DEPLOY, |