From 3e519c4e1469b93c8fc6684b6aae53779d4ff270 Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Sat, 19 May 2001 15:29:19 +0000 Subject: Renamed the "NewWindow" verb into "OpenFolderInNewWindow". Got the `File -> Folder -> Open in New Window' menu item to work. svn path=/trunk/; revision=9893 --- shell/ChangeLog | 11 +++ shell/e-shell-folder-commands.c | 10 ++- shell/e-shell-view-menu.c | 16 +++- shell/evolution-shell-component-client.c | 128 ++++++++++++++++--------------- 4 files changed, 97 insertions(+), 68 deletions(-) (limited to 'shell') diff --git a/shell/ChangeLog b/shell/ChangeLog index 684ff51747..58b481bc35 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,3 +1,14 @@ +2001-05-19 Ettore Perazzoli + + * e-shell-view-menu.c: Removed "NewView" verb. Added + `folder_verbs', with "OpenFolderInNewWindow" in it. + (e_shell_view_menu_setup): Set up the `folder_verbs' too. + (command_new_view): Renamed to + `command_open_folder_in_new_window'. + + * e-shell-folder-commands.c + (e_shell_command_open_folder_in_other_window): Implement. + 2001-05-19 Ettore Perazzoli * e-shell-view-menu.c (command_create_folder): Call diff --git a/shell/e-shell-folder-commands.c b/shell/e-shell-folder-commands.c index 4d0342f7de..34cb2d0ac3 100644 --- a/shell/e-shell-folder-commands.c +++ b/shell/e-shell-folder-commands.c @@ -31,6 +31,8 @@ #include "e-shell-folder-creation-dialog.h" +/* Create new folder. */ + void e_shell_command_create_new_folder (EShell *shell, EShellView *shell_view) @@ -55,6 +57,8 @@ e_shell_command_create_new_folder (EShell *shell, } +/* Open folder in other window. */ + void e_shell_command_open_folder_in_other_window (EShell *shell, EShellView *shell_view) @@ -63,10 +67,12 @@ e_shell_command_open_folder_in_other_window (EShell *shell, g_return_if_fail (E_IS_SHELL (shell)); g_return_if_fail (shell_view != NULL && E_IS_SHELL_VIEW (shell_view)); - g_warning ("To be implemented"); + e_shell_new_view (shell, e_shell_view_get_current_uri (shell_view)); } +/* Copy folder. */ + void e_shell_command_copy_folder (EShell *shell, EShellView *shell_view) @@ -79,6 +85,8 @@ e_shell_command_copy_folder (EShell *shell, } +/* Move folder. */ + void e_shell_command_move_folder (EShell *shell, EShellView *shell_view) diff --git a/shell/e-shell-view-menu.c b/shell/e-shell-view-menu.c index 3e8d2b9bd7..3f07b171bb 100644 --- a/shell/e-shell-view-menu.c +++ b/shell/e-shell-view-menu.c @@ -23,6 +23,8 @@ * Ettore Perazzoli */ +/* FIXME: This file is a bit of a mess. */ + #include #include @@ -329,9 +331,9 @@ command_new_folder (BonoboUIComponent *uih, } static void -command_new_view (BonoboUIComponent *uih, - gpointer data, - const char *path) +command_open_folder_in_new_window (BonoboUIComponent *uih, + gpointer data, + const char *path) { EShellView *shell_view; EShell *shell; @@ -488,7 +490,6 @@ DEFINE_UNIMPLEMENTED (command_new_contact) DEFINE_UNIMPLEMENTED (command_new_task_request) BonoboUIVerb new_verbs [] = { - BONOBO_UI_VERB ("NewView", command_new_view), BONOBO_UI_VERB ("NewFolder", command_new_folder), BONOBO_UI_VERB ("NewShortcut", command_new_shortcut), BONOBO_UI_VERB ("NewMailMessage", command_new_mail_message), @@ -513,6 +514,12 @@ BonoboUIVerb file_verbs [] = { BONOBO_UI_VERB_END }; +BonoboUIVerb folder_verbs [] = { + BONOBO_UI_VERB ("OpenFolderInNewWindow", command_open_folder_in_new_window), + + BONOBO_UI_VERB_END +}; + BonoboUIVerb help_verbs [] = { BONOBO_UI_VERB_DATA ("HelpIndex", command_help, "evolution-guide/index.html"), BONOBO_UI_VERB_DATA ("HelpGetStarted", command_help, "evolution-guide/usage-mainwindow.html"), @@ -631,6 +638,7 @@ e_shell_view_menu_setup (EShellView *shell_view) shell = e_shell_view_get_shell (shell_view); bonobo_ui_component_add_verb_list_with_data (uic, file_verbs, shell_view); + bonobo_ui_component_add_verb_list_with_data (uic, folder_verbs, shell_view); bonobo_ui_component_add_verb_list_with_data (uic, new_verbs, shell_view); bonobo_ui_component_add_verb_list (uic, help_verbs); diff --git a/shell/evolution-shell-component-client.c b/shell/evolution-shell-component-client.c index f8e00de066..02a2fc7400 100644 --- a/shell/evolution-shell-component-client.c +++ b/shell/evolution-shell-component-client.c @@ -90,48 +90,6 @@ corba_exception_to_result (const CORBA_Environment *ev) } } -static void -dispatch_callback (EvolutionShellComponentClient *shell_component_client, - EvolutionShellComponentResult result) -{ - EvolutionShellComponentClientPrivate *priv; - EvolutionShellComponentClientCallback callback; - PortableServer_ObjectId *oid; - void *callback_data; - CORBA_Environment ev; - - priv = shell_component_client->priv; - - g_return_if_fail (priv->callback != NULL); - g_return_if_fail (priv->listener_servant != NULL); - - /* Notice that we destroy the interface and reset the callback information before - dispatching the callback so that the callback can generate another request. */ - - CORBA_exception_init (&ev); - - oid = PortableServer_POA_servant_to_id (bonobo_poa (), priv->listener_servant, &ev); - PortableServer_POA_deactivate_object (bonobo_poa (), oid, &ev); - POA_GNOME_Evolution_ShellComponentListener__fini (priv->listener_servant, &ev); - CORBA_free (oid); - - CORBA_Object_release (priv->listener_interface, &ev); - free_ShellComponentListener_servant (priv->listener_servant); - - CORBA_exception_free (&ev); - - priv->listener_servant = NULL; - priv->listener_interface = CORBA_OBJECT_NIL; - - callback = priv->callback; - callback_data = priv->callback_data; - - priv->callback = NULL; - priv->callback_data = NULL; - - (* callback) (shell_component_client, result, callback_data); -} - static EvolutionShellComponentResult shell_component_result_from_corba_exception (const CORBA_Environment *ev) { @@ -150,12 +108,35 @@ static POA_GNOME_Evolution_ShellComponentListener__epv ShellComponentListener_e static POA_GNOME_Evolution_ShellComponentListener__vepv ShellComponentListener_vepv; static gboolean ShellComponentListener_vepv_initialized = FALSE; +static void ShellComponentListener_vepv_initialize (void); + struct _ShellComponentListenerServant { POA_GNOME_Evolution_ShellComponentListener servant; EvolutionShellComponentClient *component_client; }; typedef struct _ShellComponentListenerServant ShellComponentListenerServant; +static PortableServer_Servant * +create_ShellComponentListener_servant (EvolutionShellComponentClient *component_client) +{ + ShellComponentListenerServant *servant; + + if (! ShellComponentListener_vepv_initialized) + ShellComponentListener_vepv_initialize (); + + servant = g_new0 (ShellComponentListenerServant, 1); + servant->servant.vepv = &ShellComponentListener_vepv; + servant->component_client = component_client; + + return (PortableServer_Servant) servant; +} + +static void +free_ShellComponentListener_servant (PortableServer_Servant servant) +{ + g_free (servant); +} + static EvolutionShellComponentClient * component_client_from_ShellComponentListener_servant (PortableServer_Servant servant) { @@ -188,6 +169,48 @@ result_from_async_corba_result (GNOME_Evolution_ShellComponentListener_Result as } } +static void +dispatch_callback (EvolutionShellComponentClient *shell_component_client, + EvolutionShellComponentResult result) +{ + EvolutionShellComponentClientPrivate *priv; + EvolutionShellComponentClientCallback callback; + PortableServer_ObjectId *oid; + void *callback_data; + CORBA_Environment ev; + + priv = shell_component_client->priv; + + g_return_if_fail (priv->callback != NULL); + g_return_if_fail (priv->listener_servant != NULL); + + /* Notice that we destroy the interface and reset the callback information before + dispatching the callback so that the callback can generate another request. */ + + CORBA_exception_init (&ev); + + oid = PortableServer_POA_servant_to_id (bonobo_poa (), priv->listener_servant, &ev); + PortableServer_POA_deactivate_object (bonobo_poa (), oid, &ev); + POA_GNOME_Evolution_ShellComponentListener__fini (priv->listener_servant, &ev); + CORBA_free (oid); + + CORBA_Object_release (priv->listener_interface, &ev); + free_ShellComponentListener_servant (priv->listener_servant); + + CORBA_exception_free (&ev); + + priv->listener_servant = NULL; + priv->listener_interface = CORBA_OBJECT_NIL; + + callback = priv->callback; + callback_data = priv->callback_data; + + priv->callback = NULL; + priv->callback_data = NULL; + + (* callback) (shell_component_client, result, callback_data); +} + static void impl_ShellComponentListener_report_result (PortableServer_Servant servant, const GNOME_Evolution_ShellComponentListener_Result result, @@ -214,27 +237,6 @@ ShellComponentListener_vepv_initialize (void) ShellComponentListener_vepv_initialized = TRUE; } -static PortableServer_Servant * -create_ShellComponentListener_servant (EvolutionShellComponentClient *component_client) -{ - ShellComponentListenerServant *servant; - - if (! ShellComponentListener_vepv_initialized) - ShellComponentListener_vepv_initialize (); - - servant = g_new0 (ShellComponentListenerServant, 1); - servant->servant.vepv = &ShellComponentListener_vepv; - servant->component_client = component_client; - - return (PortableServer_Servant) servant; -} - -static void -free_ShellComponentListener_servant (PortableServer_Servant servant) -{ - g_free (servant); -} - static void create_listener_interface (EvolutionShellComponentClient *shell_component_client) { -- cgit