diff options
author | Ettore Perazzoli <ettore@src.gnome.org> | 2001-08-19 03:59:59 +0800 |
---|---|---|
committer | Ettore Perazzoli <ettore@src.gnome.org> | 2001-08-19 03:59:59 +0800 |
commit | 9f79315277d064fc533e1741fb43a0c540057105 (patch) | |
tree | 9d0eed6f9af2d3216c47dfd49f9446c0fee03334 /shell/e-shell-view-menu.c | |
parent | 60d36d71771eb158e04fa1e2eb073f073d13a9b0 (diff) | |
download | gsoc2013-evolution-9f79315277d064fc533e1741fb43a0c540057105.tar.gz gsoc2013-evolution-9f79315277d064fc533e1741fb43a0c540057105.tar.zst gsoc2013-evolution-9f79315277d064fc533e1741fb43a0c540057105.zip |
New, replacing `shortcut_bar_mode_changed_cb'.
* e-shell-view-menu.c (shortcut_bar_visibility_changed_cb): New,
replacing `shortcut_bar_mode_changed_cb'.
(folder_bar_visibility_changed_cb): New, replacing
`folder_bar_mode_changed_cb'.
(command_toggle_folder_bar): Use `e_shell_view_show_folder_bar()'
instead of `e_shell_view_set_folder_bar_mode()'.
(command_toggle_shortcut_bar): Use
`e_shell_view_show_shortcut_bar()' instead of
`e_shell_view_set_shortcut_bar_mode()'.
(e_shell_view_menu_setup): Updated for the
"shortcut_bar_visibility_changed" and
"folder_bar_visibility_changed" signals and the above changes.
* e-shell-view.c: New member `folder_bar_popup' in
`EShellViewPrivate'. Replaced `folder_bar_mode' and
`shortcut_bar_mode' with `folder_bar_shown' and
`shortcut_bar_shown', respectively.
(init): Updated to initialize these correctly.
(reparent): New helper function.
(reparent_storage_set_view_box_and_destroy_popup): New helper
function.
(popdown_transient_folder_bar): Updated to use the
`folder_bar_popup'.
(folder_bar_popup_map_callback): Renamed from
`storage_set_view_box_map_cb'.
(e_shell_view_set_shortcut_bar_mode): Removed.
(e_shell_view_set_folder_bar_mode): Removed.
(e_shell_view_show_shortcut_bar): New. All the calls to
`e_shell_view_set_shortcut_bar_mode()' replaced with calls to this
one.
(e_shell_view_show_folder_bar): New. All the calls to
`e_shell_view_set_folder_bar_mode()' replaced with calls to this
one.
(e_shell_view_folder_bar_shown): New. All the calls to
`e_shell_view_get_folder_bar_mode()' replaced with calls to this
one.
(e_shell_view_shortcut_bar_shown): New. All the calls to
`e_shell_view_get_shortcut_bar_mode()' replaced with calls to this
one.
(class_init): Replace signal `folder_bar_mode_changed' with
`folder_bar_visibility_changed' and `shortcut_bar_mode_changed'
with `shortcut_visibility_changed'.
(e_shell_view_save_settings): Use keys "ShortcutBarShown" and
"FolderBarShown" instead of "ShortcutBarMode" and "FolderBarMode",
respectively.
(e_shell_view_load_settings): Likewise.
* e-shell-view.h: Removed enum `EShellViewSubwindowMode'. Renamed
signal `shortcut_bar_mode_changed' to
`shortcut_bar_visibility_changed' and `folder_bar_mode_changed' to
`folder_bar_visibility_changed'.
svn path=/trunk/; revision=12203
Diffstat (limited to 'shell/e-shell-view-menu.c')
-rw-r--r-- | shell/e-shell-view-menu.c | 62 |
1 files changed, 25 insertions, 37 deletions
diff --git a/shell/e-shell-view-menu.c b/shell/e-shell-view-menu.c index f2fd333547..f62d443091 100644 --- a/shell/e-shell-view-menu.c +++ b/shell/e-shell-view-menu.c @@ -96,18 +96,18 @@ const char *authors[] = { /* EShellView callbacks. */ static void -shortcut_bar_mode_changed_cb (EShellView *shell_view, - EShellViewSubwindowMode new_mode, - void *data) +shortcut_bar_visibility_changed_cb (EShellView *shell_view, + gboolean visible, + void *data) { BonoboUIComponent *uic; const char *path; - char *txt; + const char *txt; - if (new_mode == E_SHELL_VIEW_SUBWINDOW_HIDDEN) - txt = "0"; - else + if (visible) txt = "1"; + else + txt = "0"; path = (const char *) data; uic = e_shell_view_get_bonobo_ui_component (shell_view); @@ -116,18 +116,18 @@ shortcut_bar_mode_changed_cb (EShellView *shell_view, } static void -folder_bar_mode_changed_cb (EShellView *shell_view, - EShellViewSubwindowMode new_mode, - void *data) +folder_bar_visibility_changed_cb (EShellView *shell_view, + gboolean visible, + void *data) { BonoboUIComponent *uic; const char *path; - char *txt; + const char *txt; - if (new_mode == E_SHELL_VIEW_SUBWINDOW_HIDDEN) - txt = "0"; - else + if (visible) txt = "1"; + else + txt = "0"; path = (const char *) data; uic = e_shell_view_get_bonobo_ui_component (shell_view); @@ -223,7 +223,7 @@ command_about_box (BonoboUIComponent *uih, "within the GNOME desktop environment."), NULL); gtk_signal_connect(GTK_OBJECT(about_box), "destroy", - GTK_SIGNAL_FUNC(zero_pointer), &about_box); + GTK_SIGNAL_FUNC (zero_pointer), &about_box); gtk_widget_show(about_box); g_free (version); @@ -246,21 +246,15 @@ command_toggle_folder_bar (BonoboUIComponent *component, gpointer user_data) { EShellView *shell_view; - EShellViewSubwindowMode mode; gboolean show; if (type != Bonobo_UIComponent_STATE_CHANGED) return; shell_view = E_SHELL_VIEW (user_data); - show = atoi (state); - if (show) - mode = E_SHELL_VIEW_SUBWINDOW_STICKY; - else - mode = E_SHELL_VIEW_SUBWINDOW_HIDDEN; - e_shell_view_set_folder_bar_mode (shell_view, mode); + e_shell_view_show_folder_bar (shell_view, show); } static void @@ -271,7 +265,6 @@ command_toggle_shortcut_bar (BonoboUIComponent *component, gpointer user_data) { EShellView *shell_view; - EShellViewSubwindowMode mode; gboolean show; if (type != Bonobo_UIComponent_STATE_CHANGED) @@ -281,12 +274,7 @@ command_toggle_shortcut_bar (BonoboUIComponent *component, show = atoi (state); - if (show) - mode = E_SHELL_VIEW_SUBWINDOW_STICKY; - else - mode = E_SHELL_VIEW_SUBWINDOW_HIDDEN; - - e_shell_view_set_shortcut_bar_mode (shell_view, mode); + e_shell_view_show_shortcut_bar (shell_view, show); } @@ -772,18 +760,18 @@ e_shell_view_menu_setup (EShellView *shell_view) e_pixmaps_update (uic, pixmaps); - gtk_signal_connect (GTK_OBJECT (shell_view), "shortcut_bar_mode_changed", - GTK_SIGNAL_FUNC (shortcut_bar_mode_changed_cb), + gtk_signal_connect (GTK_OBJECT (shell_view), "shortcut_bar_visibility_changed", + GTK_SIGNAL_FUNC (shortcut_bar_visibility_changed_cb), SHORTCUT_BAR_TOGGLE_PATH); - gtk_signal_connect (GTK_OBJECT (shell_view), "folder_bar_mode_changed", - GTK_SIGNAL_FUNC (folder_bar_mode_changed_cb), + gtk_signal_connect (GTK_OBJECT (shell_view), "folder_bar_visibility_changed", + GTK_SIGNAL_FUNC (folder_bar_visibility_changed_cb), FOLDER_BAR_TOGGLE_PATH); /* Initialize the toggles. Yeah, this is, well, yuck. */ - folder_bar_mode_changed_cb (shell_view, e_shell_view_get_folder_bar_mode (shell_view), - FOLDER_BAR_TOGGLE_PATH); - shortcut_bar_mode_changed_cb (shell_view, e_shell_view_get_shortcut_bar_mode (shell_view), - SHORTCUT_BAR_TOGGLE_PATH); + folder_bar_visibility_changed_cb (shell_view, e_shell_view_folder_bar_shown (shell_view), + FOLDER_BAR_TOGGLE_PATH); + shortcut_bar_visibility_changed_cb (shell_view, e_shell_view_shortcut_bar_shown (shell_view), + SHORTCUT_BAR_TOGGLE_PATH); /* Set up the work online / work offline menu item. */ gtk_signal_connect_while_alive (GTK_OBJECT (shell), "line_status_changed", |