[gthumb] selections: fixed extra widget not showing



commit 96062656ebe46ba1894159d32033cca9ee7ab52c
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Sun Apr 13 12:25:02 2014 +0200

    selections: fixed extra widget not showing

 extensions/search/gth-search-task.c                |    7 ++++++-
 extensions/selections/gth-file-source-selections.c |    8 ++++++++
 gthumb/gth-browser.c                               |    4 +++-
 gthumb/gth-file-source.c                           |   15 +++++++++++++++
 gthumb/gth-file-source.h                           |    2 ++
 5 files changed, 34 insertions(+), 2 deletions(-)
---
diff --git a/extensions/search/gth-search-task.c b/extensions/search/gth-search-task.c
index 6a881f4..d7484d2 100644
--- a/extensions/search/gth-search-task.c
+++ b/extensions/search/gth-search-task.c
@@ -92,6 +92,7 @@ info_bar_response_cb (GtkInfoBar *info_bar,
 
        switch (response_id) {
        case GTK_RESPONSE_CANCEL:
+               gtk_widget_hide (data->task->priv->dialog);
                gth_task_cancel (GTH_TASK (data->task));
                break;
 
@@ -119,6 +120,7 @@ save_search_result_copy_done_cb (void     **buffer,
                                    task->priv->search_catalog,
                                    gth_catalog_get_file_list (GTH_CATALOG (task->priv->search)),
                                    GTH_MONITOR_EVENT_CREATED);
+       gtk_widget_hide (task->priv->dialog);
        gth_task_completed (GTH_TASK (task), task->priv->error);
 }
 
@@ -260,6 +262,7 @@ browser_location_ready_cb (GthBrowser    *browser,
        g_signal_handler_disconnect (task->priv->browser, task->priv->location_ready_id);
 
        if (error) {
+               gtk_widget_hide (task->priv->dialog);
                gth_task_completed (GTH_TASK (task), NULL);
                return;
        }
@@ -413,8 +416,10 @@ gth_search_task_exec (GthTask *base)
 static void
 gth_search_task_cancelled (GthTask *task)
 {
-       if (! GTH_SEARCH_TASK (task)->priv->io_operation)
+       if (! GTH_SEARCH_TASK (task)->priv->io_operation) {
+               gtk_widget_hide (GTH_SEARCH_TASK (task)->priv->dialog);
                gth_task_completed (task, g_error_new_literal (GTH_TASK_ERROR, GTH_TASK_ERROR_CANCELLED, ""));
+       }
 }
 
 
diff --git a/extensions/selections/gth-file-source-selections.c 
b/extensions/selections/gth-file-source-selections.c
index bab08e3..5d8c0f1 100644
--- a/extensions/selections/gth-file-source-selections.c
+++ b/extensions/selections/gth-file-source-selections.c
@@ -273,6 +273,13 @@ gth_file_source_selections_remove (GthFileSource *file_source,
 }
 
 
+static gboolean
+gth_file_source_selections_shows_extra_widget (GthFileSource *file_source)
+{
+       return TRUE;
+}
+
+
 static void
 gth_file_source_selections_finalize (GObject *object)
 {
@@ -310,6 +317,7 @@ gth_file_source_selections_class_init (GthFileSourceSelectionsClass *class)
        file_source_class->is_reorderable  = gth_file_source_selections_is_reorderable;
        file_source_class->reorder = gth_file_source_selections_reorder;
        file_source_class->remove = gth_file_source_selections_remove;
+       file_source_class->shows_extra_widget = gth_file_source_selections_shows_extra_widget;
 }
 
 
diff --git a/gthumb/gth-browser.c b/gthumb/gth-browser.c
index e445bc0..3fb610a 100644
--- a/gthumb/gth-browser.c
+++ b/gthumb/gth-browser.c
@@ -397,7 +397,6 @@ gth_browser_update_sensitivity (GthBrowser *browser)
 void
 gth_browser_update_extra_widget (GthBrowser *browser)
 {
-       gtk_widget_hide (browser->priv->list_info_bar);
        gtk_widget_show (browser->priv->location_bar);
        _gtk_container_remove_children (GTK_CONTAINER (gth_location_bar_get_action_area (GTH_LOCATION_BAR 
(browser->priv->location_bar))), NULL, NULL);
        gth_location_bar_set_from_file (GTH_LOCATION_BAR (browser->priv->location_bar), 
browser->priv->location->file);
@@ -1800,6 +1799,9 @@ _gth_browser_load (GthBrowser *browser,
                break;
        }
 
+       if (! gth_file_source_shows_extra_widget (load_data->file_source))
+               gtk_widget_hide (browser->priv->list_info_bar);
+
        {
                char *uri;
 
diff --git a/gthumb/gth-file-source.c b/gthumb/gth-file-source.c
index dea8567..4fc6b0f 100644
--- a/gthumb/gth-file-source.c
+++ b/gthumb/gth-file-source.c
@@ -848,6 +848,13 @@ base_remove (GthFileSource *file_source,
 }
 
 
+static gboolean
+base_shows_extra_widget (GthFileSource *file_source)
+{
+       return FALSE;
+}
+
+
 static void
 gth_file_source_finalize (GObject *object)
 {
@@ -889,6 +896,7 @@ gth_file_source_class_init (GthFileSourceClass *class)
        class->reorder = base_reorder;
        class->remove = base_remove;
        class->get_free_space = base_get_free_space;
+       class->shows_extra_widget = base_shows_extra_widget;
 }
 
 
@@ -1363,3 +1371,10 @@ gth_file_source_get_free_space (GthFileSource      *file_source,
        g_cancellable_reset (file_source->priv->cancellable);
        GTH_FILE_SOURCE_GET_CLASS (G_OBJECT (file_source))->get_free_space (file_source, location, callback, 
data);
 }
+
+
+gboolean
+gth_file_source_shows_extra_widget (GthFileSource *file_source)
+{
+       return GTH_FILE_SOURCE_GET_CLASS (G_OBJECT (file_source))->shows_extra_widget (file_source);
+}
diff --git a/gthumb/gth-file-source.h b/gthumb/gth-file-source.h
index 9f9ffc9..24b5546 100644
--- a/gthumb/gth-file-source.h
+++ b/gthumb/gth-file-source.h
@@ -136,6 +136,7 @@ struct _GthFileSourceClass
                                               GFile                *location,
                                               SpaceReadyCallback    callback,
                                               gpointer              data);
+       gboolean     (*shows_extra_widget)    (GthFileSource        *file_source);
 };
 
 GType          gth_file_source_get_type              (void) G_GNUC_CONST;
@@ -224,6 +225,7 @@ void           gth_file_source_get_free_space        (GthFileSource        *file
                                                      GFile                *location,
                                                      SpaceReadyCallback    callback,
                                                      gpointer              data);
+gboolean       gth_file_source_shows_extra_widget    (GthFileSource        *file_source);
 
 /*< protected >*/
 


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