From 7f36752a67c274640378ec096f37e690fd5ca8ed Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Fri, 9 Jun 2000 19:19:36 +0000 Subject: Initial support for creating/removing folders. This implies some new IDL methods and new functions to implement on the component side. I have also added a simple folder creation dialog in the shell. It's quite unfinished and untested. svn path=/trunk/; revision=3491 --- shell/e-shell-view-menu.c | 46 +++++++++++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 19 deletions(-) (limited to 'shell/e-shell-view-menu.c') diff --git a/shell/e-shell-view-menu.c b/shell/e-shell-view-menu.c index 9aef0d8a97..8dec015f8d 100644 --- a/shell/e-shell-view-menu.c +++ b/shell/e-shell-view-menu.c @@ -26,7 +26,9 @@ #include #include -#include "e-shell-view.h" +#include "e-shell-folder-creation-dialog.h" +#include "e-shell-constants.h" + #include "e-shell-view-menu.h" @@ -217,6 +219,30 @@ command_toggle_shortcut_bar (BonoboUIHandler *uih, e_shell_view_set_shortcut_bar_mode (shell_view, mode); } + +static void +command_new_folder (BonoboUIHandler *uih, + void *data, + const char *path) +{ + EShellView *shell_view; + EShell *shell; + const char *current_uri; + const char *default_parent_folder; + + shell_view = E_SHELL_VIEW (data); + shell = e_shell_view_get_shell (shell_view); + current_uri = e_shell_view_get_current_uri (shell_view); + + if (strncmp (current_uri, E_SHELL_URI_PREFIX, E_SHELL_URI_PREFIX_LEN) == 0) + default_parent_folder = current_uri + E_SHELL_URI_PREFIX_LEN; + else + default_parent_folder = NULL; + + e_shell_show_folder_creation_dialog (shell, GTK_WINDOW (shell_view), + default_parent_folder); +} + /* Unimplemented commands. */ @@ -227,7 +253,6 @@ func (GtkWidget *widget, gpointer data) \ g_warning ("EShellView: %s: not implemented.", __FUNCTION__); \ } \ -DEFINE_UNIMPLEMENTED (command_new_folder) DEFINE_UNIMPLEMENTED (command_new_shortcut) DEFINE_UNIMPLEMENTED (command_new_mail_message) DEFINE_UNIMPLEMENTED (command_new_meeting_request) @@ -237,7 +262,6 @@ DEFINE_UNIMPLEMENTED (command_new_task_request) DEFINE_UNIMPLEMENTED (command_new_journal_entry) DEFINE_UNIMPLEMENTED (command_new_note) DEFINE_UNIMPLEMENTED (command_open_selected_items) -DEFINE_UNIMPLEMENTED (command_save_as) DEFINE_UNIMPLEMENTED (command_close_open_items) @@ -299,28 +323,12 @@ static GnomeUIInfo menu_file_open [] = { GNOMEUIINFO_END }; -static GnomeUIInfo menu_folder [] = { - { GNOME_APP_UI_ITEM, N_("_New Folder"), NULL, - command_new_folder, NULL, - NULL, 0, 0, 'e', GDK_CONTROL_MASK | GDK_SHIFT_MASK }, - - GNOMEUIINFO_END -}; - static GnomeUIInfo menu_file [] = { GNOMEUIINFO_SUBTREE_STOCK (N_("_New"), menu_file_new, GNOME_STOCK_MENU_NEW), GNOMEUIINFO_SUBTREE_STOCK (N_("_Open"), menu_file_open, GNOME_STOCK_MENU_NEW), GNOMEUIINFO_ITEM_NONE (N_("Clos_e All Items"), N_("Closes all the open items"), command_close_open_items), GNOMEUIINFO_SEPARATOR, - GNOMEUIINFO_MENU_SAVE_AS_ITEM (command_save_as, NULL), - - GNOMEUIINFO_SEPARATOR, - - GNOMEUIINFO_SUBTREE (N_("_Folder"), menu_folder), - - GNOMEUIINFO_SEPARATOR, - GNOMEUIINFO_MENU_EXIT_ITEM(command_quit, NULL), GNOMEUIINFO_END -- cgit v1.2.3