# HG changeset patch # User Paul Aurich # Date 1282890489 0 # Node ID 014dbe36b722e1bd3f69eb596f5377dc1d0e33ec # Parent ec12d28832663ed05972c167a926bec2afa4b2bf finch: Add support for string lists as account options diff -r ec12d2883266 -r 014dbe36b722 ChangeLog --- a/ChangeLog Fri Aug 27 05:14:08 2010 +0000 +++ b/ChangeLog Fri Aug 27 06:28:09 2010 +0000 @@ -12,6 +12,10 @@ * 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 diff -r ec12d2883266 -r 014dbe36b722 finch/gntaccount.c --- a/finch/gntaccount.c Fri Aug 27 05:14:08 2010 +0000 +++ b/finch/gntaccount.c Fri Aug 27 06:28:09 2010 +0000 @@ -236,7 +236,8 @@ } 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 @@ 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 {