changeset 24370:5950e7a32c4f

merge of '12d71b833c7d3451c58c50e6dc621a88d678d474' and '42f888b4f8e15a19002abe6f40a5d89117ee59a7'
author Richard Laager <rlaager@wiktel.com>
date Fri, 14 Nov 2008 07:41:10 +0000
parents a3523b143f78 (diff) f9503aa61fb4 (current diff)
children b70fa8735b73
files
diffstat 4 files changed, 47 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/finch/libgnt/gntentry.c	Fri Nov 14 06:52:05 2008 +0000
+++ b/finch/libgnt/gntentry.c	Fri Nov 14 07:41:10 2008 +0000
@@ -903,6 +903,7 @@
 				GNT_KEY_CTRL_K, NULL);
 	gnt_bindable_class_register_action(bindable, "delete-prev-word", del_prev_word,
 				GNT_KEY_CTRL_W, NULL);
+	gnt_bindable_register_binding(bindable, "delete-prev-word", "\033", s, NULL);
 	gnt_bindable_class_register_action(bindable, "cursor-prev-word", move_back_word,
 				"\033" "b", NULL);
 	gnt_bindable_class_register_action(bindable, "cursor-prev", move_back,
--- a/libpurple/protocols/msn/msn.c	Fri Nov 14 06:52:05 2008 +0000
+++ b/libpurple/protocols/msn/msn.c	Fri Nov 14 07:41:10 2008 +0000
@@ -550,21 +550,17 @@
 msn_new_xfer(PurpleConnection *gc, const char *who)
 {
 	MsnSession *session;
-	MsnSlpLink *slplink;
 	PurpleXfer *xfer;
 
 	session = gc->proto_data;
 
 	xfer = purple_xfer_new(gc->account, PURPLE_XFER_SEND, who);
 
-	if (xfer)
-	{
-		slplink = msn_session_get_slplink(session, who);
-
-		xfer->data = slplink;
-
-		purple_xfer_set_init_fnc(xfer, t_msn_xfer_init);
-	}
+	g_return_val_if_fail(xfer != NULL, NULL);
+
+	xfer->data = msn_session_get_slplink(session, who);
+
+	purple_xfer_set_init_fnc(xfer, t_msn_xfer_init);
 
 	return xfer;
 }
--- a/libpurple/protocols/msn/switchboard.h	Fri Nov 14 06:52:05 2008 +0000
+++ b/libpurple/protocols/msn/switchboard.h	Fri Nov 14 07:41:10 2008 +0000
@@ -68,9 +68,9 @@
  */
 struct _MsnSwitchBoard
 {
-	MsnSession *session;
-	MsnServConn *servconn;
-	MsnCmdProc *cmdproc;
+	MsnSession *session;   /**< Our parent session. */
+	MsnServConn *servconn; /**< The physical connection for this switchboard. */
+	MsnCmdProc *cmdproc;   /**< Convenience variable for servconn->cmdproc. */
 	char *im_user;
 
 	MsnSBFlag flag;
--- a/pidgin/plugins/sendbutton.c	Fri Nov 14 06:52:05 2008 +0000
+++ b/pidgin/plugins/sendbutton.c	Fri Nov 14 07:41:10 2008 +0000
@@ -37,9 +37,26 @@
 }
 
 static void
+input_buffer_changed(GtkTextBuffer *text_buffer, GtkWidget *send_button)
+{
+	if (gtk_text_buffer_get_char_count(text_buffer) != 0)
+		gtk_widget_set_sensitive(send_button, TRUE);
+	else
+		gtk_widget_set_sensitive(send_button, FALSE);
+}
+
+static void
 create_send_button_pidgin(PidginConversation *gtkconv)
 {
 	GtkWidget *send_button;
+	GtkTextBuffer *buf;
+	guint signal_id;
+
+	send_button = g_object_get_data(G_OBJECT(gtkconv->lower_hbox),
+	                                "send_button");
+
+	if (send_button != NULL)
+		return;
 
 	send_button = gtk_button_new_with_mnemonic(_("_Send"));
 	g_signal_connect(G_OBJECT(send_button), "clicked",
@@ -48,6 +65,16 @@
 	                 FALSE, 0);
 	gtk_widget_show(send_button);
 
+	buf = gtk_text_view_get_buffer(GTK_TEXT_VIEW(gtkconv->entry));
+	if (buf) {
+		signal_id = g_signal_connect(G_OBJECT(buf), "changed",
+		                             G_CALLBACK(input_buffer_changed),
+		                             send_button);
+		g_object_set_data(G_OBJECT(send_button), "buffer-signal",
+		                  GINT_TO_POINTER(signal_id));
+		input_buffer_changed(buf, send_button);
+	}
+ 
 	g_object_set_data(G_OBJECT(gtkconv->lower_hbox), "send_button",
 	                  send_button);
 }
@@ -60,7 +87,18 @@
 	send_button = g_object_get_data(G_OBJECT(gtkconv->lower_hbox),
 	                                "send_button");
 	if (send_button != NULL) {
+		GtkTextBuffer *buf;
+		guint signal_id;
+
+		buf = gtk_text_view_get_buffer(GTK_TEXT_VIEW(gtkconv->entry));
+		signal_id = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(send_button),
+		                                              "buffer-signal"));
+		if (buf && signal_id)
+			g_signal_handler_disconnect(G_OBJECT(buf), signal_id);
+
 		gtk_widget_destroy(send_button);
+		g_object_set_data(G_OBJECT(gtkconv->lower_hbox),
+		                  "send_button", NULL);
 	}
 }