summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorJames Henstridge <james@jamesh.id.au>2004-09-16 09:28:09 +0000
committerJames Henstridge <jamesh@src.gnome.org>2004-09-16 09:28:09 +0000
commit963241dd15b3046e97e526b1547fdd3543b18b14 (patch)
treecc1a200d30b3ae581bb6d49d113de854ecd89a29 /src/main.c
parent8f506690acc3e6103db31b4426856498dacc5d32 (diff)
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.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 4d8c607..b4162cd 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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);