diff options
author | Ettore Perazzoli <ettore@src.gnome.org> | 2002-05-16 05:41:51 +0800 |
---|---|---|
committer | Ettore Perazzoli <ettore@src.gnome.org> | 2002-05-16 05:41:51 +0800 |
commit | 3d386b57d1682ad0f5fb0b9a60f0d65906f578b7 (patch) | |
tree | 67f79ba63a89ee7f5e1e463b8b4e082bfca83620 /shell/evolution-test-component.c | |
parent | c1ce3633db69de57b4a589587627fa088f9a3e5f (diff) | |
download | gsoc2013-evolution-3d386b57d1682ad0f5fb0b9a60f0d65906f578b7.tar.gz 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-test-component.c')
-rw-r--r-- | shell/evolution-test-component.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/shell/evolution-test-component.c b/shell/evolution-test-component.c index 7dc991fcf3..5c2d36b16e 100644 --- a/shell/evolution-test-component.c +++ b/shell/evolution-test-component.c @@ -488,6 +488,28 @@ create_view_fn (EvolutionShellComponent *shell_component, return EVOLUTION_SHELL_COMPONENT_OK; } +static gboolean +request_quit_fn (EvolutionShellComponent *shell_component, + void *closure) +{ + GtkWidget *confirm_dialog; + GtkWidget *label; + int button; + + confirm_dialog = gnome_dialog_new ("Quit?", GNOME_STOCK_BUTTON_OK, GNOME_STOCK_BUTTON_CANCEL, NULL); + label = gtk_label_new ("Please confirm that you want to quit now."); + gtk_container_add (GTK_CONTAINER (GNOME_DIALOG (confirm_dialog)->vbox), label); + gtk_widget_show_all (confirm_dialog); + + button = gnome_dialog_run (GNOME_DIALOG (confirm_dialog)); + gtk_widget_destroy (confirm_dialog); + + if (button == 0) + return TRUE; /* OK */ + else + return FALSE; /* Cancel */ +} + /* Callbacks. */ @@ -547,7 +569,9 @@ register_component (void) shell_component = evolution_shell_component_new (folder_types, NULL, create_view_fn, - NULL, NULL, NULL, NULL, NULL, NULL); + NULL, NULL, NULL, NULL, NULL, + request_quit_fn, + NULL); gtk_signal_connect (GTK_OBJECT (shell_component), "owner_set", GTK_SIGNAL_FUNC (owner_set_callback), NULL); |