diff --git a/extensions/cck/browser/jar.mn b/extensions/cck/browser/jar.mn index 9b1d8c831f9e..cce93de55957 100755 --- a/extensions/cck/browser/jar.mn +++ b/extensions/cck/browser/jar.mn @@ -5,11 +5,10 @@ cckwizard.jar: content/cckwizard/cckwizard.js (resources/content/cckwizard/cckwizard.js) content/cckwizard/cckwizard.png (resources/content/cckwizard/cckwizard.png) content/cckwizard/cckwizard.xul (resources/content/cckwizard/cckwizard.xul) - content/cckwizard/cckwizard.properties (resources/content/cckwizard/cckwizard.properties) content/cckwizard/config.xul (resources/content/cckwizard/config.xul) content/cckwizard/pref.xul (resources/content/cckwizard/pref.xul) content/cckwizard/reg.xul (resources/content/cckwizard/reg.xul) - content/cckwizard/searchplugin.xul (resources/content/cckwizard/searchplugin.xul) + content/cckwizard/searchplugin.xul (resources/content/cckwizard/searchplugin.xul) content/cckwizard/showconfig.xul (resources/content/cckwizard/showconfig.xul) content/cckwizard/srcfiles/cck-browser-overlay.xul.in (resources/content/cckwizard/srcfiles/cck-browser-overlay.xul.in) content/cckwizard/srcfiles/cck.dtd.in (resources/content/cckwizard/srcfiles/cck.dtd.in) diff --git a/extensions/cck/browser/locales/en-US/chrome/cckWizard.dtd b/extensions/cck/browser/locales/en-US/chrome/cckWizard.dtd index 2a6ecd508f45..fd926fc3bb58 100755 --- a/extensions/cck/browser/locales/en-US/chrome/cckWizard.dtd +++ b/extensions/cck/browser/locales/en-US/chrome/cckWizard.dtd @@ -22,6 +22,8 @@ + + diff --git a/extensions/cck/browser/locales/en-US/chrome/cckwizard.properties b/extensions/cck/browser/locales/en-US/chrome/cckwizard.properties new file mode 100755 index 000000000000..ad641581a840 --- /dev/null +++ b/extensions/cck/browser/locales/en-US/chrome/cckwizard.properties @@ -0,0 +1,5 @@ +windowTitle=Firefox CCK +deleteConfirm=Are you sure you want to delete this configuration? +outputLocation=Firefox CCK Wizard is completed. XPI is available at:\n +cancelConfirm=Do you want to save your changes? + diff --git a/extensions/cck/browser/locales/jar.mn b/extensions/cck/browser/locales/jar.mn index 5492055b4d24..27e91b515acc 100755 --- a/extensions/cck/browser/locales/jar.mn +++ b/extensions/cck/browser/locales/jar.mn @@ -3,3 +3,4 @@ cckwizard.jar: % locale cckwizard @AB_CD@ %locale/@AB_CD@/cckwizard/ locale/@AB_CD@/cckwizard/cckWizard.dtd (@AB_CD@/chrome/cckWizard.dtd) + locale/@AB_CD@/cckwizard/cckwizard.properties (@AB_CD@/chrome/cckwizard.properties) diff --git a/extensions/cck/browser/resources/content/cckwizard/cckwizard.js b/extensions/cck/browser/resources/content/cckwizard/cckwizard.js index 4e653e5dd95b..0f63f594d02b 100755 --- a/extensions/cck/browser/resources/content/cckwizard/cckwizard.js +++ b/extensions/cck/browser/resources/content/cckwizard/cckwizard.js @@ -137,19 +137,34 @@ function DeleteConfig() { var bundle = document.getElementById("bundle_cckwizard"); - var rv = gPromptService.confirmEx(window, "WizardMachine", bundle.getString("deleteConfirm"), - gPromptService.BUTTON_TITLE_YES * gPromptService.BUTTON_POS_0 + - gPromptService.BUTTON_TITLE_NO * gPromptService.BUTTON_POS_1, - null, null, null, null, {}); - if (rv == false) { + var button = gPromptService.confirmEx(window, "WizardMachine", bundle.getString("deleteConfirm"), + gPromptService.BUTTON_TITLE_YES * gPromptService.BUTTON_POS_0 + + gPromptService.BUTTON_TITLE_NO * gPromptService.BUTTON_POS_1, + null, null, null, null, {}); + if (button == 0) { gPrefBranch.deleteBranch("cck.config."+currentconfigname); updateconfiglist(); } } +function SetSaveOnExitPref() +{ + gPrefBranch.setBoolPref("cck.save_on_exit", document.getElementById("saveOnExit").checked); +} +function OpenCCKWizard() +{ + try { + document.getElementById("saveOnExit").checked = gPrefBranch.getBoolPref("cck.save_on_exit"); + } catch (ex) { + } + try { + document.getElementById("zipLocation").value = gPrefBranch.getCharPref("cck.path_to_zip"); + } catch (ex) { + } + - +} function ShowMain() { @@ -225,6 +240,34 @@ function saveconfig() } +function CloseCCKWizard() +{ + var saveOnExit; + try { + saveOnExit = gPrefBranch.getBoolPref("cck.save_on_exit"); + } catch (ex) { + saveOnExit = false; + } + + var button; + if (!saveOnExit) { + var bundle = document.getElementById("bundle_cckwizard"); + + var button = gPromptService.confirmEx(window, "WizardMachine", bundle.getString("cancelConfirm"), + gPromptService.BUTTON_TITLE_YES * gPromptService.BUTTON_POS_0 + + gPromptService.BUTTON_TITLE_NO * gPromptService.BUTTON_POS_1, + null, null, null, null, {}); + } else { + button = 0; + } + + if (button == 0) { + saveconfig(); + } + gPrefBranch.setCharPref("cck.path_to_zip", document.getElementById("zipLocation").value); +} + + function OnConfigLoad() { configCheckOKButton(); @@ -724,6 +767,11 @@ function CCKZip(zipfile, location) } return; } + + var zipLocation = document.getElementById("zipLocation").value; + if (zipLocation.length == 0) { + zipLocation = "zip"; + } platform = navigator.platform; var file = location.clone(); @@ -739,9 +787,9 @@ function CCKZip(zipfile, location) line = "cd \"" + location.path + "\"\n"; fos.write(line, line.length); if (navigator.platform == "Win32") - line = "zip -r \"" + location.path + "\\" + zipfile + "\""; + line = zipLocation + " -r \"" + location.path + "\\" + zipfile + "\""; else - line = "zip -r \"" + location.path + "/" + zipfile + "\""; + line = zipLocation + " -r \"" + location.path + "/" + zipfile + "\""; for (var i=2; i < arguments.length; i++) { line += " " + arguments[i]; } @@ -769,7 +817,7 @@ function CCKZip(zipfile, location) var args = [file.path]; process.run(true, args, args.length); - file.remove(false); +// file.remove(false); } function CCKWriteXULOverlay(destdir) @@ -1361,8 +1409,10 @@ function CCKWriteConfigFile(destdir) (elements[i].nodeName == "checkbox") || (elements[i].id == "RootKey1") || (elements[i].id == "Type1")) { - var line = elements[i].getAttribute("id") + "=" + elements[i].value + "\n"; - fos.write(line, line.length); + if ((elements[i].id != "saveOnExit") && (elements[i].id != "zipLocation")) { + var line = elements[i].getAttribute("id") + "=" + elements[i].value + "\n"; + fos.write(line, line.length); + } } else if (elements[i].id == "prefList") { listbox = document.getElementById('prefList'); for (var j=0; j < listbox.getRowCount(); j++) { diff --git a/extensions/cck/browser/resources/content/cckwizard/cckwizard.xul b/extensions/cck/browser/resources/content/cckwizard/cckwizard.xul index 600c602570a8..7f878010c5d7 100755 --- a/extensions/cck/browser/resources/content/cckwizard/cckwizard.xul +++ b/extensions/cck/browser/resources/content/cckwizard/cckwizard.xul @@ -45,8 +45,9 @@