pidgin: ce1f6846: finch: Add support for string lists as a...

darkrain42 at pidgin.im darkrain42 at pidgin.im
Fri Aug 27 02:53:22 EDT 2010


----------------------------------------------------------------------
Revision: ce1f68461b4b0e34ee986f40f488e67de12b24c6
Parent:   fc48e1385d53f406de694f252adc2fd368ba1277
Author:   darkrain42 at pidgin.im
Date:     08/27/10 02:28:09
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/ce1f68461b4b0e34ee986f40f488e67de12b24c6

Changelog: 

finch: Add support for string lists as account options

Changes against parent fc48e1385d53f406de694f252adc2fd368ba1277

  patched  ChangeLog
  patched  finch/gntaccount.c

-------------- next part --------------
============================================================
--- ChangeLog	bcad2b5d654ade87781e4fcd2dfb2c64de6514e2
+++ ChangeLog	8f079ec2db857edb29c1f8dbeb4cf92b2438a332
@@ -12,6 +12,10 @@ version 2.7.4 (MM/DD/YYYY):
 	* Add support for the Gadu-Gadu protocol in the gevolution plugin to
 	  provide Evolution integration with contacts with GG IDs. (#10709)
 
+	Finch:
+	* Add support for drop-down account options (like the SILC cipher
+	  and HMAC options or the QQ protocol version).
+
 	XMPP:
 	* Fix a crash when multiple accounts are simultaneously performing
 	  SASL authentication when built with Cyrus SASL support.  (thanks
============================================================
--- finch/gntaccount.c	435ca1f5d9c19b704338e273d3cd5db4253e68d1
+++ finch/gntaccount.c	2f5867ac342d6f8b52a5fcb274b5297c51054e0f
@@ -236,7 +236,8 @@ save_account_cb(AccountEditDialog *dialo
 			}
 			else if (type == PURPLE_PREF_STRING_LIST)
 			{
-				/* TODO: */
+				gchar *value = gnt_combo_box_get_selected_data(GNT_COMBO_BOX(entry));
+				purple_account_set_string(account, setting, value);
 			}
 			else
 			{
@@ -430,8 +431,26 @@ add_protocol_options(AccountEditDialog *
 
 			if (type == PURPLE_PREF_STRING_LIST)
 			{
-				/* TODO: Use a combobox */
-				/*       Don't forget to append the widget to prpl_entries */
+				GntWidget *combo = gnt_combo_box_new();
+				GList *opt_iter = purple_account_option_get_list(option);
+				const char *dv = purple_account_option_get_default_list_value(option);
+				const char *active = dv;
+
+				if (account)
+					active = purple_account_get_string(account,
+						purple_account_option_get_setting(option), dv);
+
+				gnt_box_add_widget(GNT_BOX(box), combo);
+				dialog->prpl_entries = g_list_append(dialog->prpl_entries, combo);
+
+				for ( ; opt_iter; opt_iter = opt_iter->next)
+				{
+					PurpleKeyValuePair *kvp = opt_iter->data;
+					gnt_combo_box_add_data(GNT_COMBO_BOX(combo), kvp->value, kvp->key);
+
+					if (g_str_equal(kvp->value, active))
+						gnt_combo_box_set_selected(GNT_COMBO_BOX(combo), kvp->value);
+				}
 			}
 			else
 			{


More information about the Commits mailing list