aboutsummaryrefslogtreecommitdiffstats
path: root/shell/evolution-shell-component-client.c
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2002-05-16 05:41:51 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2002-05-16 05:41:51 +0800
commit3d386b57d1682ad0f5fb0b9a60f0d65906f578b7 (patch)
tree67f79ba63a89ee7f5e1e463b8b4e082bfca83620 /shell/evolution-shell-component-client.c
parentc1ce3633db69de57b4a589587627fa088f9a3e5f (diff)
downloadgsoc2013-evolution-3d386b57d1682ad0f5fb0b9a60f0d65906f578b7.tar
gsoc2013-evolution-3d386b57d1682ad0f5fb0b9a60f0d65906f578b7.tar.gz
gsoc2013-evolution-3d386b57d1682ad0f5fb0b9a60f0d65906f578b7.tar.bz2
gsoc2013-evolution-3d386b57d1682ad0f5fb0b9a60f0d65906f578b7.tar.lz
gsoc2013-evolution-3d386b57d1682ad0f5fb0b9a60f0d65906f578b7.tar.xz
gsoc2013-evolution-3d386b57d1682ad0f5fb0b9a60f0d65906f578b7.tar.zst
gsoc2013-evolution-3d386b57d1682ad0f5fb0b9a60f0d65906f578b7.zip
Check with e_shell_prepare_for_quit() before quitting.
* e-shell-view-menu.c (command_quit): Check with e_shell_prepare_for_quit() before quitting. * e-shell.c (e_shell_prepare_for_quit): New. * evolution-test-component.c (request_quit_fn): New function asking for confirmation to quit. * evolution-shell-component.c (evolution_shell_component_new): New arg @request_quit_fn. (impl_requestQuit): New, implementation for EvolutionShellComponent::requestQuit. (evolution_shell_component_result_to_string): Handle EVOLUTION_SHELL_COMPONENT_CANCEL. (evolution_shell_component_client_request_quit): New. * Evolution-ShellComponent.idl (requestQuit): New. * component-factory.c (create_component): Pass NULL as @request_quit_fn. * component-factory.c (create_component): Pass NULL as @request_quit_fn. * gui/component-factory.c (create_object): Pass NULL as @request_quit_fn. * gui/component/addressbook-component.c (create_component): Pass NULL as @request_quit_fn. svn path=/trunk/; revision=16925
Diffstat (limited to 'shell/evolution-shell-component-client.c')
-rw-r--r--shell/evolution-shell-component-client.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/shell/evolution-shell-component-client.c b/shell/evolution-shell-component-client.c
index 2a1b2e0a2d..7b8051e0c1 100644
--- a/shell/evolution-shell-component-client.c
+++ b/shell/evolution-shell-component-client.c
@@ -839,5 +839,47 @@ evolution_shell_component_client_populate_folder_context_menu (EvolutionShellCom
}
+void
+evolution_shell_component_client_request_quit (EvolutionShellComponentClient *shell_component_client,
+ EvolutionShellComponentClientCallback callback,
+ void *data)
+{
+ EvolutionShellComponentClientPrivate *priv;
+ GNOME_Evolution_ShellComponent corba_shell_component;
+ CORBA_Environment ev;
+
+ g_return_if_fail (EVOLUTION_IS_SHELL_COMPONENT_CLIENT (shell_component_client));
+ g_return_if_fail (callback != NULL);
+
+ priv = shell_component_client->priv;
+
+ if (priv->callback != NULL) {
+ (* callback) (shell_component_client, EVOLUTION_SHELL_COMPONENT_BUSY, data);
+ return;
+ }
+
+ create_listener_interface (shell_component_client);
+
+ CORBA_exception_init (&ev);
+
+ corba_shell_component = BONOBO_OBJREF (shell_component_client);
+
+ priv->callback = callback;
+ priv->callback_data = data;
+
+ GNOME_Evolution_ShellComponent_requestQuit (corba_shell_component, priv->listener_interface, &ev);
+
+ if (ev._major != CORBA_NO_EXCEPTION && priv->callback != NULL) {
+ (* callback) (shell_component_client,
+ shell_component_result_from_corba_exception (&ev),
+ data);
+ priv->callback = NULL;
+ priv->callback_data = NULL;
+ }
+
+ CORBA_exception_free (&ev);
+}
+
+
E_MAKE_TYPE (evolution_shell_component_client, "EvolutionShellComponentClient",
EvolutionShellComponentClient, class_init, init, PARENT_TYPE)