1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-30 06:32:27 +01:00

[bootstrap] Changes toward proper reinitialization after disabling.

--HG--
branch : bootstrapped
This commit is contained in:
Kris Maglione
2010-12-24 15:51:02 -05:00
parent 0d8f23fea5
commit 2f081bd805
7 changed files with 269 additions and 238 deletions

View File

@@ -38,6 +38,19 @@ const Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase),
};
},
cleanup: function () {
delete window.dactyl;
delete window.liberator;
},
destroy: function () {
autocommands.trigger("LeavePre", {});
storage.saveAll();
dactyl.triggerObserver("shutdown", null);
util.dump("All dactyl modules destroyed\n");
autocommands.trigger("Leave", {});
},
observe: {
"dactyl-cleanup": function () {
for (let [, mod] in iter(array(values(modules)).reverse()))
@@ -65,20 +78,6 @@ const Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase),
return "unknown";
}),
cleanup: function () {
delete window.dactyl;
delete window.modules;
delete window.liberator;
},
destroy: function () {
autocommands.trigger("LeavePre", {});
storage.saveAll();
dactyl.triggerObserver("shutdown", null);
util.dump("All dactyl modules destroyed\n");
autocommands.trigger("Leave", {});
},
/**
* @property {number} The current main mode.
* @see modes#mainModes