void session_startup(gint argc, gchar **argv) {}
void session_shutdown(gboolean permanent) {}
GList* session_state_find(struct _ObClient *c) { return NULL; }
+void session_request_logout(gboolean silent) {}
#else
#include "debug.h"
obt_paths_unref(p), p = NULL;
if (!obt_paths_mkdir_path(dir, 0700)) {
- g_message(_("Unable to make directory '%s': %s"),
+ g_message(_("Unable to make directory \"%s\": %s"),
dir, g_strerror(errno));
}
f = fopen(ob_sm_save_file, "w");
if (!f) {
success = FALSE;
- g_message(_("Unable to save the session to '%s': %s"),
+ g_message(_("Unable to save the session to \"%s\": %s"),
ob_sm_save_file, g_strerror(errno));
} else {
fprintf(f, "<?xml version=\"1.0\"?>\n\n");
if (fflush(f)) {
success = FALSE;
- g_message(_("Error while saving the session to '%s': %s"),
+ g_message(_("Error while saving the session to \"%s\": %s"),
ob_sm_save_file, g_strerror(errno));
}
fclose(f);
obt_parse_instance_unref(i);
}
+void session_request_logout(gboolean silent)
+{
+ if (sm_conn) {
+ SmcRequestSaveYourself(sm_conn,
+ SmSaveBoth,
+ TRUE, /* logout */
+ (silent ?
+ SmInteractStyleNone : SmInteractStyleAny),
+ TRUE, /* if false, with GSM, it shows the old
+ logout prompt */
+ TRUE); /* global */
+ }
+ else
+ g_message(_("Not connected to a session manager"));
+}
+
#endif