-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleanup of calendar when add-on uninstalled
Removed old screenshots, bumped supported version to 46.*
- Loading branch information
Roy Kokkelkoren
committed
May 1, 2016
1 parent
a88f98f
commit cdd78ea
Showing
7 changed files
with
23 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,19 @@ Components.utils.import("resource://calendar/modules/calUtils.jsm"); | |
Components.utils.import("resource://todotxt/logger.jsm"); | ||
|
||
window.addEventListener("load", function(e) { | ||
var ID = "{00C350E2-3F65-11E5-8E8B-FBF81D5D46B0}"; | ||
let ID = "{00C350E2-3F65-11E5-8E8B-FBF81D5D46B0}"; | ||
var calManager = cal.getCalendarManager(); | ||
let found = false; | ||
|
||
// Add observers to trigger when add-on is uninstalled | ||
AddonManager.addAddonListener({ | ||
onUninstalling: function(addon) { | ||
if (addon.id == "[email protected]") | ||
removeCal(calManager); | ||
todotxtLogger.debug("overlay.js","Uninstalling"); | ||
}, | ||
}); | ||
|
||
for each (calendar in calManager.getCalendars({})){ | ||
if(calendar.providerID == ID){ | ||
todotxtLogger.debug("overlay.js","Calendar found"); | ||
|
@@ -26,3 +35,14 @@ function createCal(calManager){ | |
newCal.name = "Todo.txt"; | ||
calManager.registerCalendar(newCal); | ||
} | ||
|
||
function removeCal(calManager){ | ||
let ID = "{00C350E2-3F65-11E5-8E8B-FBF81D5D46B0}"; | ||
for each (calendar in calManager.getCalendars({})){ | ||
if(calendar.providerID == ID){ | ||
calManager.removeCalendar(calendar); | ||
todotxtLogger.debug("overlay.js","Calendar found and removed"); | ||
break; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
<Description about="urn:mozilla:install-manifest"> | ||
<em:id>[email protected]</em:id> | ||
<em:name>Todo.txt Extension</em:name> | ||
<em:version>0.6</em:version> | ||
<em:version>0.7</em:version> | ||
<em:type>2</em:type> | ||
<em:creator>Roy Kokkelkoren</em:creator> | ||
<em:description>Thunderbird extension for the Todo.txt application</em:description> | ||
|
@@ -20,7 +20,7 @@ | |
<Description> | ||
<em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id> | ||
<em:minVersion>17.0</em:minVersion> | ||
<em:maxVersion>44.*</em:maxVersion> | ||
<em:maxVersion>46.*</em:maxVersion> | ||
</Description> | ||
</em:targetApplication> | ||
|
||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.