]>
Dogcows Code - chaz/openbox/blob - openbox/actions/session.c
436eb0f57141b13e0f6b2aaf3e215d7198d85172
1 #include "openbox/actions.h"
2 #include "openbox/prompt.h"
3 #include "openbox/session.h"
11 static gpointer
setup_func(ObParseInst
*i
, xmlDocPtr doc
, xmlNodePtr node
);
12 static gboolean
logout_func(ObActionsData
*data
, gpointer options
);
14 void action_session_startup(void)
16 actions_register("SessionLogout", setup_func
, NULL
, logout_func
,
20 static gpointer
setup_func(ObParseInst
*i
, xmlDocPtr doc
, xmlNodePtr node
)
25 o
= g_new0(Options
, 1);
28 if ((n
= parse_find_node("prompt", node
)))
29 o
->prompt
= parse_bool(doc
, n
);
34 static gboolean
prompt_cb(ObPrompt
*p
, gint result
, gpointer data
)
39 session_request_logout(o
->silent
);
41 g_message(_("The SessionLogout action is not available since Openbox was built without session management support"));
44 return TRUE
; /* call cleanup func */
47 static void prompt_cleanup(ObPrompt
*p
, gpointer data
)
53 /* Always return FALSE because its not interactive */
54 static gboolean
logout_func(ObActionsData
*data
, gpointer options
)
61 ObPromptAnswer answers
[] = {
66 o2
= g_memdup(o
, sizeof(Options
));
67 p
= prompt_new(_("Are you sure you want to log out?"),
69 answers
, 2, 0, 0, prompt_cb
, prompt_cleanup
, o2
);
70 prompt_show(p
, NULL
, FALSE
);
73 prompt_cb(NULL
, 1, NULL
);
This page took 0.03994 seconds and 4 git commands to generate.