From 389bb317cc38b762a43d1a4118496aee6bd54d1e Mon Sep 17 00:00:00 2001 From: foudfou Date: Sun, 1 Jan 2012 13:30:42 +0100 Subject: [PATCH] * catch RangeError when ctypesMap overflows * store appName in its original form (not lower-cased) --- TODO | 10 +- src/modules/FiretrayHandler.jsm | 112 +------------------- src/modules/ctypesMap.jsm | 4 +- src/modules/gtk2/FiretrayStatusIcon.jsm | 4 +- src/modules/gtk2/FiretrayWindow.jsm | 130 ++++++++++++++++++++++-- 5 files changed, 134 insertions(+), 126 deletions(-) diff --git a/TODO b/TODO index 1182f09..6dacb54 100644 --- a/TODO +++ b/TODO @@ -1,10 +1,9 @@ TODO ---- -* convert to a https://developer.mozilla.org/en/Extensions/Bootstrapped_extensions +* restore window state -see ../restartless-restart-ffext/ and -http://erikvold.com/blog/index.cfm/2010/10/28/restartless-firefox-addons-part-1-giving-your-addon-the-bootstrap +* add entry to popup menu when registering WONTFIX ------- @@ -16,6 +15,11 @@ WONTFIX user may be toggling them after we store the previous values (and before we restore them) +* convert to a + [Bootstrapped extension](https://developer.mozilla.org/en/Extensions/Bootstrapped_extensions), + nor to an JetPack/Restartable because not supported yet by Thunderbird + + ROADMAP ------- diff --git a/src/modules/FiretrayHandler.jsm b/src/modules/FiretrayHandler.jsm index 69e387b..61f2b64 100644 --- a/src/modules/FiretrayHandler.jsm +++ b/src/modules/FiretrayHandler.jsm @@ -28,7 +28,7 @@ if ("undefined" == typeof(firetray)) { // (https://developer.mozilla.org/en/XUL_School/JavaScript_Object_Management) firetray.Handler = { initialized: false, - appName: null, + appNameOriginal: null, FILENAME_DEFAULT: null, FILENAME_SUFFIX: "32.png", FILENAME_BLANK: null, @@ -40,9 +40,9 @@ firetray.Handler = { visibleWindowsCount: 0, init: function() { // does creates icon - this.appName = Services.appinfo.name.toLowerCase(); + this.appNameOriginal = Services.appinfo.name; this.FILENAME_DEFAULT = firetray.Utils.chromeToPath( - "chrome://firetray/skin/" + this.appName + this.FILENAME_SUFFIX); + "chrome://firetray/skin/" + this.appNameOriginal.toLowerCase() + this.FILENAME_SUFFIX); this.FILENAME_BLANK = firetray.Utils.chromeToPath( "chrome://firetray/skin/blank-icon.png"); this.FILENAME_NEWMAIL = firetray.Utils.chromeToPath( @@ -159,112 +159,6 @@ firetray.Handler = { return winOut; }, - -/* GTK TEST */ - - // /* - // * DAMN IT ! getZOrderDOMWindowEnumerator doesn't work on Linux :-( - // * https://bugzilla.mozilla.org/show_bug.cgi?id=156333, and all windows - // * seem to have the same zlevel ("normalZ") which is different from the - // * z-order. There seems to be no means to get/set the z-order at this - // * time... - // */ - // _updateHandledDOMWindows: function() { - // LOG("_updateHandledDOMWindows"); - // this._handledDOMWindows = []; - // var windowsEnumerator = Services.wm.getEnumerator(null); // returns a nsIDOMWindow - // while (windowsEnumerator.hasMoreElements()) { - // this._handledDOMWindows[this._handledDOMWindows.length] = - // windowsEnumerator.getNext(); - // } - // }, - - // showHideToTray: function(a1) { // unused param - // LOG("showHideToTray"); - - // /* - // * we update _handledDOMWindows only when hiding, because remembered{X,Y} - // * properties are attached to them, and we suppose there won't be - // * created/delete windows when all are hidden. - // * - // * NOTE: this may not be a good design if we want to show/hide one window - // * at a time... might need win.QueryInterface(Ci.nsIInterfaceRequestor) - // * .getInterface(Ci.nsIDOMWindowUtils).outerWindowID; - // */ - // if (!this._windowsHidden) // hide - // this._updateHandledDOMWindows(); - // LOG("nb Windows: " + this._handledDOMWindows.length); - - // for(let i=0; i