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,6 +90,85 @@ corba_exception_to_result (const CORBA_Environment *ev) } } +static EvolutionShellComponentResult +shell_component_result_from_corba_exception (const CORBA_Environment *ev) +{ + if (ev->_major == CORBA_NO_EXCEPTION) + return EVOLUTION_SHELL_COMPONENT_OK; + if (ev->_major == CORBA_SYSTEM_EXCEPTION) + return EVOLUTION_SHELL_COMPONENT_CORBAERROR; + return EVOLUTION_SHELL_COMPONENT_CORBAERROR; /* FIXME? */ +} + + +/* CORBA listener interface implementation. */ + +static PortableServer_ServantBase__epv ShellComponentListener_base_epv; +static POA_GNOME_Evolution_ShellComponentListener__epv ShellComponentListener_epv; +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) +{ + ShellComponentListenerServant *listener_servant; + + listener_servant = (ShellComponentListenerServant *) servant; + return listener_servant->component_client; +} + +static EvolutionShellComponentResult +result_from_async_corba_result (GNOME_Evolution_ShellComponentListener_Result async_corba_result) +{ + switch (async_corba_result) { + case GNOME_Evolution_ShellComponentListener_OK: + return EVOLUTION_SHELL_COMPONENT_OK; + case GNOME_Evolution_ShellComponentListener_UNSUPPORTED_OPERATION: + return EVOLUTION_SHELL_COMPONENT_UNSUPPORTEDOPERATION; + case GNOME_Evolution_ShellComponentListener_EXISTS: + return EVOLUTION_SHELL_COMPONENT_EXISTS; + case GNOME_Evolution_ShellComponentListener_INVALID_URI: + return EVOLUTION_SHELL_COMPONENT_INVALIDURI; + case GNOME_Evolution_ShellComponentListener_PERMISSION_DENIED: + return EVOLUTION_SHELL_COMPONENT_PERMISSIONDENIED; + case GNOME_Evolution_ShellComponentListener_HAS_SUBFOLDERS: + return EVOLUTION_SHELL_COMPONENT_HASSUBFOLDERS; + case GNOME_Evolution_ShellComponentListener_NO_SPACE: + return EVOLUTION_SHELL_COMPONENT_NOSPACE; + default: + return EVOLUTION_SHELL_COMPONENT_UNKNOWNERROR; + } +} + static void dispatch_callback (EvolutionShellComponentClient *shell_component_client, EvolutionShellComponentResult result) @@ -132,62 +211,6 @@ dispatch_callback (EvolutionShellComponentClient *shell_component_client, (* callback) (shell_component_client, result, callback_data); } -static EvolutionShellComponentResult -shell_component_result_from_corba_exception (const CORBA_Environment *ev) -{ - if (ev->_major == CORBA_NO_EXCEPTION) - return EVOLUTION_SHELL_COMPONENT_OK; - if (ev->_major == CORBA_SYSTEM_EXCEPTION) - return EVOLUTION_SHELL_COMPONENT_CORBAERROR; - return EVOLUTION_SHELL_COMPONENT_CORBAERROR; /* FIXME? */ -} - - -/* CORBA listener interface implementation. */ - -static PortableServer_ServantBase__epv ShellComponentListener_base_epv; -static POA_GNOME_Evolution_ShellComponentListener__epv ShellComponentListener_epv; -static POA_GNOME_Evolution_ShellComponentListener__vepv ShellComponentListener_vepv; -static gboolean ShellComponentListener_vepv_initialized = FALSE; - -struct _ShellComponentListenerServant { - POA_GNOME_Evolution_ShellComponentListener servant; - EvolutionShellComponentClient *component_client; -}; -typedef struct _ShellComponentListenerServant ShellComponentListenerServant; - -static EvolutionShellComponentClient * -component_client_from_ShellComponentListener_servant (PortableServer_Servant servant) -{ - ShellComponentListenerServant *listener_servant; - - listener_servant = (ShellComponentListenerServant *) servant; - return listener_servant->component_client; -} - -static EvolutionShellComponentResult -result_from_async_corba_result (GNOME_Evolution_ShellComponentListener_Result async_corba_result) -{ - switch (async_corba_result) { - case GNOME_Evolution_ShellComponentListener_OK: - return EVOLUTION_SHELL_COMPONENT_OK; - case GNOME_Evolution_ShellComponentListener_UNSUPPORTED_OPERATION: - return EVOLUTION_SHELL_COMPONENT_UNSUPPORTEDOPERATION; - case GNOME_Evolution_ShellComponentListener_EXISTS: - return EVOLUTION_SHELL_COMPONENT_EXISTS; - case GNOME_Evolution_ShellComponentListener_INVALID_URI: - return EVOLUTION_SHELL_COMPONENT_INVALIDURI; - case GNOME_Evolution_ShellComponentListener_PERMISSION_DENIED: - return EVOLUTION_SHELL_COMPONENT_PERMISSIONDENIED; - case GNOME_Evolution_ShellComponentListener_HAS_SUBFOLDERS: - return EVOLUTION_SHELL_COMPONENT_HASSUBFOLDERS; - case GNOME_Evolution_ShellComponentListener_NO_SPACE: - return EVOLUTION_SHELL_COMPONENT_NOSPACE; - default: - return EVOLUTION_SHELL_COMPONENT_UNKNOWNERROR; - } -} - 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) { diff --git a/ui/ChangeLog b/ui/ChangeLog index 1880e3ee97..68694cbdbb 100644 --- a/ui/ChangeLog +++ b/ui/ChangeLog @@ -1,3 +1,8 @@ +2001-05-19 Ettore Perazzoli + + * evolution.xml: Removed verb "NewView"; use + "OpenFolderInNewWindow" instead. + 2001-05-18 Ettore Perazzoli * evolution.xml: Add commands for the Folder submenu in the File diff --git a/ui/evolution.xml b/ui/evolution.xml index 408552c53e..2d885d67c3 100644 --- a/ui/evolution.xml +++ b/ui/evolution.xml @@ -36,7 +36,7 @@ -