type="toggle" state="1"
/>
+ <cmd name="ViewPropertyToolbar"
+ _label="_Property Toolbar"
+ _tip="Change the visibility of the property toolbar in the current window"
+ type="toggle" state="0"
+ />
+
+ <cmd name="PropertyToolbarTooltips"
+ id="PropertyToolbarTooltips"
+ _label="Show _Tooltips"
+ _tip="Show tooltips in the property toolbar"
+ type="toggle" state="1"
+ />
+
<cmd name="ViewGrid"
_label="_Grid"
_tip="Change the visibility of the grid in the current window"
verb=""
/>
+ <menuitem name="ViewPropertyToolbar"
+ id="ViewPropertyToolbar"
+ verb=""
+ />
+
<separator />
<submenu name="CustomizeMainToolbar"
</submenu>
+ <submenu name="CustomizePropertyToolbar"
+ _label="Customize Property Toolbar"
+ >
+
+ <menuitem name="PropertyToolbarTooltips"
+ verb=""
+ />
+
+ </submenu>
+
<separator />
<menuitem name="ViewGrid"
#define PREF_DRAWING_TOOLBAR_BUTTONS_STYLE "/drawing-toolbar-buttons-style"
#define PREF_DRAWING_TOOLBAR_VIEW_TOOLTIPS "/drawing-toolbar-view-tooltips"
+#define PREF_PROPERTY_TOOLBAR_VISIBLE "/property-toolbar-visible"
+#define PREF_PROPERTY_TOOLBAR_VIEW_TOOLTIPS "/property-toolbar-view-tooltips"
+
#define PREF_GRID_VISIBLE "/grid-visible"
#define PREF_MARKUP_VISIBLE "/markup-visible"
prefs_model->drawing_toolbar_view_tooltips,
NULL);
+ /* Property Toolbar */
+ gconf_client_set_bool (prefs_model->gconf_client,
+ BASE_KEY PREF_PROPERTY_TOOLBAR_VISIBLE,
+ prefs_model->property_toolbar_visible,
+ NULL);
+
+ gconf_client_set_bool (prefs_model->gconf_client,
+ BASE_KEY PREF_PROPERTY_TOOLBAR_VIEW_TOOLTIPS,
+ prefs_model->property_toolbar_view_tooltips,
+ NULL);
+
/* View properties */
gconf_client_set_bool (prefs_model->gconf_client,
BASE_KEY PREF_GRID_VISIBLE,
BASE_KEY PREF_DRAWING_TOOLBAR_VIEW_TOOLTIPS,
TRUE);
+ /* User Inferface/Property Toolbar */
+ prefs_model->property_toolbar_visible =
+ get_bool (prefs_model->gconf_client,
+ BASE_KEY PREF_PROPERTY_TOOLBAR_VISIBLE,
+ TRUE);
+
+ prefs_model->property_toolbar_view_tooltips =
+ get_bool (prefs_model->gconf_client,
+ BASE_KEY PREF_PROPERTY_TOOLBAR_VIEW_TOOLTIPS,
+ TRUE);
+
/* View properties */
prefs_model->grid_visible =
static void set_app_drawing_toolbar_style (BonoboUIComponent *ui_component);
+static void set_app_property_toolbar_style (BonoboUIComponent *ui_component);
+
static void set_view_style (BonoboUIComponent *ui_component);
(BonoboUIListenerFn)view_menu_item_toggled_cb,
(gpointer)win);
+ /* Set the toolbar style according to prefs */
+ set_app_property_toolbar_style (ui_component);
+
+ /* Add listener for the view menu */
+ bonobo_ui_component_add_listener (ui_component, "ViewPropertyToolbar",
+ (BonoboUIListenerFn)view_menu_item_toggled_cb,
+ (gpointer)win);
+
+ bonobo_ui_component_add_listener (ui_component, "PropertyToolbarTooltips",
+ (BonoboUIListenerFn)view_menu_item_toggled_cb,
+ (gpointer)win);
+
/* Set view grid and markup visibility according to prefs */
set_view_style (ui_component);
return;
}
+ if (strcmp (path, "ViewPropertyToolbar") == 0)
+ {
+ gl_prefs->property_toolbar_visible = s;
+ set_app_property_toolbar_style (ui_component);
+ gl_prefs_model_save_settings (gl_prefs);
+
+ return;
+ }
+
+ if (strcmp (path, "PropertyToolbarTooltips") == 0)
+ {
+ gl_prefs->property_toolbar_view_tooltips = s;
+ set_app_property_toolbar_style (ui_component);
+ gl_prefs_model_save_settings (gl_prefs);
+
+ return;
+ }
+
if (strcmp (path, "ViewGrid") == 0)
{
gl_prefs->grid_visible = s;
gl_debug (DEBUG_UI, "END");
}
+/*---------------------------------------------------------------------------*/
+/* PRIVATE. Set property toolbar style. */
+/*---------------------------------------------------------------------------*/
+static void
+set_app_property_toolbar_style (BonoboUIComponent *ui_component)
+{
+ GConfClient *client;
+ gboolean labels;
+
+ gl_debug (DEBUG_UI, "START");
+
+ g_return_if_fail (BONOBO_IS_UI_COMPONENT(ui_component));
+
+ bonobo_ui_component_freeze (ui_component, NULL);
+
+ /* Updated view menu */
+ gl_ui_util_set_verb_state (ui_component,
+ "/commands/ViewPropertyToolbar",
+ gl_prefs->property_toolbar_visible);
+
+ gl_ui_util_set_verb_sensitive (ui_component,
+ "/commands/PropertyToolbarTooltips",
+ gl_prefs->property_toolbar_visible);
+
+ gl_ui_util_set_verb_state (ui_component,
+ "/commands/PropertyToolbarTooltips",
+ gl_prefs->property_toolbar_view_tooltips);
+
+
+ /* Actually update property_toolbar style */
+ bonobo_ui_component_set_prop (
+ ui_component, "/PropertyToolbar",
+ "tips", gl_prefs->property_toolbar_view_tooltips ? "1" : "0",
+ NULL);
+
+ bonobo_ui_component_set_prop (
+ ui_component, "/PropertyToolbar",
+ "hidden", gl_prefs->property_toolbar_visible ? "0":"1", NULL);
+
+ bonobo_ui_component_thaw (ui_component, NULL);
+
+ gl_debug (DEBUG_UI, "END");
+}
+
/*---------------------------------------------------------------------------*/
/* PRIVATE. Set visibility of grid and markup. */
/*---------------------------------------------------------------------------*/