From 393fa3c3e84b73dc591fa4481bcf2731dc640157 Mon Sep 17 00:00:00 2001 From: Not Zed Date: Mon, 15 Jul 2002 02:06:46 +0000 Subject: ** fixes for #10781 2002-07-10 Not Zed ** fixes for #10781 * mail-callbacks.c (filter_edit): Add back a cancel button. We dont need to do anything special to 'undo' here, as the rules are loaded every time they're used. * mail-vfolder.c (vfolder_editor_clicked): If ok wans't clicked, revert the ruleset. (vfolder_editor_destroy): Fake a button of -1 if we get destroyed with no click. (context_rule_removed): Unref the folder after we delete it. If we're the last ref to the folder, unrefing it means it no longer exist,s which means no delte processing occurs ... svn path=/trunk/; revision=17449 --- mail/component-factory.c | 52 ++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 46 insertions(+), 6 deletions(-) (limited to 'mail/component-factory.c') diff --git a/mail/component-factory.c b/mail/component-factory.c index 7fe2a4e8a1..6c677c1874 100644 --- a/mail/component-factory.c +++ b/mail/component-factory.c @@ -385,11 +385,16 @@ xfer_folder (EvolutionShellComponent *shell_component, camel_url_free(dst); } +static char *configure_folder_uri; +static FolderBrowser *configure_folder_browser; + static void configure_folder_popup(BonoboUIComponent *component, void *user_data, const char *cname) { char *uri = user_data; + return; + vfolder_edit_rule(uri); } @@ -406,20 +411,55 @@ populate_folder_context_menu (EvolutionShellComponent *shell_component, static char popup_xml[] = ""; + static int setup = FALSE; + int add; - if (strcmp (type, "mail") != 0) - return; + if (!setup) { + setup = TRUE; + bonobo_ui_component_set_translate (uic, EVOLUTION_SHELL_COMPONENT_POPUP_PLACEHOLDER, popup_xml, NULL); + bonobo_ui_component_add_verb_full(uic, "ChangeFolderPropertiesPopUp", configure_folder_popup, NULL, NULL); + } + + if (strncmp(physical_uri, "file:", 5) == 0) { + add = folder_browser_factory_get_browser(physical_uri) != NULL; + } else if ((strncmp(physical_uri, "vfolder:", 8) == 0 + && strstr(physical_uri, "#" CAMEL_UNMATCHED_NAME) == NULL)) { + add = TRUE; + } else { + add = FALSE; + } + + printf("popup!!! url = '%s' add = %s\n", physical_uri, add?"TRUE":"FALSE"); + + bonobo_ui_component_set_prop(uic, EVOLUTION_SHELL_COMPONENT_POPUP_PLACEHOLDER "/ChangeFolderPropertiesPopUp", "sensitive", add?"1":"0", NULL); + +#if 0 + + { static int shit = 0; + shit++; + } /* FIXME: handle other types */ /* the unmatched test is a bit of a hack but it works */ - if (strncmp(physical_uri, "vfolder:", 8) != 0 - || strstr(physical_uri, "#" CAMEL_UNMATCHED_NAME) != NULL) + if (strncmp(physical_uri, "file:", 5) == 0) { + FolderBrowser *fb = folder_browser_factory_get_browser(physical_uri); + if (fb) { + printf("folderbrowser = %s\n", fb->uri); + gtk_object_ref((GtkObject *)fb); + bonobo_ui_component_add_verb_full(uic, "ChangeFolderPropertiesPopUp", configure_folder, fb, gtk_object_unref); + } else + return; + } else if ((strncmp(physical_uri, "vfolder:", 8) == 0 + && strstr(physical_uri, "#" CAMEL_UNMATCHED_NAME) == NULL)) { + bonobo_ui_component_add_verb_full(uic, "ChangeFolderPropertiesPopUp", configure_folder_popup, g_strdup(physical_uri), g_free); + } else { + printf("doing nothing\n"); return; - - bonobo_ui_component_add_verb_full(uic, "ChangeFolderPropertiesPopUp", configure_folder_popup, g_strdup(physical_uri), g_free); + } bonobo_ui_component_set_translate (uic, EVOLUTION_SHELL_COMPONENT_POPUP_PLACEHOLDER, popup_xml, NULL); +#endif } static char * -- cgit v1.2.3