mirror of
https://github.com/moparisthebest/FireTray
synced 2024-08-13 15:53:47 -04:00
* fix Makefile for including .svg into xpi
* minor fixes
This commit is contained in:
parent
08e6140312
commit
22de1d3fcc
@ -76,8 +76,9 @@ chrome_sources := $(chrome_sources_js) \
|
||||
$(wildcard $(chrome_source_root)/content/*.xml) \
|
||||
$(wildcard $(chrome_source_root)/content/*.css) \
|
||||
$(wildcard $(chrome_source_root)/skin/*.css) \
|
||||
$(wildcard $(chrome_source_root)/skin/*.png) \
|
||||
$(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/32x32/apps/*.png) \
|
||||
$(wildcard $(chrome_source_root)/locale/*/*.dtd) \
|
||||
|
@ -30,6 +30,7 @@ firetray.Chat = {
|
||||
"new-directed-incoming-message", "status-changed",
|
||||
"unread-im-count-changed"
|
||||
]);
|
||||
|
||||
firetray.ChatStatusIcon.init();
|
||||
this.updateIcon();
|
||||
|
||||
@ -156,8 +157,14 @@ firetray.Chat = {
|
||||
},
|
||||
|
||||
globalConnectedStatus: function() {
|
||||
/* Because we may already be connected during init (for ex. when toggling
|
||||
the chat_icon_enable pref), we need to updateIcon() during init(). But IM
|
||||
accounts' list is not initialized at early stage... */
|
||||
try {
|
||||
|
||||
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);
|
||||
@ -165,6 +172,14 @@ firetray.Chat = {
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
@ -81,8 +81,6 @@ firetray.Handler = {
|
||||
this.appHasChat = true;
|
||||
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.addHook(["install", "upgrade", "reinstall"], firetray.VersionChangeHandler.showReleaseNotes);
|
||||
VersionChange.addHook(["upgrade", "reinstall"], firetray.VersionChangeHandler.tryEraseOldOptions);
|
||||
@ -110,14 +108,14 @@ firetray.Handler = {
|
||||
if (this.appHasChat && Services.prefs.getBoolPref("mail.chat.enabled") &&
|
||||
firetray.Utils.prefService.getBoolPref("chat_icon_enable")) {
|
||||
Cu.import("resource://firetray/FiretrayMessaging.jsm"); // needed for existsChatAccount
|
||||
if (this.existsChatAccount()) {
|
||||
Cu.import("resource://firetray/FiretrayChat.jsm");
|
||||
firetray.Chat.init();
|
||||
firetray.Utils.addObservers(firetray.Handler, [
|
||||
"account-added", "account-removed"]);
|
||||
}
|
||||
if (this.existsChatAccount())
|
||||
firetray.Chat.init();
|
||||
}
|
||||
|
||||
this.appStartupTopic = this.getAppStartupTopic(this.appId);
|
||||
firetray.Utils.addObservers(firetray.Handler, [ this.appStartupTopic,
|
||||
"xpcom-will-shutdown", "profile-change-teardown" ]);
|
||||
|
||||
@ -165,7 +163,7 @@ firetray.Handler = {
|
||||
},
|
||||
|
||||
// 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:
|
||||
// [nsISimpleEnumerator::hasMoreElements]"), and we're unsure if we should
|
||||
// initAccounts() ourselves...
|
||||
@ -197,7 +195,7 @@ firetray.Handler = {
|
||||
log.debug("xpcom-will-shutdown");
|
||||
this.shutdown();
|
||||
break;
|
||||
case "profile-change-teardown":
|
||||
case "profile-change-teardown": // also found "quit-application-granted"
|
||||
if (data === 'shutdown-persist')
|
||||
this.restoreWarnOnClose();
|
||||
break;
|
||||
|
@ -64,6 +64,7 @@ firetray.Messaging = {
|
||||
switch (topic) {
|
||||
case "account-removed":
|
||||
this.cleanExcludedAccounts();
|
||||
break;
|
||||
default:
|
||||
log.warn("unhandled topic: "+topic);
|
||||
}
|
||||
|
@ -196,8 +196,7 @@ firetray.Window = {
|
||||
|
||||
getXIDFromChromeWindow: function(win) {
|
||||
for (let xid in firetray.Handler.windows)
|
||||
if (firetray.Handler.windows[xid].chromeWin === win)
|
||||
return xid;
|
||||
if (firetray.Handler.windows[xid].chromeWin === win) return xid;
|
||||
log.error("unknown window while lookup");
|
||||
return null;
|
||||
},
|
||||
@ -547,7 +546,7 @@ firetray.Window = {
|
||||
/** debug facility */
|
||||
firetray.Handler.dumpWindows = function() {
|
||||
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;
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
var EXPORTED_SYMBOLS = [ "firetray" ];
|
||||
|
||||
const FIRETRAY_LOG_LEVEL = "All"; // "All" for debugging
|
||||
|
||||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
const Cu = Components.utils;
|
||||
@ -137,7 +139,7 @@ firetray.Logging = {
|
||||
// Loggers are hierarchical, affiliation is handled by a '.' in the name.
|
||||
this._logger = Log4Moz.repository.getLogger(loggerName);
|
||||
// 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
|
||||
let dateFormat = "%T";
|
||||
|
Loading…
Reference in New Issue
Block a user