diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2001-06-15 06:08:54 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2001-06-15 06:08:54 +0800 |
commit | 1fb67eaca4790ba3e92e42dd5d93536aa4206b70 (patch) | |
tree | 3f9d3a35bdd9ee63ad3a3a89b83b5325883b50ac /mail/component-factory.c | |
parent | ef27346aa88f1627fdb882d64bca10e70b5a1749 (diff) | |
download | gsoc2013-evolution-1fb67eaca4790ba3e92e42dd5d93536aa4206b70.tar.gz gsoc2013-evolution-1fb67eaca4790ba3e92e42dd5d93536aa4206b70.tar.zst gsoc2013-evolution-1fb67eaca4790ba3e92e42dd5d93536aa4206b70.zip |
Updated to reflect changes to mail_config_[g,s]et_thread_list().
2001-06-14 Jeffrey Stedfast <fejj@ximian.com>
* folder-browser.c (got_folder): Updated to reflect changes to
mail_config_[g,s]et_thread_list().
(folder_browser_toggle_threads): Same.
* folder-browser-factory.c (control_activate): Updated to reflect
changes to mail_config_[g,s]et_thread_list().
* mail-config.c (mail_config_write_on_exit): Do cleanup when we're
done.
(mail_config_set_thread_list): Send in a URI so we can save the
state on a per-folder basis.
(mail_config_get_thread_list): Send in a URI so we can retrieve
the state on a per-folder basis.
* component-factory.c: Setup the accepted_dnd_types. Also added
skeleton code for DnD.
svn path=/trunk/; revision=10240
Diffstat (limited to 'mail/component-factory.c')
-rw-r--r-- | mail/component-factory.c | 79 |
1 files changed, 70 insertions, 9 deletions
diff --git a/mail/component-factory.c b/mail/component-factory.c index ed8f8707c0..2ab6d7c825 100644 --- a/mail/component-factory.c +++ b/mail/component-factory.c @@ -35,6 +35,7 @@ #include "folder-browser-factory.h" #include "evolution-shell-component.h" +#include "evolution-shell-component-dnd.h" #include "folder-browser.h" #include "mail.h" /* YUCK FIXME */ #include "mail-config.h" @@ -65,6 +66,18 @@ char *evolution_dir; static BonoboGenericFactory *component_factory = NULL; static GHashTable *storages_hash; +static char *accepted_dnd_types[] = { + "message/rfc822", + NULL +}; + +static const EvolutionShellComponentFolderType folder_types[] = { + { "mail", "evolution-inbox.png", accepted_dnd_types, NULL }, + { "mailstorage", "evolution-inbox.png", NULL, NULL }, + { "vtrash", "evolution-trash.png", NULL, NULL }, + { NULL, NULL, NULL, NULL } +}; + /* EvolutionShellComponent methods and signals. */ static EvolutionShellComponentResult @@ -77,7 +90,7 @@ create_view (EvolutionShellComponent *shell_component, EvolutionShellClient *shell_client; GNOME_Evolution_Shell corba_shell; BonoboControl *control; - + shell_client = evolution_shell_component_get_owner (shell_component); corba_shell = bonobo_object_corba_objref (BONOBO_OBJECT (shell_client)); @@ -232,6 +245,53 @@ xfer_folder (EvolutionShellComponent *shell_component, CORBA_exception_free (&ev); } +static char * +get_dnd_selection (EvolutionShellComponent *shell_component, + const char *physical_uri, + int type, + int *format_return, + const char **selection_return, + int *selection_length_return, + void *closure) +{ + g_print ("should get dnd selection for %s\n", physical_uri); + return NULL; +} + +/* Destination side DnD */ +static CORBA_boolean +destination_folder_handle_motion (EvolutionShellComponentDndDestinationFolder *folder, + const char *physical_uri, + const GNOME_Evolution_ShellComponentDnd_DestinationFolder_Context *destination_context, + GNOME_Evolution_ShellComponentDnd_Action *suggested_action_return, + gpointer user_data) +{ + g_print ("in destination_folder_handle_motion (%s)\n", physical_uri); + + *suggested_action_return = GNOME_Evolution_ShellComponentDnd_ACTION_MOVE; + + return TRUE; +} + +static CORBA_boolean +destination_folder_handle_drop (EvolutionShellComponentDndDestinationFolder *folder, + const char *physical_uri, + const GNOME_Evolution_ShellComponentDnd_DestinationFolder_Context *destination_context, + const GNOME_Evolution_ShellComponentDnd_Action action, + const GNOME_Evolution_ShellComponentDnd_Data *data, + gpointer user_data) +{ + CamelStream *stream; + + if (action == GNOME_Evolution_ShellComponentDnd_ACTION_LINK) + return FALSE; /* we can't create links */ + + g_print ("in destination_folder_handle_drop (%s)\n", physical_uri); + + return TRUE; +} + + static struct { char *name, **uri; CamelFolder **folder; @@ -350,16 +410,10 @@ debug_cb (EvolutionShellComponent *shell_component, gpointer user_data) camel_verbose_debug = 1; } -static const EvolutionShellComponentFolderType folder_types[] = { - { "mail", "evolution-inbox.png" }, - { "mailstorage", "evolution-inbox.png" }, - { "vtrash", "evolution-trash.png" }, - { NULL, NULL } -}; - static BonoboObject * component_fn (BonoboGenericFactory *factory, void *closure) { + EvolutionShellComponentDndDestinationFolder *destination_interface; EvolutionShellComponent *shell_component; MailOfflineHandler *offline_handler; @@ -369,9 +423,16 @@ component_fn (BonoboGenericFactory *factory, void *closure) remove_folder, xfer_folder, NULL, /* populate_folder_context_menu_fn */ - NULL, /* get_dnd_selection_fn */ + get_dnd_selection, NULL); + destination_interface = evolution_shell_component_dnd_destination_folder_new (destination_folder_handle_motion, + destination_folder_handle_drop, + shell_component); + + bonobo_object_add_interface (BONOBO_OBJECT (shell_component), + BONOBO_OBJECT (destination_interface)); + gtk_signal_connect (GTK_OBJECT (shell_component), "owner_set", GTK_SIGNAL_FUNC (owner_set_cb), NULL); gtk_signal_connect (GTK_OBJECT (shell_component), "owner_unset", |