[nautilus: 1/2] remove setting fts from preference dialog



commit d33960cd1ccb823e9ceec1a9d4227ac93baa97df
Author: Alexandru Pandelea <alexandru pandelea gmail com>
Date:   Sat Oct 21 17:26:49 2017 +0300

    remove setting fts from preference dialog
    
    Instead of setting whether the search should be full text search or
    not from the preference dialog, make the permanent setting from the
    search popover.
    
    https://gitlab.gnome.org/GNOME/nautilus/issues/65

 data/org.gnome.nautilus.gschema.xml             |  2 +-
 src/nautilus-global-preferences.h               |  4 ++--
 src/nautilus-preferences-window.c               |  5 -----
 src/nautilus-search-popover.c                   |  5 ++++-
 src/resources/ui/nautilus-preferences-window.ui | 30 -------------------------
 5 files changed, 7 insertions(+), 39 deletions(-)
---
diff --git a/data/org.gnome.nautilus.gschema.xml b/data/org.gnome.nautilus.gschema.xml
index 583186dec..617327ba2 100644
--- a/data/org.gnome.nautilus.gschema.xml
+++ b/data/org.gnome.nautilus.gschema.xml
@@ -212,7 +212,7 @@
       <summary>Enable new experimental views</summary>
       <description>Whether to use the new experimental views using the latest GTK+ widgets to help giving 
feedback and shaping their future.</description>
     </key>
-    <key type="b" name="fts-default">
+    <key type="b" name="fts-enabled">
       <default>true</default>
       <summary>Whether to have full text search enabled by default when opening a new window/tab</summary>
       <description>If set to true, then Nautilus will also match the file contents besides the name. This 
toggles the default active state, which can still be overridden in the search popover</description>
diff --git a/src/nautilus-global-preferences.h b/src/nautilus-global-preferences.h
index ce0b32c9d..7c19ba1fd 100644
--- a/src/nautilus-global-preferences.h
+++ b/src/nautilus-global-preferences.h
@@ -174,8 +174,8 @@ typedef enum
 #define NAUTILUS_PREFERENCES_SHOW_DELETE_PERMANENTLY "show-delete-permanently"
 #define NAUTILUS_PREFERENCES_SHOW_CREATE_LINK "show-create-link"
 
-/* Full Text Search as default */
-#define NAUTILUS_PREFERENCES_FTS_DEFAULT "fts-default"
+/* Full Text Search enabled */
+#define NAUTILUS_PREFERENCES_FTS_ENABLED "fts-enabled"
 
 void nautilus_global_preferences_init                      (void);
 
diff --git a/src/nautilus-preferences-window.c b/src/nautilus-preferences-window.c
index 9116692cd..36937f5f5 100644
--- a/src/nautilus-preferences-window.c
+++ b/src/nautilus-preferences-window.c
@@ -59,8 +59,6 @@
     "trash_confirm_checkbutton"
 #define NAUTILUS_PREFERENCES_DIALOG_USE_NEW_VIEWS_WIDGET                    \
     "use_new_views_checkbutton"
-#define NAUTILUS_PREFERENCES_FTS_DEFAULT_WIDGET                                \
-    "fts_checkbutton"
 
 /* int enums */
 #define NAUTILUS_PREFERENCES_DIALOG_THUMBNAIL_LIMIT_WIDGET                     \
@@ -477,9 +475,6 @@ static void nautilus_preferences_window_setup(GtkBuilder *builder,
     bind_builder_bool (builder, nautilus_preferences,
                        NAUTILUS_PREFERENCES_DIALOG_USE_NEW_VIEWS_WIDGET,
                        NAUTILUS_PREFERENCES_USE_EXPERIMENTAL_VIEWS);
-    bind_builder_bool (builder, nautilus_preferences,
-                       NAUTILUS_PREFERENCES_FTS_DEFAULT_WIDGET,
-                       NAUTILUS_PREFERENCES_FTS_DEFAULT);
 
     bind_builder_radio (
         builder, nautilus_preferences, (const char **) click_behavior_components,
diff --git a/src/nautilus-search-popover.c b/src/nautilus-search-popover.c
index 240136386..5c9dfa8d6 100644
--- a/src/nautilus-search-popover.c
+++ b/src/nautilus-search-popover.c
@@ -367,12 +367,14 @@ search_fts_mode_changed (GtkToggleButton       *button,
         popover->fts_enabled == FALSE)
     {
         popover->fts_enabled = TRUE;
+        g_settings_set_boolean(nautilus_preferences, NAUTILUS_PREFERENCES_FTS_ENABLED, TRUE);
         g_object_notify (G_OBJECT (popover), "fts-enabled");
     }
     else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (popover->filename_search_button)) &&
              popover->fts_enabled == TRUE)
     {
         popover->fts_enabled = FALSE;
+        g_settings_set_boolean(nautilus_preferences, NAUTILUS_PREFERENCES_FTS_ENABLED, FALSE);
         g_object_notify (G_OBJECT (popover), "fts-enabled");
     }
 }
@@ -906,7 +908,8 @@ nautilus_search_popover_init (NautilusSearchPopover *self)
         gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (self->last_used_button), TRUE);
     }
 
-    self->fts_enabled = g_settings_get_boolean (nautilus_preferences, NAUTILUS_PREFERENCES_FTS_DEFAULT);
+    self->fts_enabled = g_settings_get_boolean (nautilus_preferences,
+                                                NAUTILUS_PREFERENCES_FTS_ENABLED);
     if (self->fts_enabled)
     {
         gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (self->full_text_search_button), TRUE);
diff --git a/src/resources/ui/nautilus-preferences-window.ui b/src/resources/ui/nautilus-preferences-window.ui
index fe89e248e..3c9de33b7 100644
--- a/src/resources/ui/nautilus-preferences-window.ui
+++ b/src/resources/ui/nautilus-preferences-window.ui
@@ -825,36 +825,6 @@
                         <property name="position">4</property>
                       </packing>
                     </child>
-                    <child>
-                      <object class="GtkLabel" id="fts_label">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="label" translatable="yes">Full Text Search:</property>
-                        <property name="xalign">0</property>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">5</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkCheckButton" id="fts_checkbutton">
-                        <property name="label" translatable="yes">Set as _default</property>
-                        <property name="use_action_appearance">False</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">False</property>
-                        <property name="use_underline">True</property>
-                        <property name="xalign">0</property>
-                        <property name="draw_indicator">True</property>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">True</property>
-                        <property name="position">6</property>
-                      </packing>
-                    </child>
                   </object>
                   <packing>
                     <property name="expand">False</property>


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