From 6e6eeaf79c01b6cc755b57dac7e7ff2d36038316 Mon Sep 17 00:00:00 2001 From: Glynn Foster Date: Wed, 20 Apr 2005 01:59:42 +0000 Subject: Bug fix for #149290, based on contributions from Timo Aaltonen, Lucas 2005-04-20 Glynn Foster * src/msg.c, src/option.c, src/zenity.h: Bug fix for #149290, based on contributions from Timo Aaltonen, Lucas Rocha, and Carlos Parra. * THANKS: Update. --- ChangeLog | 7 +++++++ THANKS | 2 ++ src/msg.c | 3 +++ src/option.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ src/zenity.h | 1 + 5 files changed, 59 insertions(+) diff --git a/ChangeLog b/ChangeLog index 19812567..76c88f14 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2005-04-20 Glynn Foster + + * src/msg.c, src/option.c, src/zenity.h: Bug fix for + #149290, based on contributions from Timo Aaltonen, + Lucas Rocha, and Carlos Parra. + * THANKS: Update. + 2005-04-06 Christian Rose * configure.in: Added "ug" to ALL_LINGUAS. diff --git a/THANKS b/THANKS index a122cdcd..03e3e703 100644 --- a/THANKS +++ b/THANKS @@ -6,6 +6,7 @@ "Patches from the following people", "=================================", "Darren Adams " + "Timo Aaltonen ", "Peter Astrand ", "Jonathan Blandford ", "Paul Bolle ", @@ -30,6 +31,7 @@ "Buhan Milne ", "Christian Monneckes ", "Ivan Noris ", + "Carlos Parra ", "Havoc Pennington ", "Jan Arne Petersen ", "Kevin C Krinke ", diff --git a/src/msg.c b/src/msg.c index ffb2e531..2449c007 100644 --- a/src/msg.c +++ b/src/msg.c @@ -110,6 +110,9 @@ zenity_msg (ZenityData *data, ZenityMsgData *msg_data) if (msg_data->dialog_text) gtk_label_set_markup (GTK_LABEL (text), msg_data->dialog_text); + if (msg_data->no_wrap) + gtk_label_set_line_wrap (GTK_LABEL (text), FALSE); + zenity_util_show_dialog (dialog); gtk_main (); } diff --git a/src/option.c b/src/option.c index 603ce04b..08359120 100644 --- a/src/option.c +++ b/src/option.c @@ -34,6 +34,7 @@ gchar *zenity_general_dialog_text; gchar *zenity_general_separator; gboolean zenity_general_editable; gchar *zenity_general_uri; +gboolean zenity_general_dialog_no_wrap; /* Calendar Dialog Options */ gboolean zenity_calendar_active; @@ -253,6 +254,15 @@ GOptionEntry error_options[] = { N_("Set the dialog text"), NULL }, + { + "no-wrap", + '\0', + 0, + G_OPTION_ARG_NONE, + &zenity_general_dialog_no_wrap, + N_("Do not enable text wrapping"), + NULL + }, { NULL } @@ -277,6 +287,15 @@ GOptionEntry info_options[] = { N_("Set the dialog text"), NULL }, + { + "no-wrap", + '\0', + 0, + G_OPTION_ARG_NONE, + &zenity_general_dialog_no_wrap, + N_("Do not enable text wrapping"), + NULL + }, { NULL } @@ -524,6 +543,15 @@ GOptionEntry question_options[] = { N_("Set the dialog text"), NULL }, + { + "no-wrap", + '\0', + 0, + G_OPTION_ARG_NONE, + &zenity_general_dialog_no_wrap, + N_("Do not enable text wrapping"), + NULL + }, { NULL } @@ -581,6 +609,15 @@ GOptionEntry warning_options[] = { N_("Set the dialog text"), NULL }, + { + "no-wrap", + '\0', + 0, + G_OPTION_ARG_NONE, + &zenity_general_dialog_no_wrap, + N_("Do not enable text wrapping"), + NULL + }, { NULL } @@ -705,6 +742,7 @@ zenity_general_pre_callback (GOptionContext *context, zenity_general_separator = g_strdup ("|"); zenity_general_editable = FALSE; zenity_general_uri = NULL; + zenity_general_dialog_no_wrap = FALSE; return TRUE; } @@ -966,6 +1004,7 @@ zenity_error_post_callback (GOptionContext *context, if (results->mode == MODE_ERROR) { results->msg_data->dialog_text = zenity_general_dialog_text; results->msg_data->mode = ZENITY_MSG_ERROR; + results->msg_data->no_wrap = zenity_general_dialog_no_wrap; } return TRUE; @@ -982,6 +1021,7 @@ zenity_info_post_callback (GOptionContext *context, if (results->mode == MODE_INFO) { results->msg_data->dialog_text = zenity_general_dialog_text; results->msg_data->mode = ZENITY_MSG_INFO; + results->msg_data->no_wrap = zenity_general_dialog_no_wrap; } return TRUE; @@ -1128,6 +1168,7 @@ zenity_question_post_callback (GOptionContext *context, if (results->mode == MODE_QUESTION) { results->msg_data->dialog_text = zenity_general_dialog_text; results->msg_data->mode = ZENITY_MSG_QUESTION; + results->msg_data->no_wrap = zenity_general_dialog_no_wrap; } return TRUE; @@ -1160,6 +1201,7 @@ zenity_warning_post_callback (GOptionContext *context, if (results->mode == MODE_WARNING) { results->msg_data->dialog_text = zenity_general_dialog_text; results->msg_data->mode = ZENITY_MSG_WARNING; + results->msg_data->no_wrap = zenity_general_dialog_no_wrap; } return TRUE; @@ -1377,5 +1419,9 @@ zenity_option_parse (gint argc, gchar **argv) if (results->mode != MODE_FILE && results->mode != MODE_TEXTINFO) zenity_option_error (zenity_option_get_name (text_options, &zenity_general_uri), ERROR_SUPPORT); + if (zenity_general_dialog_no_wrap) + if (results->mode != MODE_INFO && results->mode != MODE_ERROR && results->mode != MODE_QUESTION && results->mode != MODE_WARNING) + zenity_option_error (zenity_option_get_name (text_options, &zenity_general_dialog_no_wrap), ERROR_SUPPORT); + return results; } diff --git a/src/zenity.h b/src/zenity.h index 0e869716..0f821a4a 100644 --- a/src/zenity.h +++ b/src/zenity.h @@ -57,6 +57,7 @@ typedef enum { typedef struct { gchar *dialog_text; MsgMode mode; + gboolean no_wrap; } ZenityMsgData; typedef struct { -- cgit