summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGlynn Foster <glynn.foster@sun.com>2005-04-20 01:59:42 +0000
committerGlynn Foster <gman@src.gnome.org>2005-04-20 01:59:42 +0000
commit6e6eeaf79c01b6cc755b57dac7e7ff2d36038316 (patch)
tree9e1918f75413ac47ca184829fcb182c2923c7a3e /src
parentAdded "ug" to ALL_LINGUAS. Added Uighur translation by Abduxukur Abdurixit (diff)
downloadzenity-6e6eeaf79c01b6cc755b57dac7e7ff2d36038316.tar.gz
zenity-6e6eeaf79c01b6cc755b57dac7e7ff2d36038316.tar.bz2
zenity-6e6eeaf79c01b6cc755b57dac7e7ff2d36038316.zip
Bug fix for #149290, based on contributions from Timo Aaltonen, Lucas
2005-04-20 Glynn Foster <glynn.foster@sun.com> * 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.
Diffstat (limited to 'src')
-rw-r--r--src/msg.c3
-rw-r--r--src/option.c46
-rw-r--r--src/zenity.h1
3 files changed, 50 insertions, 0 deletions
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 {
bgstack15