diff options
Diffstat (limited to 'shell')
-rw-r--r-- | shell/ChangeLog | 23 | ||||
-rw-r--r-- | shell/Evolution-Offline.idl | 6 | ||||
-rw-r--r-- | shell/Evolution-common.idl | 1 | ||||
-rw-r--r-- | shell/e-folder.c | 60 | ||||
-rw-r--r-- | shell/e-folder.h | 32 | ||||
-rw-r--r-- | shell/e-shell-config-offline.c | 16 |
6 files changed, 102 insertions, 36 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog index 45ac7e6240..ff0acc14de 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,5 +1,28 @@ 2002-05-20 Ettore Perazzoli <ettore@ximian.com> + * Evolution-Offline.idl (syncFolder): Remove exception. + (cancelSyncFolder): Remove exception. + + * e-shell-config-offline.c (storage_set_view_has_checkbox_func): + New. + (e_shell_config_offline_create_control): Pass it as the + @has_checkbox_func. + + * e-folder.c: New member can_sync_offline in EFolderPrivate. + (init): Init to FALSE. + (e_folder_get_can_sync_offline): New. + (e_folder_to_corba): Set canSyncOffline in the returned CORBA + folder. + (e_folder_set_physical_uri): Protect from when @physical_uri and + ->physical_uri are the same thing. + (e_folder_set_description): Same here with description. + (e_folder_set_type_string): And type. + + * Evolution-common.idl: New member canSyncOffline in struct + Folder. + +2002-05-20 Ettore Perazzoli <ettore@ximian.com> + * e-shell-config-offline.c (e_shell_config_offline_create_control): Pass NULL for @has_checkbox_func and @has_checkbox_func_data. diff --git a/shell/Evolution-Offline.idl b/shell/Evolution-Offline.idl index 97bfd0cc84..46821d72bb 100644 --- a/shell/Evolution-Offline.idl +++ b/shell/Evolution-Offline.idl @@ -59,13 +59,11 @@ interface Offline : Bonobo::Unknown { /* Request the component to sync the specified folder. This has to happen after ::prepareForOffline. */ oneway void syncFolder (in Folder folder, - in SyncFolderProgressListener listener) - raises (notPrepared); + in SyncFolderProgressListener listener); /* Request the component to stop syncing the specified folder. This has to happen after ::syncFolder. */ - oneway void cancelSyncFolder (in Folder folder) - raises (notSyncing); + oneway void cancelSyncFolder (in Folder folder); /* Ask the component to go into off-line mode. This always comes after a ::prepareForOffline. */ diff --git a/shell/Evolution-common.idl b/shell/Evolution-common.idl index 127521bdef..4cbf45ad7e 100644 --- a/shell/Evolution-common.idl +++ b/shell/Evolution-common.idl @@ -17,6 +17,7 @@ module Evolution { string physicalUri; string evolutionUri; long unreadCount; + boolean canSyncOffline; }; typedef sequence <Folder> FolderList; diff --git a/shell/e-folder.c b/shell/e-folder.c index 0de3160a74..3c2669f0bd 100644 --- a/shell/e-folder.c +++ b/shell/e-folder.c @@ -46,8 +46,9 @@ struct _EFolderPrivate { int child_highlight; int unread_count; - int self_highlight : 1; - int is_stock : 1; + unsigned int self_highlight : 1; + unsigned int is_stock : 1; + unsigned int can_sync_offline : 1; }; #define EF_CLASS(obj) \ @@ -148,14 +149,15 @@ init (EFolder *folder) EFolderPrivate *priv; priv = g_new (EFolderPrivate, 1); - priv->type = NULL; - priv->name = NULL; - priv->description = NULL; - priv->physical_uri = NULL; - priv->child_highlight = 0; - priv->unread_count = 0; - priv->self_highlight = FALSE; - priv->is_stock = FALSE; + priv->type = NULL; + priv->name = NULL; + priv->description = NULL; + priv->physical_uri = NULL; + priv->child_highlight = 0; + priv->unread_count = 0; + priv->self_highlight = FALSE; + priv->is_stock = FALSE; + priv->can_sync_offline = FALSE; folder->priv = priv; } @@ -274,6 +276,9 @@ e_folder_set_name (EFolder *folder, g_return_if_fail (E_IS_FOLDER (folder)); g_return_if_fail (name != NULL); + if (folder->priv->name == name) + return; + g_free (folder->priv->name); folder->priv->name = g_strdup (name); @@ -316,6 +321,9 @@ e_folder_set_physical_uri (EFolder *folder, g_return_if_fail (E_IS_FOLDER (folder)); g_return_if_fail (physical_uri != NULL); + if (folder->priv->physical_uri == physical_uri) + return; + g_free (folder->priv->physical_uri); folder->priv->physical_uri = g_strdup (physical_uri); @@ -361,6 +369,25 @@ e_folder_set_is_stock (EFolder *folder, gtk_signal_emit (GTK_OBJECT (folder), signals[CHANGED]); } +void +e_folder_set_can_sync_offline (EFolder *folder, + gboolean can_sync_offline) +{ + g_return_if_fail (E_IS_FOLDER (folder)); + + folder->priv->can_sync_offline = !! can_sync_offline; + + gtk_signal_emit (GTK_OBJECT (folder), signals[CHANGED]); +} + +gboolean +e_folder_get_can_sync_offline (EFolder *folder) +{ + g_return_val_if_fail (E_IS_FOLDER (folder), FALSE); + + return folder->priv->can_sync_offline; +} + /* Gotta love CORBA. */ @@ -372,12 +399,13 @@ e_folder_to_corba (EFolder *folder, g_return_if_fail (E_IS_FOLDER (folder)); g_return_if_fail (folder_return != NULL); - folder_return->type = e_safe_corba_string_dup (e_folder_get_type_string (folder)); - folder_return->description = e_safe_corba_string_dup (e_folder_get_description (folder)); - folder_return->displayName = e_safe_corba_string_dup (e_folder_get_name (folder)); - folder_return->physicalUri = e_safe_corba_string_dup (e_folder_get_physical_uri (folder)); - folder_return->evolutionUri = e_safe_corba_string_dup (evolution_uri); - folder_return->unreadCount = e_folder_get_unread_count (folder); + folder_return->type = e_safe_corba_string_dup (e_folder_get_type_string (folder)); + folder_return->description = e_safe_corba_string_dup (e_folder_get_description (folder)); + folder_return->displayName = e_safe_corba_string_dup (e_folder_get_name (folder)); + folder_return->physicalUri = e_safe_corba_string_dup (e_folder_get_physical_uri (folder)); + folder_return->evolutionUri = e_safe_corba_string_dup (evolution_uri); + folder_return->unreadCount = e_folder_get_unread_count (folder); + folder_return->canSyncOffline = e_folder_get_can_sync_offline (folder); } diff --git a/shell/e-folder.h b/shell/e-folder.h index 48fa5b4789..4e7c9c1996 100644 --- a/shell/e-folder.h +++ b/shell/e-folder.h @@ -72,21 +72,23 @@ EFolder *e_folder_new (const char *name, const char *type, const char *description); -const char *e_folder_get_name (EFolder *folder); -const char *e_folder_get_type_string (EFolder *folder); -const char *e_folder_get_description (EFolder *folder); -const char *e_folder_get_physical_uri (EFolder *folder); -int e_folder_get_unread_count (EFolder *folder); -gboolean e_folder_get_highlighted (EFolder *folder); -gboolean e_folder_get_is_stock (EFolder *folder); - -void e_folder_set_name (EFolder *folder, const char *name); -void e_folder_set_type_string (EFolder *folder, const char *type); -void e_folder_set_description (EFolder *folder, const char *description); -void e_folder_set_physical_uri (EFolder *folder, const char *physical_uri); -void e_folder_set_unread_count (EFolder *folder, int unread_count); -void e_folder_set_child_highlight (EFolder *folder, gboolean highlighted); -void e_folder_set_is_stock (EFolder *folder, gboolean is_stock); +const char *e_folder_get_name (EFolder *folder); +const char *e_folder_get_type_string (EFolder *folder); +const char *e_folder_get_description (EFolder *folder); +const char *e_folder_get_physical_uri (EFolder *folder); +int e_folder_get_unread_count (EFolder *folder); +gboolean e_folder_get_highlighted (EFolder *folder); +gboolean e_folder_get_is_stock (EFolder *folder); +gboolean e_folder_get_can_sync_offline (EFolder *folder); + +void e_folder_set_name (EFolder *folder, const char *name); +void e_folder_set_type_string (EFolder *folder, const char *type); +void e_folder_set_description (EFolder *folder, const char *description); +void e_folder_set_physical_uri (EFolder *folder, const char *physical_uri); +void e_folder_set_unread_count (EFolder *folder, int unread_count); +void e_folder_set_child_highlight (EFolder *folder, gboolean highlighted); +void e_folder_set_is_stock (EFolder *folder, gboolean is_stock); +void e_folder_set_can_sync_offline (EFolder *folder, gboolean can_sync_offline); void e_folder_to_corba (EFolder *folder, const char *evolution_uri, diff --git a/shell/e-shell-config-offline.c b/shell/e-shell-config-offline.c index 2776d32cdd..bc497fece6 100644 --- a/shell/e-shell-config-offline.c +++ b/shell/e-shell-config-offline.c @@ -155,6 +155,20 @@ init_storage_set_view_status_from_config (EStorageSetView *storage_set_view, CORBA_exception_free (&ev); } +static gboolean +storage_set_view_has_checkbox_func (EStorageSet *storage_set, + const char *path, + void *data) +{ + EFolder *folder; + + folder = e_storage_set_get_folder (storage_set, path); + if (folder == NULL) + return FALSE; + + return e_folder_get_can_sync_offline (folder); +} + BonoboObject * e_shell_config_offline_create_control (EShell *shell) { @@ -168,7 +182,7 @@ e_shell_config_offline_create_control (EShell *shell) page_data->storage_set_view = e_storage_set_new_view (e_shell_get_storage_set (shell), NULL); e_storage_set_view_set_show_checkboxes (E_STORAGE_SET_VIEW (page_data->storage_set_view), TRUE, - NULL, NULL); + storage_set_view_has_checkbox_func, NULL); gtk_widget_show (page_data->storage_set_view); init_storage_set_view_status_from_config (E_STORAGE_SET_VIEW (page_data->storage_set_view), shell); |