--- a/libpurple/accountopt.c Tue Aug 14 04:02:22 2012 -0400
+++ b/libpurple/accountopt.c Tue Aug 14 22:05:05 2012 +0200
@@ -50,10 +50,17 @@
- gboolean masked; /**< Whether the value entered should be
- * obscured from view (for passwords and
+ gboolean masked; /**< Whether the value entered should + * be obscured from view (for + * passwords and similar options) + GSList *hints; /**< List of hinted values */ @@ -177,6 +184,7 @@
if (option->type == PURPLE_PREF_STRING)
g_free(option->default_value.string);
+ g_slist_free_full(option->params.string.hints, &g_free); else if (option->type == PURPLE_PREF_STRING_LIST)
@@ -221,14 +229,23 @@
-purple_account_option_set_masked(PurpleAccountOption *option, gboolean masked)
+purple_account_option_string_set_masked(PurpleAccountOption *option, gboolean masked) g_return_if_fail(option != NULL);
g_return_if_fail(option->type == PURPLE_PREF_STRING);
- option->masked = masked;
+ option->params.string.masked = masked; +purple_account_option_string_set_hints(PurpleAccountOption *option, GSList *hints) + g_return_if_fail(option != NULL); + g_return_if_fail(option->type == PURPLE_PREF_STRING); + g_slist_free_full(option->params.string.hints, &g_free); + option->params.string.hints = hints; purple_account_option_set_list(PurpleAccountOption *option, GList *values)
@@ -332,12 +349,21 @@
-purple_account_option_get_masked(const PurpleAccountOption *option)
+purple_account_option_string_get_masked(const PurpleAccountOption *option) g_return_val_if_fail(option != NULL, FALSE);
g_return_val_if_fail(option->type == PURPLE_PREF_STRING, FALSE);
+ return option->params.string.masked; +purple_account_option_string_get_hints(const PurpleAccountOption *option) + g_return_val_if_fail(option != NULL, FALSE); + g_return_val_if_fail(option->type == PURPLE_PREF_STRING, FALSE); + return option->params.string.hints; --- a/libpurple/accountopt.h Tue Aug 14 04:02:22 2012 -0400
+++ b/libpurple/accountopt.h Tue Aug 14 22:05:05 2012 +0200
@@ -158,7 +158,19 @@
* @param masked The masking.
-purple_account_option_set_masked(PurpleAccountOption *option, gboolean masked);
+purple_account_option_string_set_masked(PurpleAccountOption *option, gboolean masked); + * Sets the hint list for an account option. + * The list passed will be owned by the account option, and the + * strings inside will be freed automatically. + * @param option The account option. + * @param hints The list of hints, stored as strings. +void purple_account_option_string_set_hints(PurpleAccountOption *option, * Sets the list values for an account option.
@@ -261,7 +273,16 @@
* @return %TRUE if the option's value should be obscured.
-purple_account_option_get_masked(const PurpleAccountOption *option);
+purple_account_option_string_get_masked(const PurpleAccountOption *option); + * Returns the list of hints for an account option. + * @param option The account option. + * @constreturn A list of hints, stored as strings. +const GSList * purple_account_option_string_get_hints(const PurpleAccountOption *option); * Returns the list values for an account option.
--- a/libpurple/plugins/perl/common/AccountOpts.xs Tue Aug 14 04:02:22 2012 -0400
+++ b/libpurple/plugins/perl/common/AccountOpts.xs Tue Aug 14 22:05:05 2012 +0200
@@ -102,7 +102,7 @@
Purple::Account::Option option
-purple_account_option_get_masked(option)
+purple_account_option_string_get_masked(option) Purple::Account::Option option
@@ -138,7 +138,7 @@
purple_account_option_set_list(option, t_GL);
-purple_account_option_set_masked(option, masked)
+purple_account_option_string_set_masked(option, masked) Purple::Account::Option option
--- a/pidgin/gtkaccount.c Tue Aug 14 04:02:22 2012 -0400
+++ b/pidgin/gtkaccount.c Tue Aug 14 22:05:05 2012 +0200
@@ -812,6 +812,7 @@
ProtocolOptEntry *opt_entry;
+ const GSList *str_hints; if (dialog->protocol_frame != NULL) {
gtk_notebook_remove_page (GTK_NOTEBOOK(dialog->notebook), 1);
@@ -912,8 +913,25 @@
purple_account_option_get_default_string(option));
- opt_entry->widget = entry = gtk_entry_new();
- if (purple_account_option_get_masked(option))
+ str_hints = purple_account_option_string_get_hints(option); + const GSList *hint_it = str_hints; + entry = gtk_combo_box_entry_new_text(); + const gchar *hint = hint_it->data; + hint_it = g_list_next(hint_it); + gtk_combo_box_append_text(GTK_COMBO_BOX(entry), hint); + entry = gtk_entry_new(); + opt_entry->widget = entry; + if (purple_account_option_string_get_masked(option) && str_hints) + else if (purple_account_option_string_get_masked(option)) gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE);
#if !GTK_CHECK_VERSION(2,16,0)
@@ -922,7 +940,9 @@
#endif /* Less than GTK+ 2.16 */
+ if (str_value != NULL && str_hints) + gtk_entry_set_text(GTK_ENTRY(GTK_BIN(entry)->child), str_value); gtk_entry_set_text(GTK_ENTRY(entry), str_value);
title = g_strdup_printf("_%s:",
@@ -1453,7 +1473,10 @@
switch (opt_entry->type) {
- value = gtk_entry_get_text(GTK_ENTRY(opt_entry->widget));
+ if (GTK_IS_COMBO_BOX(opt_entry->widget)) + value = gtk_combo_box_get_active_text(GTK_COMBO_BOX(opt_entry->widget)); + value = gtk_entry_get_text(GTK_ENTRY(opt_entry->widget)); purple_account_set_string(account, opt_entry->setting, value);
--- a/pidgin/plugins/perl/common/Makefile.PL.in Tue Aug 14 04:02:22 2012 -0400
+++ b/pidgin/plugins/perl/common/Makefile.PL.in Tue Aug 14 22:05:05 2012 +0200
@@ -10,7 +10,7 @@
'AUTHOR' => 'Pidgin <http://pidgin.im/>') : ()),
'DEFINE' => '@DEBUG_CFLAGS@',
'dynamic_lib' => { 'OTHERLDFLAGS' => '@LDFLAGS@' },
- 'INC' => '-I. -I@srcdir@ -I@top_srcdir@ -I@top_srcdir@/libpurple -I@top_srcdir@/pidgin @GTK_CFLAGS@',
+ 'INC' => '-I. -I@srcdir@ -I@top_srcdir@ -I@top_srcdir@/libpurple -I@top_srcdir@/pidgin @GTK_CFLAGS@ @WEBKIT_CFLAGS@', 'OBJECT' => '$(O_FILES)', # link all the C files too
'TYPEMAPS' => ["@top_srcdir@/libpurple/plugins/perl/common/typemap"],
# 'OPTIMIZE' => '-g', # For debugging.