Commit 7a2bf177 authored by Paolo Bacchilega's avatar Paolo Bacchilega

preferences: always use a specific section for the slideshow

parent 3b95e2a6
......@@ -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")),
......
......@@ -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);
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment