aboutsummaryrefslogtreecommitdiff
path: root/main/src/ui/manage_accounts
diff options
context:
space:
mode:
authorMichel Le Bihan <michel@lebihan.pl>2021-02-17 22:57:53 +0100
committerGitHub <noreply@github.com>2021-02-17 22:57:53 +0100
commite06cc0842575ebafd92213027287a1d6bc75459e (patch)
treeb482f8f87585043c7af24c281973f920df326b55 /main/src/ui/manage_accounts
parenta417cb396b18fe7ffc2a75fc640327d70793f85d (diff)
downloaddino-e06cc0842575ebafd92213027287a1d6bc75459e.tar.gz
dino-e06cc0842575ebafd92213027287a1d6bc75459e.zip
Improve IBR form handling (#990)
* Change register account dialog to show instructions Change data forms to handle title and instructions elements * Change register account dialog to show fixed fields Closes #988 * Change form switch to halign start Closes #992 * Change register account dialog to markup URLs
Diffstat (limited to 'main/src/ui/manage_accounts')
-rw-r--r--main/src/ui/manage_accounts/add_account_dialog.vala9
1 files changed, 9 insertions, 0 deletions
diff --git a/main/src/ui/manage_accounts/add_account_dialog.vala b/main/src/ui/manage_accounts/add_account_dialog.vala
index 339b880f..2f2bcb43 100644
--- a/main/src/ui/manage_accounts/add_account_dialog.vala
+++ b/main/src/ui/manage_accounts/add_account_dialog.vala
@@ -339,11 +339,20 @@ public class AddAccountDialog : Gtk.Dialog {
register_form_continue.visible = true;
register_form_continue.grab_focus();
} else if (form.fields.size > 0) {
+ if (form.instructions != null && form.instructions != "") {
+ string markup_instructions = Util.parse_add_markup(form.instructions, null, true, false);
+ form_box.add(new Label(markup_instructions) { use_markup=true, halign=Align.CENTER, xalign=0, margin_top=7,
+ wrap=true, wrap_mode=Pango.WrapMode.WORD_CHAR, visible=true });
+ }
foreach (Xep.DataForms.DataForm.Field field in form.fields) {
Widget? field_widget = Util.get_data_form_field_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 });
form_box.add(field_widget);
+ } else if (field.type_ == Xep.DataForms.DataForm.Type.FIXED && field.get_value_string() != "") {
+ string markup_fixed_field = Util.parse_add_markup(field.get_value_string(), null, true, false);
+ form_box.add(new Label(markup_fixed_field) { use_markup=true, xalign=0, margin_top=7,
+ wrap=true, wrap_mode=Pango.WrapMode.WORD_CHAR, visible=true });
}
}
register_form_continue.visible = true;