diff --git a/chrome/content/overlay.js b/chrome/content/overlay.js index 6427213..51669ba 100644 --- a/chrome/content/overlay.js +++ b/chrome/content/overlay.js @@ -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 == "todo.txt@xseth.nl") + 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; + } + } +} diff --git a/install.rdf b/install.rdf index f47f530..cf935ce 100644 --- a/install.rdf +++ b/install.rdf @@ -6,7 +6,7 @@ todo.txt@xseth.nl Todo.txt Extension - 0.6 + 0.7 2 Roy Kokkelkoren Thunderbird extension for the Todo.txt application @@ -20,7 +20,7 @@ {3550f703-e582-4d05-9a08-453d09bdfdc6} 17.0 - 44.* + 46.* diff --git a/screenshots/screenshot_1.png b/screenshots/screenshot_1.png deleted file mode 100644 index 1d21a63..0000000 Binary files a/screenshots/screenshot_1.png and /dev/null differ diff --git a/screenshots/screenshot_2.png b/screenshots/screenshot_2.png deleted file mode 100644 index 2c33aef..0000000 Binary files a/screenshots/screenshot_2.png and /dev/null differ diff --git a/screenshots/screenshot_3.png b/screenshots/screenshot_3.png deleted file mode 100644 index 8096571..0000000 Binary files a/screenshots/screenshot_3.png and /dev/null differ diff --git a/screenshots/screenshot_4.png b/screenshots/screenshot_4.png deleted file mode 100644 index 0eddfb2..0000000 Binary files a/screenshots/screenshot_4.png and /dev/null differ diff --git a/screenshots/screenshot_5.png b/screenshots/screenshot_5.png deleted file mode 100644 index 09aefe5..0000000 Binary files a/screenshots/screenshot_5.png and /dev/null differ