summaryrefslogtreecommitdiff
path: root/src/nautilus-window.c
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimo@endlessm.com>2014-01-06 10:57:20 -0800
committerCosimo Cecchi <cosimo@endlessm.com>2014-01-06 10:57:20 -0800
commiteaa67078299c20fa8eb139e5161a101d3f089efb (patch)
tree3da7ea9bcd7f22cdec68170fc55368a2dde4070f /src/nautilus-window.c
parentdbef899459767acd12a24b90e4542bee89ef2925 (diff)
downloadnautilus-eaa67078299c20fa8eb139e5161a101d3f089efb.tar.gz
window: sync initial state for start-with-sidebar action
When we construct the NautilusWindow, we show or hide the sidebar according to the value in GSettings, but we never sync the initial state of the corresponding toggle action. Based on a patch by Paul Menzel <paulepanter@users.sourceforge.net> https://bugzilla.gnome.org/show_bug.cgi?id=699165
Diffstat (limited to 'src/nautilus-window.c')
-rw-r--r--src/nautilus-window.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index 8e24f4fc3..b3c338616 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -458,6 +458,8 @@ nautilus_window_set_initial_window_geometry (NautilusWindow *window)
GdkScreen *screen;
guint max_width_for_screen, max_height_for_screen;
guint default_width, default_height;
+ gboolean show_sidebar;
+ GtkAction *action;
screen = gtk_window_get_screen (GTK_WINDOW (window));
@@ -472,6 +474,17 @@ nautilus_window_set_initial_window_geometry (NautilusWindow *window)
max_width_for_screen),
MIN (default_height,
max_height_for_screen));
+
+ show_sidebar = g_settings_get_boolean (nautilus_window_state, NAUTILUS_WINDOW_STATE_START_WITH_SIDEBAR);
+ action = gtk_action_group_get_action (window->details->main_action_group,
+ NAUTILUS_ACTION_SHOW_HIDE_SIDEBAR);
+ gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), show_sidebar);
+
+ if (show_sidebar) {
+ nautilus_window_show_sidebar (window);
+ } else {
+ nautilus_window_hide_sidebar (window);
+ }
}
static gboolean
@@ -1520,12 +1533,6 @@ nautilus_window_constructed (GObject *self)
slot = nautilus_window_open_slot (window, 0);
nautilus_window_set_active_slot (window, slot);
- if (g_settings_get_boolean (nautilus_window_state, NAUTILUS_WINDOW_STATE_START_WITH_SIDEBAR)) {
- nautilus_window_show_sidebar (window);
- } else {
- nautilus_window_hide_sidebar (window);
- }
-
window->details->bookmarks_id =
g_signal_connect_swapped (nautilus_application_get_bookmarks (application), "changed",
G_CALLBACK (nautilus_window_sync_bookmarks), window);