Example #1
0
static void
update_icon_visibility (void)
{
	gboolean state = bluetooth_applet_get_killswitch_state (applet);
	if (state != BLUETOOTH_KILLSWITCH_STATE_UNBLOCKED)
		set_icon (FALSE);
	else
		set_icon (TRUE);

	if (state == BLUETOOTH_KILLSWITCH_STATE_NO_ADAPTER)
		hide_icon ();
#ifdef HAVE_APP_INDICATOR
	else if (!g_settings_get_boolean (gsettings, GSETTINGS_VISIBLE_KEY))
		hide_icon ();
#endif
	else
		show_icon ();
}
Example #2
0
static void
update_icon_visibility (void)
{
	if (num_adapters_powered == 0)
		set_icon (FALSE);
	else
		set_icon (TRUE);

	if (show_icon_pref != FALSE) {
		if (num_adapters_present > 0 ||
		    bluetooth_killswitch_has_killswitches (killswitch) != FALSE) {
			show_icon ();
			return;
		}
	}
	hide_icon ();
}
Example #3
0
File: applet.c Project: rplnt/abrt
static void NameOwnerChanged(DBusMessage* signal)
{
    int r;
    DBusMessageIter in_iter;
    dbus_message_iter_init(signal, &in_iter);
    const char* name = NULL;
    r = load_charp(&in_iter, &name);
    if (r != ABRT_DBUS_MORE_FIELDS)
    {
        error_msg("dbus signal %s: parameter type mismatch", __func__);
        return;
    }

    /* We are only interested in (dis)appearances of our daemon */
    if (strcmp(name, "com.redhat.abrt") != 0)
        return;

    const char* old_owner = NULL;
    r = load_charp(&in_iter, &old_owner);
    if (r != ABRT_DBUS_MORE_FIELDS)
    {
        error_msg("dbus signal %s: parameter type mismatch", __func__);
        return;
    }
    const char* new_owner = NULL;
    r = load_charp(&in_iter, &new_owner);
    if (r != ABRT_DBUS_LAST_FIELD)
    {
        error_msg("dbus signal %s: parameter type mismatch", __func__);
        return;
    }

// hide icon if it's visible - as NM and don't show it, if it's not
    if (applet && !new_owner[0])
        hide_icon(applet);
}