summaryrefslogtreecommitdiff
path: root/ui/simple_dialog.h
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2016-11-29 09:32:47 -0800
committerGerald Combs <gerald@wireshark.org>2016-11-30 17:06:39 +0000
commit72427192723869535fb938425ddf8c5c4568ab5c (patch)
tree2cd098bee92dfaa3de3cc1cd4943d63010c239d3 /ui/simple_dialog.h
parentff0371e89802047a0b2ed31f127526b945d27069 (diff)
downloadwireshark-72427192723869535fb938425ddf8c5c4568ab5c.tar.gz
Qt: Fix simple_dialog formatting.
Make sure that simple_dialog displays plain text. Trim whitespace and remove excessive newlines in order to improve message formatting. Add a comment about simple_dialog's behavior in Qt and GTK+ and how it might be improved. Bug: 13178 Change-Id: Ic6ff3cecd5ef1d76ec095d7a409f38e602b41ce2 Reviewed-on: https://code.wireshark.org/review/18985 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl> Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'ui/simple_dialog.h')
-rw-r--r--ui/simple_dialog.h31
1 files changed, 26 insertions, 5 deletions
diff --git a/ui/simple_dialog.h b/ui/simple_dialog.h
index ed4139a8a3..d603d069f2 100644
--- a/ui/simple_dialog.h
+++ b/ui/simple_dialog.h
@@ -80,11 +80,32 @@ typedef enum {
/** Create and show a simple dialog.
*
- * @param type type of dialog
- * @param btn_mask the buttons to display
- * @param msg_format printf like message format
- * @param ... printf like parameters
- * @return the newly created dialog
+ * @param Type type of dialog, e.g. ESD_TYPE_WARN
+ * @param btn_mask The buttons to display, e.g. ESD_BTNS_OK_CANCEL
+ * @param msg_format Printf like message format. Text must be plain.
+ * @param ... Printf like parameters
+ * @return The newly created dialog
+ */
+/*
+ * XXX This is a bit clunky. We typically pass in:
+ * - simple_dialog_primary_start
+ * - The primary message
+ * - simple_dialog_primary_end
+ * - Optionally, the secondary message.
+ *
+ * In the GTK+ UI primary_start and primary_end make up a <span> that adds
+ * text formatting. The whole string is then shoved into a GtkLabel.
+ *
+ * In the Qt UI we use primary_start and _end to split the primary and
+ * secondary messages. They are then added to a QMessageBox via setText and
+ * setInformativeText respectively. No formatting is applied.
+ *
+ * Callers are responsible for wrapping the primary message and formatting
+ * the message text.
+ *
+ * Explicitly passing in separate primary and secondary messages would let us
+ * get rid of primary_start and primary_end and reduce the amount of
+ * gymnastics we have to to in the Qt UI.
*/
extern gpointer simple_dialog(ESD_TYPE_E type, gint btn_mask,
const gchar *msg_format, ...)