diff options
author | Federico Mena Quintero <federico@gnome.org> | 2013-05-22 17:22:28 -0500 |
---|---|---|
committer | Federico Mena Quintero <federico@gnome.org> | 2013-05-22 17:30:49 -0500 |
commit | e6dca054457256465881dadaa00106e925a7fe12 (patch) | |
tree | 08118a1dc45029fe66a0a72b2ec2dbaefb4a3a20 | |
parent | dc2f399dd0ccc0710ee46b2fce610237fe18d998 (diff) | |
download | gtk+-e6dca054457256465881dadaa00106e925a7fe12.tar.gz |
GtkFileChooser: Only allow creating bookmarks for folders, not files
https://bugzilla.gnome.org/show_bug.cgi?id=561221
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
-rw-r--r-- | gtk/gtkfilechooserdefault.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c index 4f557c4227..8d9b115ed9 100644 --- a/gtk/gtkfilechooserdefault.c +++ b/gtk/gtkfilechooserdefault.c @@ -1645,19 +1645,19 @@ static void check_file_list_menu_sensitivity (GtkFileChooserDefault *impl) { GtkFileChooserDefaultPrivate *priv = impl->priv; - GtkTreeSelection *selection; + gint num_selected; + gboolean all_files; + gboolean all_folders; gboolean active; - selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->browse_files_tree_view)); - if (gtk_tree_selection_count_selected_rows (selection) == 0) - active = FALSE; - else - active = TRUE; + selection_check (impl, &num_selected, &all_files, &all_folders); + + active = (num_selected != 0); if (priv->browse_files_popup_menu_copy_file_location_item) gtk_widget_set_sensitive (priv->browse_files_popup_menu_copy_file_location_item, active); if (priv->browse_files_popup_menu_add_shortcut_item) - gtk_widget_set_sensitive (priv->browse_files_popup_menu_add_shortcut_item, active); + gtk_widget_set_sensitive (priv->browse_files_popup_menu_add_shortcut_item, active && all_folders); if (priv->browse_files_popup_menu_visit_file_item) gtk_widget_set_sensitive (priv->browse_files_popup_menu_visit_file_item, active); } |