Commit 025b291f authored by Almer S. Tigelaar's avatar Almer S. Tigelaar Committed by Almer S. Tigelaar
Browse files

New, enable/disable all toolbars. Now works for bonobo toolbars too.

2001-05-07  Almer S. Tigelaar  <almer@gnome.org>

	* src/workbook-edit.c
	(workbook_edit_toolbars_set_sensitive): New, enable/disable
	all toolbars. Now works for bonobo toolbars too.
	(cb_thaw_ui_toolbar): Use toolbars_set_sensitive.
	(workbook_edit_set_sensitive): Idem.

	* src/GNOME_Gnumeric.xml: Add toolbar commands and set verbs
	on existing toolbars.
parent 0e75bea4
2001-05-07 Almer S. Tigelaar <almer@gnome.org>
* src/workbook-edit.c
(workbook_edit_toolbars_set_sensitive): New, enable/disable
all toolbars. Now works for bonobo toolbars too.
(cb_thaw_ui_toolbar): Use toolbars_set_sensitive.
(workbook_edit_set_sensitive): Idem.
* src/GNOME_Gnumeric.xml: Add toolbar commands and set verbs
on existing toolbars.
2001-05-07 Almer S. Tigelaar <almer@gnome.org>
* src/parser.y (gnumeric_expr_parser): Display which
......
2001-05-07 Almer S. Tigelaar <almer@gnome.org>
* src/workbook-edit.c
(workbook_edit_toolbars_set_sensitive): New, enable/disable
all toolbars. Now works for bonobo toolbars too.
(cb_thaw_ui_toolbar): Use toolbars_set_sensitive.
(workbook_edit_set_sensitive): Idem.
* src/GNOME_Gnumeric.xml: Add toolbar commands and set verbs
on existing toolbars.
2001-05-07 Almer S. Tigelaar <almer@gnome.org>
* src/parser.y (gnumeric_expr_parser): Display which
......
2001-05-07 Almer S. Tigelaar <almer@gnome.org>
* src/workbook-edit.c
(workbook_edit_toolbars_set_sensitive): New, enable/disable
all toolbars. Now works for bonobo toolbars too.
(cb_thaw_ui_toolbar): Use toolbars_set_sensitive.
(workbook_edit_set_sensitive): Idem.
* src/GNOME_Gnumeric.xml: Add toolbar commands and set verbs
on existing toolbars.
2001-05-07 Almer S. Tigelaar <almer@gnome.org>
* src/parser.y (gnumeric_expr_parser): Display which
......
2001-05-07 Almer S. Tigelaar <almer@gnome.org>
* src/workbook-edit.c
(workbook_edit_toolbars_set_sensitive): New, enable/disable
all toolbars. Now works for bonobo toolbars too.
(cb_thaw_ui_toolbar): Use toolbars_set_sensitive.
(workbook_edit_set_sensitive): Idem.
* src/GNOME_Gnumeric.xml: Add toolbar commands and set verbs
on existing toolbars.
2001-05-07 Almer S. Tigelaar <almer@gnome.org>
* src/parser.y (gnumeric_expr_parser): Display which
......
2001-05-07 Almer S. Tigelaar <almer@gnome.org>
* src/workbook-edit.c
(workbook_edit_toolbars_set_sensitive): New, enable/disable
all toolbars. Now works for bonobo toolbars too.
(cb_thaw_ui_toolbar): Use toolbars_set_sensitive.
(workbook_edit_set_sensitive): Idem.
* src/GNOME_Gnumeric.xml: Add toolbar commands and set verbs
on existing toolbars.
2001-05-07 Almer S. Tigelaar <almer@gnome.org>
* src/parser.y (gnumeric_expr_parser): Display which
......
......@@ -131,6 +131,10 @@
_label="_About..."
_tip="About this application"
pixtype="stock" pixname="About"/>
<cmd name="StandardToolbar" sensitive="1"/>
<cmd name="FormatToolbar" sensitive="1"/>
<cmd name="ObjectToolbar" sensitive="1"/>
</commands>
<menu>
......@@ -486,7 +490,7 @@
</menu>
<dockitem name="StandardToolbar" behavior="exclusive" homogeneous="0"
band_num="1" look="icon" relief="none">
band_num="1" look="icon" relief="none" verb="StandardToolbar">
<toolitem name="New"
pixtype="stock" pixname="New"
......@@ -598,7 +602,7 @@
</dockitem>
<dockitem name="FormatToolbar" band_num="2" behavior="exclusive"
homogeneous="0" look="icon" relief="none">
homogeneous="0" look="icon" relief="none" verb="FormatToolbar">
<control name="FontName"
_tip="Font selector"
......@@ -720,7 +724,7 @@
</dockitem>
<dockitem name="ObjectToolbar" band_num="2" placement="left"
homogeneous="0" look="icon" relief="none">
homogeneous="0" look="icon" relief="none" verb="ObjectToolbar">
<toolitem name="Label"
pixtype="stock" pixname="Gnumeric_Label"
......
......@@ -54,20 +54,46 @@ workbook_auto_complete_destroy (WorkbookControlGUI *wbcg)
}
static gboolean
cb_thaw_ui_toolbar (gpointer *data)
static void
workbook_edit_toolbars_set_sensitive (WorkbookControlGUI *wbcg, gboolean sensitive)
{
WorkbookControlGUI *wbcg = (WorkbookControlGUI *)data;
#ifdef ENABLE_BONOBO
CORBA_Environment ev;
#endif
static gboolean is_sensitive = TRUE;
/* Don't disable/enable again (prevent toolbar flickering) */
if (is_sensitive != sensitive)
is_sensitive = sensitive;
else
return;
g_return_val_if_fail (IS_WORKBOOK_CONTROL_GUI (wbcg), FALSE);
#ifdef ENABLE_BONOBO
#warning FIXME : how to quickly sensitize and desensitize a toolbar
CORBA_exception_init (&ev);
bonobo_ui_component_set_prop (wbcg->uic, "/commands/StandardToolbar",
"sensitive", sensitive ? "1" : "0", &ev);
bonobo_ui_component_set_prop (wbcg->uic, "/commands/FormatToolbar",
"sensitive", sensitive ? "1" : "0", &ev);
bonobo_ui_component_set_prop (wbcg->uic, "/commands/ObjectToolbar",
"sensitive", sensitive ? "1" : "0", &ev);
CORBA_exception_free (&ev);
#else
gtk_widget_set_sensitive (wbcg->standard_toolbar, TRUE);
gtk_widget_set_sensitive (wbcg->format_toolbar, TRUE);
gtk_widget_set_sensitive (wbcg->object_toolbar, TRUE);
gtk_widget_set_sensitive (wbcg->standard_toolbar, sensitive);
gtk_widget_set_sensitive (wbcg->format_toolbar, sensitive);
gtk_widget_set_sensitive (wbcg->object_toolbar, sensitive);
#endif
}
static gboolean
cb_thaw_ui_toolbar (gpointer *data)
{
WorkbookControlGUI *wbcg = (WorkbookControlGUI *)data;
g_return_val_if_fail (IS_WORKBOOK_CONTROL_GUI (wbcg), FALSE);
workbook_edit_toolbars_set_sensitive (wbcg, TRUE);
if (wbcg->ui_timer != 0) {
gtk_timeout_remove (wbcg->ui_timer);
wbcg->ui_timer = 0;
......@@ -99,15 +125,8 @@ workbook_edit_set_sensitive (WorkbookControlGUI *wbcg, gboolean flag1, gboolean
/* We put the re-enabling of the ui on a timer */
wbcg->ui_timer = gtk_timeout_add (UI_THAW_DELAY, (GtkFunction) cb_thaw_ui_toolbar,
wbcg);
} else {
#ifdef ENABLE_BONOBO
#warning FIXME : how to quickly sensitize and desensitize a toolbar
#else
gtk_widget_set_sensitive (wbcg->standard_toolbar, flag2);
gtk_widget_set_sensitive (wbcg->format_toolbar, flag2);
gtk_widget_set_sensitive (wbcg->object_toolbar, flag2);
#endif
}
} else
workbook_edit_toolbars_set_sensitive (wbcg, flag2);
}
gboolean
......
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