]> Pileus Git - ~andy/gtk/commitdiff
Don't use bitops on booleans. (gtk_file_chooser_default_should_respond):
authorMatthias Clasen <mclasen@redhat.com>
Wed, 22 Sep 2004 20:17:53 +0000 (20:17 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Wed, 22 Sep 2004 20:17:53 +0000 (20:17 +0000)
2004-09-22  Matthias Clasen  <mclasen@redhat.com>

* gtk/gtkfilechooserdefault.c (selection_check_foreach_cb): Don't use
bitops on booleans.
(gtk_file_chooser_default_should_respond): Make it easier to
select folders in SELECT_FOLDER mode.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkfilechooserdefault.c

index 93c211fde9ad3b2a71a72e5d90783f83ceeda847..423893f95e87ecca86603027c6fca1273610715d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,8 @@
 
        * gtk/gtkfilechooserdefault.c (selection_check_foreach_cb): Don't use
        bitops on booleans.
+       (gtk_file_chooser_default_should_respond): Make it easier to 
+       select folders in SELECT_FOLDER mode.
 
 Wed Sep 22 00:54:34 2004  Matthias Clasen  <mclasen@redhat.com>
 
index 93c211fde9ad3b2a71a72e5d90783f83ceeda847..423893f95e87ecca86603027c6fca1273610715d 100644 (file)
@@ -2,6 +2,8 @@
 
        * gtk/gtkfilechooserdefault.c (selection_check_foreach_cb): Don't use
        bitops on booleans.
+       (gtk_file_chooser_default_should_respond): Make it easier to 
+       select folders in SELECT_FOLDER mode.
 
 Wed Sep 22 00:54:34 2004  Matthias Clasen  <mclasen@redhat.com>
 
index 93c211fde9ad3b2a71a72e5d90783f83ceeda847..423893f95e87ecca86603027c6fca1273610715d 100644 (file)
@@ -2,6 +2,8 @@
 
        * gtk/gtkfilechooserdefault.c (selection_check_foreach_cb): Don't use
        bitops on booleans.
+       (gtk_file_chooser_default_should_respond): Make it easier to 
+       select folders in SELECT_FOLDER mode.
 
 Wed Sep 22 00:54:34 2004  Matthias Clasen  <mclasen@redhat.com>
 
index 93c211fde9ad3b2a71a72e5d90783f83ceeda847..423893f95e87ecca86603027c6fca1273610715d 100644 (file)
@@ -2,6 +2,8 @@
 
        * gtk/gtkfilechooserdefault.c (selection_check_foreach_cb): Don't use
        bitops on booleans.
+       (gtk_file_chooser_default_should_respond): Make it easier to 
+       select folders in SELECT_FOLDER mode.
 
 Wed Sep 22 00:54:34 2004  Matthias Clasen  <mclasen@redhat.com>
 
index 58ebb07e0feda92bf5273d45ace5d7b23524cdc0..6f8b905a0f404374f2299d64428adc1fd29bad65 100644 (file)
@@ -4932,9 +4932,7 @@ gtk_file_chooser_default_should_respond (GtkFileChooserEmbed *chooser_embed)
 
   current_focus = gtk_window_get_focus (GTK_WINDOW (toplevel));
 
-  if (current_focus == NULL)
-    return FALSE;
-  else if (current_focus == impl->browse_files_tree_view)
+  if (current_focus == impl->browse_files_tree_view)
     {
       int num_selected;
       gboolean all_files, all_folders;
@@ -4943,9 +4941,17 @@ gtk_file_chooser_default_should_respond (GtkFileChooserEmbed *chooser_embed)
 
       selection_check (impl, &num_selected, &all_files, &all_folders);
 
-      if (impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER && num_selected != 1)
-       return TRUE; /* zero means current folder; more than one means use the whole selection */
-
+      if (impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER)
+       {
+         if (num_selected != 1)
+           return TRUE; /* zero means current folder; more than one means use the whole selection */
+         else if (current_focus != impl->browse_files_tree_view)
+           {
+             /* a single folder is selected and a button was clicked */
+             switch_to_selected_folder (impl);
+             return TRUE;
+           }
+       }
       if (num_selected == 0)
        {
          if (impl->action == GTK_FILE_CHOOSER_ACTION_SAVE