aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2001-07-22 11:50:07 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2001-07-22 11:50:07 +0800
commitced2af332134dcdf783ef6d86d6f6ab8b948589b (patch)
treedfdd86946d12ac9d791cac635ff57faa6d7106ce
parent01101330717eca3f06233281fa40eefa5293f378 (diff)
downloadgsoc2013-evolution-ced2af332134dcdf783ef6d86d6f6ab8b948589b.tar.gz
gsoc2013-evolution-ced2af332134dcdf783ef6d86d6f6ab8b948589b.tar.zst
gsoc2013-evolution-ced2af332134dcdf783ef6d86d6f6ab8b948589b.zip
Add a `user_creatable' property to folder types and make components
use it, so that e.g. you cannot create a folder of type "mailstorage" or "vtrash". svn path=/trunk/; revision=11298
-rw-r--r--addressbook/ChangeLog6
-rw-r--r--addressbook/gui/component/addressbook-component.c2
-rw-r--r--calendar/ChangeLog6
-rw-r--r--calendar/gui/calendar-component.c4
-rw-r--r--calendar/gui/component-factory.c4
-rw-r--r--executive-summary/ChangeLog6
-rw-r--r--executive-summary/component/component-factory.c2
-rw-r--r--mail/ChangeLog5
-rw-r--r--mail/component-factory.c6
-rw-r--r--my-evolution/ChangeLog6
-rw-r--r--my-evolution/component-factory.c2
-rw-r--r--shell/ChangeLog27
-rw-r--r--shell/Evolution-ShellComponent.idl2
-rw-r--r--shell/e-component-registry.c5
-rw-r--r--shell/e-folder-type-registry.c32
-rw-r--r--shell/e-folder-type-registry.h3
-rw-r--r--shell/e-shell-folder-creation-dialog.c3
-rw-r--r--shell/evolution-shell-component.c6
-rw-r--r--shell/evolution-shell-component.h1
19 files changed, 110 insertions, 18 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 78a8d0360d..359745c7de 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,9 @@
+2001-07-21 Ettore Perazzoli <ettore@ximian.com>
+
+ * gui/component/addressbook-component.c: Make the "contacts"
+ folders user-creatable by setting `user_creatable' to %TRUE in the
+ `EvolutionShellComponentFolderType's.
+
2001-07-18 Chris Toshok <toshok@ximian.com>
[ patch contributed by Jos Dehaes <jos.dehaes@bigfoot.com> ]
diff --git a/addressbook/gui/component/addressbook-component.c b/addressbook/gui/component/addressbook-component.c
index 667904e4d1..02e3fb85f9 100644
--- a/addressbook/gui/component/addressbook-component.c
+++ b/addressbook/gui/component/addressbook-component.c
@@ -63,7 +63,7 @@ static char *accepted_dnd_types[] = {
};
static const EvolutionShellComponentFolderType folder_types[] = {
- { "contacts", "evolution-contacts.png", accepted_dnd_types, NULL },
+ { "contacts", "evolution-contacts.png", TRUE, accepted_dnd_types, NULL },
{ NULL, NULL, NULL, NULL }
};
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index c576c94afb..4d74592553 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,9 @@
+2001-07-21 Ettore Perazzoli <ettore@ximian.com>
+
+ * gui/component-factory.c: Make folders of type "calendar" and
+ "tasks" user-creatable by setting `user_creatable' to %TRUE in the
+ `EvolutionShellComponentFolderType's.
+
2001-07-19 Federico Mena Quintero <federico@ximian.com>
* gui/dialogs/event-editor.h (event_editor_update_widgets):
diff --git a/calendar/gui/calendar-component.c b/calendar/gui/calendar-component.c
index ebcf207884..dd161a46dc 100644
--- a/calendar/gui/calendar-component.c
+++ b/calendar/gui/calendar-component.c
@@ -47,8 +47,8 @@ static BonoboGenericFactory *factory = NULL;
char *evolution_dir;
static const EvolutionShellComponentFolderType folder_types[] = {
- { "calendar", "evolution-calendar.png" },
- { "tasks", "evolution-tasks.png" },
+ { "calendar", "evolution-calendar.png", TRUE, NULL, NULL },
+ { "tasks", "evolution-tasks.png", TRUE, NULL, NULL },
{ NULL, NULL }
};
diff --git a/calendar/gui/component-factory.c b/calendar/gui/component-factory.c
index ebcf207884..dd161a46dc 100644
--- a/calendar/gui/component-factory.c
+++ b/calendar/gui/component-factory.c
@@ -47,8 +47,8 @@ static BonoboGenericFactory *factory = NULL;
char *evolution_dir;
static const EvolutionShellComponentFolderType folder_types[] = {
- { "calendar", "evolution-calendar.png" },
- { "tasks", "evolution-tasks.png" },
+ { "calendar", "evolution-calendar.png", TRUE, NULL, NULL },
+ { "tasks", "evolution-tasks.png", TRUE, NULL, NULL },
{ NULL, NULL }
};
diff --git a/executive-summary/ChangeLog b/executive-summary/ChangeLog
index 36b3381c14..2cbf08dc1d 100644
--- a/executive-summary/ChangeLog
+++ b/executive-summary/ChangeLog
@@ -1,3 +1,9 @@
+2001-07-21 Ettore Perazzoli <ettore@ximian.com>
+
+ * component/component-factory.c: Make the "executive-summary"
+ folders non-user-creatable by setting `user_creatable' to %FALSE
+ in the `EvolutionShellComponentFolderType's.
+
2001-06-18 Dan Winship <danw@ximian.com>
* test-service/Makefile.am (test_service_LDADD): Remove DB3_LDADD
diff --git a/executive-summary/component/component-factory.c b/executive-summary/component/component-factory.c
index 8eaf7bc76d..0c727c40ba 100644
--- a/executive-summary/component/component-factory.c
+++ b/executive-summary/component/component-factory.c
@@ -44,7 +44,7 @@ static BonoboGenericFactory *factory = NULL;
static gint running_objects = 0;
static const EvolutionShellComponentFolderType folder_types[] = {
- { "executive-summary", "evolution-today.png" },
+ { "executive-summary", "evolution-today.png", FALSE, NULL, NULL },
{ NULL, NULL }
};
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 97472250c2..d784aa1f79 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,8 @@
+2001-07-21 Ettore Perazzoli <ettore@ximian.com>
+
+ * component-factory.c: Make types "mailstorage" and "vtrash"
+ non-user-creatable.
+
2001-07-20 Jason Leach <jleach@ximian.com>
* mail-summary.c (generate_html_summary): Change this back to the
diff --git a/mail/component-factory.c b/mail/component-factory.c
index 272f5d571a..c0d257399d 100644
--- a/mail/component-factory.c
+++ b/mail/component-factory.c
@@ -90,9 +90,9 @@ static char *exported_dnd_types[] = {
};
static const EvolutionShellComponentFolderType folder_types[] = {
- { "mail", "evolution-inbox.png", accepted_dnd_types, exported_dnd_types },
- { "mailstorage", "evolution-inbox.png", NULL, NULL },
- { "vtrash", "evolution-trash.png", accepted_dnd_types, exported_dnd_types },
+ { "mail", "evolution-inbox.png", TRUE, accepted_dnd_types, exported_dnd_types },
+ { "mailstorage", "evolution-inbox.png", FALSE, NULL, NULL },
+ { "vtrash", "evolution-trash.png", FALSE, accepted_dnd_types, exported_dnd_types },
{ NULL, NULL, NULL, NULL }
};
diff --git a/my-evolution/ChangeLog b/my-evolution/ChangeLog
index 82c5b45d90..cbed15a205 100644
--- a/my-evolution/ChangeLog
+++ b/my-evolution/ChangeLog
@@ -1,3 +1,9 @@
+2001-07-21 Ettore Perazzoli <ettore@ximian.com>
+
+ * component-factory.c: Make the "My Evolution" folder
+ non-creatable by setting the `user_creatable' member of
+ `EvolutionShellComponentFolderType' to %FALSE.
+
2001-07-20 Jason Leach <jleach@ximian.com>
* e-summary-tasks.c: Revert last changes, URIs are now back to
diff --git a/my-evolution/component-factory.c b/my-evolution/component-factory.c
index d41c059440..659342506f 100644
--- a/my-evolution/component-factory.c
+++ b/my-evolution/component-factory.c
@@ -27,7 +27,7 @@
static gint running_objects = 0;
static const EvolutionShellComponentFolderType folder_types[] = {
- { "My Evolution", "evolution-today.png" },
+ { "My Evolution", "evolution-today.png", FALSE, NULL, NULL },
{ NULL, NULL }
};
diff --git a/shell/ChangeLog b/shell/ChangeLog
index 266a02140e..881bc24f0a 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,5 +1,32 @@
2001-07-21 Ettore Perazzoli <ettore@ximian.com>
+ * e-shell-folder-creation-dialog.c (add_folder_types): Only put
+ the types that are user-creatable in the folder type option menu.
+
+ * evolution-shell-component.c
+ (impl_ShellComponent__get_supported_types): Set the
+ `user_creatable' member too.
+ (evolution_shell_component_construct): Copy the `user_creatable'
+ member too.
+
+ * evolution-shell-component.h: New member `user_creatable' in
+ `EvolutionShellComponentFolderType'.
+
+ * e-component-registry.c (register_type): Pass the user_creatable
+ member of the CORBA FolderType struct.
+
+ * e-folder-type-registry.c: New member `user_creatable' in struct
+ FolderType.
+ (e_folder_type_registry_register_type): New arg @user_creatable.
+ (register_folder_type): Likewise.
+ (folder_type_new): Likewise.
+ (e_folder_type_registry_type_is_user_creatable): New.
+
+ * Evolution-ShellComponent.idl: New member `user_creatable' in
+ `struct FolderType'.
+
+2001-07-21 Ettore Perazzoli <ettore@ximian.com>
+
* evolution-activity-client.c (impl_destroy): Use
`g_source_remove()' instead of `gtk_timeout_remove()' here, as we
are using `g_timeout_add()' and not `gtk_timeout_add()' to set up
diff --git a/shell/Evolution-ShellComponent.idl b/shell/Evolution-ShellComponent.idl
index f2e7e22ee8..73110b5011 100644
--- a/shell/Evolution-ShellComponent.idl
+++ b/shell/Evolution-ShellComponent.idl
@@ -18,6 +18,8 @@ module Evolution {
string name;
string icon_name;
+ boolean user_creatable;
+
sequence<string> accepted_dnd_types;
sequence<string> exported_dnd_types;
};
diff --git a/shell/e-component-registry.c b/shell/e-component-registry.c
index b5df6601da..db957a6ea4 100644
--- a/shell/e-component-registry.c
+++ b/shell/e-component-registry.c
@@ -105,6 +105,7 @@ static gboolean
register_type (EComponentRegistry *component_registry,
const char *name,
const char *icon_name,
+ gboolean user_creatable,
int num_exported_dnd_types,
const char **exported_dnd_types,
int num_accepted_dnd_types,
@@ -120,7 +121,7 @@ register_type (EComponentRegistry *component_registry,
g_assert (folder_type_registry != NULL);
if (! e_folder_type_registry_register_type (folder_type_registry,
- name, icon_name,
+ name, icon_name, user_creatable,
num_exported_dnd_types,
exported_dnd_types,
num_accepted_dnd_types,
@@ -188,7 +189,7 @@ register_component (EComponentRegistry *component_registry,
type = supported_types->_buffer + i;
if (! register_type (component_registry,
- type->name, type->icon_name,
+ type->name, type->icon_name, type->user_creatable,
type->exported_dnd_types._length,
(const char **) type->exported_dnd_types._buffer,
type->accepted_dnd_types._length,
diff --git a/shell/e-folder-type-registry.c b/shell/e-folder-type-registry.c
index ebd258b61e..ac520ff308 100644
--- a/shell/e-folder-type-registry.c
+++ b/shell/e-folder-type-registry.c
@@ -41,6 +41,7 @@ static GtkObjectClass *parent_class = NULL;
struct _FolderType {
char *name;
char *icon_name;
+ gboolean user_creatable;
GList *exported_dnd_types; /* char * */
GList *accepted_dnd_types; /* char * */
@@ -63,6 +64,7 @@ struct _EFolderTypeRegistryPrivate {
static FolderType *
folder_type_new (const char *name,
const char *icon_name,
+ gboolean user_creatable,
int num_exported_dnd_types,
const char **exported_dnd_types,
int num_accepted_dnd_types,
@@ -74,8 +76,9 @@ folder_type_new (const char *name,
new = g_new (FolderType, 1);
- new->name = g_strdup (name);
- new->icon_name = g_strdup (icon_name);
+ new->name = g_strdup (name);
+ new->icon_name = g_strdup (icon_name);
+ new->user_creatable = user_creatable;
new->exported_dnd_types = NULL;
for (i = 0; i < num_exported_dnd_types; i++)
@@ -146,6 +149,7 @@ static gboolean
register_folder_type (EFolderTypeRegistry *folder_type_registry,
const char *name,
const char *icon_name,
+ gboolean user_creatable,
int num_exported_dnd_types,
const char **exported_dnd_types,
int num_accepted_dnd_types,
@@ -160,7 +164,7 @@ register_folder_type (EFolderTypeRegistry *folder_type_registry,
if (get_folder_type (folder_type_registry, name) != NULL)
return FALSE;
- folder_type = folder_type_new (name, icon_name,
+ folder_type = folder_type_new (name, icon_name, user_creatable,
num_exported_dnd_types, exported_dnd_types,
num_accepted_dnd_types, accepted_dnd_types);
g_hash_table_insert (priv->name_to_type, folder_type->name, folder_type);
@@ -275,6 +279,7 @@ gboolean
e_folder_type_registry_register_type (EFolderTypeRegistry *folder_type_registry,
const char *type_name,
const char *icon_name,
+ gboolean user_creatable,
int num_exported_dnd_types,
const char **exported_dnd_types,
int num_accepted_dnd_types,
@@ -285,7 +290,7 @@ e_folder_type_registry_register_type (EFolderTypeRegistry *folder_type_registry,
g_return_val_if_fail (type_name != NULL, FALSE);
g_return_val_if_fail (icon_name != NULL, FALSE);
- return register_folder_type (folder_type_registry, type_name, icon_name,
+ return register_folder_type (folder_type_registry, type_name, icon_name, user_creatable,
num_exported_dnd_types, exported_dnd_types,
num_accepted_dnd_types, accepted_dnd_types);
}
@@ -395,6 +400,25 @@ e_folder_type_registry_get_handler_for_type (EFolderTypeRegistry *folder_type_re
return folder_type->handler;
}
+gboolean
+e_folder_type_registry_type_is_user_creatable (EFolderTypeRegistry *folder_type_registry,
+ const char *type_name)
+{
+ const FolderType *folder_type;
+
+ g_return_val_if_fail (folder_type_registry != NULL, FALSE);
+ g_return_val_if_fail (E_IS_FOLDER_TYPE_REGISTRY (folder_type_registry), FALSE);
+ g_return_val_if_fail (type_name != NULL, FALSE);
+
+ folder_type = get_folder_type (folder_type_registry, type_name);
+ if (folder_type == NULL) {
+ g_warning ("e_folder_type_registry_type_is_user_creatable() -- Unknown type `%s'", type_name);
+ return FALSE;
+ }
+
+ return folder_type->user_creatable;
+}
+
GList *
e_folder_type_registry_get_exported_dnd_types_for_type (EFolderTypeRegistry *folder_type_registry,
diff --git a/shell/e-folder-type-registry.h b/shell/e-folder-type-registry.h
index 46d7f41442..1bcb87b3ac 100644
--- a/shell/e-folder-type-registry.h
+++ b/shell/e-folder-type-registry.h
@@ -63,6 +63,7 @@ EFolderTypeRegistry *e_folder_type_registry_new (void);
gboolean e_folder_type_registry_register_type (EFolderTypeRegistry *folder_type_registry,
const char *type_name,
const char *icon_name,
+ gboolean user_creatable,
int num_exported_dnd_types,
const char **exported_dnd_types,
int num_accepted_dnd_types,
@@ -80,6 +81,8 @@ const char *e_folder_type_registry_get_icon_name_for_type (E
const char *type_name);
EvolutionShellComponentClient *e_folder_type_registry_get_handler_for_type (EFolderTypeRegistry *folder_type_registry,
const char *type_name);
+gboolean e_folder_type_registry_type_is_user_creatable (EFolderTypeRegistry *folder_type_registry,
+ const char *type_name);
GList *e_folder_type_registry_get_exported_dnd_types_for_type (EFolderTypeRegistry *folder_type_registry,
const char *type_name);
diff --git a/shell/e-shell-folder-creation-dialog.c b/shell/e-shell-folder-creation-dialog.c
index 5e6c5e5556..ea81bfdc58 100644
--- a/shell/e-shell-folder-creation-dialog.c
+++ b/shell/e-shell-folder-creation-dialog.c
@@ -361,6 +361,9 @@ add_folder_types (GtkWidget *dialog,
type_name = (const char *) p->data;
+ if (! e_folder_type_registry_type_is_user_creatable (folder_type_registry, type_name))
+ continue;
+
menu_item = gtk_menu_item_new_with_label (type_name);
gtk_widget_show (menu_item);
gtk_menu_append (GTK_MENU (menu), menu_item);
diff --git a/shell/evolution-shell-component.c b/shell/evolution-shell-component.c
index f9fd35a9f2..cf7de2354c 100644
--- a/shell/evolution-shell-component.c
+++ b/shell/evolution-shell-component.c
@@ -156,8 +156,9 @@ impl_ShellComponent__get_supported_types (PortableServer_Servant servant,
folder_type = (EvolutionShellComponentFolderType *) p->data;
corba_folder_type = folder_type_list->_buffer + i;
- corba_folder_type->name = CORBA_string_dup (folder_type->name);
- corba_folder_type->icon_name = CORBA_string_dup (folder_type->icon_name);
+ corba_folder_type->name = CORBA_string_dup (folder_type->name);
+ corba_folder_type->icon_name = CORBA_string_dup (folder_type->icon_name);
+ corba_folder_type->user_creatable = folder_type->user_creatable;
fill_corba_sequence_from_null_terminated_string_array (& corba_folder_type->accepted_dnd_types,
folder_type->accepted_dnd_types);
@@ -617,6 +618,7 @@ evolution_shell_component_construct (EvolutionShellComponent *shell_component,
new = g_new (EvolutionShellComponentFolderType, 1);
new->name = g_strdup (folder_types[i].name);
new->icon_name = g_strdup (folder_types[i].icon_name);
+ new->user_creatable = folder_types[i].user_creatable;
new->accepted_dnd_types = duplicate_null_terminated_string_array (folder_types[i].accepted_dnd_types);
new->exported_dnd_types = duplicate_null_terminated_string_array (folder_types[i].exported_dnd_types);
diff --git a/shell/evolution-shell-component.h b/shell/evolution-shell-component.h
index 190eb57a8d..28401826a0 100644
--- a/shell/evolution-shell-component.h
+++ b/shell/evolution-shell-component.h
@@ -107,6 +107,7 @@ typedef char * (* EvolutionShellComponentGetDndSelectionFn) (EvolutionShellCompo
struct _EvolutionShellComponentFolderType {
char *name;
char *icon_name;
+ gboolean user_creatable;
/* The following are NULL-terminated arrays. */
char **accepted_dnd_types;