1
0
mirror of https://github.com/moparisthebest/FireTray synced 2024-11-16 13:55:00 -05:00

* fix Makefile for including .svg into xpi

* minor fixes
This commit is contained in:
foudfou 2012-09-07 15:06:01 +02:00
parent 08e6140312
commit 22de1d3fcc
6 changed files with 38 additions and 22 deletions

View File

@ -76,8 +76,9 @@ chrome_sources := $(chrome_sources_js) \
$(wildcard $(chrome_source_root)/content/*.xml) \ $(wildcard $(chrome_source_root)/content/*.xml) \
$(wildcard $(chrome_source_root)/content/*.css) \ $(wildcard $(chrome_source_root)/content/*.css) \
$(wildcard $(chrome_source_root)/skin/*.css) \ $(wildcard $(chrome_source_root)/skin/*.css) \
$(wildcard $(chrome_source_root)/skin/*.png) \
$(wildcard $(chrome_source_root)/skin/*.gif) \ $(wildcard $(chrome_source_root)/skin/*.gif) \
$(wildcard $(chrome_source_root)/skin/*.png) \
$(wildcard $(chrome_source_root)/skin/*.svg) \
$(wildcard $(chrome_source_root)/skin/linux/icons/hicolor/22x22/apps/*.png) \ $(wildcard $(chrome_source_root)/skin/linux/icons/hicolor/22x22/apps/*.png) \
$(wildcard $(chrome_source_root)/skin/linux/icons/hicolor/32x32/apps/*.png) \ $(wildcard $(chrome_source_root)/skin/linux/icons/hicolor/32x32/apps/*.png) \
$(wildcard $(chrome_source_root)/locale/*/*.dtd) \ $(wildcard $(chrome_source_root)/locale/*/*.dtd) \

View File

@ -30,6 +30,7 @@ firetray.Chat = {
"new-directed-incoming-message", "status-changed", "new-directed-incoming-message", "status-changed",
"unread-im-count-changed" "unread-im-count-changed"
]); ]);
firetray.ChatStatusIcon.init(); firetray.ChatStatusIcon.init();
this.updateIcon(); this.updateIcon();
@ -156,15 +157,29 @@ firetray.Chat = {
}, },
globalConnectedStatus: function() { globalConnectedStatus: function() {
let accounts = Services.accounts.getAccounts(); /* Because we may already be connected during init (for ex. when toggling
let globalConnected = false; the chat_icon_enable pref), we need to updateIcon() during init(). But IM
while (accounts.hasMoreElements()) { accounts' list is not initialized at early stage... */
let account = accounts.getNext().QueryInterface(Ci.imIAccount); try {
log.debug("account="+account+" STATUS="+account.statusInfo.statusType+" connected="+account.connected);
globalConnected = globalConnected || account.connected; let accounts = Services.accounts.getAccounts();
let globalConnected = false;
while (accounts.hasMoreElements()) {
let account = accounts.getNext().QueryInterface(Ci.imIAccount);
log.debug("account="+account+" STATUS="+account.statusInfo.statusType+" connected="+account.connected);
globalConnected = globalConnected || account.connected;
}
log.debug("globalConnected="+globalConnected);
return globalConnected;
} catch (e if e instanceof Components.Exception &&
e.result === Components.results.NS_ERROR_XPC_JS_THREW_JS_OBJECT &&
/_items is undefined/.test(e.message)) {
return false; // ignore
} catch(e) {
log.error(e); return false;
} }
log.debug("globalConnected="+globalConnected);
return globalConnected;
} }
}; };

View File

@ -81,8 +81,6 @@ firetray.Handler = {
this.appHasChat = true; this.appHasChat = true;
log.info('inMailApp='+this.inMailApp+', inBrowserApp='+this.inBrowserApp+', appHasChat='+this.appHasChat); log.info('inMailApp='+this.inMailApp+', inBrowserApp='+this.inBrowserApp+', appHasChat='+this.appHasChat);
this.appStartupTopic = this.getAppStartupTopic(this.appId);
VersionChange.init(FIRETRAY_ID, FIRETRAY_VERSION, FIRETRAY_PREF_BRANCH); VersionChange.init(FIRETRAY_ID, FIRETRAY_VERSION, FIRETRAY_PREF_BRANCH);
VersionChange.addHook(["install", "upgrade", "reinstall"], firetray.VersionChangeHandler.showReleaseNotes); VersionChange.addHook(["install", "upgrade", "reinstall"], firetray.VersionChangeHandler.showReleaseNotes);
VersionChange.addHook(["upgrade", "reinstall"], firetray.VersionChangeHandler.tryEraseOldOptions); VersionChange.addHook(["upgrade", "reinstall"], firetray.VersionChangeHandler.tryEraseOldOptions);
@ -110,14 +108,14 @@ firetray.Handler = {
if (this.appHasChat && Services.prefs.getBoolPref("mail.chat.enabled") && if (this.appHasChat && Services.prefs.getBoolPref("mail.chat.enabled") &&
firetray.Utils.prefService.getBoolPref("chat_icon_enable")) { firetray.Utils.prefService.getBoolPref("chat_icon_enable")) {
Cu.import("resource://firetray/FiretrayMessaging.jsm"); // needed for existsChatAccount Cu.import("resource://firetray/FiretrayMessaging.jsm"); // needed for existsChatAccount
if (this.existsChatAccount()) { Cu.import("resource://firetray/FiretrayChat.jsm");
Cu.import("resource://firetray/FiretrayChat.jsm"); firetray.Utils.addObservers(firetray.Handler, [
"account-added", "account-removed"]);
if (this.existsChatAccount())
firetray.Chat.init(); firetray.Chat.init();
firetray.Utils.addObservers(firetray.Handler, [
"account-added", "account-removed"]);
}
} }
this.appStartupTopic = this.getAppStartupTopic(this.appId);
firetray.Utils.addObservers(firetray.Handler, [ this.appStartupTopic, firetray.Utils.addObservers(firetray.Handler, [ this.appStartupTopic,
"xpcom-will-shutdown", "profile-change-teardown" ]); "xpcom-will-shutdown", "profile-change-teardown" ]);
@ -165,7 +163,7 @@ firetray.Handler = {
}, },
// FIXME: this should definetely be done in Chat, but IM accounts // FIXME: this should definetely be done in Chat, but IM accounts
// seem not be initialized at this stage (Exception... "'TypeError: // seem not be initialized at early stage (Exception... "'TypeError:
// this._items is undefined' when calling method: // this._items is undefined' when calling method:
// [nsISimpleEnumerator::hasMoreElements]"), and we're unsure if we should // [nsISimpleEnumerator::hasMoreElements]"), and we're unsure if we should
// initAccounts() ourselves... // initAccounts() ourselves...
@ -197,7 +195,7 @@ firetray.Handler = {
log.debug("xpcom-will-shutdown"); log.debug("xpcom-will-shutdown");
this.shutdown(); this.shutdown();
break; break;
case "profile-change-teardown": case "profile-change-teardown": // also found "quit-application-granted"
if (data === 'shutdown-persist') if (data === 'shutdown-persist')
this.restoreWarnOnClose(); this.restoreWarnOnClose();
break; break;

View File

@ -64,6 +64,7 @@ firetray.Messaging = {
switch (topic) { switch (topic) {
case "account-removed": case "account-removed":
this.cleanExcludedAccounts(); this.cleanExcludedAccounts();
break;
default: default:
log.warn("unhandled topic: "+topic); log.warn("unhandled topic: "+topic);
} }

View File

@ -196,8 +196,7 @@ firetray.Window = {
getXIDFromChromeWindow: function(win) { getXIDFromChromeWindow: function(win) {
for (let xid in firetray.Handler.windows) for (let xid in firetray.Handler.windows)
if (firetray.Handler.windows[xid].chromeWin === win) if (firetray.Handler.windows[xid].chromeWin === win) return xid;
return xid;
log.error("unknown window while lookup"); log.error("unknown window while lookup");
return null; return null;
}, },
@ -547,7 +546,7 @@ firetray.Window = {
/** debug facility */ /** debug facility */
firetray.Handler.dumpWindows = function() { firetray.Handler.dumpWindows = function() {
log.debug(firetray.Handler.windowsCount); log.debug(firetray.Handler.windowsCount);
for (let winId in firetray.Handler.windows) log.debug(winId+"="+firetray.Handler.gtkWindows.get(winId)); for (let winId in firetray.Handler.windows) log.info(winId+"="+firetray.Handler.gtkWindows.get(winId));
}; };
firetray.Handler.getWindowIdFromChromeWindow = firetray.Window.getXIDFromChromeWindow; firetray.Handler.getWindowIdFromChromeWindow = firetray.Window.getXIDFromChromeWindow;

View File

@ -2,6 +2,8 @@
var EXPORTED_SYMBOLS = [ "firetray" ]; var EXPORTED_SYMBOLS = [ "firetray" ];
const FIRETRAY_LOG_LEVEL = "All"; // "All" for debugging
const Cc = Components.classes; const Cc = Components.classes;
const Ci = Components.interfaces; const Ci = Components.interfaces;
const Cu = Components.utils; const Cu = Components.utils;
@ -137,7 +139,7 @@ firetray.Logging = {
// Loggers are hierarchical, affiliation is handled by a '.' in the name. // Loggers are hierarchical, affiliation is handled by a '.' in the name.
this._logger = Log4Moz.repository.getLogger(loggerName); this._logger = Log4Moz.repository.getLogger(loggerName);
// Lowering this log level will affect all of our addon output // Lowering this log level will affect all of our addon output
this._logger.level = Log4Moz.Level["All"]; this._logger.level = Log4Moz.Level[FIRETRAY_LOG_LEVEL];
// A console appender outputs to the JS Error Console // A console appender outputs to the JS Error Console
let dateFormat = "%T"; let dateFormat = "%T";