[nautilus] Conver window-state to gsettings



commit c6a6fb894cf9bd12fbd12977ab5ccd9e58540ae1
Author: Alexander Larsson <alexl redhat com>
Date:   Thu Jul 22 17:32:57 2010 +0200

    Conver window-state to gsettings

 libnautilus-private/nautilus-global-preferences.c |   29 +-----
 libnautilus-private/nautilus-global-preferences.h |   22 ++--
 src/nautilus-application.c                        |   10 +-
 src/nautilus-navigation-window-pane.c             |   12 +-
 src/nautilus-navigation-window.c                  |  117 +++++++++------------
 5 files changed, 71 insertions(+), 119 deletions(-)
---
diff --git a/libnautilus-private/nautilus-global-preferences.c b/libnautilus-private/nautilus-global-preferences.c
index 179e174..f408f9a 100644
--- a/libnautilus-private/nautilus-global-preferences.c
+++ b/libnautilus-private/nautilus-global-preferences.c
@@ -248,34 +248,6 @@ static const PreferenceDefault preference_defaults[] = {
 	  NULL, NULL,
 	  NULL
 	},
-	{ NAUTILUS_PREFERENCES_START_WITH_TOOLBAR,
-	  PREFERENCE_BOOLEAN,
-	  GINT_TO_POINTER (TRUE)
-	},
-	{ NAUTILUS_PREFERENCES_START_WITH_LOCATION_BAR,
-	  PREFERENCE_BOOLEAN,
-	  GINT_TO_POINTER (TRUE)
-	},
-	{ NAUTILUS_PREFERENCES_ALWAYS_USE_LOCATION_ENTRY,
-	  PREFERENCE_BOOLEAN,
-	  GINT_TO_POINTER (FALSE)
-	},
-	{ NAUTILUS_PREFERENCES_START_WITH_STATUS_BAR,
-	  PREFERENCE_BOOLEAN,
-	  GINT_TO_POINTER (TRUE)
-	},
-	{ NAUTILUS_PREFERENCES_START_WITH_SIDEBAR,
-	  PREFERENCE_BOOLEAN,
-	  GINT_TO_POINTER (TRUE)
-	},
-	{ NAUTILUS_PREFERENCES_NAVIGATION_WINDOW_SAVED_GEOMETRY,
-	  PREFERENCE_STRING,
-	  ""
-	},
-	{ NAUTILUS_PREFERENCES_NAVIGATION_WINDOW_MAXIMIZED,
-	  PREFERENCE_BOOLEAN,
-	  GINT_TO_POINTER (FALSE)
-	},
 	{ NAUTILUS_PREFERENCES_TREE_SHOW_ONLY_DIRECTORIES,
 	  PREFERENCE_BOOLEAN,
 	  GINT_TO_POINTER (TRUE)
@@ -660,6 +632,7 @@ nautilus_global_preferences_init (void)
 
 	nautilus_preferences = g_settings_new("org.gnome.nautilus.preferences");
 	nautilus_media_preferences = g_settings_new("org.gnome.media-handling");
+	nautilus_window_state = g_settings_new("org.gnome.nautilus.window-state");
 
 	/* Set up storage for values accessed in this file */
 	eel_preferences_add_callback (NAUTILUS_PREFERENCES_ICON_VIEW_DEFAULT_SORT_ORDER_OR_MANUAL_LAYOUT,
diff --git a/libnautilus-private/nautilus-global-preferences.h b/libnautilus-private/nautilus-global-preferences.h
index 152df6e..8e25b4e 100644
--- a/libnautilus-private/nautilus-global-preferences.h
+++ b/libnautilus-private/nautilus-global-preferences.h
@@ -44,9 +44,6 @@ G_BEGIN_DECLS
 #define NAUTILUS_PREFERENCES_SIDE_PANE_BACKGROUND_COLOR         "side-pane-background-color"
 #define NAUTILUS_PREFERENCES_SIDE_PANE_BACKGROUND_URI           "side-pane-background-uri"
 
-/* How wide the sidebar is (or how wide it will be when expanded) */
-#define NAUTILUS_PREFERENCES_SIDEBAR_WIDTH			"sidebar-width"
-
 /* Automount options */
 #define NAUTILUS_PREFERENCES_MEDIA_AUTOMOUNT	                "automount"
 #define NAUTILUS_PREFERENCES_MEDIA_AUTOMOUNT_OPEN		"automount-open"
@@ -105,15 +102,17 @@ typedef enum
 #define NAUTILUS_PREFERENCES_ALWAYS_USE_BROWSER			"always-use-browser"
 #define NAUTILUS_PREFERENCES_NEW_TAB_POSITION			"tabs-open-position"
 
+#define NAUTILUS_PREFERENCES_ALWAYS_USE_LOCATION_ENTRY		"always-use-location-entry"
+
 /* Which views should be displayed for new windows */
-#define NAUTILUS_PREFERENCES_START_WITH_LOCATION_BAR		"preferences/start_with_location_bar"
-#define NAUTILUS_PREFERENCES_ALWAYS_USE_LOCATION_ENTRY		"preferences/always_use_location_entry"
-#define NAUTILUS_PREFERENCES_START_WITH_STATUS_BAR		"preferences/start_with_status_bar"
-#define NAUTILUS_PREFERENCES_START_WITH_SIDEBAR		 	"preferences/start_with_sidebar"
-#define NAUTILUS_PREFERENCES_START_WITH_TOOLBAR			"preferences/start_with_toolbar"
-#define NAUTILUS_PREFERENCES_SIDE_PANE_VIEW                     "preferences/side_pane_view"
-#define NAUTILUS_PREFERENCES_NAVIGATION_WINDOW_SAVED_GEOMETRY 	"preferences/navigation_window_saved_geometry"
-#define NAUTILUS_PREFERENCES_NAVIGATION_WINDOW_MAXIMIZED        "preferences/navigation_window_saved_maximized"
+#define NAUTILUS_WINDOW_STATE_START_WITH_LOCATION_BAR		"start-with-location-bar"
+#define NAUTILUS_WINDOW_STATE_START_WITH_STATUS_BAR		"start-with-status-bar"
+#define NAUTILUS_WINDOW_STATE_START_WITH_SIDEBAR		"start-with-sidebar"
+#define NAUTILUS_WINDOW_STATE_START_WITH_TOOLBAR		"start-with-toolbar"
+#define NAUTILUS_WINDOW_STATE_SIDE_PANE_VIEW                    "side-pane-view"
+#define NAUTILUS_WINDOW_STATE_GEOMETRY				"geometry"
+#define NAUTILUS_WINDOW_STATE_MAXIMIZED				"maximized"
+#define NAUTILUS_WINDOW_STATE_SIDEBAR_WIDTH			"sidebar-width"
 
 /* Sorting order */
 #define NAUTILUS_PREFERENCES_SORT_DIRECTORIES_FIRST		"preferences/sort_directories_first"
@@ -232,6 +231,7 @@ char *nautilus_global_preferences_get_default_folder_viewer_preference_as_iid (v
 
 GSettings *nautilus_preferences;
 GSettings *nautilus_media_preferences;
+GSettings *nautilus_window_state;
 
 G_END_DECLS
 
diff --git a/src/nautilus-application.c b/src/nautilus-application.c
index 3254606..29ac82b 100644
--- a/src/nautilus-application.c
+++ b/src/nautilus-application.c
@@ -1457,19 +1457,19 @@ nautilus_application_create_navigation_window (NautilusApplication *application,
 	gboolean maximized;
 
 	g_return_val_if_fail (NAUTILUS_IS_APPLICATION (application), NULL);
-	
+
 	window = create_window (application, NAUTILUS_TYPE_NAVIGATION_WINDOW, startup_id, screen);
 
-	maximized = eel_preferences_get_boolean
-			(NAUTILUS_PREFERENCES_NAVIGATION_WINDOW_MAXIMIZED);
+	maximized = g_settings_get_boolean
+		(nautilus_window_state, NAUTILUS_WINDOW_STATE_MAXIMIZED);
 	if (maximized) {
 		gtk_window_maximize (GTK_WINDOW (window));
 	} else {
 		gtk_window_unmaximize (GTK_WINDOW (window));
 	}
 
-	geometry_string = eel_preferences_get
-			(NAUTILUS_PREFERENCES_NAVIGATION_WINDOW_SAVED_GEOMETRY);
+	geometry_string = g_settings_get_string
+		(nautilus_window_state, NAUTILUS_WINDOW_STATE_GEOMETRY);
 	if (geometry_string != NULL &&
 	    geometry_string[0] != 0) {
 		/* Ignore saved window position if a window with the same
diff --git a/src/nautilus-navigation-window-pane.c b/src/nautilus-navigation-window-pane.c
index 68662aa..05ea970 100644
--- a/src/nautilus-navigation-window-pane.c
+++ b/src/nautilus-navigation-window-pane.c
@@ -571,7 +571,7 @@ nautilus_navigation_window_pane_hide_temporary_bars (NautilusNavigationWindowPan
 		if (NAUTILUS_IS_SEARCH_DIRECTORY (directory)) {
 			nautilus_navigation_window_pane_set_bar_mode (pane, NAUTILUS_BAR_SEARCH);
 		} else {
-			if (!eel_preferences_get_boolean (NAUTILUS_PREFERENCES_ALWAYS_USE_LOCATION_ENTRY)) {
+			if (!g_settings_get_boolean (nautilus_preferences, NAUTILUS_PREFERENCES_ALWAYS_USE_LOCATION_ENTRY)) {
 				nautilus_navigation_window_pane_set_bar_mode (pane, NAUTILUS_BAR_PATH);
 			}
 		}
@@ -583,7 +583,7 @@ nautilus_navigation_window_pane_hide_temporary_bars (NautilusNavigationWindowPan
 	if (pane->temporary_search_bar) {
 		NautilusNavigationWindow *window;
 
-		if (!eel_preferences_get_boolean (NAUTILUS_PREFERENCES_ALWAYS_USE_LOCATION_ENTRY)) {
+		if (!g_settings_get_boolean (nautilus_preferences, NAUTILUS_PREFERENCES_ALWAYS_USE_LOCATION_ENTRY)) {
 			nautilus_navigation_window_pane_set_bar_mode (pane, NAUTILUS_BAR_PATH);
 		} else {
 			nautilus_navigation_window_pane_set_bar_mode (pane, NAUTILUS_BAR_NAVIGATION);
@@ -784,8 +784,8 @@ nautilus_navigation_window_pane_hide_location_bar (NautilusNavigationWindowPane
 	gtk_widget_hide(pane->location_bar);
 	nautilus_navigation_window_update_show_hide_menu_items(
 			NAUTILUS_NAVIGATION_WINDOW (NAUTILUS_WINDOW_PANE (pane)->window));
-	if (save_preference && eel_preferences_key_is_writable(NAUTILUS_PREFERENCES_START_WITH_LOCATION_BAR)) {
-		eel_preferences_set_boolean(NAUTILUS_PREFERENCES_START_WITH_LOCATION_BAR, FALSE);
+	if (save_preference) {
+		g_settings_set_boolean (nautilus_window_state, NAUTILUS_WINDOW_STATE_START_WITH_LOCATION_BAR, FALSE);
 	}
 }
 
@@ -794,8 +794,8 @@ nautilus_navigation_window_pane_show_location_bar (NautilusNavigationWindowPane
 {
 	gtk_widget_show(pane->location_bar);
 	nautilus_navigation_window_update_show_hide_menu_items(NAUTILUS_NAVIGATION_WINDOW (NAUTILUS_WINDOW_PANE (pane)->window));
-	if (save_preference && eel_preferences_key_is_writable(NAUTILUS_PREFERENCES_START_WITH_LOCATION_BAR)) {
-		eel_preferences_set_boolean(NAUTILUS_PREFERENCES_START_WITH_LOCATION_BAR, TRUE);
+	if (save_preference) {
+		g_settings_set_boolean (nautilus_window_state, NAUTILUS_WINDOW_STATE_START_WITH_LOCATION_BAR, TRUE);
 	}
 }
 
diff --git a/src/nautilus-navigation-window.c b/src/nautilus-navigation-window.c
index cfa20b5..7563f55 100644
--- a/src/nautilus-navigation-window.c
+++ b/src/nautilus-navigation-window.c
@@ -184,15 +184,16 @@ nautilus_navigation_window_init (NautilusNavigationWindow *window)
 
 	nautilus_navigation_window_initialize_toolbars (window);
 
-	/* Set initial sensitivity of some buttons & menu items 
+	/* Set initial sensitivity of some buttons & menu items
 	 * now that they're all created.
 	 */
 	nautilus_navigation_window_allow_back (window, FALSE);
 	nautilus_navigation_window_allow_forward (window, FALSE);
 
-	eel_preferences_add_callback_while_alive (NAUTILUS_PREFERENCES_ALWAYS_USE_LOCATION_ENTRY,
-						  always_use_location_entry_changed,
-						  window, G_OBJECT (window));
+	g_signal_connect_swapped (nautilus_preferences,
+				  "changed::" NAUTILUS_PREFERENCES_ALWAYS_USE_LOCATION_ENTRY,
+				  G_CALLBACK(always_use_location_entry_changed),
+				  window);
 
 	g_signal_connect_swapped (nautilus_preferences,
 				  "changed::" NAUTILUS_PREFERENCES_ALWAYS_USE_BROWSER,
@@ -209,7 +210,7 @@ always_use_location_entry_changed (gpointer callback_data)
 
 	window = NAUTILUS_NAVIGATION_WINDOW (callback_data);
 
-	use_entry = eel_preferences_get_boolean (NAUTILUS_PREFERENCES_ALWAYS_USE_LOCATION_ENTRY);
+	use_entry = g_settings_get_boolean (nautilus_preferences, NAUTILUS_PREFERENCES_ALWAYS_USE_LOCATION_ENTRY);
 
 	for (walk = NAUTILUS_WINDOW(window)->details->panes; walk; walk = walk->next) {
 		nautilus_navigation_window_pane_always_use_location_entry (walk->data, use_entry);
@@ -367,11 +368,9 @@ side_pane_size_allocate_callback (GtkWidget *widget,
 
 	if (allocation->width != window->details->side_pane_width) {
 		window->details->side_pane_width = allocation->width;
-		if (g_settings_is_writable (nautilus_preferences, NAUTILUS_PREFERENCES_SIDEBAR_WIDTH)) {
-			g_settings_set_int (nautilus_preferences,
-					    NAUTILUS_PREFERENCES_SIDEBAR_WIDTH,
-					    allocation->width <= 1 ? 0 : allocation->width);
-		}
+		g_settings_set_int (nautilus_window_state,
+				    NAUTILUS_WINDOW_STATE_SIDEBAR_WIDTH,
+				    allocation->width <= 1 ? 0 : allocation->width);
 	}
 }
 
@@ -381,8 +380,8 @@ setup_side_pane_width (NautilusNavigationWindow *window)
 	g_return_if_fail (window->sidebar != NULL);
 
 	window->details->side_pane_width =
-		g_settings_get_int (nautilus_preferences,
-				    NAUTILUS_PREFERENCES_SIDEBAR_WIDTH);
+		g_settings_get_int (nautilus_window_state,
+				    NAUTILUS_WINDOW_STATE_SIDEBAR_WIDTH);
 
 	gtk_paned_set_position (GTK_PANED (window->details->content_paned),
 				window->details->side_pane_width);
@@ -418,13 +417,11 @@ side_pane_switch_page_callback (NautilusSidePane *side_pane,
 	if (sidebar == NULL) {
 		return;
 	}
-		
+
 	set_current_side_panel (window, sidebar);
 
 	id = nautilus_sidebar_get_sidebar_id (sidebar);
-	if (eel_preferences_key_is_writable (NAUTILUS_PREFERENCES_SIDE_PANE_VIEW)) {
-		eel_preferences_set (NAUTILUS_PREFERENCES_SIDE_PANE_VIEW, id);
-	}
+	g_settings_set_string (nautilus_window_state, NAUTILUS_WINDOW_STATE_SIDE_PANE_VIEW, id);
 }
 
 static void
@@ -501,8 +498,8 @@ nautilus_navigation_window_state_event (GtkWidget *widget,
 					GdkEventWindowState *event)
 {
 	if (event->changed_mask & GDK_WINDOW_STATE_MAXIMIZED) {
-		eel_preferences_set_boolean (NAUTILUS_PREFERENCES_NAVIGATION_WINDOW_MAXIMIZED,
-					     event->new_window_state & GDK_WINDOW_STATE_MAXIMIZED);
+		g_settings_set_boolean (nautilus_window_state, NAUTILUS_WINDOW_STATE_MAXIMIZED,
+					event->new_window_state & GDK_WINDOW_STATE_MAXIMIZED);
 	}
 
 	if (GTK_WIDGET_CLASS (parent_class)->window_state_event != NULL) {
@@ -597,6 +594,9 @@ nautilus_navigation_window_finalize (GObject *object)
 	g_signal_handlers_disconnect_by_func (nautilus_preferences,
 					      always_use_browser_changed,
 					      window);
+	g_signal_handlers_disconnect_by_func (nautilus_preferences,
+					      always_use_location_entry_changed,
+					      window);
 
 	G_OBJECT_CLASS (parent_class)->finalize (object);
 }
@@ -645,7 +645,7 @@ nautilus_navigation_window_add_sidebar_panel (NautilusNavigationWindow *window,
 
 	/* Show if default */
 	sidebar_id = nautilus_sidebar_get_sidebar_id (sidebar_panel);
-	default_id = eel_preferences_get (NAUTILUS_PREFERENCES_SIDE_PANE_VIEW);
+	default_id = g_settings_get_string (nautilus_window_state, NAUTILUS_WINDOW_STATE_SIDE_PANE_VIEW);
 	if (sidebar_id && default_id && !strcmp (sidebar_id, default_id)) {
 		nautilus_side_pane_show_panel (window->sidebar,
 					       GTK_WIDGET (sidebar_panel));
@@ -902,28 +902,22 @@ nautilus_navigation_window_toolbar_showing (NautilusNavigationWindow *window)
 	return TRUE;
 }
 
-void 
+void
 nautilus_navigation_window_hide_status_bar (NautilusNavigationWindow *window)
 {
 	gtk_widget_hide (NAUTILUS_WINDOW (window)->details->statusbar);
 
 	nautilus_navigation_window_update_show_hide_menu_items (window);
-	if (eel_preferences_key_is_writable (NAUTILUS_PREFERENCES_START_WITH_STATUS_BAR) &&
-	    eel_preferences_get_boolean (NAUTILUS_PREFERENCES_START_WITH_STATUS_BAR)) {
-		eel_preferences_set_boolean (NAUTILUS_PREFERENCES_START_WITH_STATUS_BAR, FALSE);
-	}
+	g_settings_set_boolean (nautilus_window_state, NAUTILUS_WINDOW_STATE_START_WITH_STATUS_BAR, FALSE);
 }
 
-void 
+void
 nautilus_navigation_window_show_status_bar (NautilusNavigationWindow *window)
 {
 	gtk_widget_show (NAUTILUS_WINDOW (window)->details->statusbar);
 
 	nautilus_navigation_window_update_show_hide_menu_items (window);
-	if (eel_preferences_key_is_writable (NAUTILUS_PREFERENCES_START_WITH_STATUS_BAR) &&
-	    !eel_preferences_get_boolean (NAUTILUS_PREFERENCES_START_WITH_STATUS_BAR)) {
-		eel_preferences_set_boolean (NAUTILUS_PREFERENCES_START_WITH_STATUS_BAR, TRUE);
-	}
+	g_settings_set_boolean (nautilus_window_state, NAUTILUS_WINDOW_STATE_START_WITH_STATUS_BAR, TRUE);
 }
 
 gboolean
@@ -937,29 +931,23 @@ nautilus_navigation_window_status_bar_showing (NautilusNavigationWindow *window)
 }
 
 
-void 
+void
 nautilus_navigation_window_hide_toolbar (NautilusNavigationWindow *window)
 {
 	gtk_widget_hide (window->details->toolbar);
 	nautilus_navigation_window_update_show_hide_menu_items (window);
-	if (eel_preferences_key_is_writable (NAUTILUS_PREFERENCES_START_WITH_TOOLBAR) &&
-	    eel_preferences_get_boolean (NAUTILUS_PREFERENCES_START_WITH_TOOLBAR)) {
-		eel_preferences_set_boolean (NAUTILUS_PREFERENCES_START_WITH_TOOLBAR, FALSE);
-	}
+	g_settings_set_boolean (nautilus_window_state, NAUTILUS_WINDOW_STATE_START_WITH_TOOLBAR, FALSE);
 }
 
-void 
+void
 nautilus_navigation_window_show_toolbar (NautilusNavigationWindow *window)
 {
 	gtk_widget_show (window->details->toolbar);
 	nautilus_navigation_window_update_show_hide_menu_items (window);
-	if (eel_preferences_key_is_writable (NAUTILUS_PREFERENCES_START_WITH_TOOLBAR) &&
-	    !eel_preferences_get_boolean (NAUTILUS_PREFERENCES_START_WITH_TOOLBAR)) {
-		eel_preferences_set_boolean (NAUTILUS_PREFERENCES_START_WITH_TOOLBAR, TRUE);
-	}
+	g_settings_set_boolean (nautilus_window_state, NAUTILUS_WINDOW_STATE_START_WITH_TOOLBAR, TRUE);
 }
 
-void 
+void
 nautilus_navigation_window_hide_sidebar (NautilusNavigationWindow *window)
 {
 	if (window->sidebar == NULL) {
@@ -969,13 +957,10 @@ nautilus_navigation_window_hide_sidebar (NautilusNavigationWindow *window)
 	nautilus_navigation_window_tear_down_sidebar (window);
 	nautilus_navigation_window_update_show_hide_menu_items (window);
 
-	if (eel_preferences_key_is_writable (NAUTILUS_PREFERENCES_START_WITH_SIDEBAR) &&
-	    eel_preferences_get_boolean (NAUTILUS_PREFERENCES_START_WITH_SIDEBAR)) {
-		eel_preferences_set_boolean (NAUTILUS_PREFERENCES_START_WITH_SIDEBAR, FALSE);
-	}
+	g_settings_set_boolean (nautilus_window_state, NAUTILUS_WINDOW_STATE_START_WITH_SIDEBAR, FALSE);
 }
 
-void 
+void
 nautilus_navigation_window_show_sidebar (NautilusNavigationWindow *window)
 {
 	if (window->sidebar != NULL) {
@@ -984,10 +969,7 @@ nautilus_navigation_window_show_sidebar (NautilusNavigationWindow *window)
 
 	nautilus_navigation_window_set_up_sidebar (window);
 	nautilus_navigation_window_update_show_hide_menu_items (window);
-	if (eel_preferences_key_is_writable (NAUTILUS_PREFERENCES_START_WITH_SIDEBAR) &&
-	    !eel_preferences_get_boolean (NAUTILUS_PREFERENCES_START_WITH_SIDEBAR)) {
-		eel_preferences_set_boolean (NAUTILUS_PREFERENCES_START_WITH_SIDEBAR, TRUE);
-	}
+	g_settings_set_boolean (nautilus_window_state, NAUTILUS_WINDOW_STATE_START_WITH_SIDEBAR, TRUE);
 }
 
 gboolean
@@ -1038,7 +1020,7 @@ nautilus_navigation_window_get_base_page_index (NautilusNavigationWindow *window
  */
 static void
 nautilus_navigation_window_show (GtkWidget *widget)
-{	
+{
 	NautilusNavigationWindow *window;
 	gboolean show_location_bar;
 	gboolean always_use_location_entry;
@@ -1047,17 +1029,17 @@ nautilus_navigation_window_show (GtkWidget *widget)
 	window = NAUTILUS_NAVIGATION_WINDOW (widget);
 
 	/* Initially show or hide views based on preferences; once the window is displayed
-	 * these can be controlled on a per-window basis from View menu items. 
+	 * these can be controlled on a per-window basis from View menu items.
 	 */
 
-	if (eel_preferences_get_boolean (NAUTILUS_PREFERENCES_START_WITH_TOOLBAR)) {
+	if (g_settings_get_boolean (nautilus_window_state, NAUTILUS_WINDOW_STATE_START_WITH_TOOLBAR)) {
 		nautilus_navigation_window_show_toolbar (window);
 	} else {
 		nautilus_navigation_window_hide_toolbar (window);
 	}
 
-	show_location_bar = eel_preferences_get_boolean (NAUTILUS_PREFERENCES_START_WITH_LOCATION_BAR);
-	always_use_location_entry = eel_preferences_get_boolean (NAUTILUS_PREFERENCES_ALWAYS_USE_LOCATION_ENTRY);
+	show_location_bar = g_settings_get_boolean (nautilus_window_state, NAUTILUS_WINDOW_STATE_START_WITH_LOCATION_BAR);
+	always_use_location_entry = g_settings_get_boolean (nautilus_preferences, NAUTILUS_PREFERENCES_ALWAYS_USE_LOCATION_ENTRY);
 	for (walk = NAUTILUS_WINDOW(window)->details->panes; walk; walk = walk->next) {
 		NautilusNavigationWindowPane *pane = walk->data;
 		if (show_location_bar) {
@@ -1072,14 +1054,14 @@ nautilus_navigation_window_show (GtkWidget *widget)
 			nautilus_navigation_window_pane_set_bar_mode (pane, NAUTILUS_BAR_PATH);
 		}
 	}
-	
-	if (eel_preferences_get_boolean (NAUTILUS_PREFERENCES_START_WITH_SIDEBAR)) {
+
+	if (g_settings_get_boolean (nautilus_window_state, NAUTILUS_WINDOW_STATE_START_WITH_SIDEBAR)) {
 		nautilus_navigation_window_show_sidebar (window);
 	} else {
 		nautilus_navigation_window_hide_sidebar (window);
 	}
 
-	if (eel_preferences_get_boolean (NAUTILUS_PREFERENCES_START_WITH_STATUS_BAR)) {
+	if (g_settings_get_boolean (nautilus_window_state, NAUTILUS_WINDOW_STATE_START_WITH_STATUS_BAR)) {
 		nautilus_navigation_window_show_status_bar (window);
 	} else {
 		nautilus_navigation_window_hide_status_bar (window);
@@ -1100,20 +1082,17 @@ nautilus_navigation_window_save_geometry (NautilusNavigationWindow *window)
 		geometry_string = eel_gtk_window_get_geometry_string (GTK_WINDOW (window));
 		is_maximized = gdk_window_get_state (gtk_widget_get_window (GTK_WIDGET (window)))
 				& GDK_WINDOW_STATE_MAXIMIZED;
-		
-		if (eel_preferences_key_is_writable (NAUTILUS_PREFERENCES_NAVIGATION_WINDOW_SAVED_GEOMETRY) &&
-		    !is_maximized) {
-			eel_preferences_set
-				(NAUTILUS_PREFERENCES_NAVIGATION_WINDOW_SAVED_GEOMETRY, 
+
+		if (!is_maximized) {
+			g_settings_set_string
+				(nautilus_window_state, NAUTILUS_WINDOW_STATE_GEOMETRY,
 				 geometry_string);
 		}
 		g_free (geometry_string);
 
-		if (eel_preferences_key_is_writable (NAUTILUS_PREFERENCES_NAVIGATION_WINDOW_MAXIMIZED)) {
-			eel_preferences_set_boolean
-				(NAUTILUS_PREFERENCES_NAVIGATION_WINDOW_MAXIMIZED, 
-				 is_maximized);
-		}
+		g_settings_set_boolean
+			(nautilus_window_state, NAUTILUS_WINDOW_STATE_MAXIMIZED,
+			 is_maximized);
 	}
 }
 
@@ -1142,9 +1121,9 @@ real_get_default_size (NautilusWindow *window,
 	if (default_width) {
 		*default_width = NAUTILUS_NAVIGATION_WINDOW_DEFAULT_WIDTH;
 	}
-	
+
 	if (default_height) {
-		*default_height = NAUTILUS_NAVIGATION_WINDOW_DEFAULT_HEIGHT;	
+		*default_height = NAUTILUS_NAVIGATION_WINDOW_DEFAULT_HEIGHT;
 	}
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]