aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog18
-rw-r--r--mail/component-factory.c41
-rw-r--r--mail/mail-callbacks.c10
3 files changed, 56 insertions, 13 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index d295e66bf0..f97bc2df27 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,21 @@
+2001-07-19 Peter Williams <peterw@ximian.com>
+
+ Track the NoSelect changes in Camel.
+
+ * mail-callbacks.c (create_folders): We don't need to check if
+ the URL is NULL or not anymore.
+
+ * component-factory.c (create_noselect_control): New
+ function. Create a dummy control for folders that can't contain
+ messages (ie \NoSelect)
+ (create_view): If the URI says the folder is noselect, make a
+ dummy control. FIXME: still should merge in the global UI
+ elements.
+ (xfer_folder): Don't allow the operation if the destination is
+ NoSelect.
+ (destination_folder_handle_motion): Ditto.
+ (destination_folder_handle_drop): Ditto.
+
2001-07-19 Not Zed <NotZed@Ximian.com>
* mail-local.c (reconfigure_folder_reconfigure): remvoed
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);
diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c
index b20ee1baf0..067866fed5 100644
--- a/mail/mail-callbacks.c
+++ b/mail/mail-callbacks.c
@@ -2016,15 +2016,13 @@ static void
create_folders (EvolutionStorage *storage, const char *prefix, CamelFolderInfo *fi)
{
char *path;
-
- if (fi->url) {
- mail_folder_cache_set_update_estorage (fi->url, storage);
- mail_folder_cache_note_folderinfo (fi->url, fi);
- }
+
+ mail_folder_cache_set_update_estorage (fi->url, storage);
+ mail_folder_cache_note_folderinfo (fi->url, fi);
path = g_strdup_printf ("%s/%s", prefix, fi->name);
evolution_storage_new_folder (storage, path, fi->name,
- "mail", fi->url ? fi->url : "",
+ "mail", fi->url,
fi->name, /* description */
fi->unread_message_count > 0);