diff options
Diffstat (limited to 'mail/component-factory.c')
-rw-r--r-- | mail/component-factory.c | 41 |
1 files changed, 34 insertions, 7 deletions
diff --git a/mail/component-factory.c b/mail/component-factory.c index 5502fa7683..5074cbfabf 100644 --- a/mail/component-factory.c +++ b/mail/component-factory.c @@ -103,6 +103,16 @@ static const char *schema_types[] = { /* EvolutionShellComponent methods and signals. */ +static BonoboControl * +create_noselect_control (void) +{ + GtkWidget *label; + + label = gtk_label_new (_("This folder cannot contain messages.")); + gtk_widget_show (label); + return bonobo_control_new (label); +} + static EvolutionShellComponentResult create_view (EvolutionShellComponent *shell_component, const char *physical_uri, @@ -118,8 +128,12 @@ create_view (EvolutionShellComponent *shell_component, corba_shell = bonobo_object_corba_objref (BONOBO_OBJECT (shell_client)); if (g_strcasecmp (folder_type, "mail") == 0) { - control = folder_browser_factory_new_control (physical_uri, - corba_shell); + /* hack-tastic! */ + if (strstr (physical_uri, "noselect=yes")) + control = create_noselect_control (); + else + control = folder_browser_factory_new_control (physical_uri, + corba_shell); } else if (g_strcasecmp (folder_type, "mailstorage") == 0) { CamelService *store; EvolutionStorage *storage; @@ -262,6 +276,12 @@ xfer_folder (EvolutionShellComponent *shell_component, CamelException ex; GPtrArray *uids; + if (strstr (destination_physical_uri, "noselect=yes")) { + GNOME_Evolution_ShellComponentListener_notifyResult (listener, + GNOME_Evolution_ShellComponentListener_UNSUPPORTED_OPERATION, &ev); + return; + } + camel_exception_init (&ex); source = mail_tool_uri_to_folder (source_physical_uri, &ex); camel_exception_clear (&ex); @@ -321,8 +341,12 @@ destination_folder_handle_motion (EvolutionShellComponentDndDestinationFolder *f gpointer user_data) { g_print ("in destination_folder_handle_motion (%s)\n", physical_uri); - - *suggested_action_return = GNOME_Evolution_ShellComponentDnd_ACTION_MOVE; + + if (strstr (physical_uri, "noselect=yes")) + /* uh, no way to say "illegal" */ + *suggested_action_return = GNOME_Evolution_ShellComponentDnd_ACTION_DEFAULT; + else + *suggested_action_return = GNOME_Evolution_ShellComponentDnd_ACTION_MOVE; return TRUE; } @@ -381,6 +405,9 @@ destination_folder_handle_drop (EvolutionShellComponentDndDestinationFolder *des if (action == GNOME_Evolution_ShellComponentDnd_ACTION_LINK) return FALSE; /* we can't create links */ + if (strstr (physical_uri, "noselect=yes")) + return FALSE; + g_print ("in destination_folder_handle_drop (%s)\n", physical_uri); for (type = 0; accepted_dnd_types[type]; type++) @@ -546,7 +573,7 @@ owner_set_cb (EvolutionShellComponent *shell_component, mail_config_init (); storages_hash = g_hash_table_new (NULL, NULL); - + vfolder_create_storage (shell_component); corba_shell = bonobo_object_corba_objref (BONOBO_OBJECT (shell_client)); @@ -732,7 +759,7 @@ storage_create_folder (EvolutionStorage *storage, prefix = g_strndup (path, name - path - 1); folder_created (store, prefix, fi); g_free (prefix); - + camel_store_free_folder_info (store, fi); return EVOLUTION_STORAGE_OK; @@ -775,7 +802,7 @@ storage_remove_folder (EvolutionStorage *storage, if (camel_store_supports_subscriptions (store)) camel_store_unsubscribe_folder (store, fi->full_name, NULL); - folder_deleted (store, fi); + evolution_storage_removed_folder (storage, path); camel_store_free_folder_info (store, fi); |