[nautilus] Share "show hidden" option with GTK file chooser
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] Share "show hidden" option with GTK file chooser
- Date: Fri, 7 Dec 2012 17:57:05 +0000 (UTC)
commit 85524e01c37ef6cfa617190fe77b1a8381b31080
Author: Timothy Arceri <t_arceri yahoo com au>
Date: Tue Dec 4 07:45:48 2012 +1100
Share "show hidden" option with GTK file chooser
https://bugzilla.gnome.org/show_bug.cgi?id=143599
libnautilus-private/nautilus-directory-async.c | 4 ++--
libnautilus-private/nautilus-directory.c | 2 +-
libnautilus-private/nautilus-global-preferences.c | 3 +++
libnautilus-private/nautilus-global-preferences.h | 3 ++-
.../org.gnome.nautilus.gschema.xml.in | 2 +-
src/nautilus-file-management-properties.c | 2 +-
src/nautilus-view.c | 4 ++--
7 files changed, 12 insertions(+), 8 deletions(-)
---
diff --git a/libnautilus-private/nautilus-directory-async.c b/libnautilus-private/nautilus-directory-async.c
index 506f320..f1d53f3 100644
--- a/libnautilus-private/nautilus-directory-async.c
+++ b/libnautilus-private/nautilus-directory-async.c
@@ -827,7 +827,7 @@ static gboolean show_hidden_files = TRUE;
static void
show_hidden_files_changed_callback (gpointer callback_data)
{
- show_hidden_files = g_settings_get_boolean (nautilus_preferences, NAUTILUS_PREFERENCES_SHOW_HIDDEN_FILES);
+ show_hidden_files = g_settings_get_boolean (gtk_filechooser_preferences, NAUTILUS_PREFERENCES_SHOW_HIDDEN_FILES);
}
static gboolean
@@ -837,7 +837,7 @@ should_skip_file (NautilusDirectory *directory, GFileInfo *info)
/* Add the callback once for the life of our process */
if (!show_hidden_files_changed_callback_installed) {
- g_signal_connect_swapped (nautilus_preferences,
+ g_signal_connect_swapped (gtk_filechooser_preferences,
"changed::" NAUTILUS_PREFERENCES_SHOW_HIDDEN_FILES,
G_CALLBACK(show_hidden_files_changed_callback),
NULL);
diff --git a/libnautilus-private/nautilus-directory.c b/libnautilus-private/nautilus-directory.c
index 993cee3..645224d 100644
--- a/libnautilus-private/nautilus-directory.c
+++ b/libnautilus-private/nautilus-directory.c
@@ -350,7 +350,7 @@ add_preferences_callbacks (void)
{
nautilus_global_preferences_init ();
- g_signal_connect_swapped (nautilus_preferences,
+ g_signal_connect_swapped (gtk_filechooser_preferences,
"changed::" NAUTILUS_PREFERENCES_SHOW_HIDDEN_FILES,
G_CALLBACK(filtering_changed_callback),
NULL);
diff --git a/libnautilus-private/nautilus-global-preferences.c b/libnautilus-private/nautilus-global-preferences.c
index 9f9c942..c4f5443 100644
--- a/libnautilus-private/nautilus-global-preferences.c
+++ b/libnautilus-private/nautilus-global-preferences.c
@@ -71,6 +71,9 @@ nautilus_global_preferences_init (void)
nautilus_icon_view_preferences = g_settings_new("org.gnome.nautilus.icon-view");
nautilus_list_view_preferences = g_settings_new("org.gnome.nautilus.list-view");
nautilus_desktop_preferences = g_settings_new("org.gnome.nautilus.desktop");
+ /* Some settings such as show hidden files are shared between Nautilus and GTK file chooser */
+ gtk_filechooser_preferences = g_settings_new_with_path ("org.gtk.Settings.FileChooser",
+ "/org/gtk/settings/file-chooser/");
gnome_lockdown_preferences = g_settings_new("org.gnome.desktop.lockdown");
gnome_background_preferences = g_settings_new("org.gnome.desktop.background");
gnome_interface_preferences = g_settings_new ("org.gnome.desktop.interface");
diff --git a/libnautilus-private/nautilus-global-preferences.h b/libnautilus-private/nautilus-global-preferences.h
index 632fd42..bd26470 100644
--- a/libnautilus-private/nautilus-global-preferences.h
+++ b/libnautilus-private/nautilus-global-preferences.h
@@ -36,7 +36,7 @@ G_BEGIN_DECLS
#define NAUTILUS_PREFERENCES_ENABLE_DELETE "enable-delete"
/* Display */
-#define NAUTILUS_PREFERENCES_SHOW_HIDDEN_FILES "show-hidden-files"
+#define NAUTILUS_PREFERENCES_SHOW_HIDDEN_FILES "show-hidden"
/* Mouse */
#define NAUTILUS_PREFERENCES_MOUSE_USE_EXTRA_BUTTONS "mouse-use-extra-buttons"
@@ -165,6 +165,7 @@ GSettings *nautilus_icon_view_preferences;
GSettings *nautilus_list_view_preferences;
GSettings *nautilus_desktop_preferences;
GSettings *nautilus_window_state;
+GSettings *gtk_filechooser_preferences;
GSettings *gnome_lockdown_preferences;
GSettings *gnome_background_preferences;
GSettings *gnome_interface_preferences;
diff --git a/libnautilus-private/org.gnome.nautilus.gschema.xml.in b/libnautilus-private/org.gnome.nautilus.gschema.xml.in
index 83c082d..ba0f731 100644
--- a/libnautilus-private/org.gnome.nautilus.gschema.xml.in
+++ b/libnautilus-private/org.gnome.nautilus.gschema.xml.in
@@ -157,7 +157,7 @@
<key name="show-hidden-files" type="b">
<default>false</default>
<_summary>Whether to show hidden files</_summary>
- <_description>If set to true, then hidden files are shown by default in the file manager. Hidden files are either dotfiles, listed in the folder's .hidden file or backup files ending with a tilde (~).</_description>
+ <_description>This key is deprecated and ignored. The "show-hidden" key from "org.gtk.Settings.FileChooser" is now used instead.</_description>
</key>
<key name="bulk-rename-tool" type="ay">
<default>[]</default>
diff --git a/src/nautilus-file-management-properties.c b/src/nautilus-file-management-properties.c
index 7a470d8..da18bba 100644
--- a/src/nautilus-file-management-properties.c
+++ b/src/nautilus-file-management-properties.c
@@ -683,7 +683,7 @@ nautilus_file_management_properties_dialog_setup (GtkBuilder *builder, GtkWindow
bind_builder_bool (builder, nautilus_preferences,
NAUTILUS_FILE_MANAGEMENT_PROPERTIES_TRASH_DELETE_WIDGET,
NAUTILUS_PREFERENCES_ENABLE_DELETE);
- bind_builder_bool (builder, nautilus_preferences,
+ bind_builder_bool (builder, gtk_filechooser_preferences,
NAUTILUS_FILE_MANAGEMENT_PROPERTIES_SHOW_HIDDEN_WIDGET,
NAUTILUS_PREFERENCES_SHOW_HIDDEN_FILES);
diff --git a/src/nautilus-view.c b/src/nautilus-view.c
index a113e38..5ac32d9 100644
--- a/src/nautilus-view.c
+++ b/src/nautilus-view.c
@@ -470,7 +470,7 @@ nautilus_view_reset_to_defaults (NautilusView *view)
action = gtk_action_group_get_action (view->details->dir_action_group,
NAUTILUS_ACTION_SHOW_HIDDEN_FILES);
gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action),
- g_settings_get_boolean (nautilus_preferences, NAUTILUS_PREFERENCES_SHOW_HIDDEN_FILES));
+ g_settings_get_boolean (gtk_filechooser_preferences, NAUTILUS_PREFERENCES_SHOW_HIDDEN_FILES));
}
static gboolean
@@ -2646,7 +2646,7 @@ nautilus_view_init (NautilusView *view)
view->details->sort_directories_first =
g_settings_get_boolean (nautilus_preferences, NAUTILUS_PREFERENCES_SORT_DIRECTORIES_FIRST);
view->details->show_hidden_files =
- g_settings_get_boolean (nautilus_preferences, NAUTILUS_PREFERENCES_SHOW_HIDDEN_FILES);
+ g_settings_get_boolean (gtk_filechooser_preferences, NAUTILUS_PREFERENCES_SHOW_HIDDEN_FILES);
g_signal_connect_object (nautilus_trash_monitor_get (), "trash_state_changed",
G_CALLBACK (nautilus_view_trash_state_changed_callback), view, 0);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]