diff options
author | Sadrul Habib Chowdhury <sadrul@pidgin.im> | 2008-04-29 19:01:25 +0000 |
---|---|---|
committer | Sadrul Habib Chowdhury <sadrul@pidgin.im> | 2008-04-29 19:01:25 +0000 |
commit | 1327ffe293ed0951fafea1178f4093fcc6020bc6 (patch) | |
tree | a89de3c567dc448eb814fcbfb93c82684c867ce3 /pidgin | |
parent | cfdbe6004fe5e021afd95904b4d5a0170d9713f6 (diff) | |
parent | f36ee1610614b373d99794f3f4d1ff3e313cf260 (diff) | |
download | pidgin-1327ffe293ed0951fafea1178f4093fcc6020bc6.tar.gz |
merge of 'fe1e09e03bcbada9f49b554a817b72093a9137f3'
and '80562b52fb71c383460fb2325bf40d0050f243d5'
Diffstat (limited to 'pidgin')
-rw-r--r-- | pidgin/gtkblist.c | 11 | ||||
-rw-r--r-- | pidgin/gtkrequest.c | 22 |
2 files changed, 21 insertions, 12 deletions
diff --git a/pidgin/gtkblist.c b/pidgin/gtkblist.c index 78446eb0dd..f0d4b723fb 100644 --- a/pidgin/gtkblist.c +++ b/pidgin/gtkblist.c @@ -632,7 +632,11 @@ chat_components_edit_ok(PurpleChat *chat, PurpleRequestFields *allfields) else val = g_strdup(purple_request_field_string_get_value(field)); - g_hash_table_replace(purple_chat_get_components(chat), g_strdup(id), val); /* val should not be free'd */ + if (!val) { + g_hash_table_remove(purple_chat_get_components(chat), id); + } else { + g_hash_table_replace(purple_chat_get_components(chat), g_strdup(id), val); /* val should not be free'd */ + } } } } @@ -663,8 +667,13 @@ static void chat_components_edit(GtkWidget *w, PurpleBlistNode *node) } else { field = purple_request_field_string_new(pce->identifier, pce->label, g_hash_table_lookup(purple_chat_get_components(chat), pce->identifier), FALSE); + if (pce->secret) + purple_request_field_string_set_masked(field, TRUE); } + if (pce->required) + purple_request_field_set_required(field, TRUE); + purple_request_field_group_add_field(group, field); g_free(pce); } diff --git a/pidgin/gtkrequest.c b/pidgin/gtkrequest.c index 5a70c4ed87..4d93ef2a2e 100644 --- a/pidgin/gtkrequest.c +++ b/pidgin/gtkrequest.c @@ -1120,6 +1120,16 @@ pidgin_request_fields(const char *title, const char *primary, gtk_box_pack_start(GTK_BOX(hbox), img, FALSE, FALSE, 0); gtk_widget_show(img); + /* Cancel button */ + button = pidgin_dialog_add_button(GTK_DIALOG(win), text_to_stock(cancel_text), G_CALLBACK(multifield_cancel_cb), data); + GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); + + /* OK button */ + button = pidgin_dialog_add_button(GTK_DIALOG(win), text_to_stock(ok_text), G_CALLBACK(multifield_ok_cb), data); + data->ok_button = button; + GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); + gtk_window_set_default(GTK_WINDOW(win), button); + /* Setup the vbox */ vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_BORDER); gtk_box_pack_start(GTK_BOX(hbox), vbox, TRUE, TRUE, 0); @@ -1393,18 +1403,8 @@ pidgin_request_fields(const char *title, const char *primary, g_object_unref(sg); - /* Cancel button */ - button = pidgin_dialog_add_button(GTK_DIALOG(win), text_to_stock(cancel_text), G_CALLBACK(multifield_cancel_cb), data); - GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); - - /* OK button */ - button = pidgin_dialog_add_button(GTK_DIALOG(win), text_to_stock(ok_text), G_CALLBACK(multifield_ok_cb), data); - data->ok_button = button; - GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); - gtk_window_set_default(GTK_WINDOW(win), button); - if (!purple_request_fields_all_required_filled(fields)) - gtk_widget_set_sensitive(button, FALSE); + gtk_widget_set_sensitive(data->ok_button, FALSE); pidgin_auto_parent_window(win); |