file chooser: Don't show recent in save mode
authorMatthias Clasen <mclasen@redhat.com>
Wed, 1 Jul 2015 15:40:15 +0000 (08:40 -0700)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 4 Jul 2015 04:29:25 +0000 (00:29 -0400)
Don't show Recent in the sidebar when we are in save mode.
We also ignore the startup-mode = recent in save mode now - we
don't want to populate the file list with recent files if Recent
is not on the sidebar. If you really want to go there, you can
still enter recent:// in the location entry.

https://bugzilla.gnome.org/show_bug.cgi?id=751653

gtk/gtkfilechooserwidget.c

index cb304faf617244ee8e18c25fc6d3703b6904dfe8..eb34ef7eb74bf53ae2a72c464317e28c4adea6d5 100644 (file)
@@ -549,6 +549,7 @@ static void     settings_load                (GtkFileChooserWidget *impl);
 static void     show_filters                 (GtkFileChooserWidget *impl,
                                               gboolean               show);
 
+static gboolean recent_files_setting_is_enabled (GtkFileChooserWidget *impl);
 static void     recent_start_loading         (GtkFileChooserWidget *impl);
 static void     recent_stop_loading          (GtkFileChooserWidget *impl);
 static void     recent_clear_model           (GtkFileChooserWidget *impl,
@@ -2731,6 +2732,7 @@ update_appearance (GtkFileChooserWidget *impl)
     {
       save_widgets_create (impl);
       gtk_places_sidebar_set_show_enter_location (GTK_PLACES_SIDEBAR (priv->places_sidebar), FALSE);
+      gtk_places_sidebar_set_show_recent (GTK_PLACES_SIDEBAR (priv->places_sidebar), FALSE);
 
       if (priv->select_multiple)
        {
@@ -2738,12 +2740,14 @@ update_appearance (GtkFileChooserWidget *impl)
                     "Re-setting to single selection mode.");
          set_select_multiple (impl, FALSE, TRUE);
        }
+
     }
   else if (priv->action == GTK_FILE_CHOOSER_ACTION_OPEN ||
           priv->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER)
     {
       save_widgets_destroy (impl);
       gtk_places_sidebar_set_show_enter_location (GTK_PLACES_SIDEBAR (priv->places_sidebar), TRUE);
+      gtk_places_sidebar_set_show_recent (GTK_PLACES_SIDEBAR (priv->places_sidebar), recent_files_setting_is_enabled (impl));
       location_mode_set (impl, priv->location_mode);
     }
 
@@ -3374,7 +3378,7 @@ set_startup_mode (GtkFileChooserWidget *impl)
   switch (priv->startup_mode)
     {
     case STARTUP_MODE_RECENT:
-      if (recent_files_setting_is_enabled (impl))
+      if (gtk_places_sidebar_get_show_recent (GTK_PLACES_SIDEBAR (priv->places_sidebar)))
         {
           operation_mode_set (impl, OPERATION_MODE_RECENT);
           break;