New member is_interactive' in EShellPrivate'. (init): Init to %FALSE.

* e-shell.c: New member `is_interactive' in `EShellPrivate'.
(init): Init to %FALSE.
(set_interactive): New.
(e_shell_create_view): Make interactive.
(view_destroy_cb): If no views are left, make non-interactive.

* evolution-shell-component.c (class_init): Set up the
"interactive" signal.
(impl_interactive): New implementation for the ::interactive
method.
(class_init): Install.

* evolution-shell-component.h: New signal `interactive'.

* Evolution-ShellComponent.idl: New method ::interactive.

svn path=/trunk/; revision=13890
This commit is contained in:
Ettore Perazzoli
2001-10-22 19:09:24 +00:00
parent fd9cceb0d7
commit 367221fa5e
5 changed files with 108 additions and 7 deletions

View File

@ -1,3 +1,21 @@
2001-10-22 Ettore Perazzoli <ettore@ximian.com>
* e-shell.c: New member `is_interactive' in `EShellPrivate'.
(init): Init to %FALSE.
(set_interactive): New.
(e_shell_create_view): Make interactive.
(view_destroy_cb): If no views are left, make non-interactive.
* evolution-shell-component.c (class_init): Set up the
"interactive" signal.
(impl_interactive): New implementation for the ::interactive
method.
(class_init): Install.
* evolution-shell-component.h: New signal `interactive'.
* Evolution-ShellComponent.idl: New method ::interactive.
2001-10-19 Ettore Perazzoli <ettore@ximian.com>
* e-storage-set-view.c (tree_drag_data_received): Pass the

View File

@ -57,6 +57,8 @@ module Evolution {
void unsetOwner ()
raises (NotOwned);
void interactive (in boolean now_interactive);
void debug (in string log_path);
/* FIXME: We might want more exceptions here. */

View File

@ -124,6 +124,11 @@ struct _EShellPrivate {
the start-up sequence, to avoid CORBA calls to do make wrong things
to happen while the shell is initializing. */
unsigned int is_initialized : 1;
/* Wether the shell is working in "interactive" mode or not.
(Currently, it's interactive IIF there is at least one active
view.) */
unsigned int is_interactive : 1;
};
@ -143,6 +148,49 @@ enum {
static guint signals[LAST_SIGNAL] = { 0 };
/* Interactivity handling. */
static void
set_interactive (EShell *shell,
gboolean interactive)
{
EShellPrivate *priv;
GList *id_list, *p;
priv = shell->priv;
if (!! priv->is_interactive == !! interactive)
return;
priv->is_interactive = interactive;
id_list = e_component_registry_get_id_list (priv->component_registry);
for (p = id_list; p != NULL; p = p->next) {
EvolutionShellComponentClient *shell_component_client;
GNOME_Evolution_ShellComponent shell_component_objref;
const char *id;
CORBA_Environment ev;
id = (const char *) p->data;
shell_component_client = e_component_registry_get_component_by_id (priv->component_registry, id);
shell_component_objref = bonobo_object_corba_objref (BONOBO_OBJECT (shell_component_client));
CORBA_exception_init (&ev);
g_print ("Notifying interactive change (%s) -- %s\n", interactive ? "TRUE" : "FALSE", id);
GNOME_Evolution_ShellComponent_interactive (shell_component_objref, interactive, &ev);
if (ev._major != CORBA_NO_EXCEPTION)
g_warning ("Error changing interactive status of component %s to %s -- %s\n",
id, interactive ? "TRUE" : "FALSE", ev._repo_id);
CORBA_exception_free (&ev);
}
e_free_string_list (id_list);
}
/* Callback for the folder selection dialog. */
@ -430,7 +478,6 @@ impl_Shell_selectUserFolder (PortableServer_Servant servant,
} else {
XClassHint class_hints;
XWMHints *parent_wm_hints;
int format;
/* Set the WM class and the WindowGroup hint to be the same as
the foreign parent window's. This way smartass window
@ -800,6 +847,8 @@ view_destroy_cb (GtkObject *object,
shell->priv->views = g_list_remove (shell->priv->views, object);
if (shell->priv->views == NULL) {
set_interactive (shell, FALSE);
bonobo_object_ref (BONOBO_OBJECT (shell));
gtk_signal_emit (GTK_OBJECT (shell), signals [NO_VIEWS_LEFT]);
bonobo_object_unref (BONOBO_OBJECT (shell));
@ -954,6 +1003,7 @@ init (EShell *shell)
priv->line_status = E_SHELL_LINE_STATUS_ONLINE;
priv->db = CORBA_OBJECT_NIL;
priv->is_initialized = FALSE;
priv->is_interactive = FALSE;
shell->priv = priv;
}
@ -1169,12 +1219,13 @@ e_shell_create_view (EShell *shell,
gtk_signal_connect (GTK_OBJECT (view), "destroy",
GTK_SIGNAL_FUNC (view_destroy_cb), shell);
if (uri != NULL)
if (!e_shell_view_display_uri (E_SHELL_VIEW (view), uri))
/* FIXME: Consider popping a dialog box up
about how the provided URI does not
exist/could not be displayed */
if (uri != NULL) {
if (!e_shell_view_display_uri (E_SHELL_VIEW (view), uri)) {
/* FIXME: Consider popping a dialog box up about how the provided URI does not
exist/could not be displayed. */
e_shell_view_display_uri (E_SHELL_VIEW (view), E_SHELL_VIEW_DEFAULT_URI);
}
}
shell->priv->views = g_list_prepend (shell->priv->views, view);
@ -1186,6 +1237,8 @@ e_shell_create_view (EShell *shell,
e_shell_view_show_shortcut_bar (view, e_shell_view_shortcut_bar_shown (template_view));
}
set_interactive (shell, TRUE);
return view;
}

View File

@ -79,6 +79,7 @@ enum {
OWNER_UNSET,
OWNER_DIED,
DEBUG,
INTERACTIVE,
HANDLE_EXTERNAL_URI,
USER_CREATE_NEW_ITEM,
LAST_SIGNAL
@ -436,6 +437,20 @@ impl_debug (PortableServer_Servant servant,
gtk_signal_emit (GTK_OBJECT (shell_component), signals[DEBUG]);
}
static void
impl_interactive (PortableServer_Servant servant,
CORBA_boolean interactive,
CORBA_Environment *ev)
{
BonoboObject *bonobo_object;
EvolutionShellComponent *shell_component;
bonobo_object = bonobo_object_from_servant (servant);
shell_component = EVOLUTION_SHELL_COMPONENT (bonobo_object);
gtk_signal_emit (GTK_OBJECT (shell_component), signals[INTERACTIVE], interactive);
}
static Bonobo_Control
impl_createView (PortableServer_Servant servant,
const CORBA_char *physical_uri,
@ -738,6 +753,15 @@ class_init (EvolutionShellComponentClass *klass)
gtk_marshal_NONE__NONE,
GTK_TYPE_NONE, 0);
signals[INTERACTIVE]
= gtk_signal_new ("interactive",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (EvolutionShellComponentClass, interactive),
gtk_marshal_NONE__BOOL,
GTK_TYPE_NONE, 1,
GTK_TYPE_BOOL);
signals[HANDLE_EXTERNAL_URI]
= gtk_signal_new ("handle_external_uri",
GTK_RUN_FIRST,
@ -767,7 +791,8 @@ class_init (EvolutionShellComponentClass *klass)
epv->_get_userCreatableItemTypes = impl__get_userCreatableItemTypes;
epv->setOwner = impl_setOwner;
epv->unsetOwner = impl_unsetOwner;
epv->debug = impl_debug;
epv->debug = impl_debug;
epv->interactive = impl_interactive;
epv->createView = impl_createView;
epv->handleExternalURI = impl_handleExternalURI;
epv->createFolderAsync = impl_createFolderAsync;

View File

@ -143,6 +143,9 @@ struct _EvolutionShellComponentClass {
void (* debug) (EvolutionShellComponent *shell_component);
void (* interactive) (EvolutionShellComponent *shell_component,
gboolean is_interactive);
void (* handle_external_uri) (EvolutionShellComponent *shell_component,
const char *uri);