[gtk+/wip/gbsneto/placessidebar-locations: 3/8] filechooserwidget: show places view sidebar's ::show-other-locations
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/gbsneto/placessidebar-locations: 3/8] filechooserwidget: show places view sidebar's ::show-other-locations
- Date: Sun, 21 Jun 2015 15:17:29 +0000 (UTC)
commit cd607d78b84b6795315bfb7944647a4b6dd7743d
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Tue Jun 16 20:48:55 2015 -0300
filechooserwidget: show places view sidebar's ::show-other-locations
Adapt GtkFileChooserWidget to be the reference implementation of the
newly added GtkPlacesView widget.
gtk/gtkfilechooserwidget.c | 15 +++++++++++++++
gtk/ui/gtkfilechooserwidget.ui | 12 ++++++++++++
2 files changed, 27 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c
index 51b0294..dfef740 100644
--- a/gtk/gtkfilechooserwidget.c
+++ b/gtk/gtkfilechooserwidget.c
@@ -2226,6 +2226,20 @@ places_sidebar_show_enter_location_cb (GtkPlacesSidebar *sidebar,
operation_mode_set (impl, OPERATION_MODE_ENTER_LOCATION);
}
+/* Callback used when the places sidebar asks us to show other locations */
+static void
+places_sidebar_show_other_locations_cb (GtkPlacesSidebar *sidebar,
+ GtkFileChooserWidget *impl)
+{
+ GtkFileChooserWidgetPrivate *priv = impl->priv;
+
+ gtk_stack_set_visible_child_name (GTK_STACK (priv->browse_files_stack), "other_locations");
+
+ priv->preview_widget_active = FALSE;
+ gtk_widget_hide (GTK_WIDGET (priv->browse_header_box));
+ update_preview_widget_visibility (impl);
+}
+
static void
location_toggle_popup_handler (GtkFileChooserWidget *impl)
{
@@ -7538,6 +7552,7 @@ gtk_file_chooser_widget_class_init (GtkFileChooserWidgetClass *class)
gtk_widget_class_bind_template_callback (widget_class, places_sidebar_open_location_cb);
gtk_widget_class_bind_template_callback (widget_class, places_sidebar_show_error_message_cb);
gtk_widget_class_bind_template_callback (widget_class, places_sidebar_show_enter_location_cb);
+ gtk_widget_class_bind_template_callback (widget_class, places_sidebar_show_other_locations_cb);
gtk_widget_class_bind_template_callback (widget_class, search_entry_activate_cb);
gtk_widget_class_bind_template_callback (widget_class, search_entry_stop_cb);
gtk_widget_class_bind_template_callback (widget_class, new_folder_popover_active);
diff --git a/gtk/ui/gtkfilechooserwidget.ui b/gtk/ui/gtkfilechooserwidget.ui
index 264f9cc..f3f4cb7 100644
--- a/gtk/ui/gtkfilechooserwidget.ui
+++ b/gtk/ui/gtkfilechooserwidget.ui
@@ -19,12 +19,14 @@
<property name="hscrollbar_policy">never</property>
<property name="local_only">True</property>
<property name="show_enter_location">True</property>
+ <property name="show_other_locations">True</property>
<style>
<class name="sidebar"/>
</style>
<signal name="open-location" handler="places_sidebar_open_location_cb" swapped="no"/>
<signal name="show-error-message" handler="places_sidebar_show_error_message_cb"
swapped="no"/>
<signal name="show-enter-location" handler="places_sidebar_show_enter_location_cb"
swapped="no"/>
+ <signal name="show-other-locations" handler="places_sidebar_show_other_locations_cb"
swapped="no"/>
</object>
<packing>
<property name="resize">False</property>
@@ -249,6 +251,16 @@
</packing>
</child>
<child>
+ <object class="GtkPlacesView" id="other_files_view">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <signal name="open-location" handler="places_sidebar_open_location_cb"
swapped="no"/>
+ </object>
+ <packing>
+ <property name="name">other_locations</property>
+ </packing>
+ </child>
+ <child>
<object class="GtkGrid">
<property name="visible">True</property>
<property name="row_spacing">12</property>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]