mirror of
https://github.com/moparisthebest/FireTray
synced 2025-01-08 12:08:05 -05:00
* ctypes-utils: just log 'Info' if lib not found.
* Cleaning
This commit is contained in:
parent
f2acc43dce
commit
2b0084b69a
@ -23,7 +23,7 @@ var firetrayChrome = { // each new window gets a new firetrayChrome !
|
|||||||
firetray_log.debug("Handler initialized: "+firetray.Handler.initialized);
|
firetray_log.debug("Handler initialized: "+firetray.Handler.initialized);
|
||||||
let init = firetray.Handler.initialized || firetray.Handler.init();
|
let init = firetray.Handler.initialized || firetray.Handler.init();
|
||||||
|
|
||||||
firetray_log.debug("ONLOAD"); firetray.Handler.dumpWindows();
|
firetray_log.debug("ONLOAD");
|
||||||
this.winId = firetray.Handler.registerWindow(win);
|
this.winId = firetray.Handler.registerWindow(win);
|
||||||
|
|
||||||
win.addEventListener('close', firetrayChrome.onClose, true);
|
win.addEventListener('close', firetrayChrome.onClose, true);
|
||||||
@ -39,7 +39,7 @@ var firetrayChrome = { // each new window gets a new firetrayChrome !
|
|||||||
onQuit: function(win) {
|
onQuit: function(win) {
|
||||||
win.removeEventListener('close', firetrayChrome.onClose, true);
|
win.removeEventListener('close', firetrayChrome.onClose, true);
|
||||||
firetray.Handler.unregisterWindow(win);
|
firetray.Handler.unregisterWindow(win);
|
||||||
firetray_log.info("windowsCount="+firetray.Handler.windowsCount+", visibleWindowsCount="+firetray.Handler.visibleWindowsCount);
|
firetray_log.debug("windowsCount="+firetray.Handler.windowsCount+", visibleWindowsCount="+firetray.Handler.visibleWindowsCount);
|
||||||
firetray_log.debug('Firetray UNLOADED !');
|
firetray_log.debug('Firetray UNLOADED !');
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -119,17 +119,15 @@ function ctypes_library(aName, aABIs, aDefines, aGlobal) {
|
|||||||
for each (let abi in aABIs) {
|
for each (let abi in aABIs) {
|
||||||
// FIXME: ABI is in fact SO_VER. Now we're mixing .so versions and the
|
// FIXME: ABI is in fact SO_VER. Now we're mixing .so versions and the
|
||||||
// .dll extension :(
|
// .dll extension :(
|
||||||
let soname = abi === 'dll' ? aName :
|
let libname = abi === 'dll' ? aName :
|
||||||
"lib" + aName + ".so." + abi.toString();
|
"lib" + aName + ".so." + abi.toString();
|
||||||
log.debug("Trying " + soname);
|
log.debug("Trying " + libname);
|
||||||
try {
|
try {
|
||||||
library = ctypes.open(soname);
|
library = ctypes.open(libname);
|
||||||
this.ABI = abi;
|
this.ABI = abi;
|
||||||
log.debug("Successfully loaded " + soname);
|
log.debug("Successfully loaded " + libname);
|
||||||
break;
|
break;
|
||||||
} catch(e) {
|
} catch(e) {}
|
||||||
log.warn(soname+" unfound.");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.name = aName;
|
this.name = aName;
|
||||||
@ -153,7 +151,7 @@ function ctypes_library(aName, aABIs, aDefines, aGlobal) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (!library) {
|
if (!library) {
|
||||||
log.debug("Failed to load library: " + aName);
|
log.info("Library does not exist: " + aName);
|
||||||
this.ABI = -1;
|
this.ABI = -1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -54,19 +54,18 @@ firetray.StatusIcon = {
|
|||||||
if (!firetray.PopupMenu.init())
|
if (!firetray.PopupMenu.init())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
// FIXME: we may want to split into 2 separate modules: GtkStatusIcon and
|
||||||
|
// AppIndicator.
|
||||||
Cu.import("resource://firetray/ctypes/linux/appindicator.jsm");
|
Cu.import("resource://firetray/ctypes/linux/appindicator.jsm");
|
||||||
if (appind3.available() && this.dbusNotificationWatcherReady()) {
|
if (appind3.available() && this.dbusNotificationWatcherReady()) {
|
||||||
firetray.Handler.subscribeLibsForClosing([appind3]);
|
firetray.Handler.subscribeLibsForClosing([appind3]);
|
||||||
// FIXME: we may want to split into 2 separate modules: GtkStatusIcon and
|
|
||||||
// AppIndicator.
|
|
||||||
this.indicatorInit();
|
this.indicatorInit();
|
||||||
}
|
} else {
|
||||||
|
|
||||||
this.trayIcon = gtk.gtk_status_icon_new();
|
this.trayIcon = gtk.gtk_status_icon_new();
|
||||||
firetray.Handler.setIconImageDefault();
|
firetray.Handler.setIconImageDefault();
|
||||||
firetray.Handler.setIconTooltipDefault();
|
firetray.Handler.setIconTooltipDefault();
|
||||||
|
|
||||||
this.addCallbacks();
|
this.addCallbacks();
|
||||||
|
}
|
||||||
|
|
||||||
this.initialized = true;
|
this.initialized = true;
|
||||||
return true;
|
return true;
|
||||||
@ -246,10 +245,18 @@ firetray.StatusIcon = {
|
|||||||
dbusNotificationWatcherReady: function() {
|
dbusNotificationWatcherReady: function() {
|
||||||
let watcherReady = false;
|
let watcherReady = false;
|
||||||
|
|
||||||
|
function error(e) {
|
||||||
|
if (!e.isNull()) {
|
||||||
|
log.error(e.contents.message);
|
||||||
|
glib.g_error_free(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let conn = new gio.GDBusConnection.ptr;
|
let conn = new gio.GDBusConnection.ptr;
|
||||||
let error = new glib.GError.ptr(null);
|
let err = new glib.GError.ptr(null);
|
||||||
conn = gio.g_bus_get_sync(gio.G_BUS_TYPE_SESSION, null, error.address());
|
conn = gio.g_bus_get_sync(gio.G_BUS_TYPE_SESSION, null, err.address());
|
||||||
firetray.js.assert(error.isNull());
|
if (error(err)) return watcherReady;
|
||||||
|
|
||||||
if (!conn.isNull()) {
|
if (!conn.isNull()) {
|
||||||
let flags = gio.G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START |
|
let flags = gio.G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START |
|
||||||
gio.G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES |
|
gio.G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES |
|
||||||
@ -263,8 +270,8 @@ firetray.StatusIcon = {
|
|||||||
appind3.NOTIFICATION_WATCHER_DBUS_OBJ,
|
appind3.NOTIFICATION_WATCHER_DBUS_OBJ,
|
||||||
appind3.NOTIFICATION_WATCHER_DBUS_IFACE,
|
appind3.NOTIFICATION_WATCHER_DBUS_IFACE,
|
||||||
null, /* GCancellable */
|
null, /* GCancellable */
|
||||||
error.address());
|
err.address());
|
||||||
firetray.js.assert(error.isNull());
|
if (error(err)) return watcherReady;
|
||||||
|
|
||||||
if (!proxy.isNull()) {
|
if (!proxy.isNull()) {
|
||||||
let owner = gio.g_dbus_proxy_get_name_owner(proxy);
|
let owner = gio.g_dbus_proxy_get_name_owner(proxy);
|
||||||
@ -276,7 +283,6 @@ firetray.StatusIcon = {
|
|||||||
|
|
||||||
gobject.g_object_unref(conn);
|
gobject.g_object_unref(conn);
|
||||||
}
|
}
|
||||||
glib.g_error_free(error);
|
|
||||||
|
|
||||||
return watcherReady;
|
return watcherReady;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user