]>
Dogcows Code - chaz/openbox/blob - openbox/actions/session.c
0031a273db5371a0fbd20763fb393e1a8454aa6d
1 #include "openbox/actions.h"
2 #include "openbox/prompt.h"
3 #include "openbox/session.h"
7 void action_logout_startup(void) {}
15 static gpointer
setup_func(ObParseInst
*i
, xmlDocPtr doc
, xmlNodePtr node
);
16 static gboolean
logout_func(ObActionsData
*data
, gpointer options
);
18 void action_session_startup(void)
20 actions_register("SessionLogout", setup_func
, NULL
, logout_func
,
24 static gpointer
setup_func(ObParseInst
*i
, xmlDocPtr doc
, xmlNodePtr node
)
29 o
= g_new0(Options
, 1);
31 if ((n
= parse_find_node("prompt", node
)))
32 o
->prompt
= parse_bool(doc
, n
);
37 static void prompt_cb(ObPrompt
*p
, gint result
, gpointer data
)
41 session_request_logout(o
->silent
);
46 /* Always return FALSE because its not interactive */
47 static gboolean
logout_func(ObActionsData
*data
, gpointer options
)
54 ObPromptAnswer answers
[] = {
59 o2
= g_memdup(o
, sizeof(Options
));
60 p
= prompt_new(_("Are you sure you want to log out?"),
61 answers
, 2, 0, 0, prompt_cb
, o2
);
62 prompt_show(p
, NULL
, FALSE
);
65 prompt_cb(NULL
, 1, NULL
);
This page took 0.041089 seconds and 4 git commands to generate.