summaryrefslogtreecommitdiff
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 11:06:27 -0800
commit7a76c2dad619494ac04a0713d56882a3b141384c (patch)
tree3de83ef19a94896d1954573e6b0165fa8ef82929
parentf420c26e7295f872f41cb17018d1e230ebf5bfb4 (diff)
downloadnautilus-7a76c2dad619494ac04a0713d56882a3b141384c.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
-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);