aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2002-09-26 05:41:53 +0800
committerDan Winship <danw@src.gnome.org>2002-09-26 05:41:53 +0800
commitfaf4db97fab2375f9b13c35b95702eacf590eec4 (patch)
treedf32c78f8af34b5277a8b03f512e811de6806f41
parentc56047966f0d46eb2d62e4e4e5ef73e1f464d0b4 (diff)
downloadgsoc2013-evolution-faf4db97fab2375f9b13c35b95702eacf590eec4.tar
gsoc2013-evolution-faf4db97fab2375f9b13c35b95702eacf590eec4.tar.gz
gsoc2013-evolution-faf4db97fab2375f9b13c35b95702eacf590eec4.tar.bz2
gsoc2013-evolution-faf4db97fab2375f9b13c35b95702eacf590eec4.tar.lz
gsoc2013-evolution-faf4db97fab2375f9b13c35b95702eacf590eec4.tar.xz
gsoc2013-evolution-faf4db97fab2375f9b13c35b95702eacf590eec4.tar.zst
gsoc2013-evolution-faf4db97fab2375f9b13c35b95702eacf590eec4.zip
add "mail/public". Leave "vtrash" as it is rather than renaming it to
* component-factory.c (folder_types): add "mail/public". Leave "vtrash" as it is rather than renaming it to "mail/vtrash", because we want it to behave differently from normal mail folders more often than we want it to behave the same. (type_is_mail, type_is_vtrash): utility funcs (create_view, create_folder, remove_folder, xfer_folder, populate_folder_context_menu, unpopulate_folder_context_menu, destination_folder_handle_drop, storage_create_folder): Use type_is_mail/type_is_vtrash. (create_component): Register "New Post" with "mail/public" instead of "mail" so it becomes the default New icon for it. (29024) * mail-callbacks.c (transfer_msg): Use "mail/*" for allowed type. * message-browser.c (transfer_msg): Likewise. * mail-account-gui.c (mail_account_gui_new): Use "mail/*" instead of "mail" here for sent/drafts allowed type. (?) svn path=/trunk/; revision=18223
-rw-r--r--mail/ChangeLog21
-rw-r--r--mail/component-factory.c33
-rw-r--r--mail/mail-account-gui.c2
-rw-r--r--mail/mail-callbacks.c2
-rw-r--r--mail/message-browser.c2
5 files changed, 47 insertions, 13 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index cf7bfd7704..5bbf4072b0 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,24 @@
+2002-09-25 Dan Winship <danw@ximian.com>
+
+ * component-factory.c (folder_types): add "mail/public". Leave
+ "vtrash" as it is rather than renaming it to "mail/vtrash",
+ because we want it to behave differently from normal mail folders
+ more often than we want it to behave the same.
+ (type_is_mail, type_is_vtrash): utility funcs
+ (create_view, create_folder, remove_folder, xfer_folder,
+ populate_folder_context_menu, unpopulate_folder_context_menu,
+ destination_folder_handle_drop, storage_create_folder): Use
+ type_is_mail/type_is_vtrash.
+ (create_component): Register "New Post" with "mail/public" instead
+ of "mail" so it becomes the default New icon for it. (29024)
+
+ * mail-callbacks.c (transfer_msg): Use "mail/*" for allowed type.
+
+ * message-browser.c (transfer_msg): Likewise.
+
+ * mail-account-gui.c (mail_account_gui_new): Use "mail/*" instead
+ of "mail" here for sent/drafts allowed type. (?)
+
2002-09-25 Jeffrey Stedfast <fejj@ximian.com>
* upgrade-mailer.c (imap_url_upgrade): NULL-check si->folders
diff --git a/mail/component-factory.c b/mail/component-factory.c
index ca18001533..c5ca3c4d14 100644
--- a/mail/component-factory.c
+++ b/mail/component-factory.c
@@ -100,6 +100,7 @@ static char *exported_dnd_types[] = {
static const EvolutionShellComponentFolderType folder_types[] = {
{ "mail", "evolution-inbox.png", N_("Mail"), N_("Folder containing mail"), TRUE, accepted_dnd_types, exported_dnd_types },
+ { "mail/public", "evolution-inbox.png", N_("Public Mail"), N_("Public folder containing mail"), FALSE, accepted_dnd_types, exported_dnd_types },
{ "vtrash", "evolution-trash.png", N_("Virtual Trash"), N_("Virtual Trash folder"), FALSE, accepted_dnd_types, exported_dnd_types },
{ NULL, NULL, NULL, NULL, FALSE, NULL, NULL }
};
@@ -109,6 +110,18 @@ static const char *schema_types[] = {
NULL
};
+static inline gboolean
+type_is_mail (const char *type)
+{
+ return !strcmp (type, "mail") || !strcmp (type, "mail/public");
+}
+
+static inline gboolean
+type_is_vtrash (const char *type)
+{
+ return !strcmp (type, "vtrash");
+}
+
/* EvolutionShellComponent methods and signals. */
static BonoboControl *
@@ -136,7 +149,7 @@ create_view (EvolutionShellComponent *shell_component,
shell_client = evolution_shell_component_get_owner (shell_component);
corba_shell = bonobo_object_corba_objref (BONOBO_OBJECT (shell_client));
- if (!g_strcasecmp (folder_type, "mail")) {
+ if (type_is_mail (folder_type)) {
const char *noselect;
CamelURL *url;
@@ -148,7 +161,7 @@ create_view (EvolutionShellComponent *shell_component,
control = folder_browser_factory_new_control (physical_uri,
corba_shell);
camel_url_free (url);
- } else if (!g_strcasecmp (folder_type, "vtrash")) {
+ } else if (type_is_vtrash (folder_type)) {
if (!g_strncasecmp (physical_uri, "file:", 5))
control = folder_browser_factory_new_control ("vtrash:file:/", corba_shell);
else
@@ -193,7 +206,7 @@ create_folder (EvolutionShellComponent *shell_component,
CORBA_exception_init (&ev);
- if (!strcmp (type, "mail")) {
+ if (type_is_mail (type)) {
mail_get_folder (physical_uri, CAMEL_STORE_FOLDER_CREATE, create_folder_done,
CORBA_Object_duplicate (listener, &ev), mail_thread_new);
} else {
@@ -233,7 +246,7 @@ remove_folder (EvolutionShellComponent *shell_component,
CORBA_exception_init (&ev);
- if (strcmp (type, "mail") != 0) {
+ if (!type_is_mail (type)) {
GNOME_Evolution_ShellComponentListener_notifyResult (listener,
GNOME_Evolution_ShellComponentListener_UNSUPPORTED_TYPE, &ev);
CORBA_exception_free (&ev);
@@ -295,7 +308,7 @@ xfer_folder (EvolutionShellComponent *shell_component,
CORBA_exception_init (&ev);
- if (strcmp (type, "mail") != 0) {
+ if (!type_is_mail (type)) {
GNOME_Evolution_ShellComponentListener_notifyResult (listener,
GNOME_Evolution_ShellComponentListener_UNSUPPORTED_TYPE, &ev);
return;
@@ -417,7 +430,7 @@ populate_folder_context_menu (EvolutionShellComponent *shell_component,
"<menuitem name=\"ChangeFolderPropertiesPopUp\" verb=\"ChangeFolderPropertiesPopUp\""
" _label=\"Properties...\" _tip=\"Change this folder's properties\"/>";
- if (strcmp (type, "mail") != 0)
+ if (!type_is_mail (type))
return;
/* FIXME: handle other types */
@@ -438,7 +451,7 @@ unpopulate_folder_context_menu (EvolutionShellComponent *shell_component,
const char *type,
void *closure)
{
- if (strcmp (type, "mail") != 0)
+ if (!type_is_mail (type))
return;
/* FIXME: handle other types */
@@ -571,7 +584,7 @@ destination_folder_handle_drop (EvolutionShellComponentDndDestinationFolder *des
camel_exception_init (&ex);
/* if this is a local vtrash folder, then it's uri is vtrash:file:/ */
- if (!strcmp (folder_type, "vtrash") && !strncmp (physical_uri, "file:", 5))
+ if (type_is_vtrash (folder_type) && !strncmp (physical_uri, "file:", 5))
physical_uri = "vtrash:file:/";
switch (type) {
@@ -1035,7 +1048,7 @@ create_component (void)
evolution_shell_component_add_user_creatable_item (shell_component, "post",
_("New Message Post"), _("_Post Message"),
_("Post a new mail message"),
- "mail", 'p',
+ "mail/public", 'p',
icon);
if (icon != NULL)
gdk_pixbuf_unref (icon);
@@ -1140,7 +1153,7 @@ storage_create_folder (EvolutionStorage *storage,
/* We could just use 'path' always here? */
- if (strcmp (type, "mail") != 0) {
+ if (!type_is_mail (type)) {
notify_listener (listener, GNOME_Evolution_Storage_UNSUPPORTED_TYPE);
return;
}
diff --git a/mail/mail-account-gui.c b/mail/mail-account-gui.c
index 4bed19d082..9560b0dc42 100644
--- a/mail/mail-account-gui.c
+++ b/mail/mail-account-gui.c
@@ -1365,7 +1365,7 @@ prepare_signatures (MailAccountGui *gui)
MailAccountGui *
mail_account_gui_new (MailConfigAccount *account, MailAccountsTab *dialog)
{
- const char *allowed_types[] = { "mail", NULL };
+ const char *allowed_types[] = { "mail/*", NULL };
MailAccountGui *gui;
GtkWidget *button;
diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c
index 9f4fbf71cc..e55d125e83 100644
--- a/mail/mail-callbacks.c
+++ b/mail/mail-callbacks.c
@@ -1671,7 +1671,7 @@ transfer_msg_done (gboolean ok, void *data)
static void
transfer_msg (FolderBrowser *fb, gboolean delete_from_source)
{
- static const char *allowed_types[] = { "mail", "vtrash", NULL };
+ static const char *allowed_types[] = { "mail/*", "vtrash", NULL };
extern EvolutionShellClient *global_shell_client;
GNOME_Evolution_Folder *folder;
static char *last_uri = NULL;
diff --git a/mail/message-browser.c b/mail/message-browser.c
index 12dace6e88..1b44f0934b 100644
--- a/mail/message-browser.c
+++ b/mail/message-browser.c
@@ -115,7 +115,7 @@ transfer_msg_done (gboolean ok, void *data)
static void
transfer_msg (MessageBrowser *mb, int del)
{
- const char *allowed_types[] = { "mail", "vtrash", NULL };
+ const char *allowed_types[] = { "mail/*", "vtrash", NULL };
extern EvolutionShellClient *global_shell_client;
GNOME_Evolution_Folder *folder;
static char *last_uri = NULL;