[nautilus/wip/csoriano/waiting-ui-review: 3/3] preferences: add list view on search



commit ab4a49d03d41a7919cbebeaa280ce201ce253b63
Author: Carlos Soriano <csoriano gnome org>
Date:   Wed Feb 10 15:17:41 2016 +0100

    preferences: add list view on search
    
    We were automatically switching to list view when searching and
    disabling this automatic switch if the user chose to use the icon view
    while searching.
    However that's confusing.
    
    Add a explicit preference for it in the preferences dialog and remove
    the automatic choice.

 src/nautilus-preferences-dialog.c               |    5 +++
 src/nautilus-window-slot.c                      |    7 ----
 src/resources/ui/nautilus-preferences-dialog.ui |   45 +++++++++++------------
 3 files changed, 26 insertions(+), 31 deletions(-)
---
diff --git a/src/nautilus-preferences-dialog.c b/src/nautilus-preferences-dialog.c
index e216315..144e5ee 100644
--- a/src/nautilus-preferences-dialog.c
+++ b/src/nautilus-preferences-dialog.c
@@ -62,6 +62,8 @@
   "local_recursive_search_checkbutton"
 #define NAUTILUS_PREFERENCES_DIALOG_REMOTE_RECURSIVE_SEARCH_WIDGET              \
   "remote_recursive_search_checkbutton"
+#define NAUTILUS_PREFERENCES_DIALOG_LIST_VIEW_ON_SEARCH_WIDGET                 \
+  "list_view_on_search_checkbutton"
 
 /* int enums */
 #define NAUTILUS_PREFERENCES_DIALOG_THUMBNAIL_LIMIT_WIDGET                     \
@@ -499,6 +501,9 @@ static void nautilus_preferences_dialog_setup(GtkBuilder *builder,
   bind_builder_bool(builder, nautilus_preferences,
                     NAUTILUS_PREFERENCES_DIALOG_REMOTE_RECURSIVE_SEARCH_WIDGET,
                     NAUTILUS_PREFERENCES_REMOTE_RECURSIVE_SEARCH);
+  bind_builder_bool(builder, nautilus_preferences,
+                    NAUTILUS_PREFERENCES_DIALOG_LIST_VIEW_ON_SEARCH_WIDGET,
+                    NAUTILUS_PREFERENCES_LIST_VIEW_ON_SEARCH);
 
   bind_builder_enum(builder, nautilus_preferences,
                     NAUTILUS_PREFERENCES_DIALOG_PREVIEW_FILES_WIDGET,
diff --git a/src/nautilus-window-slot.c b/src/nautilus-window-slot.c
index 9d20fb2..ebc0f04 100644
--- a/src/nautilus-window-slot.c
+++ b/src/nautilus-window-slot.c
@@ -687,13 +687,6 @@ action_files_view_mode (GSimpleAction *action,
                                                  NAUTILUS_DEFAULT_FOLDER_VIEWER_LIST_VIEW);
                     }
         } else if (g_strcmp0 (name, "grid") == 0) {
-                    /* If the user manually changed the view mode to grid, disable the automatic
-                     * switch to list view on search */
-                    if (nautilus_view_is_searching (nautilus_window_slot_get_current_view (slot))) {
-                          g_settings_set_boolean (nautilus_preferences,
-                                                  NAUTILUS_PREFERENCES_LIST_VIEW_ON_SEARCH,
-                                                  FALSE);
-                    }
                     g_settings_set_enum (nautilus_preferences,
                                          NAUTILUS_PREFERENCES_DEFAULT_FOLDER_VIEWER,
                                          NAUTILUS_DEFAULT_FOLDER_VIEWER_ICON_VIEW);
diff --git a/src/resources/ui/nautilus-preferences-dialog.ui b/src/resources/ui/nautilus-preferences-dialog.ui
index 8fdfef1..6ae03e0 100644
--- a/src/resources/ui/nautilus-preferences-dialog.ui
+++ b/src/resources/ui/nautilus-preferences-dialog.ui
@@ -797,12 +797,12 @@
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkAlignment" id="alignment1">
+                      <object class="GtkAlignment" id="alignment10">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
                         <property name="left_padding">12</property>
                         <child>
-                          <object class="GtkBox" id="vbox4">
+                          <object class="GtkBox" id="vbox16">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
                             <property name="orientation">vertical</property>
@@ -824,26 +824,6 @@
                                 <property name="position">0</property>
                               </packing>
                             </child>
-                          </object>
-                        </child>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">1</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkAlignment" id="alignment3">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="left_padding">12</property>
-                        <child>
-                          <object class="GtkBox" id="vbox10">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="orientation">vertical</property>
-                            <property name="spacing">6</property>
                             <child>
                               <object class="GtkCheckButton" id="remote_recursive_search_checkbutton">
                                 <property name="label" translatable="yes">Search subfolders on _network 
locations</property>
@@ -858,7 +838,24 @@
                               <packing>
                                 <property name="expand">False</property>
                                 <property name="fill">False</property>
-                                <property name="position">0</property>
+                                <property name="position">1</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkCheckButton" id="list_view_on_search_checkbutton">
+                                <property name="label" translatable="yes">Use List View when 
_searching</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">False</property>
+                                <property name="position">2</property>
                               </packing>
                             </child>
                           </object>
@@ -867,7 +864,7 @@
                       <packing>
                         <property name="expand">False</property>
                         <property name="fill">False</property>
-                        <property name="position">2</property>
+                        <property name="position">3</property>
                       </packing>
                     </child>
                   </object>


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