summaryrefslogtreecommitdiff
path: root/src/option.c
diff options
context:
space:
mode:
authorArx Cruz <arxcruz@src.gnome.org>2011-07-19 14:33:28 -0300
committerArx Cruz <arxcruz@src.gnome.org>2011-07-19 14:39:05 -0300
commit1d339e29a782de8962379652635c9ee42988d99c (patch)
treee371539ef66a0403fc78147180d160c923c441bb /src/option.c
parent239fc66928c41ffd0ebaa88cfcd05ff114028895 (diff)
Enable html support in --text-info option. This fix bug #598655, thanks for the work from Francis Meyvis francis.meyvis at gmail dot com. Two new options in --text-info: * --html - enable HTML support. * --url - load an url
If you need to load a local html file, you can use --filename=patch/to/html. Examples: * zenity --text-info --html --filename=file.html * zenity --text-info --html --url=www.gnome.org Zenity will add http:// if isn't declared in --url
Diffstat (limited to 'src/option.c')
-rw-r--r--src/option.c34
1 files changed, 33 insertions, 1 deletions
diff --git a/src/option.c b/src/option.c
index 079bd02..e5f79b9 100644
--- a/src/option.c
+++ b/src/option.c
@@ -100,6 +100,10 @@ static gboolean zenity_question_active;
static gboolean zenity_text_active;
static gchar *zenity_text_font;
static gchar *zenity_text_checkbox;
+#ifdef HAVE_WEBKITGTK
+static gboolean zenity_text_enable_html;
+static gchar *zenity_text_url;
+#endif
/* Warning Dialog Options */
static gboolean zenity_warning_active;
@@ -786,9 +790,29 @@ static GOptionEntry text_options[] = {
G_OPTION_FLAG_NOALIAS,
G_OPTION_ARG_STRING,
&zenity_text_checkbox,
- N_("Enable a I read and agree checkbox"),
+ N_("Enable an I read and agree checkbox"),
N_("TEXT")
},
+#ifdef HAVE_WEBKITGTK
+ {
+ "html",
+ '\0',
+ G_OPTION_FLAG_NOALIAS,
+ G_OPTION_ARG_NONE,
+ &zenity_text_enable_html,
+ N_("Enable html support"),
+ NULL
+ },
+ {
+ "url",
+ '\0',
+ G_OPTION_FLAG_NOALIAS,
+ G_OPTION_ARG_STRING,
+ &zenity_text_url,
+ N_("Sets an url instead of a file. Only works if you use --html option"),
+ N_("URL")
+ },
+#endif
{
NULL
}
@@ -1347,6 +1371,10 @@ zenity_text_pre_callback (GOptionContext *context,
zenity_text_active = FALSE;
zenity_text_font = NULL;
zenity_text_checkbox = NULL;
+#ifdef HAVE_WEBKITGTK
+ zenity_text_enable_html = FALSE;
+ zenity_text_url = NULL;
+#endif
return TRUE;
}
@@ -1743,6 +1771,10 @@ zenity_text_post_callback (GOptionContext *context,
results->text_data->ok_label = zenity_general_ok_button;
results->text_data->cancel_label = zenity_general_cancel_button;
results->text_data->checkbox = zenity_text_checkbox;
+#ifdef HAVE_WEBKITGTK
+ results->text_data->html = zenity_text_enable_html;
+ results->text_data->url = zenity_text_url;
+#endif
} else {
if (zenity_text_font)
zenity_option_error (zenity_option_get_name (text_options, &zenity_text_font),