From b02ee171c1713b56e2d6db7721488b64c238b478 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Tue, 19 Nov 2019 00:00:08 +0100 Subject: Don't display labels of hidden DataForm fields --- main/src/ui/manage_accounts/add_account_dialog.vala | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'main/src/ui/manage_accounts') diff --git a/main/src/ui/manage_accounts/add_account_dialog.vala b/main/src/ui/manage_accounts/add_account_dialog.vala index 27807d8e..0ad8b72d 100644 --- a/main/src/ui/manage_accounts/add_account_dialog.vala +++ b/main/src/ui/manage_accounts/add_account_dialog.vala @@ -301,16 +301,12 @@ public class AddAccountDialog : Gtk.Dialog { register_form_continue.visible = true; register_form_continue.grab_focus(); } else if (form.fields.size > 0) { - int i = 0; foreach (Xep.DataForms.DataForm.Field field in form.fields) { - if (field.label != null && field.label != "") { + Widget? field_widget = Util.get_data_form_fild_widget(field); + if (field.label != null && field.label != "" && field_widget != null) { form_box.add(new Label(field.label) { xalign=0, margin_top=7, visible=true }); - } - Widget field_widget = Util.get_data_form_fild_widget(field); - if (field_widget != null) { form_box.add(field_widget); } - i++; } register_form_continue.visible = true; register_form_continue_label.label = _("Register"); -- cgit v1.2.3-70-g09d2