summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorGlynn Foster <glynn.foster@sun.com>2004-04-28 12:06:02 +0000
committerGlynn Foster <gman@src.gnome.org>2004-04-28 12:06:02 +0000
commit02955ce70f7fa58da88dc8d66e07520afb94f642 (patch)
tree66e1ac639a4bc20193c904c008c447386da5af71 /src/main.c
parentUntranslate 3 strings again. Thanks to Christian for pointing this out. (diff)
downloadzenity-02955ce70f7fa58da88dc8d66e07520afb94f642.tar.gz
zenity-02955ce70f7fa58da88dc8d66e07520afb94f642.tar.bz2
zenity-02955ce70f7fa58da88dc8d66e07520afb94f642.zip
Fix the list dialog not being able to handle --text to change the text. It
2004-04-29 Glynn Foster <glynn.foster@sun.com> * src/main.c, src/tree.c: Fix the list dialog not being able to handle --text to change the text. It was also intentional but must have fallen through the gaps. * data/zenity.1: Update * help/C/zenity.xml: Update.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 58fe37ac..9b112c62 100644
--- a/src/main.c
+++ b/src/main.c
@@ -96,6 +96,7 @@ enum {
OPTION_FILENAME,
OPTION_MULTIFILE,
OPTION_TEXTFILENAME,
+ OPTION_LISTTEXT,
OPTION_COLUMN,
OPTION_SEPERATOR,
OPTION_LISTEDIT,
@@ -462,6 +463,15 @@ struct poptOption list_options[] = {
NULL
},
{
+ "text",
+ '\0',
+ POPT_ARG_STRING,
+ NULL,
+ OPTION_LISTTEXT,
+ N_("Set the dialog text"),
+ NULL
+ },
+ {
"column",
'\0',
POPT_ARG_STRING,
@@ -959,6 +969,7 @@ zenity_init_parsing_options (void) {
results->progress_data->pulsate = FALSE;
results->progress_data->autoclose = FALSE;
results->entry_data->visible = TRUE;
+ results->tree_data->dialog_text = NULL;
results->tree_data->checkbox = FALSE;
results->tree_data->radiobox = FALSE;
results->tree_data->editable = FALSE;
@@ -1004,6 +1015,8 @@ zenity_free_parsing_options (void) {
g_free (results->text_data->uri);
break;
case MODE_LIST:
+ if (results->tree_data->dialog_text)
+ g_free (results->tree_data->dialog_text);
if (results->tree_data->columns)
g_slist_foreach (results->tree_data->columns, (GFunc) g_free, NULL);
if (results->tree_data->separator)
@@ -1237,6 +1250,7 @@ zenity_parse_options_callback (poptContext ctx,
case OPTION_ERRORTEXT:
case OPTION_QUESTIONTEXT:
case OPTION_PROGRESSTEXT:
+ case OPTION_LISTTEXT:
case OPTION_WARNINGTEXT:
/* FIXME: This is an ugly hack because of the way the poptOptions are
@@ -1244,7 +1258,7 @@ zenity_parse_options_callback (poptContext ctx,
* parse_options_callback gets called for each option. Suckage
*/
- if (parse_option_text > 6)
+ if (parse_option_text > 7)
zenity_error ("--text", ERROR_DUPLICATE);
switch (results->mode) {
@@ -1267,6 +1281,10 @@ zenity_parse_options_callback (poptContext ctx,
results->progress_data->dialog_text = g_locale_to_utf8 (g_strcompress (arg),
-1, NULL, NULL, NULL);
break;
+ case MODE_LIST:
+ results->tree_data->dialog_text = g_locale_to_utf8 (g_strcompress (arg),
+ -1, NULL, NULL, NULL);
+ break;
default:
zenity_error ("--text", ERROR_SUPPORT);
}
bgstack15