diff options
author | Not Zed <NotZed@Ximian.com> | 2004-03-03 15:38:54 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2004-03-03 15:38:54 +0800 |
commit | cc11303dc2a9775eeb742feedff5c2bfea224fc3 (patch) | |
tree | 26c38bd0497d91e529305944a419623e59de8fa1 | |
parent | 467bbf6fb6b0b215d7b6bd18a6b84acd839a08f9 (diff) | |
download | gsoc2013-evolution-cc11303dc2a9775eeb742feedff5c2bfea224fc3.tar.gz gsoc2013-evolution-cc11303dc2a9775eeb742feedff5c2bfea224fc3.tar.zst gsoc2013-evolution-cc11303dc2a9775eeb742feedff5c2bfea224fc3.zip |
** See bug #54121.
2004-03-03 Not Zed <NotZed@Ximian.com>
** See bug #54121.
* mail-component.c (impl_requestCreateItem)
(emc_new_folder_response): Hack in a nastish implementation of
create folder for the new menu.
(impl__get_userCreatableItems): add 'new mail folder' to new
button.
svn path=/trunk/; revision=24945
-rw-r--r-- | mail/ChangeLog | 10 | ||||
-rw-r--r-- | mail/em-folder-tree.c | 1 | ||||
-rw-r--r-- | mail/mail-component.c | 56 |
3 files changed, 57 insertions, 10 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index cdf0fd8097..451dfa9afe 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,6 +1,14 @@ 2004-03-03 Not Zed <NotZed@Ximian.com> - * em-inline-filter.c (emif_scan): + ** See bug #54121. + + * mail-component.c (impl_requestCreateItem) + (emc_new_folder_response): Hack in a nastish implementation of + create folder for the new menu. + (impl__get_userCreatableItems): add 'new mail folder' to new + button. + +2004-03-03 Not Zed <NotZed@Ximian.com> * em-folder-tree-model.c (em_folder_tree_model_set_folder_info): if we have the folder opened already, and its the outbox, then use diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c index f19394f3eb..e2d6d6cb12 100644 --- a/mail/em-folder-tree.c +++ b/mail/em-folder-tree.c @@ -1857,7 +1857,6 @@ emft_popup_move (GtkWidget *item, EMFolderTree *emft) NULL, emft_popup_copy_folder_selected, cfd); } - gboolean em_folder_tree_create_folder (EMFolderTree *emft, const char *path, const char *uri) { diff --git a/mail/mail-component.c b/mail/mail-component.c index ec02f61196..79d493fb9c 100644 --- a/mail/mail-component.c +++ b/mail/mail-component.c @@ -140,7 +140,7 @@ mc_add_store(MailComponent *component, CamelStore *store, const char *name, void static void mc_add_local_store_done(CamelStore *store, CamelFolderInfo *info, void *data) { - MailComponent *mc = data; + /*MailComponent *mc = data;*/ int i; for (i=0;i<sizeof(mc_default_folders)/sizeof(mc_default_folders[0]);i++) { @@ -536,7 +536,7 @@ impl__get_userCreatableItems (PortableServer_Servant servant, CORBA_Environment { GNOME_Evolution_CreatableItemTypeList *list = GNOME_Evolution_CreatableItemTypeList__alloc (); - list->_length = 1; + list->_length = 2; list->_maximum = list->_length; list->_buffer = GNOME_Evolution_CreatableItemTypeList_allocbuf (list->_length); @@ -549,24 +549,64 @@ impl__get_userCreatableItems (PortableServer_Servant servant, CORBA_Environment list->_buffer[0].menuShortcut = 'm'; list->_buffer[0].iconName = "new-message.xpm"; + list->_buffer[1].id = "folder"; + list->_buffer[1].description = _("New Mail Folder"); + list->_buffer[1].menuDescription = _("Mail _Folder"); + list->_buffer[1].tooltip = _("Create a new mail folder"); + list->_buffer[1].menuShortcut = 'f'; + list->_buffer[1].iconName = "folder-mini.png"; + return list; } static void +emc_new_folder_response(EMFolderSelector *emfs, int response, MailComponent *mc) +{ + const char *uri, *path; + + if (response != GTK_RESPONSE_OK) { + gtk_widget_destroy((GtkWidget *)emfs); + return; + } + + uri = em_folder_selector_get_selected_uri(emfs); + path = em_folder_selector_get_selected_path(emfs); + + if (em_folder_tree_create_folder(emfs->emft, path, uri)) + gtk_widget_destroy((GtkWidget *)emfs); +} + +static void impl_requestCreateItem (PortableServer_Servant servant, const CORBA_char *item_type_name, CORBA_Environment *ev) { - if (strcmp (item_type_name, "message") != 0) { + MailComponent *mc = MAIL_COMPONENT(bonobo_object_from_servant(servant)); + + if (strcmp(item_type_name, "message") == 0) { + if (!em_utils_check_user_can_send_mail(NULL)) + return; + + em_utils_compose_new_message (); + } else if (strcmp(item_type_name, "folder") == 0) { + /* This api is fucked up, too tightly integrated with the tree view */ + EMFolderTree *folder_tree; + GtkWidget *dialog; + + folder_tree = (EMFolderTree *) em_folder_tree_new_with_model(mc->priv->model); + dialog = em_folder_selector_create_new (folder_tree, 0, _("Create folder"), _("Specify where to create the folder:")); + /* We need to get this from the currently activated component? + em_folder_selector_set_selected ((EMFolderSelector *) dialog, emft->priv->selected_uri);*/ + g_signal_connect (dialog, "response", G_CALLBACK(emc_new_folder_response), mc); + gtk_widget_show(dialog); + /* FIXME: what is this crap, this should go in the folder selector */ + gtk_widget_grab_focus((GtkWidget *)((EMFolderSelector *)dialog)->name_entry); + } else { + CORBA_exception_set (ev, CORBA_USER_EXCEPTION, ex_GNOME_Evolution_Component_UnknownType, NULL); return; } - - if (!em_utils_check_user_can_send_mail(NULL)) - return; - - em_utils_compose_new_message (); } static void |