/soc/2013/ankitkv/gobjectification: f8f2504a9a62: Merged soc.201...

Ankit Vani a at nevitus.org
Tue Nov 5 19:29:24 EST 2013


Changeset: f8f2504a9a62e56fe2facc5fb536794072c59e72
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-11-06 05:59 +0530
Branch:	 soc.2013.gobjectification.plugins
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/f8f2504a9a62

Description:

Merged soc.2013.gobjectification branch

diffstat:

 libpurple/protocols/jabber/auth.c       |   5 +++--
 libpurple/protocols/jabber/auth_cyrus.c |   5 +++--
 libpurple/request-datasheet.c           |  14 +++++++++++---
 pidgin/gtkrequest.c                     |   9 ++++++---
 4 files changed, 23 insertions(+), 10 deletions(-)

diffs (115 lines):

diff --git a/libpurple/protocols/jabber/auth.c b/libpurple/protocols/jabber/auth.c
--- a/libpurple/protocols/jabber/auth.c
+++ b/libpurple/protocols/jabber/auth.c
@@ -105,8 +105,9 @@ auth_old_pass_cb(PurpleConnection *gc, P
 
 	if (!entry || !*entry)
 	{
-		purple_notify_error(account, NULL, _("Password is required to sign on."), NULL,
-				purple_request_cpar_from_account(account));
+		purple_notify_error(account, NULL,
+			_("Password is required to sign on."), NULL,
+			purple_request_cpar_from_connection(gc));
 		return;
 	}
 
diff --git a/libpurple/protocols/jabber/auth_cyrus.c b/libpurple/protocols/jabber/auth_cyrus.c
--- a/libpurple/protocols/jabber/auth_cyrus.c
+++ b/libpurple/protocols/jabber/auth_cyrus.c
@@ -145,8 +145,9 @@ static void auth_pass_cb(PurpleConnectio
 
 	if (!entry || !*entry)
 	{
-		purple_notify_error(account, NULL, _("Password is required to sign on."), NULL,
-				purple_request_cpar_from_account(account));
+		purple_notify_error(account, NULL,
+			_("Password is required to sign on."), NULL,
+			purple_request_cpar_from_connection(gc));
 		return;
 	}
 
diff --git a/libpurple/request-datasheet.c b/libpurple/request-datasheet.c
--- a/libpurple/request-datasheet.c
+++ b/libpurple/request-datasheet.c
@@ -242,8 +242,16 @@ purple_request_datasheet_action_call(Pur
 {
 	g_return_if_fail(act != NULL);
 
-	if (act->cb)
-		act->cb(rec, act->cb_data);
+	if (!act->cb)
+		return;
+
+	if (!purple_request_datasheet_action_is_sensitive(act, rec)) {
+		purple_debug_warning("request-datasheet",
+			"Action is disabled for this record");
+		return;
+	}
+
+	act->cb(rec, act->cb_data);
 }
 
 void
@@ -266,7 +274,7 @@ purple_request_datasheet_action_is_sensi
 	if (!act->sens_cb)
 		return (rec != NULL);
 
-	return act->sens_cb(rec, act->cb_data);
+	return act->sens_cb(rec, act->sens_data);
 }
 
 /***** Datasheet record API ***************************************************/
diff --git a/pidgin/gtkrequest.c b/pidgin/gtkrequest.c
--- a/pidgin/gtkrequest.c
+++ b/pidgin/gtkrequest.c
@@ -1840,7 +1840,7 @@ datasheet_action_clicked(GtkButton *btn,
 }
 
 static GtkWidget *
-create_datasheet_field(PurpleRequestField *field)
+create_datasheet_field(PurpleRequestField *field, GtkSizeGroup *buttons_sg)
 {
 	PurpleRequestDatasheet *sheet;
 	guint i, col_count;
@@ -1923,6 +1923,7 @@ create_datasheet_field(PurpleRequestFiel
 	gtk_widget_show(GTK_WIDGET(view));
 
 	buttons_box = GTK_VBOX(gtk_vbox_new(FALSE, PIDGIN_HIG_BORDER));
+	gtk_size_group_add_widget(buttons_sg, GTK_WIDGET(buttons_box));
 
 	gtk_box_pack_start(GTK_BOX(main_box), scrollable, TRUE, TRUE, 0);
 	gtk_box_pack_start(GTK_BOX(main_box), GTK_WIDGET(buttons_box),
@@ -1982,7 +1983,7 @@ pidgin_request_fields(const char *title,
 	GtkWidget *table;
 	GtkWidget *button;
 	GtkWidget *img;
-	GtkSizeGroup *sg;
+	GtkSizeGroup *sg, *datasheet_buttons_sg;
 	GList *gl, *fl;
 	PurpleRequestFieldGroup *group;
 	PurpleRequestField *field;
@@ -2063,6 +2064,7 @@ pidgin_request_fields(const char *title,
 	gtk_widget_show(vbox);
 
 	sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
+	datasheet_buttons_sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
 
 	if(primary) {
 		primary_esc = pidgin_request_escape(cpar, primary);
@@ -2344,7 +2346,7 @@ pidgin_request_fields(const char *title,
 					else if (type == PURPLE_REQUEST_FIELD_CERTIFICATE)
 						widget = create_certificate_field(field);
 					else if (type == PURPLE_REQUEST_FIELD_DATASHEET)
-						widget = create_datasheet_field(field);
+						widget = create_datasheet_field(field, datasheet_buttons_sg);
 					else
 						continue;
 				}
@@ -2408,6 +2410,7 @@ pidgin_request_fields(const char *title,
 	}
 
 	g_object_unref(sg);
+	g_object_unref(datasheet_buttons_sg);
 
 	if (!purple_request_fields_all_required_filled(fields))
 		gtk_widget_set_sensitive(data->ok_button, FALSE);



More information about the Commits mailing list