[gthumb] preferences: always use a specific section for the slideshow



commit 7a2bf177fe6f5ae9cb2d58dc4da931a1bb62ead4
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Sat Nov 16 17:49:34 2019 +0100

    preferences: always use a specific section for the slideshow

 extensions/image_viewer/preferences.c |  1 -
 extensions/slideshow/preferences.c    | 30 +++++-------------------------
 2 files changed, 5 insertions(+), 26 deletions(-)
---
diff --git a/extensions/image_viewer/preferences.c b/extensions/image_viewer/preferences.c
index 3bc6f2ad..e07c0858 100644
--- a/extensions/image_viewer/preferences.c
+++ b/extensions/image_viewer/preferences.c
@@ -106,7 +106,6 @@ image_viewer__dlg_preferences_construct_cb (GtkWidget  *dialog,
        notebook = _gtk_builder_get_widget (dialog_builder, "notebook");
 
        page = _gtk_builder_get_widget (data->builder, "preferences_page");
-       g_object_set_data (G_OBJECT (page), "extension-name", "image_viewer");
        gtk_widget_show (page);
 
        gtk_combo_box_set_active (GTK_COMBO_BOX (GET_WIDGET ("change_zoom_combobox")),
diff --git a/extensions/slideshow/preferences.c b/extensions/slideshow/preferences.c
index 6ae8dbeb..4f46612a 100644
--- a/extensions/slideshow/preferences.c
+++ b/extensions/slideshow/preferences.c
@@ -98,7 +98,7 @@ ss__dlg_preferences_construct_cb (GtkWidget  *dialog,
        BrowserData *data;
        GtkWidget   *notebook;
        char        *current_transition;
-       gboolean     image_viewer_page_found;
+       GtkWidget   *label;
 
        notebook = _gtk_builder_get_widget (dialog_builder, "notebook");
 
@@ -139,30 +139,10 @@ ss__dlg_preferences_construct_cb (GtkWidget  *dialog,
                          G_CALLBACK (change_delay_spinbutton_value_changed_cb),
                          data);
 
-       image_viewer_page_found = FALSE;
-       if (gth_main_extension_is_active ("image_viewer")) {
-               GList *children;
-               GList *scan;
-
-               children = gtk_container_get_children (GTK_CONTAINER (gtk_builder_get_object (dialog_builder, 
"notebook")));
-               for (scan = children; scan; scan = scan->next) {
-                       GtkWidget *page = scan->data;
-
-                       if (g_strcmp0 (g_object_get_data (G_OBJECT (page), "extension-name"), "image_viewer") 
== 0) {
-                               image_viewer_page_found = TRUE;
-                               gtk_widget_set_vexpand (data->preferences_page, FALSE);
-                               gtk_box_pack_start (GTK_BOX (page), data->preferences_page, FALSE, FALSE, 0);
-                       }
-               }
-       }
-
-       if (! image_viewer_page_found) { /* add the preferences in an ad-hoc page */
-               GtkWidget *label;
-
-               label = gtk_label_new (_("Slideshow"));
-               gtk_widget_show (label);
-               gtk_notebook_append_page (GTK_NOTEBOOK (notebook), data->preferences_page, label);
-       }
+       label = gtk_label_new (_("Slideshow"));
+       gtk_widget_show (label);
+
+       gtk_notebook_append_page (GTK_NOTEBOOK (notebook), data->preferences_page, label);
 
        g_object_set_data_full (G_OBJECT (dialog), BROWSER_DATA_KEY, data, (GDestroyNotify) 
browser_data_free);
 }


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