[gtk+] file-chooser: make enter location an operation mode



commit 384b227e7b3dc1e7a969ad17451c9af62bde6ccd
Author: William Jon McCann <william jon mccann gmail com>
Date:   Wed Apr 9 13:49:54 2014 -0400

    file-chooser: make enter location an operation mode
    
    https://bugzilla.gnome.org/show_bug.cgi?id=722211

 gtk/gtkfilechooserwidget.c |   21 ++++++++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c
index 6871b46..498ede0 100644
--- a/gtk/gtkfilechooserwidget.c
+++ b/gtk/gtkfilechooserwidget.c
@@ -184,6 +184,7 @@ typedef enum {
 typedef enum {
   OPERATION_MODE_BROWSE,
   OPERATION_MODE_SEARCH,
+  OPERATION_MODE_ENTER_LOCATION,
   OPERATION_MODE_RECENT
 } OperationMode;
 
@@ -2120,7 +2121,7 @@ static void
 places_sidebar_show_enter_location_cb (GtkPlacesSidebar *sidebar,
                                        GtkFileChooserWidget *impl)
 {
-  location_mode_set (impl, LOCATION_MODE_FILENAME_ENTRY);
+  operation_mode_set (impl, OPERATION_MODE_ENTER_LOCATION);
 }
 
 static void
@@ -2332,6 +2333,9 @@ location_bar_update (GtkFileChooserWidget *impl)
 
   switch (priv->operation_mode)
     {
+    case OPERATION_MODE_ENTER_LOCATION:
+      break;
+
     case OPERATION_MODE_BROWSE:
       break;
 
@@ -2382,6 +2386,10 @@ operation_mode_stop (GtkFileChooserWidget *impl, OperationMode mode)
 {
   switch (mode)
     {
+    case OPERATION_MODE_ENTER_LOCATION:
+      stop_loading_and_clear_list_model (impl, TRUE);
+      break;
+
     case OPERATION_MODE_BROWSE:
       stop_loading_and_clear_list_model (impl, TRUE);
       break;
@@ -2402,6 +2410,13 @@ operation_mode_stop (GtkFileChooserWidget *impl, OperationMode mode)
 }
 
 static void
+operation_mode_set_enter_location (GtkFileChooserWidget *impl)
+{
+  location_mode_set (impl, LOCATION_MODE_FILENAME_ENTRY);
+  location_bar_update (impl);
+}
+
+static void
 operation_mode_set_browse (GtkFileChooserWidget *impl)
 {
   GtkFileChooserWidgetPrivate *priv = impl->priv;
@@ -2443,6 +2458,10 @@ operation_mode_set (GtkFileChooserWidget *impl, OperationMode mode)
 
   switch (priv->operation_mode)
     {
+    case OPERATION_MODE_ENTER_LOCATION:
+      operation_mode_set_enter_location (impl);
+      break;
+
     case OPERATION_MODE_BROWSE:
       operation_mode_set_browse (impl);
       break;


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