[gtk+] file chooser: More search rework
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] file chooser: More search rework
- Date: Sat, 4 Jul 2015 04:39:45 +0000 (UTC)
commit 7e45b09c8e74cc0685556df102874a9c642fda11
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Jun 26 20:02:31 2015 -0400
file chooser: More search rework
Drop the radio buttons for current location vs everywhere, and
always search in the current location.
gtk/gtkfilechooserwidget.c | 12 +-----------
gtk/ui/gtkfilechooserwidget.ui | 28 ++--------------------------
2 files changed, 3 insertions(+), 37 deletions(-)
---
diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c
index 51b0294..1613748 100644
--- a/gtk/gtkfilechooserwidget.c
+++ b/gtk/gtkfilechooserwidget.c
@@ -242,7 +242,6 @@ struct _GtkFileChooserWidgetPrivate {
/* OPERATION_MODE_SEARCH */
GtkWidget *search_entry;
- GtkWidget *current_location_radio;
GtkSearchEngine *search_engine;
GtkQuery *search_query;
GtkFileSystemModel *search_model;
@@ -2542,7 +2541,6 @@ static void
operation_mode_set_search (GtkFileChooserWidget *impl)
{
GtkFileChooserWidgetPrivate *priv = impl->priv;
- gchar *current;
g_assert (priv->search_model == NULL);
@@ -2554,12 +2552,6 @@ operation_mode_set_search (GtkFileChooserWidget *impl)
gtk_entry_grab_focus_without_selecting (GTK_ENTRY (priv->search_entry));
gtk_places_sidebar_set_location (GTK_PLACES_SIDEBAR (priv->places_sidebar), NULL);
gtk_widget_set_sensitive (priv->filter_combo, FALSE);
- if (priv->current_folder)
- current = g_file_get_basename (priv->current_folder);
- else
- current = g_strdup (_("Home"));
- gtk_button_set_label (GTK_BUTTON (priv->current_location_radio), current);
- g_free (current);
gtk_tree_view_column_set_visible (priv->list_location_column, TRUE);
}
@@ -6302,8 +6294,7 @@ search_start_query (GtkFileChooserWidget *impl,
gtk_query_set_text (priv->search_query, query_text);
}
- if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->current_location_radio)) &&
- priv->current_folder)
+ if (priv->current_folder)
{
gchar *location;
location = g_file_get_uri (priv->current_folder);
@@ -7508,7 +7499,6 @@ gtk_file_chooser_widget_class_init (GtkFileChooserWidgetClass *class)
gtk_widget_class_bind_template_child_private (widget_class, GtkFileChooserWidget, extra_and_filters);
gtk_widget_class_bind_template_child_private (widget_class, GtkFileChooserWidget, location_entry_box);
gtk_widget_class_bind_template_child_private (widget_class, GtkFileChooserWidget, search_entry);
- gtk_widget_class_bind_template_child_private (widget_class, GtkFileChooserWidget, current_location_radio);
gtk_widget_class_bind_template_child_private (widget_class, GtkFileChooserWidget, list_name_column);
gtk_widget_class_bind_template_child_private (widget_class, GtkFileChooserWidget, list_pixbuf_renderer);
gtk_widget_class_bind_template_child_private (widget_class, GtkFileChooserWidget, list_name_renderer);
diff --git a/gtk/ui/gtkfilechooserwidget.ui b/gtk/ui/gtkfilechooserwidget.ui
index 264f9cc..02a287a 100644
--- a/gtk/ui/gtkfilechooserwidget.ui
+++ b/gtk/ui/gtkfilechooserwidget.ui
@@ -103,38 +103,14 @@
<property name="no-show-all">True</property>
<property name="spacing">6</property>
<property name="border_width">6</property>
- <child>
+ <child type="center">
<object class="GtkSearchEntry" id="search_entry">
<property name="visible">True</property>
- <property name="hexpand">True</property>
+ <property name="width-chars">45</property>
<signal name="search-changed" handler="search_entry_activate_cb"
swapped="yes"/>
<signal name="stop-search" handler="search_entry_stop_cb" swapped="yes"/>
</object>
</child>
- <child>
- <object class="GtkBox">
- <property name="visible">True</property>
- <style>
- <class name="linked"/>
- </style>
- <child>
- <object class="GtkRadioButton" id="current_location_radio">
- <property name="visible">True</property>
- <property name="draw-indicator">False</property>
- <property name="label" translatable="yes">Home</property>
- <signal name="toggled" handler="search_entry_activate_cb"
swapped="yes"/>
- </object>
- </child>
- <child>
- <object class="GtkRadioButton">
- <property name="visible">True</property>
- <property name="draw-indicator">False</property>
- <property name="group">current_location_radio</property>
- <property name="label" translatable="yes">All Files</property>
- </object>
- </child>
- </object>
- </child>
</object>
<packing>
<property name="name">search</property>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]