CCK only - add some error checking for a weird edge case

This commit is contained in:
mkaply%us.ibm.com 2006-05-19 16:39:57 +00:00
parent 3b59e14a39
commit c80aa2a68a

View File

@ -1917,6 +1917,24 @@ function InitConfigInfo()
function CCKWriteConfigFile(destdir)
{
var file = destdir.clone();
if (!file.exists()) {
var bundle = document.getElementById("bundle_cckwizard");
var button = gPromptService.confirmEx(window, bundle.getString("windowTitle"), bundle.getString("createDir").replace(/%S/g, file.path),
gPromptService.BUTTON_TITLE_YES * gPromptService.BUTTON_POS_0 +
gPromptService.BUTTON_TITLE_NO * gPromptService.BUTTON_POS_1,
null, null, null, null, {});
if (button == 0) {
try {
file.create(Components.interfaces.nsIFile.DIRECTORY_TYPE, 0775);
} catch (ex) {
gPromptService.alert(window, bundle.getString("windowTitle"),
bundle.getString("createDirError").replace(/%S/g, filename));
return;
}
} else {
return;
}
}
file.append("cck.config");
var fos = Components.classes["@mozilla.org/network/file-output-stream;1"]