Browse Source

keysnail.js: Show popup on finish of update-init-file

pull/1/head
10sr 10 years ago
parent
commit
ed7becbd24
1 changed files with 19 additions and 5 deletions
  1. +19
    -5
      _keysnail.js

+ 19
- 5
_keysnail.js View File

@@ -415,7 +415,6 @@ var updateInitFile = (function(){
throw util.getLocaleString("failedToInstallFile", [aFile.leafName]) + " :: " + x; throw util.getLocaleString("failedToInstallFile", [aFile.leafName]) + " :: " + x;
} }


// TODO: fail when dstdir is empty
try try
{ {
// calc dir from path // calc dir from path
@@ -433,8 +432,11 @@ var updateInitFile = (function(){
} }


let confirmed = force || let confirmed = force ||
util.confirm(util.getLocaleString("overWriteConfirmationTitle"),
util.getLocaleString("overWriteConfirmation", [destinationFile.path]));
util.confirm(
util.getLocaleString("overWriteConfirmationTitle"),
util.getLocaleString("overWriteConfirmation",
[destinationFile.path])
);


if (!confirmed) { if (!confirmed) {
throw util.getLocaleString("canceledByUser"); throw util.getLocaleString("canceledByUser");
@@ -447,7 +449,9 @@ var updateInitFile = (function(){
} }
catch (x) catch (x)
{ {
throw util.getLocaleString("failedToInstallFile", [aFile.leafName]) + " :: " + x;
throw util.getLocaleString("failedToInstallFile",
[aFile.leafName]) +
" :: " + x;
} }
} }


@@ -462,8 +466,18 @@ var updateInitFile = (function(){
let file = userscript.writeTextTmp(name, req.responseText); let file = userscript.writeTextTmp(name, req.responseText);
let installed = placeFile(file); let installed = placeFile(file);
util.message(installed.path + " installed"); util.message(installed.path + " installed");
display.showPopup("update-init-file",
installed.path + " installed")
} catch (x) { } catch (x) {
util.message("An error occured while installing required scripts :: " + x.message);
util.message(
"An error occured while installing required scripts :: " +
x.message
);
display.showPopup(
"update-init-file",
"An error occured while installing required scripts :: " +
x.message
);
} }
}); });
} }


Loading…
Cancel
Save