im.pidgin.pidgin: 8bec06d2cd0a64ece46cb3cd73db9b085b91e161

jeff2 at soc.pidgin.im jeff2 at soc.pidgin.im
Sat Feb 9 02:30:42 EST 2008


-----------------------------------------------------------------
Revision: 8bec06d2cd0a64ece46cb3cd73db9b085b91e161
Ancestor: e1213913e6feb23196743f9c0c2b33dc36e4aab3
Author: jeff2 at soc.pidgin.im
Date: 2008-02-09T07:26:12
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/8bec06d2cd0a64ece46cb3cd73db9b085b91e161

Modified files:
        pidgin/gtkconv.c pidgin/gtkconvwin.h pidgin/gtkprefs.c
        pidgin/pidginstock.c pidgin/pidginstock.h

ChangeLog: 

Pidgin attention GUI from nok. Adds "Send Attention" to conversation
menu, which sends a generic attention command -- that could be a nudge,
buzz, zap, etc. depending on the prpl. Only sends attention command
type #0 for now (multiple types tracked by #4810) and the send-attention.png
is missing (tracked by #4809).

Closes #2788.

-------------- next part --------------
============================================================
--- pidgin/gtkconv.c	36ebed693314aabd4836913f85e4d122cf28865a
+++ pidgin/gtkconv.c	a40e18765524bd2fbd31b8176929d44149940909
@@ -1186,6 +1186,17 @@ static void
 }
 
 static void
+menu_send_attention_cb(gpointer data, guint action, GtkWidget *widget)
+{
+	PidginWindow *win = data;
+	PurpleConversation *conv = pidgin_conv_window_get_active_conversation(win);
+
+	if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM) {
+		serv_send_attention(purple_conversation_get_gc(conv), purple_conversation_get_name(conv), 0);
+	}
+}
+
+static void
 menu_add_pounce_cb(gpointer data, guint action, GtkWidget *widget)
 {
 	PidginWindow *win = data;
@@ -2952,6 +2963,7 @@ static GtkItemFactoryEntry menu_items[] 
 	{ "/Conversation/sep1", NULL, NULL, 0, "<Separator>", NULL },
 
 	{ N_("/Conversation/Se_nd File..."), NULL, menu_send_file_cb, 0, "<StockItem>", PIDGIN_STOCK_TOOLBAR_SEND_FILE },
+	{ N_("/Conversation/Send _Attention..."), NULL, menu_send_attention_cb, 0, "<StockItem>", PIDGIN_STOCK_TOOLBAR_SEND_ATTENTION },
 	{ N_("/Conversation/Add Buddy _Pounce..."), NULL, menu_add_pounce_cb,
 			0, "<Item>", NULL },
 	{ N_("/Conversation/_Get Info"), "<CTL>O", menu_get_info_cb, 0,
@@ -3258,6 +3270,9 @@ setup_menubar(PidginWindow *win)
 		gtk_item_factory_get_widget(win->menu.item_factory,
 		                            N_("/Conversation/Send File..."));
 
+	win->menu.send_attention =
+		gtk_item_factory_get_widget(win->menu.item_factory,
+			                    N_("/Conversation/Send Attention"));
 	win->menu.add_pounce =
 		gtk_item_factory_get_widget(win->menu.item_factory,
 		                            N_("/Conversation/Add Buddy Pounce..."));
@@ -6245,6 +6260,7 @@ gray_stuff_out(PidginConversation *gtkco
 		/* Deal with menu items */
 		gtk_widget_show(win->menu.view_log);
 		gtk_widget_show(win->menu.send_file);
+		gtk_widget_show(win->menu.send_attention);
 		gtk_widget_show(win->menu.add_pounce);
 		gtk_widget_show(win->menu.get_info);
 		gtk_widget_hide(win->menu.invite);
@@ -6273,6 +6289,7 @@ gray_stuff_out(PidginConversation *gtkco
 		/* Deal with menu items */
 		gtk_widget_show(win->menu.view_log);
 		gtk_widget_hide(win->menu.send_file);
+		gtk_widget_hide(win->menu.send_attention);
 		gtk_widget_hide(win->menu.add_pounce);
 		gtk_widget_hide(win->menu.get_info);
 		gtk_widget_show(win->menu.invite);
@@ -6345,6 +6362,7 @@ gray_stuff_out(PidginConversation *gtkco
 			gtk_widget_set_sensitive(win->menu.send_file,
 									 (prpl_info->send_file != NULL && (!prpl_info->can_receive_file ||
 									  prpl_info->can_receive_file(gc, purple_conversation_get_name(conv)))));
+			gtk_widget_set_sensitive(win->menu.send_attention, (prpl_info->send_attention != NULL));
 			gtk_widget_set_sensitive(win->menu.alias,
 									 (account != NULL) &&
 									 (purple_find_buddy(account, purple_conversation_get_name(conv)) != NULL));
@@ -6365,6 +6383,7 @@ gray_stuff_out(PidginConversation *gtkco
 		/* Then deal with menu items */
 		gtk_widget_set_sensitive(win->menu.view_log, TRUE);
 		gtk_widget_set_sensitive(win->menu.send_file, FALSE);
+		gtk_widget_set_sensitive(win->menu.send_attention, FALSE);
 		gtk_widget_set_sensitive(win->menu.add_pounce, TRUE);
 		gtk_widget_set_sensitive(win->menu.get_info, FALSE);
 		gtk_widget_set_sensitive(win->menu.invite, FALSE);
============================================================
--- pidgin/gtkconvwin.h	250c2499fcc142e466d0695dc27e203f56ff9156
+++ pidgin/gtkconvwin.h	f2401eb8bac7b34d82b01a8d21dd520e51625c85
@@ -51,6 +51,7 @@ struct _PidginWindow
 		GtkWidget *view_log;
 
 		GtkWidget *send_file;
+		GtkWidget *send_attention;
 		GtkWidget *add_pounce;
 		GtkWidget *get_info;
 		GtkWidget *invite;
============================================================
--- pidgin/gtkprefs.c	a0f8fc52d627a946b45974d566ff70285d6bc75c
+++ pidgin/gtkprefs.c	83dd7387f18211191d661c3a8e36bae330e22934
@@ -976,7 +976,10 @@ conv_page(void)
 		fontpref = pidgin_prefs_checkbox(_("Use font from _theme"), PIDGIN_PREFS_ROOT "/conversations/use_theme_font", vbox);
 
 	font_name = purple_prefs_get_string(PIDGIN_PREFS_ROOT "/conversations/custom_font");
-	font_button = gtk_font_button_new_with_font(font_name ? font_name : NULL);
+	font_button = gtk_font_button_new();
+	if (font_name && strlen(font_name))
+		gtk_font_button_set_font_name((GtkFontButton *)font_button, (const char*)font_name);
+
 	gtk_font_button_set_show_style(GTK_FONT_BUTTON(font_button), TRUE);
 	hbox = pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("Conversation _font:"), NULL, font_button, FALSE, NULL);
 	if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/use_theme_font"))
============================================================
--- pidgin/pidginstock.c	284a74fc79e3afe410fc8f73e459eeba6e6a7dda
+++ pidgin/pidginstock.c	800e56e1f0d1d421221c6915d8a99e00b27976a7
@@ -168,6 +168,7 @@ static struct SizedStockIcon {
 	{ PIDGIN_STOCK_TOOLBAR_UNBLOCK, "toolbar", "unblock.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL  },
 	{ PIDGIN_STOCK_TOOLBAR_SELECT_AVATAR, "toolbar", "select-avatar.png", FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, NULL  },
 	{ PIDGIN_STOCK_TOOLBAR_SEND_FILE, "toolbar", "send-file.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL  },
+	{ PIDGIN_STOCK_TOOLBAR_SEND_ATTENTION, "toolbar", "send-attention.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL  },
 
 	{ PIDGIN_STOCK_TRAY_AVAILABLE, "tray", "tray-online.png", FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, NULL  },
 	{ PIDGIN_STOCK_TRAY_INVISIBLE, "tray", "tray-invisible.png", FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, NULL  },
============================================================
--- pidgin/pidginstock.h	cebcad7166aead1bf5a44b5ad7d2f40ebda98618
+++ pidgin/pidginstock.h	1bd3c07e7ac664bb93467676007aae55ba2ad09b
@@ -129,6 +129,7 @@
 #define PIDGIN_STOCK_TOOLBAR_UNBLOCK      "pidgin-unblock"
 #define PIDGIN_STOCK_TOOLBAR_SELECT_AVATAR "pidgin-select-avatar"
 #define PIDGIN_STOCK_TOOLBAR_SEND_FILE    "pidgin-send-file"
+#define PIDGIN_STOCK_TOOLBAR_SEND_ATTENTION	"pidgin-send-attention"
 
 /* Tray icons */
 #define PIDGIN_STOCK_TRAY_AVAILABLE       "pidgin-tray-available"


More information about the Commits mailing list