예제 #1
0
static void
update_discoverability (GObject    *gobject,
                        GParamSpec *pspec,
                        gpointer    user_data)
{
	BluetoothApplet *applet = BLUETOOTH_APPLET (gobject);
	gboolean discoverable;
	GObject *object;

	/* Avoid loops from changing the UI */
	if (discover_lock != FALSE)
		return;

	discover_lock = TRUE;

	object = gtk_builder_get_object (xml, "discoverable");

	discoverable = bluetooth_applet_get_discoverable (applet);

#ifndef HAVE_APP_INDICATOR
	gtk_action_set_visible (GTK_ACTION (object), TRUE);
#else
	gtk_action_set_sensitive (GTK_TOGGLE_ACTION (object), TRUE);
#endif
	gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (object), discoverable);

	discover_lock = FALSE;
}
예제 #2
0
static void
_discoverable_cb (BluetoothApplet *applet,
                  GParamSpec      *pspec,
                  DawatiBtShell   *shell)
{
  gboolean discoverable;
  DawatiBtShellPrivate *priv = GET_PRIVATE (shell);

  discoverable = bluetooth_applet_get_discoverable (applet);
  if (discoverable != priv->discoverable) {
    priv->discoverable = discoverable;
    dawati_bt_shell_update (shell);
  }
}