aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorParthasarathi Susarla <saps@src.gnome.org>2005-12-21 15:18:49 +0800
committerParthasarathi Susarla <saps@src.gnome.org>2005-12-21 15:18:49 +0800
commit57884e830b43bf7a4a1eb08ce59cb8dd06a0de60 (patch)
tree8924656fe29b0ca86450ed4c55c185d917f2770b
parent8e71ebe0f4885419bb524fed4838a3277003a828 (diff)
downloadgsoc2013-evolution-57884e830b43bf7a4a1eb08ce59cb8dd06a0de60.tar.gz
gsoc2013-evolution-57884e830b43bf7a4a1eb08ce59cb8dd06a0de60.tar.zst
gsoc2013-evolution-57884e830b43bf7a4a1eb08ce59cb8dd06a0de60.zip
committed these files to fix http://bugzilla.gnome.org/show_bug.cgi?id=260354
ChangeLog addressbook/ChangeLog addressbook/gui/component/addressbook-component.c calendar/ChangeLog calendar/gui/calendar-component.c calendar/gui/memos-component.c calendar/gui/tasks-component.c mail/ChangeLog mail/Evolution-Mail.idl mail/mail-component.c shell/ChangeLog shell/Evolution-Component.idl shell/Evolution-Shell.idl shell/Evolution.idl shell/Makefile.am shell/e-shell-window.c shell/e-shell-window.h shell/e-shell.c svn path=/trunk/; revision=30915
-rw-r--r--ChangeLog39
-rw-r--r--addressbook/ChangeLog7
-rw-r--r--addressbook/gui/component/addressbook-component.c35
-rw-r--r--calendar/ChangeLog12
-rw-r--r--calendar/gui/calendar-component.c25
-rw-r--r--calendar/gui/memos-component.c25
-rw-r--r--calendar/gui/tasks-component.c25
-rw-r--r--mail/ChangeLog15
-rw-r--r--mail/Evolution-Mail.idl2
-rw-r--r--mail/mail-component.c62
-rw-r--r--shell/ChangeLog39
-rw-r--r--shell/Evolution-Component.idl18
-rw-r--r--shell/Evolution-Shell.idl105
-rw-r--r--shell/Evolution.idl1
-rw-r--r--shell/Makefile.am8
-rw-r--r--shell/e-shell-window.c72
-rw-r--r--shell/e-shell-window.h2
-rw-r--r--shell/e-shell.c14
18 files changed, 405 insertions, 101 deletions
diff --git a/ChangeLog b/ChangeLog
index 05ea39b5b9..bb4e97975b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,42 @@
+2004-06-28 Not Zed <NotZed@Ximian.com>
+
+ * e-shell-view.c (impl_ShellView_setTitle): take a component id
+ argument.
+
+ * e-shell-window.c (component_view_free): release the corba object
+ properly.
+ (e_shell_window_set_title): new helper to set the title for the
+ component.
+ (switch_view): use the component specific title if available or
+ fallback to the component name.
+
+2004-06-25 Not Zed <NotZed@Ximian.com>
+
+ ** See bug #60354.
+
+ * Evolution-Component.idl: createControls -> createView and
+ ComponentView to keep track of things.
+
+ * Evolution-Shell.idl: return a new type ShellView from
+ createNewWindow so other parts of the system can access it later.
+ ShellView so far just lets you set title or switch component, but
+ could be subclassed later.
+
+ * e-shell.c (impl_Shell_createNewWindow): return a shell view.
+
+ * e-shell-window.c (init_view): create the view from the compnent
+ first, then get the controls from it separately.
+ (init): setup the e-shell-view object for the create view
+ thing.
+
+ * e-shell-view.c (e_shell_view_new): simple bonobo object for
+ Evolution_ShellView, keep track of the EShellWindow.
+
+ * e-component-view.[ch]: simple bonobo object for
+ Evolution_ComponentView. Just keep track of the controls.
+
+ patch committed on behalf of Notzed - partha
+
2005-12-19 Chenthill Palanisamy <pchenthill@novell.com>
committing for David Trowbridge <trowbrds cs colorado edu>
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index a16a6a3bef..5903fbafcc 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,10 @@
+2005-12-21 Not Zed <NotZed@Ximian.com>
+
+ * gui/component/addressbook-component.c (impl_createView): changed
+ from createControls for new shell apis.
+
+ Committed on behalf of Notzed - partha
+
2005-12-17 Tor Lillqvist <tml@novell.com>
* gui/component/addressbook-migrate.c
diff --git a/addressbook/gui/component/addressbook-component.c b/addressbook/gui/component/addressbook-component.c
index 2332795736..72eedac8aa 100644
--- a/addressbook/gui/component/addressbook-component.c
+++ b/addressbook/gui/component/addressbook-component.c
@@ -41,6 +41,10 @@
#include "misc/e-task-bar.h"
#include "misc/e-info-label.h"
+#include "shell/e-component-view.h"
+
+#include "shell/e-component-view.h"
+
#include <string.h>
#include <bonobo/bonobo-i18n.h>
#include <gtk/gtkimage.h>
@@ -183,30 +187,27 @@ view_destroyed_cb (gpointer data, GObject *where_the_object_was)
/* Evolution::Component CORBA methods. */
-static void
-impl_createControls (PortableServer_Servant servant,
- Bonobo_Control *corba_sidebar_control,
- Bonobo_Control *corba_view_control,
- Bonobo_Control *corba_statusbar_control,
- CORBA_Environment *ev)
+static GNOME_Evolution_ComponentView
+impl_createView (PortableServer_Servant servant,
+ GNOME_Evolution_ShellView parent,
+ CORBA_Environment *ev)
{
AddressbookComponent *addressbook_component = ADDRESSBOOK_COMPONENT (bonobo_object_from_servant (servant));
AddressbookComponentPrivate *priv = addressbook_component->priv;
AddressbookView *view = addressbook_view_new ();
- BonoboControl *sidebar_control;
- BonoboControl *view_control;
- BonoboControl *statusbar_control;
-
- sidebar_control = bonobo_control_new (addressbook_view_peek_sidebar (view));
- view_control = addressbook_view_peek_folder_view (view);
- statusbar_control = bonobo_control_new (addressbook_view_peek_statusbar (view));
g_object_weak_ref (G_OBJECT (view), view_destroyed_cb, addressbook_component);
priv->views = g_list_append (priv->views, view);
- *corba_sidebar_control = CORBA_Object_duplicate (BONOBO_OBJREF (sidebar_control), ev);
- *corba_view_control = CORBA_Object_duplicate (BONOBO_OBJREF (view_control), ev);
- *corba_statusbar_control = CORBA_Object_duplicate (BONOBO_OBJREF (statusbar_control), ev);
+ EComponentView *component_view;
+
+ component_view = e_component_view_new_controls (parent, "contacts",
+ bonobo_control_new (addressbook_view_peek_sidebar (view)),
+ addressbook_view_peek_folder_view (view),
+ bonobo_control_new (addressbook_view_peek_statusbar (view)));
+
+ return BONOBO_OBJREF(component_view);
+
}
static GNOME_Evolution_CreatableItemTypeList *
@@ -438,7 +439,7 @@ addressbook_component_class_init (AddressbookComponentClass *class)
POA_GNOME_Evolution_Component__epv *epv = &class->epv;
GObjectClass *object_class = G_OBJECT_CLASS (class);
- epv->createControls = impl_createControls;
+ epv->createView = impl_createView;
epv->_get_userCreatableItems = impl__get_userCreatableItems;
epv->requestCreateItem = impl_requestCreateItem;
epv->upgradeFromVersion = impl_upgradeFromVersion;
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index aa25a83a07..3ac1889d31 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,15 @@
+2005-12-21 Johnny Jacob <johnnyjacob@gmail.com>
+
+ * gui/memos-component.c (impl_createControls): -> createView for
+ new shell apis.
+
+2005-12-21 Not Zed <NotZed@Ximian.com>
+
+ * gui/tasks-component.c (impl_createControls): same.
+
+ * gui/calendar-component.c (impl_createControls): ->createView for
+ new shell apis.
+
2005-12-20 Chenthill Palanisamy <pchenthill@novell.com>
Fixes #324525
diff --git a/calendar/gui/calendar-component.c b/calendar/gui/calendar-component.c
index b2cd808f94..1ed8641123 100644
--- a/calendar/gui/calendar-component.c
+++ b/calendar/gui/calendar-component.c
@@ -35,6 +35,7 @@
#include <libecal/e-cal-time-util.h>
#include <libedataserverui/e-source-selector.h>
#include <shell/e-user-creatable-items-handler.h>
+#include <shell/e-component-view.h>
#include "e-calendar-view.h"
#include "calendar-config-keys.h"
#include "calendar-config.h"
@@ -1407,16 +1408,15 @@ view_destroyed_cb (gpointer data, GObject *where_the_object_was)
}
}
-static void
-impl_createControls (PortableServer_Servant servant,
- Bonobo_Control *corba_sidebar_control,
- Bonobo_Control *corba_view_control,
- Bonobo_Control *corba_statusbar_control,
- CORBA_Environment *ev)
+static GNOME_Evolution_ComponentView
+impl_createView (PortableServer_Servant servant,
+ GNOME_Evolution_ShellView parent,
+ CORBA_Environment *ev)
{
CalendarComponent *calendar_component = CALENDAR_COMPONENT (bonobo_object_from_servant (servant));
CalendarComponentPrivate *priv;
CalendarComponentView *component_view;
+ EComponentView *ecv;
priv = calendar_component->priv;
@@ -1426,16 +1426,17 @@ impl_createControls (PortableServer_Servant servant,
/* FIXME Should we describe the problem in a control? */
bonobo_exception_set (ev, ex_GNOME_Evolution_Component_Failed);
- return;
+ return CORBA_OBJECT_NIL;
}
g_object_weak_ref (G_OBJECT (component_view->view_control), view_destroyed_cb, calendar_component);
priv->views = g_list_append (priv->views, component_view);
- /* Return the controls */
- *corba_sidebar_control = CORBA_Object_duplicate (BONOBO_OBJREF (component_view->sidebar_control), ev);
- *corba_view_control = CORBA_Object_duplicate (BONOBO_OBJREF (component_view->view_control), ev);
- *corba_statusbar_control = CORBA_Object_duplicate (BONOBO_OBJREF (component_view->statusbar_control), ev);
+ /* TODO: Make CalendarComponentView just subclass EComponentView */
+ ecv = e_component_view_new_controls (parent, "calendar", component_view->sidebar_control,
+ component_view->view_control, component_view->statusbar_control);
+
+ return BONOBO_OBJREF(ecv);
}
@@ -1579,7 +1580,7 @@ calendar_component_class_init (CalendarComponentClass *class)
parent_class = g_type_class_peek_parent (class);
epv->upgradeFromVersion = impl_upgradeFromVersion;
- epv->createControls = impl_createControls;
+ epv->createView = impl_createView;
epv->_get_userCreatableItems = impl__get_userCreatableItems;
epv->requestCreateItem = impl_requestCreateItem;
epv->handleURI = impl_handleURI;
diff --git a/calendar/gui/memos-component.c b/calendar/gui/memos-component.c
index 44e4747d09..259ec736b0 100644
--- a/calendar/gui/memos-component.c
+++ b/calendar/gui/memos-component.c
@@ -34,6 +34,7 @@
#include <libecal/e-cal.h>
#include <libedataserverui/e-source-selector.h>
#include <shell/e-user-creatable-items-handler.h>
+#include <shell/e-component-view.h>
#include "e-cal-model.h"
#include "e-memos.h"
#include "memos-component.h"
@@ -1109,16 +1110,15 @@ view_destroyed_cb (gpointer data, GObject *where_the_object_was)
}
}
-static void
-impl_createControls (PortableServer_Servant servant,
- Bonobo_Control *corba_sidebar_control,
- Bonobo_Control *corba_view_control,
- Bonobo_Control *corba_statusbar_control,
- CORBA_Environment *ev)
+static GNOME_Evolution_ComponentView
+impl_createView (PortableServer_Servant servant,
+ GNOME_Evolution_ShellView parent,
+ CORBA_Environment *ev)
{
MemosComponent *component = MEMOS_COMPONENT (bonobo_object_from_servant (servant));
MemosComponentPrivate *priv;
MemosComponentView *component_view;
+ EComponentView *ecv;
priv = component->priv;
@@ -1128,16 +1128,17 @@ impl_createControls (PortableServer_Servant servant,
/* FIXME Should we describe the problem in a control? */
bonobo_exception_set (ev, ex_GNOME_Evolution_Component_Failed);
- return;
+ return CORBA_OBJECT_NIL;
}
g_object_weak_ref (G_OBJECT (component_view->view_control), view_destroyed_cb, component);
priv->views = g_list_append (priv->views, component_view);
- /* Return the controls */
- *corba_sidebar_control = CORBA_Object_duplicate (BONOBO_OBJREF (component_view->sidebar_control), ev);
- *corba_view_control = CORBA_Object_duplicate (BONOBO_OBJREF (component_view->view_control), ev);
- *corba_statusbar_control = CORBA_Object_duplicate (BONOBO_OBJREF (component_view->statusbar_control), ev);
+ /* TODO: Make CalendarComponentView just subclass EComponentView */
+ ecv = e_component_view_new_controls (parent, "memos", component_view->sidebar_control,
+ component_view->view_control, component_view->statusbar_control);
+
+ return BONOBO_OBJREF(ecv);
}
static GNOME_Evolution_CreatableItemTypeList *
@@ -1262,7 +1263,7 @@ memos_component_class_init (MemosComponentClass *klass)
parent_class = g_type_class_peek_parent (klass);
epv->upgradeFromVersion = impl_upgradeFromVersion;
- epv->createControls = impl_createControls;
+ epv->createView = impl_createView;
epv->_get_userCreatableItems = impl__get_userCreatableItems;
epv->requestCreateItem = impl_requestCreateItem;
diff --git a/calendar/gui/tasks-component.c b/calendar/gui/tasks-component.c
index 83e3daea93..7f332b80f1 100644
--- a/calendar/gui/tasks-component.c
+++ b/calendar/gui/tasks-component.c
@@ -33,6 +33,7 @@
#include <libecal/e-cal.h>
#include <libedataserverui/e-source-selector.h>
#include <shell/e-user-creatable-items-handler.h>
+#include <shell/e-component-view.h>
#include "e-cal-model.h"
#include "e-tasks.h"
#include "tasks-component.h"
@@ -1124,16 +1125,15 @@ view_destroyed_cb (gpointer data, GObject *where_the_object_was)
}
}
-static void
-impl_createControls (PortableServer_Servant servant,
- Bonobo_Control *corba_sidebar_control,
- Bonobo_Control *corba_view_control,
- Bonobo_Control *corba_statusbar_control,
- CORBA_Environment *ev)
+static GNOME_Evolution_ComponentView
+impl_createView (PortableServer_Servant servant,
+ GNOME_Evolution_ShellView parent,
+ CORBA_Environment *ev)
{
TasksComponent *component = TASKS_COMPONENT (bonobo_object_from_servant (servant));
TasksComponentPrivate *priv;
TasksComponentView *component_view;
+ EComponentView *ecv;
priv = component->priv;
@@ -1143,16 +1143,17 @@ impl_createControls (PortableServer_Servant servant,
/* FIXME Should we describe the problem in a control? */
bonobo_exception_set (ev, ex_GNOME_Evolution_Component_Failed);
- return;
+ return CORBA_OBJECT_NIL;
}
g_object_weak_ref (G_OBJECT (component_view->view_control), view_destroyed_cb, component);
priv->views = g_list_append (priv->views, component_view);
- /* Return the controls */
- *corba_sidebar_control = CORBA_Object_duplicate (BONOBO_OBJREF (component_view->sidebar_control), ev);
- *corba_view_control = CORBA_Object_duplicate (BONOBO_OBJREF (component_view->view_control), ev);
- *corba_statusbar_control = CORBA_Object_duplicate (BONOBO_OBJREF (component_view->statusbar_control), ev);
+ /* TODO: Make TasksComponentView just subclass EComponentView */
+ ecv = e_component_view_new_controls (parent, "tasks", component_view->sidebar_control,
+ component_view->view_control, component_view->statusbar_control);
+
+ return BONOBO_OBJREF(ecv);
}
static GNOME_Evolution_CreatableItemTypeList *
@@ -1286,7 +1287,7 @@ tasks_component_class_init (TasksComponentClass *klass)
parent_class = g_type_class_peek_parent (klass);
epv->upgradeFromVersion = impl_upgradeFromVersion;
- epv->createControls = impl_createControls;
+ epv->createView = impl_createView;
epv->_get_userCreatableItems = impl__get_userCreatableItems;
epv->requestCreateItem = impl_requestCreateItem;
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 282a1fa75c..1b9aafd1bf 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,18 @@
+2005-12-21 Not Zed <NotZed@Ximian.com>
+
+ * mail-component.c (impl_createView, view_changed_cb): api updates.
+
+2004-12-21 Not Zed <NotZed@Ximian.com>
+
+ ** See bug #60354.
+
+ * mail-component.c (view_changed_cb): set the shell window title
+ as well.
+ (impl_createView): renamed from createControls, just return a
+ EComponentView instead.
+
+ Committed on behalf of notzed - partha
+
2005-12-21 Jeff Cai <jeff.cai@sun.com>
** See bug 324473
diff --git a/mail/Evolution-Mail.idl b/mail/Evolution-Mail.idl
index 52afa167de..844a1eaaf5 100644
--- a/mail/Evolution-Mail.idl
+++ b/mail/Evolution-Mail.idl
@@ -3,7 +3,7 @@
#define _GNOME_EVOLUTION_MAILCOMPONENT_IDL
-#include <shell/Evolution-Component.idl>
+#include <shell/Evolution-Shell.idl>
module GNOME {
module Evolution {
diff --git a/mail/mail-component.c b/mail/mail-component.c
index 9ca61d2a75..9a23a46ba6 100644
--- a/mail/mail-component.c
+++ b/mail/mail-component.c
@@ -64,6 +64,7 @@
#include "e-activity-handler.h"
#include "shell/e-user-creatable-items-handler.h"
+#include "shell/e-component-view.h"
#include "composer/e-msg-composer.h"
@@ -491,10 +492,15 @@ view_on_url (GObject *emitter, const char *url, const char *nice_url, MailCompon
}
static void
-view_changed(EMFolderView *emfv, EInfoLabel *el)
+view_changed(EMFolderView *emfv, EComponentView *component_view)
{
+ EInfoLabel *el = g_object_get_data((GObject *)component_view, "info-label");
+ CORBA_Environment ev;
+
+ CORBA_exception_init(&ev);
+
if (emfv->folder) {
- char *name;
+ char *name, *title;
guint32 visible, unread, deleted, junked;
GString *tmp = g_string_new("");
@@ -556,20 +562,27 @@ view_changed(EMFolderView *emfv, EInfoLabel *el)
e_info_label_set_info(el, _(name), tmp->str);
else
e_info_label_set_info(el, name, tmp->str);
+
+ title = g_strdup_printf("%s, %s", name, tmp->str);
+ e_component_view_set_title(component_view, title);
+ g_free(title);
+
g_string_free(tmp, TRUE);
camel_object_free(emfv->folder, CAMEL_FOLDER_NAME, name);
} else {
e_info_label_set_info(el, _("Mail"), "");
+ e_component_view_set_title(component_view, _("Mail"));
}
}
static int
view_changed_timeout(void *d)
{
- EInfoLabel *el = d;
+ EComponentView *component_view = d;
+ EInfoLabel *el = g_object_get_data((GObject *)component_view, "info-label");
EMFolderView *emfv = g_object_get_data((GObject *)el, "folderview");
- view_changed(emfv, el);
+ view_changed(emfv, component_view);
g_object_set_data((GObject *)emfv, "view-changed-timeout", NULL);
@@ -580,9 +593,10 @@ view_changed_timeout(void *d)
}
static void
-view_changed_cb(EMFolderView *emfv, EInfoLabel *el)
+view_changed_cb(EMFolderView *emfv, EComponentView *component_view)
{
void *v;
+ EInfoLabel *el = g_object_get_data((GObject *)component_view, "info-label");
/* This can get called 3 times every cursor move, so
we don't need to/want to run it immediately */
@@ -596,23 +610,19 @@ view_changed_cb(EMFolderView *emfv, EInfoLabel *el)
g_object_ref(el);
}
- g_object_set_data((GObject *)emfv, "view-changed-timeout", GINT_TO_POINTER(g_timeout_add(250, view_changed_timeout, el)));
+ g_object_set_data((GObject *)emfv, "view-changed-timeout", GINT_TO_POINTER(g_timeout_add(250, view_changed_timeout, component_view)));
}
/* Evolution::Component CORBA methods. */
-static void
-impl_createControls (PortableServer_Servant servant,
- Bonobo_Control *corba_tree_control,
- Bonobo_Control *corba_view_control,
- Bonobo_Control *corba_statusbar_control,
- CORBA_Environment *ev)
+static GNOME_Evolution_ComponentView
+impl_createView (PortableServer_Servant servant,
+ GNOME_Evolution_ShellView parent,
+ CORBA_Environment *ev)
{
MailComponent *mail_component = MAIL_COMPONENT (bonobo_object_from_servant (servant));
MailComponentPrivate *priv = mail_component->priv;
- BonoboControl *tree_control;
- BonoboControl *view_control;
- BonoboControl *statusbar_control;
+ EComponentView *component_view;
GtkWidget *tree_widget, *vbox, *info;
GtkWidget *view_widget;
GtkWidget *statusbar_widget;
@@ -653,25 +663,23 @@ impl_createControls (PortableServer_Servant servant,
gtk_widget_show(info);
gtk_widget_show(vbox);
- tree_control = bonobo_control_new (vbox);
- view_control = bonobo_control_new (view_widget);
- statusbar_control = bonobo_control_new (statusbar_widget);
-
- *corba_tree_control = CORBA_Object_duplicate (BONOBO_OBJREF (tree_control), ev);
- *corba_view_control = CORBA_Object_duplicate (BONOBO_OBJREF (view_control), ev);
- *corba_statusbar_control = CORBA_Object_duplicate (BONOBO_OBJREF (statusbar_control), ev);
+ component_view = e_component_view_new(parent, "mail", vbox, view_widget, statusbar_widget);
+
+ g_object_set_data((GObject *)component_view, "info-label", info);
g_object_set_data_full((GObject *)view_widget, "e-creatable-items-handler",
e_user_creatable_items_handler_new("mail", create_local_item_cb, tree_widget),
(GDestroyNotify)g_object_unref);
- g_signal_connect (view_control, "activate", G_CALLBACK (view_control_activate_cb), view_widget);
+ g_signal_connect (component_view->view_control, "activate", G_CALLBACK (view_control_activate_cb), view_widget);
g_signal_connect (tree_widget, "folder-selected", G_CALLBACK (folder_selected_cb), view_widget);
- g_signal_connect(view_widget, "changed", G_CALLBACK(view_changed_cb), info);
- g_signal_connect(view_widget, "loaded", G_CALLBACK(view_changed_cb), info);
-
+ g_signal_connect(view_widget, "changed", G_CALLBACK(view_changed_cb), component_view);
+ g_signal_connect(view_widget, "loaded", G_CALLBACK(view_changed_cb), component_view);
+
g_object_set_data((GObject*)info, "folderview", view_widget);
+
+ return BONOBO_OBJREF(component_view);
}
static CORBA_boolean
@@ -1017,7 +1025,7 @@ mail_component_class_init (MailComponentClass *class)
object_class->dispose = impl_dispose;
object_class->finalize = impl_finalize;
- epv->createControls = impl_createControls;
+ epv->createView = impl_createView;
epv->requestQuit = impl_requestQuit;
epv->quit = impl_quit;
epv->_get_userCreatableItems = impl__get_userCreatableItems;
diff --git a/shell/ChangeLog b/shell/ChangeLog
index c89628c529..206ce41681 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,3 +1,42 @@
+2005-12-21 Not Zed <NotZed@Ximian.com>
+
+ * e-shell-view.c (impl_ShellView_setTitle): take a component id
+ argument.
+
+ * e-shell-window.c (component_view_free): release the corba object
+ properly.
+ (e_shell_window_set_title): new helper to set the title for the
+ component.
+ (switch_view): use the component specific title if available or
+ fallback to the component name.
+
+2004-12-21 Not Zed <NotZed@Ximian.com>
+
+ ** See bug #60354.
+
+ * Evolution-Component.idl: createControls -> createView and
+ ComponentView to keep track of things.
+
+ * Evolution-Shell.idl: return a new type ShellView from
+ createNewWindow so other parts of the system can access it later.
+ ShellView so far just lets you set title or switch component, but
+ could be subclassed later.
+
+ * e-shell.c (impl_Shell_createNewWindow): return a shell view.
+
+ * e-shell-window.c (init_view): create the view from the compnent
+ first, then get the controls from it separately.
+ (init): setup the e-shell-view object for the create view
+ thing.
+
+ * e-shell-view.c (e_shell_view_new): simple bonobo object for
+ Evolution_ShellView, keep track of the EShellWindow.
+
+ * e-component-view.[ch]: simple bonobo object for
+ Evolution_ComponentView. Just keep track of the controls.
+
+ Committed on behalf of NotZed - partha
+
2005-12-17 Tor Lillqvist <tml@novell.com>
* e-config-upgrade.c: Use libedataserver's e_xml_parse_file()
diff --git a/shell/Evolution-Component.idl b/shell/Evolution-Component.idl
index d464327a31..a64efebe42 100644
--- a/shell/Evolution-Component.idl
+++ b/shell/Evolution-Component.idl
@@ -42,6 +42,18 @@ module Evolution {
};
typedef sequence <CreatableItemType> CreatableItemTypeList;
+ interface ComponentView : Bonobo::Unknown {
+ void getControls (out Bonobo::Control sidebar_control,
+ out Bonobo::Control view_control,
+ out Bonobo::Control statusbar_control);
+ };
+
+ interface ComponentView : Bonobo::Unknown {
+ void getControls (out Bonobo::Control sidebar_control,
+ out Bonobo::Control view_control,
+ out Bonobo::Control statusbar_control);
+ };
+
interface Listener : Bonobo::Unknown {
/* Indicate the change of state is complete */
void complete();
@@ -64,12 +76,10 @@ module Evolution {
raises (UnsupportedVersion, UpgradeFailed);
/*** Basic functionality. ***/
+ ComponentView createView(in ShellView parent)
+ raises (Failed);
/* Create the controls for embedding in the shell. */
- void createControls (out Bonobo::Control sidebar_control,
- out Bonobo::Control view_control,
- out Bonobo::Control statusbar_control)
- raises (Failed);
/* Check if the component can quit.
Do not perform any quit-related tasks however.
diff --git a/shell/Evolution-Shell.idl b/shell/Evolution-Shell.idl
index c9d075918d..b67aee1151 100644
--- a/shell/Evolution-Shell.idl
+++ b/shell/Evolution-Shell.idl
@@ -15,6 +15,109 @@
module GNOME {
module Evolution {
+ enum CreatableItem {
+ CREATABLE_OBJECT,
+ CREATABLE_FOLDER
+ };
+
+ /* A type of item that the component can create when asked by the user,
+ e.g. a mail message or an appointment. */
+ struct CreatableItemType {
+ string id;
+ string description;
+ string menuDescription;
+ string tooltip;
+ char menuShortcut;
+ string iconName;
+ CreatableItem type;
+ };
+ typedef sequence <CreatableItemType> CreatableItemTypeList;
+
+ interface ComponentView : Bonobo::Unknown {
+ void getControls (out Bonobo::Control sidebar_control,
+ out Bonobo::Control view_control,
+ out Bonobo::Control statusbar_control);
+ };
+
+ interface Listener : Bonobo::Unknown {
+ /* Indicate the change of state is complete */
+ void complete();
+ };
+
+ interface ShellView : Bonobo::Unknown {
+ /* Should really use a ComponentView i guess */
+ void setTitle(in string component, in string title);
+ void setComponent(in string component);
+ };
+
+ interface Component : Bonobo::Unknown {
+ exception Failed {};
+ exception UnknownType {};
+ /* We don't know about the old version we're upgrading from */
+ exception UnsupportedVersion {};
+ /* We encountered a non-recoverable, fatal error, explain why */
+ exception UpgradeFailed {
+ string what;
+ string why;
+ };
+
+ /*** Upgrade path. ***/
+
+ void upgradeFromVersion (in short major, in short minor, in short revision)
+ raises (UnsupportedVersion, UpgradeFailed);
+
+ /*** Basic functionality. ***/
+ ComponentView createView(in ShellView parent)
+ raises (Failed);
+
+ /* Create the controls for embedding in the shell. */
+
+ /* Check if the component can quit.
+ Do not perform any quit-related tasks however.
+ May be called multiple times, depending on user interaction. */
+ boolean requestQuit ();
+
+ /* Ask the component to quit. Returns TRUE when the
+ component has completed any closing-down tasks, and
+ is ready to exit(). This will be called repeatedly
+ at intervals until it returns TRUE. */
+ boolean quit ();
+
+ /* Notify the component of whether the shell is currently
+ running in interactive mode or not. (I.e. basically,
+ whether there are any Evolution windows on the screen.)
+ @new_view_xid is an X Window ID ("None" if @now_interactive
+ is FALSE) */
+ void interactive (in boolean now_interactive,
+ in unsigned long new_view_xid);
+
+
+ /*** The following stuff is needed to build the "New" toolbar
+ item as well as the "File -> New" submenu. ***/
+
+ /* List of creatable items. */
+ readonly attribute CreatableItemTypeList userCreatableItems;
+
+ /* Pop up a new editing dialog for the item with the specified
+ @item_type_name. */
+ void requestCreateItem (in string item_type_name)
+ raises (UnknownType, Failed);
+
+
+ /*** URI handling (e.g. for the command-line, "evolution
+ mailto:foo@bar.org") ***/
+ void handleURI (in string uri);
+
+
+ /*** Send/receive. ***/
+
+ void sendAndReceive ();
+
+ /* Set the online status of the component asynchronously */
+
+ void setLineStatus(in boolean online, in Listener listener);
+ };
+
interface Shell : Bonobo::Unknown {
exception Busy {};
exception ComponentNotFound {};
@@ -29,7 +132,7 @@ module Evolution {
* @component_id: id or alias of the component to display in the new window.
*
*/
- void createNewWindow (in string component_id)
+ ShellView createNewWindow (in string component_id)
raises (NotReady, ComponentNotFound, UnsupportedSchema, InternalError);
/**
diff --git a/shell/Evolution.idl b/shell/Evolution.idl
index a734c091fd..167caa258b 100644
--- a/shell/Evolution.idl
+++ b/shell/Evolution.idl
@@ -13,7 +13,6 @@
#include <Bonobo.idl>
-#include <Evolution-Component.idl>
#include <Evolution-ConfigControl.idl>
#include <Evolution-Shell.idl>
diff --git a/shell/Makefile.am b/shell/Makefile.am
index 944c25cd7c..1082df8ed0 100644
--- a/shell/Makefile.am
+++ b/shell/Makefile.am
@@ -79,6 +79,7 @@ eshellincludedir = $(privincludedir)/shell
eshellinclude_HEADERS = \
Evolution.h \
+ e-component-view.h \
e-shell-utils.h \
e-user-creatable-items-handler.h \
evolution-config-control.h \
@@ -91,6 +92,7 @@ eshellinclude_HEADERS = \
libeshell_la_SOURCES = \
$(IDL_GENERATED) \
$(MARSHAL_GENERATED) \
+ e-component-view.c \
evolution-component.c \
evolution-listener.c \
e-shell-utils.c \
@@ -118,6 +120,8 @@ evolution_SOURCES = \
e-corba-config-page.h \
e-history.c \
e-history.h \
+ e-shell.c \
+ e-shell.h \
e-shell-constants.h \
e-shell-folder-title-bar.c \
e-shell-folder-title-bar.h \
@@ -129,8 +133,8 @@ evolution_SOURCES = \
e-shell-window-commands.h \
e-shell-window.c \
e-shell-window.h \
- e-shell.c \
- e-shell.h \
+ e-shell-view.c \
+ e-shell-view.h \
e-sidebar.c \
e-sidebar.h \
es-event.c \
diff --git a/shell/e-shell-window.c b/shell/e-shell-window.c
index 0fd5fe3dca..a0f70c7ccf 100644
--- a/shell/e-shell-window.c
+++ b/shell/e-shell-window.c
@@ -25,6 +25,7 @@
#endif
#include "e-shell-window.h"
+#include "e-shell-view.h"
#include "Evolution.h"
@@ -67,6 +68,9 @@ struct _ComponentView {
char *component_id;
char *component_alias;
+ GNOME_Evolution_ComponentView component_view;
+ char *title;
+
GtkWidget *sidebar_widget;
GtkWidget *view_widget;
GtkWidget *statusbar_widget;
@@ -79,6 +83,8 @@ typedef struct _ComponentView ComponentView;
struct _EShellWindowPrivate {
EShell *shell;
+ EShellView *shell_view; /* CORBA wrapper for this, just a placeholder */
+
/* plugin menu manager */
ESMenu *menu;
@@ -149,6 +155,13 @@ component_view_new (const char *id, const char *alias, int button_id)
static void
component_view_free (ComponentView *view)
{
+ if (view->component_view) {
+ CORBA_Environment ev = { 0 };
+
+ CORBA_Object_release(view->component_view, &ev);
+ CORBA_exception_free(&ev);
+ }
+
g_free (view->component_id);
g_free (view->component_alias);
g_free (view);
@@ -193,6 +206,7 @@ init_view (EShellWindow *window,
EShellWindowPrivate *priv = window->priv;
EComponentRegistry *registry = e_shell_peek_component_registry (window->priv->shell);
GNOME_Evolution_Component component_iface;
+ GNOME_Evolution_ComponentView component_view;
Bonobo_UIContainer container;
Bonobo_Control sidebar_control;
Bonobo_Control view_control;
@@ -221,19 +235,29 @@ init_view (EShellWindow *window,
/* 2. Set up view. */
- GNOME_Evolution_Component_createControls (component_iface, &sidebar_control, &view_control, &statusbar_control, &ev);
- if (BONOBO_EX (&ev)) {
+ /* The rest of the code assumes that the component is valid and can create
+ controls; if this fails something is really wrong in the component
+ (e.g. methods not implemented)... So handle it as if there was no
+ component at all. */
+
+ component_view = GNOME_Evolution_Component_createView(component_iface, BONOBO_OBJREF(priv->shell_view), &ev);
+ if (component_view == NULL || BONOBO_EX (&ev)) {
g_warning ("Cannot create view for %s", view->component_id);
+ bonobo_object_release_unref (component_iface, NULL);
+ CORBA_exception_free (&ev);
+ return;
+ }
- /* The rest of the code assumes that the component is valid and can create
- controls; if this fails something is really wrong in the component
- (e.g. methods not implemented)... So handle it as if there was no
- component at all. */
+ GNOME_Evolution_ComponentView_getControls(component_view, &sidebar_control, &view_control, &statusbar_control, &ev);
+ if (BONOBO_EX (&ev)) {
+ g_warning ("Cannot create view for %s", view->component_id);
bonobo_object_release_unref (component_iface, NULL);
CORBA_exception_free (&ev);
return;
}
+ view->component_view = component_view;
+
CORBA_exception_free (&ev);
container = bonobo_ui_component_get_container (priv->ui_component);
@@ -301,9 +325,12 @@ switch_view (EShellWindow *window, ComponentView *component_view)
gtk_notebook_set_current_page (GTK_NOTEBOOK (priv->statusbar_notebook), component_view->notebook_page_num);
}
- title = g_strdup_printf ("Evolution - %s", info->button_label);
- gtk_window_set_title (GTK_WINDOW (window), title);
- g_free (title);
+ if (component_view->title == NULL) {
+ title = g_strdup_printf ("Evolution - %s", info->button_label);
+ gtk_window_set_title (GTK_WINDOW (window), title);
+ g_free (title);
+ } else
+ gtk_window_set_title (GTK_WINDOW (window), component_view->title);
if (info->button_icon)
gtk_window_set_icon (GTK_WINDOW (window), info->button_icon);
@@ -839,6 +866,7 @@ e_shell_window_init (EShellWindow *shell_window)
EShellWindowPrivate *priv = g_new0 (EShellWindowPrivate, 1);
priv->tooltips = gtk_tooltips_new ();
+ priv->shell_view = e_shell_view_new(shell_window);
shell_window->priv = priv;
@@ -1064,3 +1092,29 @@ e_shell_window_show_settings (EShellWindow *window)
e_shell_show_settings (window->priv->shell, window->priv->current_view ? window->priv->current_view->component_alias : NULL, window);
}
+void
+e_shell_window_set_title(EShellWindow *window, const char *component_id, const char *title)
+{
+ EShellWindowPrivate *priv = window->priv;
+ ComponentView *view = NULL;
+ GSList *p;
+
+ for (p = priv->component_views; p != NULL; p = p->next) {
+ ComponentView *this_view = p->data;
+
+ if (strcmp (this_view->component_id, component_id) == 0
+ || (this_view->component_alias != NULL
+ && strcmp (this_view->component_alias, component_id) == 0)) {
+ view = p->data;
+ break;
+ }
+ }
+
+ if (view) {
+ g_free(view->title);
+ view->title = g_strdup(title);
+ if (view->title && view == priv->current_view)
+ gtk_window_set_title((GtkWindow *)window, title);
+ }
+}
+
diff --git a/shell/e-shell-window.h b/shell/e-shell-window.h
index 796e08d050..2c54d73ef0 100644
--- a/shell/e-shell-window.h
+++ b/shell/e-shell-window.h
@@ -68,6 +68,8 @@ BonoboUIComponent *e_shell_window_peek_bonobo_ui_component (EShellWindow *windo
ESidebar *e_shell_window_peek_sidebar (EShellWindow *window);
GtkWidget *e_shell_window_peek_statusbar (EShellWindow *window);
+void e_shell_window_set_title(EShellWindow *window, const char *component_id, const char *title);
+
void e_shell_window_save_defaults (EShellWindow *window);
void e_shell_window_show_settings (EShellWindow *window);
diff --git a/shell/e-shell.c b/shell/e-shell.c
index 99277b1cf6..433baa9ccf 100644
--- a/shell/e-shell.c
+++ b/shell/e-shell.c
@@ -67,6 +67,7 @@
#include "e-shell-marshal.h"
#include "e-shell-settings-dialog.h"
#include "e-shell.h"
+#include "e-shell-view.h"
#include "es-event.h"
#include "evolution-listener.h"
#include "evolution-shell-component-utils.h"
@@ -216,7 +217,7 @@ raise_exception_if_not_ready (PortableServer_Servant servant,
return FALSE;
}
-static void
+static GNOME_Evolution_ShellView
impl_Shell_createNewWindow (PortableServer_Servant servant,
const CORBA_char *component_id,
CORBA_Environment *ev)
@@ -224,9 +225,10 @@ impl_Shell_createNewWindow (PortableServer_Servant servant,
BonoboObject *bonobo_object;
EShell *shell;
EShellWindow *shell_window;
+ EShellView *shell_view;
if (raise_exception_if_not_ready (servant, ev))
- return;
+ return CORBA_OBJECT_NIL;
bonobo_object = bonobo_object_from_servant (servant);
shell = E_SHELL (bonobo_object);
@@ -238,8 +240,14 @@ impl_Shell_createNewWindow (PortableServer_Servant servant,
if (shell_window == NULL) {
CORBA_exception_set (ev, CORBA_USER_EXCEPTION,
ex_GNOME_Evolution_Shell_ComponentNotFound, NULL);
- return;
+ return CORBA_OBJECT_NIL;
}
+
+ /* refs?? */
+ shell_view = e_shell_view_new(shell_window);
+
+ return BONOBO_OBJREF(shell_view);
+
}
static void