Commit 67608b01 authored by Michael Meeks's avatar Michael Meeks Committed by Michael Meeks
Browse files

Fix a load of evil embeddable-grid bugs, fix oaf activation.


Fix a load of evil embeddable-grid bugs, fix oaf activation.

2000-05-11  Michael Meeks  <michael@helixcode.com>

	* src/embeddable-grid.c (grid_view_activate): grab widget focus.

	* src/workbook-format-toolbar.c (workbook_feedback_set): make it
	cope with no format toolbar.

	* src/workbook.c (workbook_init): g_new0 for safety and to blank
	edit_line.

	* src/embeddable-grid.c (grid_view_new): set a sensible default
	size so we actually see something. (grid_view_activate): Fix with
	state boolean. (set_header_visibility): implement.
	(embeddable_grid_set_header_visibility): update.
	(grid_view_destroy): kill. (grid_view_new): kill evil private list
	of views.

	* gnumeric.oafinfo: another fix, evil bug from oaf conversion script.
parent 77cbe275
2000-05-11 Michael Meeks <michael@helixcode.com>
* src/embeddable-grid.c (grid_view_activate): grab widget focus.
* src/workbook-format-toolbar.c (workbook_feedback_set): make it
cope with no format toolbar.
* src/workbook.c (workbook_init): g_new0 for safety and to blank
edit_line.
* src/embeddable-grid.c (grid_view_new): set a sensible default
size so we actually see something. (grid_view_activate): Fix with
state boolean. (set_header_visibility): implement.
(embeddable_grid_set_header_visibility): update.
(grid_view_destroy): kill. (grid_view_new): kill evil private list
of views.
* gnumeric.oafinfo: another fix, evil bug from oaf conversion script.
2000-05-11 Jon K Hellan <hellan@acm.org>
* src/workbook.c (workbook_rename_sheet): Don't make "Duplicate
......
2000-05-11 Michael Meeks <michael@helixcode.com>
* src/embeddable-grid.c (grid_view_activate): grab widget focus.
* src/workbook-format-toolbar.c (workbook_feedback_set): make it
cope with no format toolbar.
* src/workbook.c (workbook_init): g_new0 for safety and to blank
edit_line.
* src/embeddable-grid.c (grid_view_new): set a sensible default
size so we actually see something. (grid_view_activate): Fix with
state boolean. (set_header_visibility): implement.
(embeddable_grid_set_header_visibility): update.
(grid_view_destroy): kill. (grid_view_new): kill evil private list
of views.
* gnumeric.oafinfo: another fix, evil bug from oaf conversion script.
2000-05-11 Jon K Hellan <hellan@acm.org>
* src/workbook.c (workbook_rename_sheet): Don't make "Duplicate
......
......@@ -43,7 +43,7 @@
<oaf_server iid="OAFIID:GOADID:Gnumeric:Grid:1.0:872b76ec-a9c7-4848-aa9e-c0c60b27d446"
type="factory"
location="OAFIID:GOADID:GNOME:Gnumeric:GridFactory:1.0:a1c2ad1c-33bd-4c42-b5d1-9a454f862873">
location="OAFIID:GOADID:Gnumeric:GridFactory:1.0:a1c2ad1c-33bd-4c42-b5d1-9a454f862873">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:GNOME/Gnumeric/Grid"/>
......
......@@ -43,7 +43,7 @@
<oaf_server iid="OAFIID:GOADID:Gnumeric:Grid:1.0:872b76ec-a9c7-4848-aa9e-c0c60b27d446"
type="factory"
location="OAFIID:GOADID:GNOME:Gnumeric:GridFactory:1.0:a1c2ad1c-33bd-4c42-b5d1-9a454f862873">
location="OAFIID:GOADID:Gnumeric:GridFactory:1.0:a1c2ad1c-33bd-4c42-b5d1-9a454f862873">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:GNOME/Gnumeric/Grid"/>
......
......@@ -43,7 +43,7 @@
<oaf_server iid="OAFIID:GOADID:Gnumeric:Grid:1.0:872b76ec-a9c7-4848-aa9e-c0c60b27d446"
type="factory"
location="OAFIID:GOADID:GNOME:Gnumeric:GridFactory:1.0:a1c2ad1c-33bd-4c42-b5d1-9a454f862873">
location="OAFIID:GOADID:Gnumeric:GridFactory:1.0:a1c2ad1c-33bd-4c42-b5d1-9a454f862873">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:GNOME/Gnumeric/Grid"/>
......
2000-05-11 Michael Meeks <michael@helixcode.com>
* src/embeddable-grid.c (grid_view_activate): grab widget focus.
* src/workbook-format-toolbar.c (workbook_feedback_set): make it
cope with no format toolbar.
* src/workbook.c (workbook_init): g_new0 for safety and to blank
edit_line.
* src/embeddable-grid.c (grid_view_new): set a sensible default
size so we actually see something. (grid_view_activate): Fix with
state boolean. (set_header_visibility): implement.
(embeddable_grid_set_header_visibility): update.
(grid_view_destroy): kill. (grid_view_new): kill evil private list
of views.
* gnumeric.oafinfo: another fix, evil bug from oaf conversion script.
2000-05-11 Jon K Hellan <hellan@acm.org>
* src/workbook.c (workbook_rename_sheet): Don't make "Duplicate
......
2000-05-11 Michael Meeks <michael@helixcode.com>
* src/embeddable-grid.c (grid_view_activate): grab widget focus.
* src/workbook-format-toolbar.c (workbook_feedback_set): make it
cope with no format toolbar.
* src/workbook.c (workbook_init): g_new0 for safety and to blank
edit_line.
* src/embeddable-grid.c (grid_view_new): set a sensible default
size so we actually see something. (grid_view_activate): Fix with
state boolean. (set_header_visibility): implement.
(embeddable_grid_set_header_visibility): update.
(grid_view_destroy): kill. (grid_view_new): kill evil private list
of views.
* gnumeric.oafinfo: another fix, evil bug from oaf conversion script.
2000-05-11 Jon K Hellan <hellan@acm.org>
* src/workbook.c (workbook_rename_sheet): Don't make "Duplicate
......
2000-05-11 Michael Meeks <michael@helixcode.com>
* src/embeddable-grid.c (grid_view_activate): grab widget focus.
* src/workbook-format-toolbar.c (workbook_feedback_set): make it
cope with no format toolbar.
* src/workbook.c (workbook_init): g_new0 for safety and to blank
edit_line.
* src/embeddable-grid.c (grid_view_new): set a sensible default
size so we actually see something. (grid_view_activate): Fix with
state boolean. (set_header_visibility): implement.
(embeddable_grid_set_header_visibility): update.
(grid_view_destroy): kill. (grid_view_new): kill evil private list
of views.
* gnumeric.oafinfo: another fix, evil bug from oaf conversion script.
2000-05-11 Jon K Hellan <hellan@acm.org>
* src/workbook.c (workbook_rename_sheet): Don't make "Duplicate
......
2000-05-11 Michael Meeks <michael@helixcode.com>
* src/embeddable-grid.c (grid_view_activate): grab widget focus.
* src/workbook-format-toolbar.c (workbook_feedback_set): make it
cope with no format toolbar.
* src/workbook.c (workbook_init): g_new0 for safety and to blank
edit_line.
* src/embeddable-grid.c (grid_view_new): set a sensible default
size so we actually see something. (grid_view_activate): Fix with
state boolean. (set_header_visibility): implement.
(embeddable_grid_set_header_visibility): update.
(grid_view_destroy): kill. (grid_view_new): kill evil private list
of views.
* gnumeric.oafinfo: another fix, evil bug from oaf conversion script.
2000-05-11 Jon K Hellan <hellan@acm.org>
* src/workbook.c (workbook_rename_sheet): Don't make "Duplicate
......
2000-05-11 Michael Meeks <michael@helixcode.com>
* src/embeddable-grid.c (grid_view_activate): grab widget focus.
* src/workbook-format-toolbar.c (workbook_feedback_set): make it
cope with no format toolbar.
* src/workbook.c (workbook_init): g_new0 for safety and to blank
edit_line.
* src/embeddable-grid.c (grid_view_new): set a sensible default
size so we actually see something. (grid_view_activate): Fix with
state boolean. (set_header_visibility): implement.
(embeddable_grid_set_header_visibility): update.
(grid_view_destroy): kill. (grid_view_new): kill evil private list
of views.
* gnumeric.oafinfo: another fix, evil bug from oaf conversion script.
2000-05-11 Jon K Hellan <hellan@acm.org>
* src/workbook.c (workbook_rename_sheet): Don't make "Duplicate
......
......@@ -43,7 +43,7 @@
<oaf_server iid="OAFIID:GOADID:Gnumeric:Grid:1.0:872b76ec-a9c7-4848-aa9e-c0c60b27d446"
type="factory"
location="OAFIID:GOADID:GNOME:Gnumeric:GridFactory:1.0:a1c2ad1c-33bd-4c42-b5d1-9a454f862873">
location="OAFIID:GOADID:Gnumeric:GridFactory:1.0:a1c2ad1c-33bd-4c42-b5d1-9a454f862873">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:GNOME/Gnumeric/Grid"/>
......
......@@ -41,24 +41,35 @@ Grid_get_sheet (PortableServer_Servant servant, CORBA_Environment *ev)
return CORBA_Object_duplicate (eg->sheet->priv->corba_server, ev);
}
static void
set_header_visibility (BonoboView *view, void *data)
{
EmbeddableGrid *eg = EMBEDDABLE_GRID (data);
GridView *grid_view = GRID_VIEW (view);
g_return_if_fail (eg != NULL);
g_return_if_fail (grid_view != NULL);
g_return_if_fail (grid_view->sheet_view != NULL);
sheet_view_set_header_visibility (
grid_view->sheet_view,
eg->show_col_title,
eg->show_row_title);
}
void
embeddable_grid_set_header_visibility (EmbeddableGrid *eg,
gboolean col_headers_visible,
gboolean row_headers_visible)
{
GList *l;
g_return_if_fail (eg != NULL);
g_return_if_fail (IS_EMBEDDABLE_GRID (eg));
for (l = eg->views; l; l = l->next){
GridView *grid_view = GRID_VIEW (l->data);
sheet_view_set_header_visibility (
grid_view->sheet_view,
col_headers_visible,
row_headers_visible);
}
eg->show_col_title = col_headers_visible;
eg->show_row_title = row_headers_visible;
bonobo_embeddable_foreach_view (BONOBO_EMBEDDABLE (eg),
set_header_visibility, eg);
}
static void
......@@ -296,29 +307,18 @@ grid_view_get_type (void)
}
/*
* Invoked by the "destroy" method. We use this to keep the
* EmbeddableGrid list of views up to date.
* Invoked by the "view_activate" method.
*/
static void
grid_view_destroy (GridView *grid_view)
grid_view_activate (GridView *grid_view, gboolean state)
{
EmbeddableGrid *eg = grid_view->embeddable;
if (state) {
g_return_if_fail (grid_view != NULL);
eg->views = g_list_remove (eg->views, grid_view);
}
gtk_widget_grab_focus (GTK_WIDGET (grid_view->sheet_view));
}
/*
* Invoked by the "view_activate" method.
*/
static void
grid_view_activate (GridView *grid_view)
{
/* FIXME: Do we need to do any more work here? */
g_warning ("FIXME: plug is now private, can't set_focus");
/* gtk_signal_emit_by_name (GTK_OBJECT (grid_view->view.plug), "set_focus",
grid_view->sheet_view->sheet_view);*/
bonobo_view_activate_notify (BONOBO_VIEW (grid_view), TRUE);
bonobo_view_activate_notify (BONOBO_VIEW (grid_view), state);
}
BonoboView *
......@@ -330,7 +330,7 @@ grid_view_new (EmbeddableGrid *eg)
grid_view = gtk_type_new (GRID_VIEW_TYPE);
corba_grid_view = bonobo_view_corba_object_create (BONOBO_OBJECT (grid_view));
if (corba_grid_view == CORBA_OBJECT_NIL){
if (corba_grid_view == CORBA_OBJECT_NIL) {
gtk_object_destroy (GTK_OBJECT (corba_grid_view));
return NULL;
}
......@@ -338,16 +338,13 @@ grid_view_new (EmbeddableGrid *eg)
grid_view->embeddable = eg;
grid_view->sheet_view = sheet_new_sheet_view (eg->sheet);
gtk_widget_show (GTK_WIDGET (grid_view->sheet_view));
g_warning ("FIXME: view_construct API changed");
gtk_widget_set_usize (GTK_WIDGET (grid_view->sheet_view), 320, 200);
bonobo_view_construct (
BONOBO_VIEW (grid_view),
corba_grid_view,
GTK_WIDGET (grid_view->sheet_view));
eg->views = g_list_prepend (eg->views, grid_view);
gtk_signal_connect (GTK_OBJECT (grid_view), "destroy",
GTK_SIGNAL_FUNC (grid_view_destroy), NULL);
gtk_signal_connect (GTK_OBJECT (grid_view), "activate",
GTK_SIGNAL_FUNC (grid_view_activate), NULL);
......
......@@ -26,9 +26,6 @@ struct _EmbeddableGrid {
/* The sheet, only one */
Sheet *sheet;
/* A list of all the views */
GList *views;
gboolean show_col_title;
gboolean show_row_title;
};
......
......@@ -1224,7 +1224,7 @@ sheet_load_cell_val (Sheet const *sheet)
g_return_if_fail (sheet != NULL);
g_return_if_fail (IS_SHEET (sheet));
entry = GTK_ENTRY(workbook_get_entry (sheet->workbook));
entry = GTK_ENTRY (workbook_get_entry (sheet->workbook));
cell = sheet_cell_get (sheet,
sheet->cursor.edit_pos.col,
sheet->cursor.edit_pos.row);
......@@ -1242,7 +1242,8 @@ sheet_load_cell_val (Sheet const *sheet)
gtk_entry_set_text (entry, text);
/* If this is part of an array we add '{' '}' and size information
/*
* If this is part of an array we add '{' '}' and size information
* to the display. That is not actually part of the parsable
* expression, but it is a useful extension to the simple '{' '}' that
* MS excel(tm) uses.
......
......@@ -730,9 +730,10 @@ workbook_feedback_set (Workbook *wb, MStyle *style)
gboolean font_set;
char size_str [40];
g_return_if_fail (style != NULL);
g_return_if_fail (wb != NULL);
g_return_if_fail (style != NULL);
g_return_if_fail (IS_WORKBOOK (wb));
g_return_if_fail (wb->priv->format_toolbar);
/* Handle font boldness */
g_return_if_fail (mstyle_is_element_set (style, MSTYLE_FONT_BOLD));
......
......@@ -2238,7 +2238,7 @@ workbook_init (GtkObject *object)
{
Workbook *wb = WORKBOOK (object);
wb->priv = g_new (WorkbookPrivate, 1);
wb->priv = g_new0 (WorkbookPrivate, 1);
wb->sheets = g_hash_table_new (gnumeric_strcase_hash, gnumeric_strcase_equal);
wb->current_sheet= NULL;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment