[evolution-patches] patches to make the info label a control
- From: Dan Winship <danw ximian com>
- To: evolution-patches ximian com
- Subject: [evolution-patches] patches to make the info label a control
- Date: Tue, 20 Apr 2004 16:40:23 -0400
This controlifies the info label, so that Connector can display the info
label that goes with the view. It also gets rid of the factories for
getting individual view controls from the components. (Along with this
patch, there are changes to make Connector use createControls(), and
then it uses its own sidebar with the component's view, statusbar, and
info label.)
Index: shell/Evolution-Component.idl
===================================================================
RCS file: /cvs/gnome/evolution/shell/Evolution-Component.idl,v
retrieving revision 1.14
diff -u -r1.14 Evolution-Component.idl
--- shell/Evolution-Component.idl 9 Apr 2004 15:46:00 -0000 1.14
+++ shell/Evolution-Component.idl 20 Apr 2004 20:36:19 -0000
@@ -41,8 +41,12 @@
/*** Basic functionality. ***/
- /* Create the controls for embedding in the shell. */
+ /* Create the controls for embedding in the shell.
+ * The shell is allowed to destroy any of the controls
+ * except the view if it needs to.
+ */
void createControls (out Bonobo::Control sidebar_control,
+ out Bonobo::Control info_control,
out Bonobo::Control view_control,
out Bonobo::Control statusbar_control)
raises (Failed);
Index: shell/e-shell-window.c
===================================================================
RCS file: /cvs/gnome/evolution/shell/e-shell-window.c,v
retrieving revision 1.19
diff -u -r1.19 e-shell-window.c
--- shell/e-shell-window.c 9 Apr 2004 15:46:00 -0000 1.19
+++ shell/e-shell-window.c 20 Apr 2004 20:36:19 -0000
@@ -70,6 +70,7 @@
char *component_alias;
GtkWidget *sidebar_widget;
+ GtkWidget *info_widget;
GtkWidget *view_widget;
GtkWidget *statusbar_widget;
@@ -92,6 +93,7 @@
/* Notebooks used to switch between components. */
GtkWidget *sidebar_notebook;
+ GtkWidget *info_notebook;
GtkWidget *view_notebook;
GtkWidget *statusbar_notebook;
@@ -155,33 +157,39 @@
static void
component_view_deactivate (ComponentView *view)
{
- BonoboControlFrame *view_control_frame;
- BonoboControlFrame *sidebar_control_frame;
+ BonoboControlFrame *frame;
g_return_if_fail (view->sidebar_widget != NULL);
+ g_return_if_fail (view->info_widget != NULL);
g_return_if_fail (view->view_widget != NULL);
- view_control_frame = bonobo_widget_get_control_frame (BONOBO_WIDGET (view->view_widget));
- bonobo_control_frame_control_deactivate (view_control_frame);
+ frame = bonobo_widget_get_control_frame (BONOBO_WIDGET (view->view_widget));
+ bonobo_control_frame_control_deactivate (frame);
- sidebar_control_frame = bonobo_widget_get_control_frame (BONOBO_WIDGET (view->sidebar_widget));
- bonobo_control_frame_control_deactivate (sidebar_control_frame);
+ frame = bonobo_widget_get_control_frame (BONOBO_WIDGET (view->sidebar_widget));
+ bonobo_control_frame_control_deactivate (frame);
+
+ frame = bonobo_widget_get_control_frame (BONOBO_WIDGET (view->info_widget));
+ bonobo_control_frame_control_deactivate (frame);
}
static void
component_view_activate (ComponentView *view)
{
- BonoboControlFrame *view_control_frame;
- BonoboControlFrame *sidebar_control_frame;
+ BonoboControlFrame *frame;
g_return_if_fail (view->sidebar_widget != NULL);
+ g_return_if_fail (view->info_widget != NULL);
g_return_if_fail (view->view_widget != NULL);
- view_control_frame = bonobo_widget_get_control_frame (BONOBO_WIDGET (view->view_widget));
- bonobo_control_frame_control_activate (view_control_frame);
+ frame = bonobo_widget_get_control_frame (BONOBO_WIDGET (view->view_widget));
+ bonobo_control_frame_control_activate (frame);
+
+ frame = bonobo_widget_get_control_frame (BONOBO_WIDGET (view->sidebar_widget));
+ bonobo_control_frame_control_activate (frame);
- sidebar_control_frame = bonobo_widget_get_control_frame (BONOBO_WIDGET (view->sidebar_widget));
- bonobo_control_frame_control_activate (sidebar_control_frame);
+ frame = bonobo_widget_get_control_frame (BONOBO_WIDGET (view->info_widget));
+ bonobo_control_frame_control_activate (frame);
}
static void
@@ -193,15 +201,16 @@
GNOME_Evolution_Component component_iface;
Bonobo_UIContainer container;
Bonobo_Control sidebar_control;
+ Bonobo_Control info_control;
Bonobo_Control view_control;
Bonobo_Control statusbar_control;
CORBA_Environment ev;
int sidebar_notebook_page_num;
int view_notebook_page_num;
- int statusbar_notebook_page_num;
g_assert (view->view_widget == NULL);
g_assert (view->sidebar_widget == NULL);
+ g_assert (view->info_widget == NULL);
g_assert (view->notebook_page_num == -1);
CORBA_exception_init (&ev);
@@ -219,7 +228,7 @@
/* 2. Set up view. */
- GNOME_Evolution_Component_createControls (component_iface, &sidebar_control, &view_control, &statusbar_control, &ev);
+ GNOME_Evolution_Component_createControls (component_iface, &sidebar_control, &info_control, &view_control, &statusbar_control, &ev);
if (BONOBO_EX (&ev)) {
g_warning ("Cannot create view for %s", view->component_id);
@@ -240,6 +249,10 @@
gtk_widget_show (view->sidebar_widget);
bonobo_object_release_unref (sidebar_control, NULL);
+ view->info_widget = bonobo_widget_new_control_from_objref (info_control, container);
+ gtk_widget_show (view->info_widget);
+ bonobo_object_release_unref (info_control, NULL);
+
view->view_widget = bonobo_widget_new_control_from_objref (view_control, container);
gtk_widget_show (view->view_widget);
bonobo_object_release_unref (view_control, NULL);
@@ -249,12 +262,12 @@
bonobo_object_release_unref (statusbar_control, NULL);
gtk_notebook_append_page (GTK_NOTEBOOK (priv->sidebar_notebook), view->sidebar_widget, NULL);
+ gtk_notebook_append_page (GTK_NOTEBOOK (priv->info_notebook), view->info_widget, NULL);
gtk_notebook_append_page (GTK_NOTEBOOK (priv->view_notebook), view->view_widget, NULL);
gtk_notebook_append_page (GTK_NOTEBOOK (priv->statusbar_notebook), view->statusbar_widget, NULL);
sidebar_notebook_page_num = gtk_notebook_page_num (GTK_NOTEBOOK (priv->sidebar_notebook), view->sidebar_widget);
view_notebook_page_num = gtk_notebook_page_num (GTK_NOTEBOOK (priv->view_notebook), view->view_widget);
- statusbar_notebook_page_num = gtk_notebook_page_num (GTK_NOTEBOOK (priv->view_notebook), view->statusbar_widget);
/* Since we always add a view page and a sidebar page at the same time... */
g_assert (sidebar_notebook_page_num == view_notebook_page_num);
@@ -265,6 +278,7 @@
gtk_notebook_set_current_page (GTK_NOTEBOOK (priv->view_notebook), view_notebook_page_num);
gtk_notebook_set_current_page (GTK_NOTEBOOK (priv->sidebar_notebook), view_notebook_page_num);
+ gtk_notebook_set_current_page (GTK_NOTEBOOK (priv->info_notebook), view_notebook_page_num);
gtk_notebook_set_current_page (GTK_NOTEBOOK (priv->statusbar_notebook), view_notebook_page_num);
if (priv->current_view != NULL)
@@ -291,6 +305,7 @@
gtk_notebook_set_current_page (GTK_NOTEBOOK (priv->view_notebook), component_view->notebook_page_num);
gtk_notebook_set_current_page (GTK_NOTEBOOK (priv->sidebar_notebook), component_view->notebook_page_num);
+ gtk_notebook_set_current_page (GTK_NOTEBOOK (priv->info_notebook), component_view->notebook_page_num);
gtk_notebook_set_current_page (GTK_NOTEBOOK (priv->statusbar_notebook), component_view->notebook_page_num);
}
@@ -548,16 +563,24 @@
EShellWindowPrivate *priv = window->priv;
EComponentRegistry *registry = e_shell_peek_component_registry (priv->shell);
GConfClient *gconf_client = gconf_client_get_default ();
- GtkWidget *contents_vbox;
+ GtkWidget *contents_vbox, *sidebar_vbox;
GSList *p;
int button_id;
priv->paned = gtk_hpaned_new ();
+ sidebar_vbox = gtk_vbox_new (FALSE, 0);
+ gtk_paned_pack1 (GTK_PANED (priv->paned), sidebar_vbox, FALSE, FALSE);
+
+ priv->info_notebook = gtk_notebook_new ();
+ gtk_notebook_set_show_tabs (GTK_NOTEBOOK (priv->info_notebook), FALSE);
+ gtk_notebook_set_show_border (GTK_NOTEBOOK (priv->info_notebook), FALSE);
+ gtk_box_pack_start (GTK_BOX (sidebar_vbox), priv->info_notebook, FALSE, TRUE, 0);
+
priv->sidebar = e_sidebar_new ();
g_signal_connect (priv->sidebar, "button_selected",
G_CALLBACK (sidebar_button_selected_callback), window);
- gtk_paned_pack1 (GTK_PANED (priv->paned), priv->sidebar, FALSE, FALSE);
+ gtk_box_pack_end (GTK_BOX (sidebar_vbox), priv->sidebar, TRUE, TRUE, 0);
priv->sidebar_notebook = gtk_notebook_new ();
gtk_notebook_set_show_tabs (GTK_NOTEBOOK (priv->sidebar_notebook), FALSE);
Index: addressbook/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/ChangeLog,v
retrieving revision 1.1658
diff -u -r1.1658 ChangeLog
--- addressbook/ChangeLog 20 Apr 2004 16:55:05 -0000 1.1658
+++ addressbook/ChangeLog 20 Apr 2004 20:36:19 -0000
@@ -1,3 +1,17 @@
+2004-04-20 Dan Winship <danw ximian com>
+
+ * gui/component/addressbook-view.c (addressbook_view_init):
+ Reorganize widgets to deal with sidebar/info separation
+
+ * gui/component/addressbook-component.c (impl_createControls):
+ Pass back info control as well.
+
+ * gui/component/GNOME_Evolution_Addressbook.server.in.in: remove
+ the view control factory.
+
+ * gui/component/component-factory.c (factory): Remove view
+ control.
+
2004-04-20 Chris Toshok <toshok ximian com>
* gui/widgets/e-addressbook-view.etspec: use cursor-mode="line" to
Index: addressbook/gui/component/GNOME_Evolution_Addressbook.server.in.in
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/gui/component/GNOME_Evolution_Addressbook.server.in.in,v
retrieving revision 1.13
diff -u -r1.13 GNOME_Evolution_Addressbook.server.in.in
--- addressbook/gui/component/GNOME_Evolution_Addressbook.server.in.in 19 Apr 2004 15:19:05 -0000 1.13
+++ addressbook/gui/component/GNOME_Evolution_Addressbook.server.in.in 20 Apr 2004 20:36:19 -0000
@@ -32,20 +32,6 @@
</oaf_server>
-<oaf_server iid="OAFIID:GNOME_Evolution_Addressbook_Control:@VERSION@"
- type="factory"
- location="OAFIID:GNOME_Evolution_Addressbook_Factory:@VERSION@">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:BonoboControl/addressbook-control:@VERSION@"/>
- <item value="IDL:GNOME/Control:1.0"/>
- </oaf_attribute>
-
- <oaf_attribute name="name" type="string"
- _value="Evolution Addressbook folder viewer"/>
-
-</oaf_server>
-
<oaf_server iid="OAFIID:GNOME_Evolution_Addressbook_Component:@VERSION@"
type="factory"
location="OAFIID:GNOME_Evolution_Addressbook_Factory:@VERSION@">
Index: addressbook/gui/component/addressbook-component.c
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/gui/component/addressbook-component.c,v
retrieving revision 1.126
diff -u -r1.126 addressbook-component.c
--- addressbook/gui/component/addressbook-component.c 19 Apr 2004 15:19:05 -0000 1.126
+++ addressbook/gui/component/addressbook-component.c 20 Apr 2004 20:36:19 -0000
@@ -59,20 +59,24 @@
static void
impl_createControls (PortableServer_Servant servant,
Bonobo_Control *corba_sidebar_control,
+ Bonobo_Control *corba_info_control,
Bonobo_Control *corba_view_control,
Bonobo_Control *corba_statusbar_control,
CORBA_Environment *ev)
{
AddressbookView *view = addressbook_view_new ();
BonoboControl *sidebar_control;
+ BonoboControl *info_control;
BonoboControl *view_control;
BonoboControl *statusbar_control;
sidebar_control = bonobo_control_new (addressbook_view_peek_sidebar (view));
+ info_control = bonobo_control_new (addressbook_view_peek_info_label (view));
view_control = addressbook_view_peek_folder_view (view);
statusbar_control = bonobo_control_new (addressbook_view_peek_statusbar (view));
*corba_sidebar_control = CORBA_Object_duplicate (BONOBO_OBJREF (sidebar_control), ev);
+ *corba_info_control = CORBA_Object_duplicate (BONOBO_OBJREF (info_control), ev);
*corba_view_control = CORBA_Object_duplicate (BONOBO_OBJREF (view_control), ev);
*corba_statusbar_control = CORBA_Object_duplicate (BONOBO_OBJREF (statusbar_control), ev);
}
Index: addressbook/gui/component/addressbook-view.c
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/gui/component/addressbook-view.c,v
retrieving revision 1.3
diff -u -r1.3 addressbook-view.c
--- addressbook/gui/component/addressbook-view.c 19 Apr 2004 15:19:05 -0000 1.3
+++ addressbook/gui/component/addressbook-view.c 20 Apr 2004 20:36:19 -0000
@@ -973,7 +973,6 @@
addressbook_view_init (AddressbookView *view)
{
AddressbookViewPrivate *priv;
- GtkWidget *selector_scrolled_window;
view->priv =
priv = g_new0 (AddressbookViewPrivate, 1);
@@ -1042,16 +1041,11 @@
e_source_selector_show_selection (E_SOURCE_SELECTOR (priv->selector), FALSE);
gtk_widget_show (priv->selector);
- selector_scrolled_window = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (selector_scrolled_window), GTK_SHADOW_IN);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (selector_scrolled_window),
+ priv->sidebar_widget = gtk_scrolled_window_new (NULL, NULL);
+ gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (priv->sidebar_widget), GTK_SHADOW_IN);
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (priv->sidebar_widget),
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
- gtk_container_add (GTK_CONTAINER (selector_scrolled_window), priv->selector);
- gtk_widget_show (selector_scrolled_window);
-
- priv->sidebar_widget = gtk_vbox_new(FALSE, 0);
- gtk_box_pack_start(GTK_BOX (priv->sidebar_widget), priv->info_widget, FALSE, TRUE, 0);
- gtk_box_pack_start(GTK_BOX (priv->sidebar_widget), selector_scrolled_window, TRUE, TRUE, 0);
+ gtk_container_add (GTK_CONTAINER (priv->sidebar_widget), priv->selector);
gtk_widget_show (priv->sidebar_widget);
g_signal_connect_object (priv->selector, "primary_selection_changed",
Index: addressbook/gui/component/component-factory.c
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/gui/component/component-factory.c,v
retrieving revision 1.11
diff -u -r1.11 component-factory.c
--- addressbook/gui/component/component-factory.c 20 Feb 2004 02:41:11 -0000 1.11
+++ addressbook/gui/component/component-factory.c 20 Apr 2004 20:36:19 -0000
@@ -39,7 +39,6 @@
#define FACTORY_ID "OAFIID:GNOME_Evolution_Addressbook_Factory:" BASE_VERSION
#define VCARD_CONTROL_ID "OAFIID:GNOME_Evolution_Addressbook_VCard_Control:" BASE_VERSION
-#define ADDRESSBOOK_CONTROL_ID "OAFIID:GNOME_Evolution_Addressbook_Control:" BASE_VERSION
#define COMPONENT_ID "OAFIID:GNOME_Evolution_Addressbook_Component:" BASE_VERSION
#define ADDRESS_POPUP_ID "OAFIID:GNOME_Evolution_Addressbook_AddressPopup:" BASE_VERSION
#define SELECT_NAMES_ID "OAFIID:GNOME_Evolution_Addressbook_SelectNames:" BASE_VERSION
@@ -57,8 +56,6 @@
if (strcmp (component_id, VCARD_CONTROL_ID) == 0)
return BONOBO_OBJECT (eab_vcard_control_new ());
- if (strcmp (component_id, ADDRESSBOOK_CONTROL_ID) == 0)
- return BONOBO_OBJECT (addressbook_new_control ());
if (strcmp (component_id, COMPONENT_ID) == 0) {
BonoboObject *object = BONOBO_OBJECT (addressbook_component_peek ());
bonobo_object_ref (object);
Index: calendar/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2262
diff -u -r1.2262 ChangeLog
--- calendar/ChangeLog 19 Apr 2004 15:19:32 -0000 1.2262
+++ calendar/ChangeLog 20 Apr 2004 20:36:19 -0000
@@ -1,3 +1,15 @@
+2004-04-20 Dan Winship <danw ximian com>
+
+ * gui/calendar-component.c (impl_createControls): Pass back info
+ control (and don't pack info and sidebar widgets together)
+
+ * gui/tasks-component.c (impl_createControls): Likewise
+
+ * gui/GNOME_Evolution_Calendar.server.in.in: Remove calendar and
+ task view controls
+
+ * gui/main.c (factory): Remove calendar and task view controls
+
2004-04-19 Michael Terry <mike mterry name>
* gui/GNOME_Evolution_Calendar.server.in.in:
Index: calendar/gui/GNOME_Evolution_Calendar.server.in.in
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/GNOME_Evolution_Calendar.server.in.in,v
retrieving revision 1.12
diff -u -r1.12 GNOME_Evolution_Calendar.server.in.in
--- calendar/gui/GNOME_Evolution_Calendar.server.in.in 19 Apr 2004 15:19:32 -0000 1.12
+++ calendar/gui/GNOME_Evolution_Calendar.server.in.in 20 Apr 2004 20:36:19 -0000
@@ -48,24 +48,6 @@
<oaf_attribute name="evolution:button_sort_order" type="string" value="-8"/>
</oaf_server>
-<oaf_server iid="OAFIID:GNOME_Evolution_Calendar_Control:@VERSION@"
- type="factory"
- location="OAFIID:GNOME_Evolution_Calendar_Factory:@VERSION@">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:BonoboControl/calendar-control:@VERSION@"/>
- <item value="IDL:Bonobo/Control:1.0"/>
- <item value="IDL:Bonobo/PropertyBag:1.0"/>
- </oaf_attribute>
-
- <oaf_attribute name="bonobo:supported_mime_types" type="stringv">
- <item value="text/calendar"/>
- </oaf_attribute>
-
- <oaf_attribute name="name" type="string"
- _value="Evolution Calendar viewer"/>
-</oaf_server>
-
<oaf_server iid="OAFIID:GNOME_Evolution_Tasks_Component:@VERSION@"
type="factory"
location="OAFIID:GNOME_Evolution_Calendar_Factory:@VERSION@">
@@ -81,24 +63,6 @@
<oaf_attribute name="evolution:button_label" type="string" _value="Tasks"/>
<oaf_attribute name="evolution:button_icon" type="string" value="stock_todo"/>
<oaf_attribute name="evolution:button_sort_order" type="string" value="-8"/>
-</oaf_server>
-
-<oaf_server iid="OAFIID:GNOME_Evolution_Tasks_Control:@VERSION@"
- type="factory"
- location="OAFIID:GNOME_Evolution_Calendar_Factory:@VERSION@">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:BonoboControl/tasks-control:@VERSION@"/>
- <item value="IDL:Bonobo/Control:1.0"/>
- <item value="IDL:Bonobo/PropertyBag:1.0"/>
- </oaf_attribute>
-
- <oaf_attribute name="bonobo:supported_mime_types" type="stringv">
- <item value="text/calendar"/>
- </oaf_attribute>
-
- <oaf_attribute name="name" type="string"
- _value="Evolution Tasks viewer"/>
</oaf_server>
<oaf_server iid="OAFIID:GNOME_Evolution_Calendar_CompEditorFactory:@VERSION@"
Index: calendar/gui/calendar-component.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/calendar-component.c,v
retrieving revision 1.163
diff -u -r1.163 calendar-component.c
--- calendar/gui/calendar-component.c 19 Apr 2004 15:19:32 -0000 1.163
+++ calendar/gui/calendar-component.c 20 Apr 2004 20:36:19 -0000
@@ -790,15 +790,17 @@
static void
impl_createControls (PortableServer_Servant servant,
Bonobo_Control *corba_sidebar_control,
+ Bonobo_Control *corba_info_control,
Bonobo_Control *corba_view_control,
Bonobo_Control *corba_statusbar_control,
CORBA_Environment *ev)
{
CalendarComponent *calendar_component = CALENDAR_COMPONENT (bonobo_object_from_servant (servant));
CalendarComponentPrivate *priv;
- GtkWidget *selector_scrolled_window, *vbox, *info;
+ GtkWidget *selector_scrolled_window, *info;
GtkWidget *statusbar_widget;
BonoboControl *sidebar_control;
+ BonoboControl *info_control;
BonoboControl *statusbar_control;
guint not;
@@ -828,17 +830,12 @@
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (selector_scrolled_window),
GTK_SHADOW_IN);
gtk_widget_show (selector_scrolled_window);
+ sidebar_control = bonobo_control_new (selector_scrolled_window);
info = e_info_label_new("stock_calendar");
e_info_label_set_info((EInfoLabel *)info, _("Calendars"), "");
gtk_widget_show (info);
-
- vbox = gtk_vbox_new(FALSE, 0);
- gtk_box_pack_start(GTK_BOX (vbox), info, FALSE, TRUE, 0);
- gtk_box_pack_start(GTK_BOX (vbox), selector_scrolled_window, TRUE, TRUE, 0);
- gtk_widget_show (vbox);
-
- sidebar_control = bonobo_control_new (vbox);
+ info_control = bonobo_control_new (info);
/* Create main calendar view */
/* FIXME Instead of returning, we should make a control with a
@@ -894,6 +891,7 @@
/* Return the controls */
*corba_sidebar_control = CORBA_Object_duplicate (BONOBO_OBJREF (sidebar_control), ev);
+ *corba_info_control = CORBA_Object_duplicate (BONOBO_OBJREF (info_control), ev);
*corba_view_control = CORBA_Object_duplicate (BONOBO_OBJREF (priv->view_control), ev);
*corba_statusbar_control = CORBA_Object_duplicate (BONOBO_OBJREF (statusbar_control), ev);
}
Index: calendar/gui/main.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/main.c,v
retrieving revision 1.165
diff -u -r1.165 main.c
--- calendar/gui/main.c 15 Apr 2004 14:44:20 -0000 1.165
+++ calendar/gui/main.c 20 Apr 2004 20:36:19 -0000
@@ -51,9 +51,7 @@
#define FACTORY_ID "OAFIID:GNOME_Evolution_Calendar_Factory:" BASE_VERSION
#define CALENDAR_COMPONENT_ID "OAFIID:GNOME_Evolution_Calendar_Component:" BASE_VERSION
-#define CALENDAR_CONTROL_ID "OAFIID:GNOME_Evolution_Calendar_Control:" BASE_VERSION
#define TASKS_COMPONENT_ID "OAFIID:GNOME_Evolution_Tasks_Component:" BASE_VERSION
-#define TASKS_CONTROL_ID "OAFIID:GNOME_Evolution_Tasks_Control:" BASE_VERSION
#define ITIP_CONTROL_ID "OAFIID:GNOME_Evolution_Calendar_iTip_Control:" BASE_VERSION
#define CONFIG_CONTROL_ID "OAFIID:GNOME_Evolution_Calendar_ConfigControl:" BASE_VERSION
#define COMP_EDITOR_FACTORY_ID "OAFIID:GNOME_Evolution_Calendar_CompEditorFactory:" BASE_VERSION
@@ -162,15 +160,11 @@
BonoboObject *object = BONOBO_OBJECT (calendar_component_peek ());
bonobo_object_ref (object);
return object;
- } else if (strcmp (component_id, CALENDAR_CONTROL_ID) == 0)
- return BONOBO_OBJECT (control_factory_new_control ());
- else if (strcmp (component_id, TASKS_COMPONENT_ID) == 0) {
+ } else if (strcmp (component_id, TASKS_COMPONENT_ID) == 0) {
BonoboObject *object = BONOBO_OBJECT (tasks_component_peek ());
bonobo_object_ref (object);
return object;
- } else if (strcmp (component_id, TASKS_CONTROL_ID) == 0)
- return BONOBO_OBJECT (tasks_control_new ());
- else if (strcmp (component_id, ITIP_CONTROL_ID) == 0)
+ } else if (strcmp (component_id, ITIP_CONTROL_ID) == 0)
return BONOBO_OBJECT (itip_bonobo_control_new ());
else if (strcmp (component_id, CONFIG_CONTROL_ID) == 0)
return BONOBO_OBJECT (cal_prefs_dialog_new ());
Index: calendar/gui/tasks-component.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/tasks-component.c,v
retrieving revision 1.61
diff -u -r1.61 tasks-component.c
--- calendar/gui/tasks-component.c 19 Apr 2004 15:19:32 -0000 1.61
+++ calendar/gui/tasks-component.c 20 Apr 2004 20:36:19 -0000
@@ -471,14 +471,15 @@
static void
impl_createControls (PortableServer_Servant servant,
Bonobo_Control *corba_sidebar_control,
+ Bonobo_Control *corba_info_control,
Bonobo_Control *corba_view_control,
Bonobo_Control *corba_statusbar_control,
CORBA_Environment *ev)
{
TasksComponent *component = TASKS_COMPONENT (bonobo_object_from_servant (servant));
TasksComponentPrivate *priv;
- GtkWidget *selector_scrolled_window, *statusbar_widget, *vbox, *info;
- BonoboControl *sidebar_control, *statusbar_control;
+ GtkWidget *selector_scrolled_window, *statusbar_widget, *info;
+ BonoboControl *sidebar_control, *info_control, *statusbar_control;
guint not;
priv = component->priv;
@@ -494,17 +495,12 @@
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (selector_scrolled_window),
GTK_SHADOW_IN);
gtk_widget_show (selector_scrolled_window);
+ sidebar_control = bonobo_control_new (selector_scrolled_window);
- info = e_info_label_new("stock_task");
+ info = e_info_label_new("evolution-tasks-mini.png");
e_info_label_set_info((EInfoLabel *)info, _("Tasks"), "");
gtk_widget_show (info);
-
- vbox = gtk_vbox_new(FALSE, 0);
- gtk_box_pack_start(GTK_BOX (vbox), info, FALSE, TRUE, 0);
- gtk_box_pack_start(GTK_BOX (vbox), selector_scrolled_window, TRUE, TRUE, 0);
- gtk_widget_show (vbox);
-
- sidebar_control = bonobo_control_new (vbox);
+ info_control = bonobo_control_new (info);
/* create the tasks view */
priv->view_control = tasks_control_new ();
@@ -543,6 +539,7 @@
/* Return the controls */
*corba_sidebar_control = CORBA_Object_duplicate (BONOBO_OBJREF (sidebar_control), ev);
+ *corba_info_control = CORBA_Object_duplicate (BONOBO_OBJREF (info_control), ev);
*corba_view_control = CORBA_Object_duplicate (BONOBO_OBJREF (priv->view_control), ev);
/* Create the task bar */
Index: mail/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/mail/ChangeLog,v
retrieving revision 1.3250
diff -u -r1.3250 ChangeLog
--- mail/ChangeLog 19 Apr 2004 21:55:21 -0000 1.3250
+++ mail/ChangeLog 20 Apr 2004 20:36:19 -0000
@@ -1,3 +1,14 @@
+2004-04-20 Dan Winship <danw ximian com>
+
+ * mail-component.c (impl_createControls): Pass back info control
+ (and don't pack the info label and sidebar together). Also, add a
+ property bag to the view control for overriding its URI.
+ (mail_control_new): No longer used.
+
+ * GNOME_Evolution_Mail.server.in.in: Remove folder view control
+
+ * mail-component-factory.c (factory): Remove folder view control
+
2004-04-19 Jeffrey Stedfast <fejj ximian com>
* em-folder-browser.c: Use E_ICON_SIZE_* enums for the menu icon
Index: mail/GNOME_Evolution_Mail.server.in.in
===================================================================
RCS file: /cvs/gnome/evolution/mail/GNOME_Evolution_Mail.server.in.in,v
retrieving revision 1.19
diff -u -r1.19 GNOME_Evolution_Mail.server.in.in
--- mail/GNOME_Evolution_Mail.server.in.in 19 Apr 2004 15:20:48 -0000 1.19
+++ mail/GNOME_Evolution_Mail.server.in.in 20 Apr 2004 20:36:19 -0000
@@ -76,21 +76,6 @@
_value="Evolution Mail composer"/>
</oaf_server>
- <!-- (control) -->
- <oaf_server iid="OAFIID:GNOME_Evolution_Mail_Control:@VERSION@"
- type="factory"
- location="OAFIID:GNOME_Evolution_Mail_Factory:@VERSION@">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:BonoboControl/evolution-mail-control:@VERSION@"/>
- <item value="IDL:GNOME/Control:1.0"/>
- </oaf_attribute>
-
- <oaf_attribute name="name" type="string"
- _value="Evolution Mail folder viewer"/>
-
- </oaf_server>
-
<!-- Startup Wizard -->
<!-- (wizard) -->
<oaf_server iid="OAFIID:GNOME_Evolution_Mail_Wizard:@VERSION@"
Index: mail/mail-component-factory.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-component-factory.c,v
retrieving revision 1.10
diff -u -r1.10 mail-component-factory.c
--- mail/mail-component-factory.c 11 Feb 2004 08:26:15 -0000 1.10
+++ mail/mail-component-factory.c 20 Apr 2004 20:36:19 -0000
@@ -49,7 +49,6 @@
#define FACTORY_ID "OAFIID:GNOME_Evolution_Mail_Factory:" BASE_VERSION
#define COMPONENT_ID "OAFIID:GNOME_Evolution_Mail_Component:" BASE_VERSION
#define COMPOSER_ID "OAFIID:GNOME_Evolution_Mail_Composer:" BASE_VERSION
-#define MAIL_CONTROL_ID "OAFIID:GNOME_Evolution_Mail_Control:" BASE_VERSION
#define FOLDER_INFO_ID "OAFIID:GNOME_Evolution_FolderInfo:" BASE_VERSION
#define MAIL_CONFIG_ID "OAFIID:GNOME_Evolution_MailConfig:" BASE_VERSION
#define WIZARD_ID "OAFIID:GNOME_Evolution_Mail_Wizard:" BASE_VERSION
@@ -64,8 +63,6 @@
bonobo_object_ref (BONOBO_OBJECT (component));
return BONOBO_OBJECT (component);
- } else if (strcmp(component_id, MAIL_CONTROL_ID) == 0) {
- return (BonoboObject *) mail_control_new ();
} else if (strcmp(component_id, MAIL_CONFIG_ID) == 0) {
return (BonoboObject *)g_object_new (evolution_mail_config_get_type (), NULL);
} else if (strcmp(component_id, WIZARD_ID) == 0) {
Index: mail/mail-component.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-component.c,v
retrieving revision 1.73
diff -u -r1.73 mail-component.c
--- mail/mail-component.c 19 Apr 2004 15:20:48 -0000 1.73
+++ mail/mail-component.c 20 Apr 2004 20:36:19 -0000
@@ -501,6 +501,7 @@
static void
impl_createControls (PortableServer_Servant servant,
Bonobo_Control *corba_tree_control,
+ Bonobo_Control *corba_info_control,
Bonobo_Control *corba_view_control,
Bonobo_Control *corba_statusbar_control,
CORBA_Environment *ev)
@@ -508,11 +509,14 @@
MailComponent *mail_component = MAIL_COMPONENT (bonobo_object_from_servant (servant));
MailComponentPrivate *priv = mail_component->priv;
BonoboControl *tree_control;
+ BonoboControl *info_control;
BonoboControl *view_control;
BonoboControl *statusbar_control;
- GtkWidget *tree_widget, *vbox, *info;
+ GtkWidget *tree_widget;
+ GtkWidget *info_widget;
GtkWidget *view_widget;
GtkWidget *statusbar_widget;
+ BonoboPropertyBag *pbag;
mail_session_set_interactive(TRUE);
mc_startup(mail_component);
@@ -533,20 +537,30 @@
gtk_widget_show (view_widget);
gtk_widget_show (statusbar_widget);
- vbox = gtk_vbox_new(FALSE, 0);
- info = e_info_label_new("stock_mail");
- e_info_label_set_info((EInfoLabel *)info, _("Mail"), "");
- gtk_box_pack_start((GtkBox *)vbox, info, FALSE, TRUE, 0);
- gtk_box_pack_start((GtkBox *)vbox, tree_widget, TRUE, TRUE, 0);
-
- gtk_widget_show(info);
- gtk_widget_show(vbox);
+ info_widget = e_info_label_new("evolution-inbox-mini.png");
+ e_info_label_set_info((EInfoLabel *)info_widget, _("Mail"), "");
+ gtk_widget_show(info_widget);
- tree_control = bonobo_control_new (vbox);
+ tree_control = bonobo_control_new (tree_widget);
+ info_control = bonobo_control_new (info_widget);
view_control = bonobo_control_new (view_widget);
statusbar_control = bonobo_control_new (statusbar_widget);
+ pbag = bonobo_property_bag_new (get_prop, set_prop, view_control);
+ bonobo_property_bag_add (pbag,
+ PROPERTY_FOLDER_URI,
+ PROPERTY_FOLDER_URI_IDX,
+ BONOBO_ARG_STRING,
+ NULL,
+ _("URI of the mail source that the view will display"),
+ 0);
+ bonobo_control_set_properties (view_control,
+ BONOBO_OBJREF (pbag),
+ NULL);
+ bonobo_object_unref (BONOBO_OBJECT (pbag));
+
*corba_tree_control = CORBA_Object_duplicate (BONOBO_OBJREF (tree_control), ev);
+ *corba_info_control = CORBA_Object_duplicate (BONOBO_OBJREF (info_control), ev);
*corba_view_control = CORBA_Object_duplicate (BONOBO_OBJREF (view_control), ev);
*corba_statusbar_control = CORBA_Object_duplicate (BONOBO_OBJREF (statusbar_control), ev);
@@ -556,8 +570,8 @@
g_signal_connect (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), info_widget);
+ g_signal_connect(view_widget, "loaded", G_CALLBACK(view_changed_cb), info_widget);
}
static CORBA_boolean
@@ -800,38 +814,6 @@
}
/* Public API. */
-BonoboControl *
-mail_control_new (void)
-{
- BonoboControl *view_control;
- GtkWidget *view_widget;
- BonoboPropertyBag *pbag;
-
- view_widget = em_folder_browser_new ();
- em_folder_view_set_statusbar ((EMFolderView *) view_widget, FALSE);
- gtk_widget_show (view_widget);
-
- view_control = bonobo_control_new (view_widget);
- pbag = bonobo_property_bag_new (get_prop, set_prop, view_control);
-
- bonobo_property_bag_add (pbag,
- PROPERTY_FOLDER_URI,
- PROPERTY_FOLDER_URI_IDX,
- BONOBO_ARG_STRING,
- NULL,
- _("URI of the mail source that the view will display"),
- 0);
-
- bonobo_control_set_properties (view_control,
- bonobo_object_corba_objref (BONOBO_OBJECT (pbag)),
- NULL);
- bonobo_object_unref (BONOBO_OBJECT (pbag));
-
- g_signal_connect (view_control, "activate", G_CALLBACK (view_control_activate_cb), view_widget);
-
- return view_control;
-}
-
MailComponent *
mail_component_peek (void)
{
Index: mail/mail-component.h
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-component.h,v
retrieving revision 1.12
diff -u -r1.12 mail-component.h
--- mail/mail-component.h 17 Feb 2004 21:02:56 -0000 1.12
+++ mail/mail-component.h 20 Apr 2004 20:36:19 -0000
@@ -64,8 +64,6 @@
GType mail_component_get_type (void);
-struct _BonoboControl *mail_control_new(void);
-
MailComponent *mail_component_peek (void);
/* NOTE: Using NULL as the component implies using the default component */
Index: shell/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/shell/ChangeLog,v
retrieving revision 1.1417
diff -u -r1.1417 ChangeLog
--- shell/ChangeLog 19 Apr 2004 21:49:10 -0000 1.1417
+++ shell/ChangeLog 20 Apr 2004 20:36:19 -0000
@@ -1,3 +1,15 @@
+2004-04-20 Dan Winship <danw ximian com>
+
+ * Evolution-Component.idl (createControls): add another out param
+ (info_control), and note explicitly that the caller is allowed to
+ destroy the controls it doesn't want and still use the others.
+
+ * e-shell-window.c (component_view_activate,
+ component_view_deactivate): Deal with info controls.
+ (init_view): Likewise
+ (switch_view): Likewise
+ (setup_widgets): Likewise (and pack it in with the sidebar)
+
2004-04-19 Jeffrey Stedfast <fejj ximian com>
* e-user-creatable-items-handler.c (ensure_menu_items): Same.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]