|
|
|
|
@ -80,7 +80,7 @@ struct _ComponentInfo {
|
|
|
|
|
typedef struct _ComponentInfo ComponentInfo;
|
|
|
|
|
|
|
|
|
|
struct _EShellOfflineHandlerPrivate {
|
|
|
|
|
EComponentRegistry *component_registry;
|
|
|
|
|
EShell *shell;
|
|
|
|
|
|
|
|
|
|
EShellView *parent_shell_view;
|
|
|
|
|
|
|
|
|
|
@ -331,12 +331,14 @@ static void
|
|
|
|
|
cancel_offline (EShellOfflineHandler *offline_handler)
|
|
|
|
|
{
|
|
|
|
|
EShellOfflineHandlerPrivate *priv;
|
|
|
|
|
EComponentRegistry *component_registry;
|
|
|
|
|
GList *component_ids;
|
|
|
|
|
GList *p;
|
|
|
|
|
|
|
|
|
|
priv = offline_handler->priv;
|
|
|
|
|
|
|
|
|
|
component_ids = e_component_registry_get_id_list (priv->component_registry);
|
|
|
|
|
component_registry = e_shell_get_component_registry (priv->shell);
|
|
|
|
|
component_ids = e_component_registry_get_id_list (component_registry);
|
|
|
|
|
|
|
|
|
|
for (p = component_ids; p != NULL; p = p->next) {
|
|
|
|
|
EvolutionShellComponentClient *shell_component_client;
|
|
|
|
|
@ -345,7 +347,7 @@ cancel_offline (EShellOfflineHandler *offline_handler)
|
|
|
|
|
const char *id;
|
|
|
|
|
|
|
|
|
|
id = (const char *) p->data;
|
|
|
|
|
shell_component_client = e_component_registry_get_component_by_id (priv->component_registry, id);
|
|
|
|
|
shell_component_client = e_component_registry_get_component_by_id (component_registry, id);
|
|
|
|
|
|
|
|
|
|
offline_interface = evolution_shell_component_client_get_offline_interface (shell_component_client);
|
|
|
|
|
if (offline_interface == CORBA_OBJECT_NIL)
|
|
|
|
|
@ -376,14 +378,16 @@ cancel_offline (EShellOfflineHandler *offline_handler)
|
|
|
|
|
static gboolean
|
|
|
|
|
prepare_for_offline (EShellOfflineHandler *offline_handler)
|
|
|
|
|
{
|
|
|
|
|
EComponentRegistry *component_registry;
|
|
|
|
|
EShellOfflineHandlerPrivate *priv;
|
|
|
|
|
GList *component_ids;
|
|
|
|
|
GList *p;
|
|
|
|
|
gboolean error;
|
|
|
|
|
|
|
|
|
|
priv = offline_handler->priv;
|
|
|
|
|
component_registry = e_shell_get_component_registry (priv->shell);
|
|
|
|
|
|
|
|
|
|
component_ids = e_component_registry_get_id_list (priv->component_registry);
|
|
|
|
|
component_ids = e_component_registry_get_id_list (component_registry);
|
|
|
|
|
|
|
|
|
|
error = FALSE;
|
|
|
|
|
for (p = component_ids; p != NULL; p = p->next) {
|
|
|
|
|
@ -397,7 +401,7 @@ prepare_for_offline (EShellOfflineHandler *offline_handler)
|
|
|
|
|
const char *id;
|
|
|
|
|
|
|
|
|
|
id = (const char *) p->data;
|
|
|
|
|
shell_component_client = e_component_registry_get_component_by_id (priv->component_registry, id);
|
|
|
|
|
shell_component_client = e_component_registry_get_component_by_id (component_registry, id);
|
|
|
|
|
offline_interface = evolution_shell_component_client_get_offline_interface (shell_component_client);
|
|
|
|
|
if (offline_interface == CORBA_OBJECT_NIL)
|
|
|
|
|
continue;
|
|
|
|
|
@ -659,8 +663,7 @@ impl_destroy (GtkObject *object)
|
|
|
|
|
offline_handler = E_SHELL_OFFLINE_HANDLER (object);
|
|
|
|
|
priv = offline_handler->priv;
|
|
|
|
|
|
|
|
|
|
if (priv->component_registry != NULL)
|
|
|
|
|
gtk_object_unref (GTK_OBJECT (priv->component_registry));
|
|
|
|
|
/* (We don't unref the shell, as it's our owner.) */
|
|
|
|
|
|
|
|
|
|
g_hash_table_foreach (priv->id_to_component_info, hash_foreach_free_component_info, NULL);
|
|
|
|
|
g_hash_table_destroy (priv->id_to_component_info);
|
|
|
|
|
@ -722,16 +725,16 @@ init (EShellOfflineHandler *shell_offline_handler)
|
|
|
|
|
|
|
|
|
|
priv = g_new (EShellOfflineHandlerPrivate, 1);
|
|
|
|
|
|
|
|
|
|
priv->component_registry = NULL;
|
|
|
|
|
priv->parent_shell_view = NULL;
|
|
|
|
|
priv->shell = NULL;
|
|
|
|
|
priv->parent_shell_view = NULL;
|
|
|
|
|
|
|
|
|
|
priv->dialog_gui = NULL;
|
|
|
|
|
priv->dialog_gui = NULL;
|
|
|
|
|
|
|
|
|
|
priv->num_total_connections = 0;
|
|
|
|
|
priv->id_to_component_info = g_hash_table_new (g_str_hash, g_str_equal);
|
|
|
|
|
priv->num_total_connections = 0;
|
|
|
|
|
priv->id_to_component_info = g_hash_table_new (g_str_hash, g_str_equal);
|
|
|
|
|
|
|
|
|
|
priv->procedure_in_progress = FALSE;
|
|
|
|
|
priv->finished = FALSE;
|
|
|
|
|
priv->procedure_in_progress = FALSE;
|
|
|
|
|
priv->finished = FALSE;
|
|
|
|
|
|
|
|
|
|
shell_offline_handler->priv = priv;
|
|
|
|
|
}
|
|
|
|
|
@ -740,51 +743,45 @@ init (EShellOfflineHandler *shell_offline_handler)
|
|
|
|
|
/**
|
|
|
|
|
* e_shell_offline_handler_construct:
|
|
|
|
|
* @offline_handler: A pointer to an EShellOfflineHandler to construct.
|
|
|
|
|
* @component_registry: The registry for the components that we want to put
|
|
|
|
|
* off-line.
|
|
|
|
|
* @shell: The Evolution shell.
|
|
|
|
|
*
|
|
|
|
|
* Construct the @offline_handler.
|
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
e_shell_offline_handler_construct (EShellOfflineHandler *offline_handler,
|
|
|
|
|
EComponentRegistry *component_registry)
|
|
|
|
|
EShell *shell)
|
|
|
|
|
{
|
|
|
|
|
EShellOfflineHandlerPrivate *priv;
|
|
|
|
|
|
|
|
|
|
g_return_if_fail (offline_handler != NULL);
|
|
|
|
|
g_return_if_fail (E_IS_SHELL_OFFLINE_HANDLER (offline_handler));
|
|
|
|
|
g_return_if_fail (component_registry != NULL);
|
|
|
|
|
g_return_if_fail (E_IS_COMPONENT_REGISTRY (component_registry));
|
|
|
|
|
g_return_if_fail (E_IS_SHELL (shell));
|
|
|
|
|
|
|
|
|
|
priv = offline_handler->priv;
|
|
|
|
|
|
|
|
|
|
g_assert (priv->component_registry == NULL);
|
|
|
|
|
g_assert (priv->shell == NULL);
|
|
|
|
|
|
|
|
|
|
GTK_OBJECT_UNSET_FLAGS (GTK_OBJECT (offline_handler), GTK_FLOATING);
|
|
|
|
|
|
|
|
|
|
gtk_object_ref (GTK_OBJECT (component_registry));
|
|
|
|
|
priv->component_registry = component_registry;
|
|
|
|
|
priv->shell = shell;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* e_shell_offline_handler_new:
|
|
|
|
|
* @component_registry: The registry for the components that we want to put
|
|
|
|
|
* off-line.
|
|
|
|
|
* @shell: The Evolution shell.
|
|
|
|
|
*
|
|
|
|
|
* Create a new offline handler.
|
|
|
|
|
*
|
|
|
|
|
* Return value: A pointer to the newly created EShellOfflineHandler object.
|
|
|
|
|
**/
|
|
|
|
|
EShellOfflineHandler *
|
|
|
|
|
e_shell_offline_handler_new (EComponentRegistry *component_registry)
|
|
|
|
|
e_shell_offline_handler_new (EShell *shell)
|
|
|
|
|
{
|
|
|
|
|
EShellOfflineHandler *offline_handler;
|
|
|
|
|
|
|
|
|
|
g_return_val_if_fail (component_registry != NULL, NULL);
|
|
|
|
|
g_return_val_if_fail (E_IS_COMPONENT_REGISTRY (component_registry), NULL);
|
|
|
|
|
g_return_val_if_fail (E_IS_SHELL (shell), NULL);
|
|
|
|
|
|
|
|
|
|
offline_handler = (EShellOfflineHandler *) gtk_type_new (e_shell_offline_handler_get_type ());
|
|
|
|
|
e_shell_offline_handler_construct (offline_handler, component_registry);
|
|
|
|
|
e_shell_offline_handler_construct (offline_handler, shell);
|
|
|
|
|
|
|
|
|
|
return offline_handler;
|
|
|
|
|
}
|
|
|
|
|
|