summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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 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 {