diff options
author | James Henstridge <james@jamesh.id.au> | 2004-09-16 09:28:09 +0000 |
---|---|---|
committer | James Henstridge <jamesh@src.gnome.org> | 2004-09-16 09:28:09 +0000 |
commit | 963241dd15b3046e97e526b1547fdd3543b18b14 (patch) | |
tree | cc1a200d30b3ae581bb6d49d113de854ecd89a29 /src/main.c | |
parent | Updated Persian translation by Meelad Zakaria <meelad@bamdad.org>. (diff) | |
download | zenity-963241dd15b3046e97e526b1547fdd3543b18b14.tar.gz zenity-963241dd15b3046e97e526b1547fdd3543b18b14.tar.bz2 zenity-963241dd15b3046e97e526b1547fdd3543b18b14.zip |
add code to listen for commands on stdin when in listen mode.
2004-09-16 James Henstridge <james@jamesh.id.au>
* src/notification.c: add code to listen for commands on stdin
when in listen mode.
* src/main.c: parse the --listen argument for --notification mode.
* src/zenity.h (ZenityNotificationData): add a field for the
"listen" argument.
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -115,6 +115,7 @@ enum { OPTION_WARNINGTEXT, OPTION_NOTIFICATIONICON, OPTION_NOTIFICATIONTEXT, + OPTION_NOTIFICATIONLISTEN, OPTION_ABOUT, OPTION_VERSION, OPTION_LAST, @@ -581,6 +582,15 @@ struct poptOption notification_options[] = { N_("Set the notification text"), NULL }, + { + "listen", + '\0', + POPT_ARG_NONE, + NULL, + OPTION_NOTIFICATIONLISTEN, + N_("Listen for commands on stdin"), + NULL + }, POPT_TABLEEND }; @@ -1051,6 +1061,7 @@ zenity_init_parsing_options (void) { results->tree_data->radiobox = FALSE; results->tree_data->editable = FALSE; results->tree_data->print_column = NULL; + results->notification_data->listen = FALSE; } static void @@ -1572,6 +1583,12 @@ zenity_parse_options_callback (poptContext ctx, results->tree_data->print_column = g_strdup (arg); break; + case OPTION_NOTIFICATIONLISTEN: + if (results->mode != MODE_NOTIFICATION) + zenity_error ("--listen", ERROR_SUPPORT); + + results->notification_data->listen = TRUE; + break; case OPTION_ABOUT: if (results->mode != MODE_LAST) zenity_error (NULL, ERROR_DIALOG); |