diff options
author | Matthias Clasen <mclasen@redhat.com> | 2015-07-01 08:40:15 -0700 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2015-07-04 00:29:25 -0400 |
commit | fe128b5b4d198a39c74a1a81b7a3e27f12262ff8 (patch) | |
tree | 360f3016f6440751235d7b4225d4cc07a566592f | |
parent | 648e4a7ea928d0d6d183e7e94def0ae15f97ac7b (diff) | |
download | gtk+-fe128b5b4d198a39c74a1a81b7a3e27f12262ff8.tar.gz |
file chooser: Don't show recent in save mode
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
-rw-r--r-- | gtk/gtkfilechooserwidget.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c index cb304faf61..eb34ef7eb7 100644 --- a/gtk/gtkfilechooserwidget.c +++ b/gtk/gtkfilechooserwidget.c @@ -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; |