aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorPeter Williams <peterw@ximian.com>2001-07-20 05:35:43 +0800
committerPeter Williams <peterw@src.gnome.org>2001-07-20 05:35:43 +0800
commit85a02926e6c5b8c73dbb44fe343da80247babaf8 (patch)
tree71e8bdcc136081da9ec4f11eacef0027dddff07e /mail
parent3f9e744cab8fc9a34590974da264018ec091bbb1 (diff)
downloadgsoc2013-evolution-85a02926e6c5b8c73dbb44fe343da80247babaf8.tar
gsoc2013-evolution-85a02926e6c5b8c73dbb44fe343da80247babaf8.tar.gz
gsoc2013-evolution-85a02926e6c5b8c73dbb44fe343da80247babaf8.tar.bz2
gsoc2013-evolution-85a02926e6c5b8c73dbb44fe343da80247babaf8.tar.lz
gsoc2013-evolution-85a02926e6c5b8c73dbb44fe343da80247babaf8.tar.xz
gsoc2013-evolution-85a02926e6c5b8c73dbb44fe343da80247babaf8.tar.zst
gsoc2013-evolution-85a02926e6c5b8c73dbb44fe343da80247babaf8.zip
In camel:
2001-07-19 Peter Williams <peterw@ximian.com> Policy change: NULL url's are no longer allowed in CamelFolderInfos. They used to signify that the folder was, in IMAP jargon, NoSelect; now the same effect is achieved by adding a "noselect=yes" parameter to the end of the URL. As far as I know, IMAP is the only affected provider. * providers/imap/camel-imap-store.c (delete_folder): New function. Implement folder deletion. (camel_imap_store_class_init): Set the delete_folder class function here. (get_folder_status): New function. Utility wrapper around the STATUS command. (create_folder): If the parent folder is NoSelect but is empty, delete it and recreate it as a a subfolder-containing folder. If it is NoSelect but contains messages, set an exception. (parse_list_response_as_folder_info): Always set the FolderInfo's URL, but add a NoSelect parameter if it isn't selectable. (get_folder_info_online): Change logic of removing the namespace to reflect URL change. Same for logic of checking unread counts. (get_folder_info_online): Use get_folder_status to simplify this. * camel-store.c (camel_folder_info_build): When creating dummy parents, copy the child's URL and set the NoSelect parameter. In mail: 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. svn path=/trunk/; revision=11237
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);