From 10eab2350036e1c36377c93d31472125b3e7c8c7 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 10 Jul 2009 18:36:49 -0400 Subject: Implement the shutdown protocol and stub in session management. The shutdown protocol is modelled after online/offline preparation. Session management code is copied from libegg. Not yet used. --- modules/addressbook/e-book-shell-backend.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'modules/addressbook/e-book-shell-backend.c') diff --git a/modules/addressbook/e-book-shell-backend.c b/modules/addressbook/e-book-shell-backend.c index 68af7ed03b..53737b538e 100644 --- a/modules/addressbook/e-book-shell-backend.c +++ b/modules/addressbook/e-book-shell-backend.c @@ -395,6 +395,16 @@ book_shell_backend_handle_uri_cb (EShellBackend *shell_backend, return TRUE; } +static void +book_shell_backend_prepare_for_shutdown_cb (EShellBackend *shell_backend, + EActivity *activity) +{ + /* FIXME Should specify whether Cancel is allowed. Currently, + * clicking Cancel when prompted to save during shutdown + * just discards changes. */ + eab_editor_request_close_all (); +} + static void book_shell_backend_window_created_cb (EShellBackend *shell_backend, GtkWindow *window) @@ -475,6 +485,11 @@ book_shell_backend_constructed (GObject *object) G_CALLBACK (book_shell_backend_handle_uri_cb), shell_backend); + g_signal_connect_swapped ( + shell, "prepare-for-shutdown", + G_CALLBACK (book_shell_backend_prepare_for_shutdown_cb), + shell_backend); + g_signal_connect_swapped ( shell, "window-created", G_CALLBACK (book_shell_backend_window_created_cb), @@ -483,19 +498,6 @@ book_shell_backend_constructed (GObject *object) autocompletion_config_init (shell); } -static gboolean -book_shell_backend_is_busy (EShellBackend *shell_backend) -{ - return !eab_editor_request_close_all (); -} - -static gboolean -book_shell_backend_shutdown (EShellBackend *shell_backend) -{ - /* FIXME */ - return TRUE; -} - static void book_shell_backend_class_init (EBookShellBackendClass *class) { @@ -517,8 +519,6 @@ book_shell_backend_class_init (EBookShellBackendClass *class) shell_backend_class->schemes = ""; shell_backend_class->sort_order = 300; shell_backend_class->start = NULL; - shell_backend_class->is_busy = book_shell_backend_is_busy; - shell_backend_class->shutdown = book_shell_backend_shutdown; shell_backend_class->migrate = e_book_shell_backend_migrate; g_object_class_install_property ( -- cgit v1.2.3