gchar *data_dir;
gchar *accel_map_file;
gchar *toolbars_file;
+
+#ifdef ENABLE_DBUS
gchar *crashed_file;
guint crashed_idle;
+#endif
EggToolbarsModel *toolbars_model;
g_free (uri_list);
}
+#ifdef ENABLE_DBUS
static void
ev_application_save_session_crashed (EvApplication *application)
{
return response == GTK_RESPONSE_ACCEPT;
}
+#endif /* ENABLE_DBUS */
gboolean
ev_application_load_session (EvApplication *application)
return FALSE;
} else
#endif /* WITH_SMCLIENT */
+#ifdef ENABLE_DBUS
if (g_file_test (application->crashed_file, G_FILE_TEST_IS_REGULAR)) {
if (ev_application_run_crash_recovery_dialog (application)) {
state_file = g_key_file_new ();
} else {
return FALSE;
}
- } else {
+ } else
+#endif /* ENABLE_DBUS */
return FALSE;
- }
uri_list = g_key_file_get_string_list (state_file,
"Evince",
static void
ev_application_init_session (EvApplication *application)
{
+#ifdef ENABLE_DBUS
application->crashed_file = g_build_filename (application->dot_dir,
"evince-crashed", NULL);
+#endif
#ifdef WITH_SMCLIENT
application->smclient = egg_sm_client_get ();
gtk_window_set_screen (GTK_WINDOW (new_window), screen);
}
+#ifdef ENABLE_DBUS
ev_application_save_session_crashed (application);
g_signal_connect_swapped (new_window, "destroy",
G_CALLBACK (save_session_crashed_in_idle),
application);
+#endif
if (!GTK_WIDGET_REALIZED (new_window))
gtk_widget_realize (new_window);
we can restore window size without flickering */
ev_window_open_uri (new_window, uri, dest, mode, search_string);
+#ifdef ENABLE_DBUS
ev_application_save_session_crashed (application);
g_signal_connect_swapped (new_window, "destroy",
G_CALLBACK (save_session_crashed_in_idle),
application);
+#endif
if (!GTK_WIDGET_REALIZED (GTK_WIDGET (new_window)))
gtk_widget_realize (GTK_WIDGET (new_window));
void
ev_application_shutdown (EvApplication *application)
{
+#ifdef ENABLE_DBUS
if (application->crashed_file) {
ev_application_save_session_crashed (application);
g_free (application->crashed_file);
application->crashed_file = NULL;
}
+#endif
if (application->accel_map_file) {
gtk_accel_map_save (application->accel_map_file);