1 #include "openbox/actions.h"
2 #include "openbox/openbox.h"
3 #include "openbox/prompt.h"
10 static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node);
11 static gboolean run_func(ObActionsData *data, gpointer options);
13 void action_exit_startup(void)
15 actions_register("Exit", setup_func, NULL, run_func, NULL, NULL);
18 static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node)
23 o = g_new0(Options, 1);
26 if ((n = parse_find_node("prompt", node)))
27 o->prompt = parse_bool(doc, n);
32 static gboolean prompt_cb(ObPrompt *p, gint result, gpointer data)
36 return TRUE; /* call the cleanup func */
39 static void prompt_cleanup(ObPrompt *p, gpointer data)
44 /* Always return FALSE because its not interactive */
45 static gboolean run_func(ObActionsData *data, gpointer options)
51 ObPromptAnswer answers[] = {
56 p = prompt_new(_("Are you sure you want to exit Openbox?"),
58 answers, 2, 0, 0, prompt_cb, prompt_cleanup, NULL);
59 prompt_show(p, NULL, FALSE);