[gtk+/wip/matthiasc/filechooser: 12/13] file chooser: Make Escape work in search entry



commit 055d9c0152269a4a0932d530c63869000623f4ba
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Jun 27 01:23:16 2015 -0400

    file chooser: Make Escape work in search entry
    
    Arrange things so that hitting Escape during a running
    search stops the search, but leaves the search results
    around, and hitting Escape again leaves the search mode.

 gtk/gtkfilechooserwidget.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c
index 2c87035..76a7627 100644
--- a/gtk/gtkfilechooserwidget.c
+++ b/gtk/gtkfilechooserwidget.c
@@ -6289,8 +6289,6 @@ search_engine_error_cb (GtkSearchEngine *engine,
 
   search_stop_searching (impl, TRUE);
   error_message (impl, _("Could not send the search request"), message);
-
-  set_busy_cursor (impl, FALSE);
 }
 
 /* Frees the data in the search_model */
@@ -6329,6 +6327,7 @@ search_stop_searching (GtkFileChooserWidget *impl,
       g_signal_handlers_disconnect_by_data (priv->search_engine, impl);
       g_object_unref (priv->search_engine);
       priv->search_engine = NULL;
+      set_busy_cursor (impl, FALSE);
     }
 }
 
@@ -6450,7 +6449,10 @@ search_entry_activate_cb (GtkFileChooserWidget *impl)
 static void
 search_entry_stop_cb (GtkFileChooserWidget *impl)
 {
-  g_object_set (impl, "search-mode", FALSE, NULL);
+  if (impl->priv->search_engine)
+    search_stop_searching (impl, FALSE);
+  else
+    g_object_set (impl, "search-mode", FALSE, NULL);
 }
 
 /* Hides the path bar and creates the search entry */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]