示例#1
0
static gboolean
status_icon_delete_event_cb (GtkWidget         *widget,
			     GdkEvent          *event,
			     EmpathyStatusIcon *icon)
{
	status_icon_set_visibility (icon, FALSE, TRUE);
	return TRUE;
}
示例#2
0
static void
status_icon_show_hide_window_cb (GtkToggleAction   *action,
				 EmpathyStatusIcon *icon)
{
	gboolean visible;

	visible = gtk_toggle_action_get_active (action);
	status_icon_set_visibility (icon, visible, TRUE);
}
示例#3
0
static void
status_icon_toggle_visibility (EmpathyStatusIcon *icon)
{
	EmpathyStatusIconPriv *priv = GET_PRIV (icon);
	gboolean               visible;

	visible = gtk_window_is_active (priv->window);
	status_icon_set_visibility (icon, !visible, TRUE);
}
static void
status_icon_show_hide_window_cb (GtkWidget         *widget,
                                 EmpathyStatusIcon *icon)
{
    gboolean visible;

    visible = gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (widget));
    status_icon_set_visibility (icon, visible, TRUE);
}
示例#5
0
static gboolean
status_icon_key_press_event_cb  (GtkWidget *window,
				 GdkEventKey *event,
				 EmpathyStatusIcon *icon)
{
	if (event->keyval == GDK_Escape) {
		status_icon_set_visibility (icon, FALSE, TRUE);
	}
	return FALSE;
}
示例#6
0
static void
status_icon_notify_visibility_cb (EmpathyConf *conf,
				  const gchar *key,
				  gpointer     user_data)
{
	EmpathyStatusIcon *icon = user_data;
	gboolean           hidden = FALSE;

	if (empathy_conf_get_bool (conf, key, &hidden)) {
		status_icon_set_visibility (icon, !hidden, FALSE);
	}
}
示例#7
0
EmpathyStatusIcon *
empathy_status_icon_new (GtkWindow *window, gboolean hide_contact_list)
{
	EmpathyStatusIconPriv *priv;
	EmpathyStatusIcon     *icon;
	gboolean               should_hide;
#ifdef HAVE_LIBINDICATE
	gboolean               use_libindicate;
#endif

	g_return_val_if_fail (GTK_IS_WINDOW (window), NULL);

	icon = g_object_new (EMPATHY_TYPE_STATUS_ICON, NULL);
	priv = GET_PRIV (icon);

	priv->window = g_object_ref (window);
#ifdef HAVE_LIBINDICATE
	priv->indicator_manager = empathy_indicator_manager_dup_singleton ();
	g_signal_connect (priv->indicator_manager, "server-activate",
			  G_CALLBACK (indicate_server_activate_cb),
			  icon);
#endif

	g_signal_connect_after (priv->window, "key-press-event",
			  G_CALLBACK (status_icon_key_press_event_cb),
			  icon);

	g_signal_connect (priv->window, "delete-event",
			  G_CALLBACK (status_icon_delete_event_cb),
			  icon);

	if (!hide_contact_list) {
		empathy_conf_get_bool (empathy_conf_get (),
				       EMPATHY_PREFS_UI_MAIN_WINDOW_HIDDEN,
			               &should_hide);
	} else {
		should_hide = TRUE;
	}

#ifdef HAVE_LIBINDICATE
	empathy_conf_get_bool (empathy_conf_get (),
			       EMPATHY_PREFS_UI_USE_LIBINDICATE,
		               &use_libindicate);
	status_icon_set_use_libindicate (icon, use_libindicate);
#endif

	if (gtk_window_is_active (priv->window) == should_hide) {
		status_icon_set_visibility (icon, !should_hide, FALSE);
	}

	return icon;
}
示例#8
0
static void
status_icon_toggle_visibility (EmpathyStatusIcon *icon)
{
	EmpathyStatusIconPriv *priv = GET_PRIV (icon);
	gboolean               visible;
#ifdef HAVE_LIBINDICATE
	gboolean               use_libindicate;
#endif

	visible = gtk_window_is_active (priv->window);
#ifdef HAVE_LIBINDICATE
	empathy_conf_get_bool (empathy_conf_get (),
			       EMPATHY_PREFS_UI_USE_LIBINDICATE,
		               &use_libindicate);
	if (use_libindicate) {
		visible = GTK_WIDGET_VISIBLE (priv->window);
	}
#endif
	status_icon_set_visibility (icon, !visible, TRUE);
}
示例#9
0
EmpathyStatusIcon *
empathy_status_icon_new (GtkWindow *window, gboolean hide_contact_list)
{
	EmpathyStatusIconPriv *priv;
	EmpathyStatusIcon     *icon;
	gboolean               should_hide;

	g_return_val_if_fail (GTK_IS_WINDOW (window), NULL);

	icon = g_object_new (EMPATHY_TYPE_STATUS_ICON, NULL);
	priv = GET_PRIV (icon);

	priv->window = g_object_ref (window);

	g_signal_connect_after (priv->window, "key-press-event",
			  G_CALLBACK (status_icon_key_press_event_cb),
			  icon);

	g_signal_connect (priv->window, "delete-event",
			  G_CALLBACK (status_icon_delete_event_cb),
			  icon);

	if (!hide_contact_list) {
		empathy_conf_get_bool (empathy_conf_get (),
				       EMPATHY_PREFS_UI_MAIN_WINDOW_HIDDEN,
			               &should_hide);
	} else {
		should_hide = TRUE;
	}

	if (gtk_window_is_active (priv->window) == should_hide) {
		status_icon_set_visibility (icon, !should_hide, FALSE);
	}

	return icon;
}