static void gl_mdi_finalize (GObject *object);
static void gl_mdi_app_created_cb (BonoboMDI *mdi, BonoboWindow *win);
-static void gl_mdi_set_app_toolbar_style (BonoboWindow *win);
-static void gl_mdi_set_app_statusbar_style (BonoboWindow *win);
+static void gl_mdi_set_app_main_toolbar_style (BonoboWindow *win);
+static void gl_mdi_set_app_drawing_toolbar_style (BonoboWindow *win);
+static void gl_mdi_set_app_statusbar_style (BonoboWindow *win);
static gint gl_mdi_add_child_cb (BonoboMDI *mdi, BonoboMDIChild *child);
static gint gl_mdi_add_view_cb (BonoboMDI *mdi, GtkWidget *view);
g_return_if_fail (ui_component != NULL);
/* Set the toolbar style according to prefs */
- gl_mdi_set_app_toolbar_style (win);
+ gl_mdi_set_app_main_toolbar_style (win);
/* Add listener fo the view menu */
- bonobo_ui_component_add_listener (ui_component, "ViewToolbar",
+ bonobo_ui_component_add_listener (ui_component, "ViewMainToolbar",
(BonoboUIListenerFn)gl_mdi_view_menu_item_toggled_cb,
(gpointer)win);
- bonobo_ui_component_add_listener (ui_component, "ToolbarSystem",
+ bonobo_ui_component_add_listener (ui_component, "MainToolbarSystem",
(BonoboUIListenerFn)gl_mdi_view_menu_item_toggled_cb,
(gpointer)win);
- bonobo_ui_component_add_listener (ui_component, "ToolbarIcon",
+ bonobo_ui_component_add_listener (ui_component, "MainToolbarIcon",
(BonoboUIListenerFn)gl_mdi_view_menu_item_toggled_cb,
(gpointer)win);
- bonobo_ui_component_add_listener (ui_component, "ToolbarIconText",
+ bonobo_ui_component_add_listener (ui_component, "MainToolbarIconText",
(BonoboUIListenerFn)gl_mdi_view_menu_item_toggled_cb,
(gpointer)win);
- bonobo_ui_component_add_listener (ui_component, "ToolbarTooltips",
+ bonobo_ui_component_add_listener (ui_component, "MainToolbarTooltips",
+ (BonoboUIListenerFn)gl_mdi_view_menu_item_toggled_cb,
+ (gpointer)win);
+
+ /* Set the toolbar style according to prefs */
+ gl_mdi_set_app_drawing_toolbar_style (win);
+
+ /* Add listener fo the view menu */
+ bonobo_ui_component_add_listener (ui_component, "ViewDrawingToolbar",
+ (BonoboUIListenerFn)gl_mdi_view_menu_item_toggled_cb,
+ (gpointer)win);
+
+ bonobo_ui_component_add_listener (ui_component, "DrawingToolbarSystem",
+ (BonoboUIListenerFn)gl_mdi_view_menu_item_toggled_cb,
+ (gpointer)win);
+ bonobo_ui_component_add_listener (ui_component, "DrawingToolbarIcon",
+ (BonoboUIListenerFn)gl_mdi_view_menu_item_toggled_cb,
+ (gpointer)win);
+ bonobo_ui_component_add_listener (ui_component, "DrawingToolbarIconText",
+ (BonoboUIListenerFn)gl_mdi_view_menu_item_toggled_cb,
+ (gpointer)win);
+ bonobo_ui_component_add_listener (ui_component, "DrawingToolbarTooltips",
(BonoboUIListenerFn)gl_mdi_view_menu_item_toggled_cb,
(gpointer)win);
s = (strcmp (state, "1") == 0);
- if ((strcmp (path, "ViewToolbar") == 0) &&
- (s != gl_prefs->toolbar_visible))
+ if ((strcmp (path, "ViewMainToolbar") == 0) &&
+ (s != gl_prefs->main_toolbar_visible))
{
- gl_prefs->toolbar_visible = s;
- gl_mdi_set_app_toolbar_style (win);
+ gl_prefs->main_toolbar_visible = s;
+ gl_mdi_set_app_main_toolbar_style (win);
return;
}
- if (s && (strcmp (path, "ToolbarSystem") == 0) &&
- (gl_prefs->toolbar_buttons_style != GL_TOOLBAR_SYSTEM))
+ if (s && (strcmp (path, "MainToolbarSystem") == 0) &&
+ (gl_prefs->main_toolbar_buttons_style != GL_TOOLBAR_SYSTEM))
{
- gl_prefs->toolbar_buttons_style = GL_TOOLBAR_SYSTEM;
- gl_mdi_set_app_toolbar_style (win);
+ gl_prefs->main_toolbar_buttons_style = GL_TOOLBAR_SYSTEM;
+ gl_mdi_set_app_main_toolbar_style (win);
return;
}
- if (s && (strcmp (path, "ToolbarIcon") == 0) &&
- (gl_prefs->toolbar_buttons_style != GL_TOOLBAR_ICONS))
+ if (s && (strcmp (path, "MainToolbarIcon") == 0) &&
+ (gl_prefs->main_toolbar_buttons_style != GL_TOOLBAR_ICONS))
{
- gl_prefs->toolbar_buttons_style = GL_TOOLBAR_ICONS;
- gl_mdi_set_app_toolbar_style (win);
+ gl_prefs->main_toolbar_buttons_style = GL_TOOLBAR_ICONS;
+ gl_mdi_set_app_main_toolbar_style (win);
return;
}
- if (s && (strcmp (path, "ToolbarIconText") == 0) &&
- (gl_prefs->toolbar_buttons_style != GL_TOOLBAR_ICONS_AND_TEXT))
+ if (s && (strcmp (path, "MainToolbarIconText") == 0) &&
+ (gl_prefs->main_toolbar_buttons_style != GL_TOOLBAR_ICONS_AND_TEXT))
{
- gl_prefs->toolbar_buttons_style = GL_TOOLBAR_ICONS_AND_TEXT;
- gl_mdi_set_app_toolbar_style (win);
+ gl_prefs->main_toolbar_buttons_style = GL_TOOLBAR_ICONS_AND_TEXT;
+ gl_mdi_set_app_main_toolbar_style (win);
+
+ return;
+ }
+
+ if ((strcmp (path, "MainToolbarTooltips") == 0) &&
+ (s != gl_prefs->main_toolbar_view_tooltips))
+ {
+ gl_prefs->main_toolbar_view_tooltips = s;
+ gl_mdi_set_app_main_toolbar_style (win);
return;
}
- if ((strcmp (path, "ToolbarTooltips") == 0) &&
- (s != gl_prefs->toolbar_view_tooltips))
+ if ((strcmp (path, "ViewDrawingToolbar") == 0) &&
+ (s != gl_prefs->drawing_toolbar_visible))
{
- gl_prefs->toolbar_view_tooltips = s;
- gl_mdi_set_app_toolbar_style (win);
+ gl_prefs->drawing_toolbar_visible = s;
+ gl_mdi_set_app_drawing_toolbar_style (win);
+
+ return;
+ }
+
+ if (s && (strcmp (path, "DrawingToolbarSystem") == 0) &&
+ (gl_prefs->drawing_toolbar_buttons_style != GL_TOOLBAR_SYSTEM))
+ {
+ gl_prefs->drawing_toolbar_buttons_style = GL_TOOLBAR_SYSTEM;
+ gl_mdi_set_app_drawing_toolbar_style (win);
+
+ return;
+ }
+
+ if (s && (strcmp (path, "DrawingToolbarIcon") == 0) &&
+ (gl_prefs->drawing_toolbar_buttons_style != GL_TOOLBAR_ICONS))
+ {
+ gl_prefs->drawing_toolbar_buttons_style = GL_TOOLBAR_ICONS;
+ gl_mdi_set_app_drawing_toolbar_style (win);
+
+ return;
+ }
+
+ if (s && (strcmp (path, "DrawingToolbarIconText") == 0) &&
+ (gl_prefs->drawing_toolbar_buttons_style != GL_TOOLBAR_ICONS_AND_TEXT))
+ {
+ gl_prefs->drawing_toolbar_buttons_style = GL_TOOLBAR_ICONS_AND_TEXT;
+ gl_mdi_set_app_drawing_toolbar_style (win);
+
+ return;
+ }
+
+ if ((strcmp (path, "DrawingToolbarTooltips") == 0) &&
+ (s != gl_prefs->drawing_toolbar_view_tooltips))
+ {
+ gl_prefs->drawing_toolbar_view_tooltips = s;
+ gl_mdi_set_app_drawing_toolbar_style (win);
return;
}
}
/*---------------------------------------------------------------------------*/
-/* Set toolbar style. */
+/* Set main toolbar style. */
/*---------------------------------------------------------------------------*/
static void
-gl_mdi_set_app_toolbar_style (BonoboWindow *win)
+gl_mdi_set_app_main_toolbar_style (BonoboWindow *win)
{
BonoboUIComponent *ui_component;
GConfClient *client;
/* Updated view menu */
gl_ui_set_verb_state (ui_component,
- "/commands/ViewToolbar",
- gl_prefs->toolbar_visible);
+ "/commands/ViewMainToolbar",
+ gl_prefs->main_toolbar_visible);
gl_ui_set_verb_sensitive (ui_component,
- "/commands/ToolbarSystem",
- gl_prefs->toolbar_visible);
+ "/commands/MainToolbarSystem",
+ gl_prefs->main_toolbar_visible);
gl_ui_set_verb_sensitive (ui_component,
- "/commands/ToolbarIcon",
- gl_prefs->toolbar_visible);
+ "/commands/MainToolbarIcon",
+ gl_prefs->main_toolbar_visible);
gl_ui_set_verb_sensitive (ui_component,
- "/commands/ToolbarIconText",
- gl_prefs->toolbar_visible);
+ "/commands/MainToolbarIconText",
+ gl_prefs->main_toolbar_visible);
gl_ui_set_verb_sensitive (ui_component,
- "/commands/ToolbarTooltips",
- gl_prefs->toolbar_visible);
+ "/commands/MainToolbarTooltips",
+ gl_prefs->main_toolbar_visible);
gl_ui_set_verb_state (ui_component,
- "/commands/ToolbarSystem",
- gl_prefs->toolbar_buttons_style == GL_TOOLBAR_SYSTEM);
+ "/commands/MainToolbarSystem",
+ gl_prefs->main_toolbar_buttons_style == GL_TOOLBAR_SYSTEM);
gl_ui_set_verb_state (ui_component,
- "/commands/ToolbarIcon",
- gl_prefs->toolbar_buttons_style == GL_TOOLBAR_ICONS);
+ "/commands/MainToolbarIcon",
+ gl_prefs->main_toolbar_buttons_style == GL_TOOLBAR_ICONS);
gl_ui_set_verb_state (ui_component,
- "/commands/ToolbarIconText",
- gl_prefs->toolbar_buttons_style == GL_TOOLBAR_ICONS_AND_TEXT);
+ "/commands/MainToolbarIconText",
+ gl_prefs->main_toolbar_buttons_style == GL_TOOLBAR_ICONS_AND_TEXT);
+
+ gl_ui_set_verb_state (ui_component,
+ "/commands/MainToolbarTooltips",
+ gl_prefs->main_toolbar_view_tooltips);
+
+
+ /* Actually update main_toolbar style */
+ bonobo_ui_component_set_prop (
+ ui_component, "/MainToolbar",
+ "tips", gl_prefs->main_toolbar_view_tooltips ? "1" : "0",
+ NULL);
+
+ switch (gl_prefs->main_toolbar_buttons_style)
+ {
+ case GL_TOOLBAR_SYSTEM:
+
+ client = gconf_client_get_default ();
+ if (client == NULL)
+ goto error;
+
+ labels = gconf_client_get_bool (client,
+ "/desktop/gnome/interface/toolbar-labels", NULL);
+
+ g_object_unref (G_OBJECT (client));
+
+ if (labels)
+ {
+ gl_debug (DEBUG_MDI, "SYSTEM: BOTH");
+ bonobo_ui_component_set_prop (
+ ui_component, "/MainToolbar", "look", "both", NULL);
+
+ }
+ else
+ {
+ gl_debug (DEBUG_MDI, "SYSTEM: ICONS");
+ bonobo_ui_component_set_prop (
+ ui_component, "/MainToolbar", "look", "icons", NULL);
+ }
+
+ break;
+
+ case GL_TOOLBAR_ICONS:
+ gl_debug (DEBUG_MDI, "GLABELS: ICONS");
+ bonobo_ui_component_set_prop (
+ ui_component, "/MainToolbar", "look", "icon", NULL);
+
+ break;
+
+ case GL_TOOLBAR_ICONS_AND_TEXT:
+ gl_debug (DEBUG_MDI, "GLABELS: ICONS_AND_TEXT");
+ bonobo_ui_component_set_prop (
+ ui_component, "/MainToolbar", "look", "both", NULL);
+
+ break;
+ default:
+ goto error;
+ break;
+ }
+
+ bonobo_ui_component_set_prop (
+ ui_component, "/MainToolbar",
+ "hidden", gl_prefs->main_toolbar_visible ? "0":"1", NULL);
+
+ error:
+ bonobo_ui_component_thaw (ui_component, NULL);
+
+ gl_debug (DEBUG_MDI, "END");
+}
+
+
+/*---------------------------------------------------------------------------*/
+/* Set drawing toolbar style. */
+/*---------------------------------------------------------------------------*/
+static void
+gl_mdi_set_app_drawing_toolbar_style (BonoboWindow *win)
+{
+ BonoboUIComponent *ui_component;
+ GConfClient *client;
+ gboolean labels;
+
+ gl_debug (DEBUG_MDI, "START");
+
+ g_return_if_fail (BONOBO_IS_WINDOW (win));
+
+ ui_component = bonobo_mdi_get_ui_component_from_window (win);
+ g_return_if_fail (ui_component != NULL);
+
+ bonobo_ui_component_freeze (ui_component, NULL);
+
+ /* Updated view menu */
+ gl_ui_set_verb_state (ui_component,
+ "/commands/ViewDrawingToolbar",
+ gl_prefs->drawing_toolbar_visible);
+
+ gl_ui_set_verb_sensitive (ui_component,
+ "/commands/DrawingToolbarSystem",
+ gl_prefs->drawing_toolbar_visible);
+ gl_ui_set_verb_sensitive (ui_component,
+ "/commands/DrawingToolbarIcon",
+ gl_prefs->drawing_toolbar_visible);
+ gl_ui_set_verb_sensitive (ui_component,
+ "/commands/DrawingToolbarIconText",
+ gl_prefs->drawing_toolbar_visible);
+ gl_ui_set_verb_sensitive (ui_component,
+ "/commands/DrawingToolbarTooltips",
+ gl_prefs->drawing_toolbar_visible);
+
+ gl_ui_set_verb_state (
+ ui_component,
+ "/commands/DrawingToolbarSystem",
+ gl_prefs->drawing_toolbar_buttons_style == GL_TOOLBAR_SYSTEM);
+
+ gl_ui_set_verb_state (
+ ui_component,
+ "/commands/DrawingToolbarIcon",
+ gl_prefs->drawing_toolbar_buttons_style == GL_TOOLBAR_ICONS);
+
+ gl_ui_set_verb_state (
+ ui_component,
+ "/commands/DrawingToolbarIconText",
+ gl_prefs->drawing_toolbar_buttons_style == GL_TOOLBAR_ICONS_AND_TEXT);
gl_ui_set_verb_state (ui_component,
- "/commands/ToolbarTooltips",
- gl_prefs->toolbar_view_tooltips);
+ "/commands/DrawingToolbarTooltips",
+ gl_prefs->drawing_toolbar_view_tooltips);
- /* Actually update toolbar style */
+ /* Actually update drawing_toolbar style */
bonobo_ui_component_set_prop (
- ui_component, "/Toolbar",
- "tips", gl_prefs->toolbar_view_tooltips ? "1" : "0",
+ ui_component, "/DrawingToolbar",
+ "tips", gl_prefs->drawing_toolbar_view_tooltips ? "1" : "0",
NULL);
- switch (gl_prefs->toolbar_buttons_style)
+ switch (gl_prefs->drawing_toolbar_buttons_style)
{
case GL_TOOLBAR_SYSTEM:
{
gl_debug (DEBUG_MDI, "SYSTEM: BOTH");
bonobo_ui_component_set_prop (
- ui_component, "/Toolbar", "look", "both", NULL);
+ ui_component, "/DrawingToolbar", "look", "both", NULL);
}
else
{
gl_debug (DEBUG_MDI, "SYSTEM: ICONS");
bonobo_ui_component_set_prop (
- ui_component, "/Toolbar", "look", "icons", NULL);
+ ui_component, "/DrawingToolbar", "look", "icons", NULL);
}
break;
case GL_TOOLBAR_ICONS:
gl_debug (DEBUG_MDI, "GLABELS: ICONS");
bonobo_ui_component_set_prop (
- ui_component, "/Toolbar", "look", "icon", NULL);
+ ui_component, "/DrawingToolbar", "look", "icon", NULL);
break;
case GL_TOOLBAR_ICONS_AND_TEXT:
gl_debug (DEBUG_MDI, "GLABELS: ICONS_AND_TEXT");
bonobo_ui_component_set_prop (
- ui_component, "/Toolbar", "look", "both", NULL);
+ ui_component, "/DrawingToolbar", "look", "both", NULL);
break;
default:
}
bonobo_ui_component_set_prop (
- ui_component, "/Toolbar",
- "hidden", gl_prefs->toolbar_visible ? "0":"1", NULL);
+ ui_component, "/DrawingToolbar",
+ "hidden", gl_prefs->drawing_toolbar_visible ? "0":"1", NULL);
error:
bonobo_ui_component_thaw (ui_component, NULL);
#define PREF_DEFAULT_FILL_COLOR "/default-fill-color"
-#define PREF_TOOLBAR_VISIBLE "/toolbar-visible"
-#define PREF_TOOLBAR_BUTTONS_STYLE "/toolbar-buttons-style"
-#define PREF_TOOLBAR_VIEW_TOOLTIPS "/toolbar-view-tooltips"
+#define PREF_MAIN_TOOLBAR_VISIBLE "/main-toolbar-visible"
+#define PREF_MAIN_TOOLBAR_BUTTONS_STYLE "/main-toolbar-buttons-style"
+#define PREF_MAIN_TOOLBAR_VIEW_TOOLTIPS "/main-toolbar-view-tooltips"
+
+#define PREF_DRAWING_TOOLBAR_VISIBLE "/drawing-toolbar-visible"
+#define PREF_DRAWING_TOOLBAR_BUTTONS_STYLE "/drawing-toolbar-buttons-style"
+#define PREF_DRAWING_TOOLBAR_VIEW_TOOLTIPS "/drawing-toolbar-view-tooltips"
#define PREF_MDI_MODE "/mdi-mode"
#define PREF_TABS_POSITION "/mdi-tabs-position"
NULL);
- /* Toolbar */
+ /* Main Toolbar */
+ gconf_client_set_bool (gconf_client,
+ BASE_KEY PREF_MAIN_TOOLBAR_VISIBLE,
+ gl_prefs->main_toolbar_visible,
+ NULL);
+
+ gconf_client_set_int (gconf_client,
+ BASE_KEY PREF_MAIN_TOOLBAR_BUTTONS_STYLE,
+ gl_prefs->main_toolbar_buttons_style,
+ NULL);
+
+ gconf_client_set_bool (gconf_client,
+ BASE_KEY PREF_MAIN_TOOLBAR_VIEW_TOOLTIPS,
+ gl_prefs->main_toolbar_view_tooltips,
+ NULL);
+
+ /* Drawing Toolbar */
gconf_client_set_bool (gconf_client,
- BASE_KEY PREF_TOOLBAR_VISIBLE,
- gl_prefs->toolbar_visible,
+ BASE_KEY PREF_DRAWING_TOOLBAR_VISIBLE,
+ gl_prefs->drawing_toolbar_visible,
NULL);
gconf_client_set_int (gconf_client,
- BASE_KEY PREF_TOOLBAR_BUTTONS_STYLE,
- gl_prefs->toolbar_buttons_style,
+ BASE_KEY PREF_DRAWING_TOOLBAR_BUTTONS_STYLE,
+ gl_prefs->drawing_toolbar_buttons_style,
NULL);
gconf_client_set_bool (gconf_client,
- BASE_KEY PREF_TOOLBAR_VIEW_TOOLTIPS,
- gl_prefs->toolbar_view_tooltips,
+ BASE_KEY PREF_DRAWING_TOOLBAR_VIEW_TOOLTIPS,
+ gl_prefs->drawing_toolbar_view_tooltips,
NULL);
DEFAULT_FILL_COLOR);
- /* User Inferface/Toolbar */
- gl_prefs->toolbar_visible =
+ /* User Inferface/Main Toolbar */
+ gl_prefs->main_toolbar_visible =
+ get_bool (gconf_client,
+ BASE_KEY PREF_MAIN_TOOLBAR_VISIBLE,
+ TRUE);
+
+ gl_prefs->main_toolbar_buttons_style =
+ get_int (gconf_client,
+ BASE_KEY PREF_MAIN_TOOLBAR_BUTTONS_STYLE,
+ GL_TOOLBAR_SYSTEM);
+
+ gl_prefs->main_toolbar_view_tooltips =
+ get_bool (gconf_client,
+ BASE_KEY PREF_MAIN_TOOLBAR_VIEW_TOOLTIPS,
+ TRUE);
+
+ /* User Inferface/Drawing Toolbar */
+ gl_prefs->drawing_toolbar_visible =
get_bool (gconf_client,
- BASE_KEY PREF_TOOLBAR_VISIBLE,
+ BASE_KEY PREF_DRAWING_TOOLBAR_VISIBLE,
TRUE);
- gl_prefs->toolbar_buttons_style =
+ gl_prefs->drawing_toolbar_buttons_style =
get_int (gconf_client,
- BASE_KEY PREF_TOOLBAR_BUTTONS_STYLE,
+ BASE_KEY PREF_DRAWING_TOOLBAR_BUTTONS_STYLE,
GL_TOOLBAR_SYSTEM);
- gl_prefs->toolbar_view_tooltips =
+ gl_prefs->drawing_toolbar_view_tooltips =
get_bool (gconf_client,
- BASE_KEY PREF_TOOLBAR_VIEW_TOOLTIPS,
+ BASE_KEY PREF_DRAWING_TOOLBAR_VIEW_TOOLTIPS,
TRUE);