From 384b227e7b3dc1e7a969ad17451c9af62bde6ccd Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Wed, 9 Apr 2014 13:49:54 -0400 Subject: [PATCH] file-chooser: make enter location an operation mode https://bugzilla.gnome.org/show_bug.cgi?id=722211 --- gtk/gtkfilechooserwidget.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c index 6871b46dbc..498ede0200 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; @@ -2401,6 +2409,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) { @@ -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;