im.pidgin.pidgin: 2dbcc02d87584e804dd54fa2b58d232e6373785b

resiak at soc.pidgin.im resiak at soc.pidgin.im
Sat Feb 16 13:15:54 EST 2008


-----------------------------------------------------------------
Revision: 2dbcc02d87584e804dd54fa2b58d232e6373785b
Ancestor: 1feb18178944ec0683c72714b1f19c45c751ba64
Author: resiak at soc.pidgin.im
Date: 2008-02-16T18:13:48
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/2dbcc02d87584e804dd54fa2b58d232e6373785b

Modified files:
        pidgin/gtkblist.c

ChangeLog: 

Pull setting the urgent hint on the blist when it is unfocused into its own
function.

-------------- next part --------------
============================================================
--- pidgin/gtkblist.c	6f5ea19ed10321fed345f855596665324daaaa7f
+++ pidgin/gtkblist.c	e1f5d7320ccc714f48b64e180c8b94fe157706fb
@@ -159,6 +159,7 @@ static void pidgin_blist_expand_contact_
 static void pidgin_blist_collapse_contact_cb(GtkWidget *w, PurpleBlistNode *node);
 static char *pidgin_get_group_title(PurpleBlistNode *gnode, gboolean expanded);
 static void pidgin_blist_expand_contact_cb(GtkWidget *w, PurpleBlistNode *node);
+static void set_urgent(void);
 
 typedef enum {
 	PIDGIN_BLIST_NODE_HAS_PENDING_MESSAGE    =  1 << 0,  /* Whether there's pending message in a conversation */
@@ -4443,8 +4444,7 @@ add_error_dialog(PidginBuddyList *gtkbli
 	PidginBuddyListPrivate *priv = PIDGIN_BUDDY_LIST_GET_PRIVATE(gtkblist);
 	gtk_container_add(GTK_CONTAINER(priv->error_scrollbook), dialog);
 
-	if (!GTK_WIDGET_HAS_FOCUS(gtkblist->window))
-		pidgin_set_urgent(GTK_WINDOW(gtkblist->window), TRUE);
+	set_urgent();
 }
 
 static GtkWidget *
@@ -4591,8 +4591,7 @@ update_generic_error_message(PurpleAccou
 		GTK_CONTAINER(priv->error_scrollbook), account);
 	pidgin_mini_dialog_set_description(PIDGIN_MINI_DIALOG(mini_dialog),
 		description);
-	if (!GTK_WIDGET_HAS_FOCUS(gtkblist->window))
-		pidgin_set_urgent(GTK_WINDOW(gtkblist->window), TRUE);
+	set_urgent();
 }
 
 
@@ -4749,8 +4748,7 @@ add_to_signed_on_elsewhere(PurpleAccount
 
 	update_signed_on_elsewhere_minidialog_title();
 
-	if (!GTK_WIDGET_HAS_FOCUS(gtkblist->window))
-		pidgin_set_urgent(GTK_WINDOW(gtkblist->window), TRUE);
+	set_urgent();
 }
 
 static void
@@ -4776,8 +4774,7 @@ update_signed_on_elsewhere_tooltip(Purpl
 	GtkContainer *c = GTK_CONTAINER(priv->signed_on_elsewhere->contents);
 	GtkWidget *label = find_child_widget_by_account(c, account);
 	gtk_widget_set_tooltip_text(label, description);
-	if (!GTK_WIDGET_HAS_FOCUS(gtkblist->window))
-		pidgin_set_urgent(GTK_WINDOW(gtkblist->window), TRUE);
+	set_urgent();
 #endif
 }
 
@@ -6805,8 +6802,7 @@ void pidgin_blist_add_alert(GtkWidget *w
 void pidgin_blist_add_alert(GtkWidget *widget)
 {
 	gtk_container_add(GTK_CONTAINER(gtkblist->scrollbook), widget);
-	if (!GTK_WIDGET_HAS_FOCUS(gtkblist->window))
-		pidgin_set_urgent(GTK_WINDOW(gtkblist->window), TRUE);
+	set_urgent();
 }
 
 void
@@ -6824,14 +6820,21 @@ pidgin_blist_set_headline(const char *te
 	gtkblist->headline_data = user_data;
 	gtkblist->headline_destroy = destroy;
 	if (text != NULL || pixbuf != NULL) {
-		if (!GTK_WIDGET_HAS_FOCUS(gtkblist->window))
-			pidgin_set_urgent(GTK_WINDOW(gtkblist->window), TRUE);
+		set_urgent();
 		gtk_widget_show_all(gtkblist->headline_hbox);
 	} else {
 		gtk_widget_hide(gtkblist->headline_hbox);
 	}
 }
 
+
+static void
+set_urgent(void)
+{
+	if (!GTK_WIDGET_HAS_FOCUS(gtkblist->window))
+		pidgin_set_urgent(GTK_WINDOW(gtkblist->window), TRUE);
+}
+
 static PurpleBlistUiOps blist_ui_ops =
 {
 	pidgin_blist_new_list,


More information about the Commits mailing list