summaryrefslogtreecommitdiff
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
parent77bd857bfecbab6e65fc3f3d7f31ca7d01a89822 (diff)
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.
-rw-r--r--ChangeLog7
-rw-r--r--THANKS2
-rw-r--r--src/msg.c3
-rw-r--r--src/option.c46
-rw-r--r--src/zenity.h1
5 files changed, 59 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 1981256..76c88f1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+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.
+
2005-04-06 Christian Rose <menthos@menthos.com>
* configure.in: Added "ug" to ALL_LINGUAS.
diff --git a/THANKS b/THANKS
index a122cdc..03e3e70 100644
--- a/THANKS
+++ b/THANKS
@@ -6,6 +6,7 @@
"Patches from the following people",
"=================================",
"Darren Adams <darrenadams dsl pipex com>"
+ "Timo Aaltonen <tjaaltonen gnome cc hut fi>",
"Peter Astrand <astrand lysator liu se>",
"Jonathan Blandford <jrb redhat com>",
"Paul Bolle <pebolle tiscali nl>",
@@ -30,6 +31,7 @@
"Buhan Milne <bgmilne linux-mandrake com>",
"Christian Monneckes <c-w-m gmx de>",
"Ivan Noris <vix vazka sk>",
+ "Carlos Parra <cparra emergya info>",
"Havoc Pennington <hp redhat com>",
"Jan Arne Petersen <jpetersen uni-bonn de>",
"Kevin C Krinke <kckrinke opendoorsoftware com>",
diff --git a/src/msg.c b/src/msg.c
index ffb2e53..2449c00 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 603ce04..0835912 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 0e86971..0f821a4 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 {