From 2c96093cd1622e22c11b50d939cce33d752ce3ee Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Sat, 04 Nov 2017 21:20:58 -0400 Subject: mq_html_form*(): Add optional button names --- (limited to 'src/utils') diff --git a/src/utils/html.c b/src/utils/html.c index 0549457..35e6e65 100644 --- a/src/utils/html.c +++ b/src/utils/html.c @@ -673,7 +673,8 @@ mq_html_notebook(gboolean vertical, const gchar *name, guint current_page, ...) } gchar * -mq_html_form(const gchar *submit_label, const gchar *reset_label, ...) +mq_html_form(const gchar *submit_name, const gchar *submit_label, + const gchar *reset_name, const gchar *reset_label, ...) { gsize len; va_list ap; @@ -690,12 +691,24 @@ mq_html_form(const gchar *submit_label, const gchar *reset_label, ...) va_end(ap); len += strlen("
\n"); if (reset_label && reset_label[0]) { - len += strlen("\n"); } if (submit_label && submit_label[0]) { - len += strlen("\n"); } @@ -714,12 +727,24 @@ mq_html_form(const gchar *submit_label, const gchar *reset_label, ...) va_end(ap); ptr = g_stpcpy(ptr, "
\n"); if (reset_label && reset_label[0]) { - ptr = g_stpcpy(ptr, "\n"); } if (submit_label && submit_label[0]) { - ptr = g_stpcpy(ptr, "\n"); } @@ -730,8 +755,8 @@ mq_html_form(const gchar *submit_label, const gchar *reset_label, ...) } gchar * -mq_html_form_v(const gchar *submit_label, const gchar *reset_label, - gchar **children) +mq_html_form_v(const gchar *submit_name, const gchar *submit_label, + const gchar *reset_name, const gchar *reset_label, gchar **children) { gsize len; gsize i; @@ -745,12 +770,24 @@ mq_html_form_v(const gchar *submit_label, const gchar *reset_label, } len += strlen("
\n"); if (reset_label && reset_label[0]) { - len += strlen("\n"); } if (submit_label && submit_label[0]) { - len += strlen("\n"); } @@ -766,12 +803,24 @@ mq_html_form_v(const gchar *submit_label, const gchar *reset_label, } ptr = g_stpcpy(ptr, "
\n"); if (reset_label && reset_label[0]) { - ptr = g_stpcpy(ptr, "\n"); } if (submit_label && submit_label[0]) { - ptr = g_stpcpy(ptr, "\n"); } diff --git a/src/utils/html.h b/src/utils/html.h index 53d4216..16129be 100644 --- a/src/utils/html.h +++ b/src/utils/html.h @@ -66,12 +66,13 @@ mq_html_notebook(gboolean vertical, const gchar *name, guint current_page, ...) G_GNUC_NULL_TERMINATED; gchar * -mq_html_form(const gchar *submit_label, const gchar *reset_label, ...) +mq_html_form(const gchar *submit_name, const gchar *submit_label, + const gchar *reset_name, const gchar *reset_label, ...) G_GNUC_NULL_TERMINATED; gchar * -mq_html_form_v(const gchar *submit_label, const gchar *reset_label, - gchar **children); +mq_html_form_v(const gchar *submit_name, const gchar *submit_label, + const gchar *reset_name, const gchar *reset_label, gchar **children); gchar * mq_html_input_text(const gchar *name, const gchar *label, const gchar *value); -- cgit v0.9.1