Remove exception. (cancelSyncFolder): Remove exception.

* 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.

svn path=/trunk/; revision=16946
This commit is contained in:
Ettore Perazzoli
2002-05-20 18:38:10 +00:00
parent 97d578613b
commit 3682e0ef1f
6 changed files with 101 additions and 35 deletions

View File

@ -1,3 +1,26 @@
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

View File

@ -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. */

View File

@ -17,6 +17,7 @@ module Evolution {
string physicalUri;
string evolutionUri;
long unreadCount;
boolean canSyncOffline;
};
typedef sequence <Folder> FolderList;

View File

@ -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);
}

View File

@ -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);
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_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,

View File

@ -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);