Commit 0143f44b authored by Paolo Bacchilega's avatar Paolo Bacchilega
Browse files

Empty Options dialog after Canceling it once

[bug #711788]
parent 8218cdec
......@@ -78,8 +78,8 @@ gth_image_saver_jpeg_get_control (GthImageSaver *base)
int i;
int active_idx;
if (self->priv->builder == NULL)
self->priv->builder = _gtk_builder_new_from_file ("jpeg-options.ui", "cairo_io");
_g_object_unref (self->priv->builder);
self->priv->builder = _gtk_builder_new_from_file ("jpeg-options.ui", "cairo_io");
active_idx = 0;
extensions = g_strsplit (gth_image_saver_get_extensions (base), " ", -1);
......
......@@ -67,8 +67,8 @@ gth_image_saver_png_get_control (GthImageSaver *base)
{
GthImageSaverPng *self = GTH_IMAGE_SAVER_PNG (base);
if (self->priv->builder == NULL)
self->priv->builder = _gtk_builder_new_from_file ("png-options.ui", "cairo_io");
_g_object_unref (self->priv->builder);
self->priv->builder = _gtk_builder_new_from_file ("png-options.ui", "cairo_io");
gtk_adjustment_set_value (GTK_ADJUSTMENT (_gtk_builder_get_widget (self->priv->builder, "png_compression_adjustment")),
g_settings_get_int (self->priv->settings, PREF_PNG_COMPRESSION_LEVEL));
......@@ -366,4 +366,5 @@ gth_image_saver_png_init (GthImageSaverPng *self)
{
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_IMAGE_SAVER_PNG, GthImageSaverPngPrivate);
self->priv->settings = g_settings_new (GTHUMB_IMAGE_SAVERS_PNG_SCHEMA);
self->priv->builder = NULL;
}
......@@ -51,8 +51,8 @@ gth_image_saver_tga_get_control (GthImageSaver *base)
{
GthImageSaverTga *self = GTH_IMAGE_SAVER_TGA (base);
if (self->priv->builder == NULL)
self->priv->builder = _gtk_builder_new_from_file ("tga-options.ui", "cairo_io");
_g_object_unref (self->priv->builder);
self->priv->builder = _gtk_builder_new_from_file ("tga-options.ui", "cairo_io");
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (_gtk_builder_get_widget (self->priv->builder, "tga_rle_compression_checkbutton")),
g_settings_get_boolean (self->priv->settings, PREF_TGA_RLE_COMPRESSION));
......@@ -357,4 +357,5 @@ gth_image_saver_tga_init (GthImageSaverTga *self)
{
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_IMAGE_SAVER_TGA, GthImageSaverTgaPrivate);
self->priv->settings = g_settings_new (GTHUMB_IMAGE_SAVERS_TGA_SCHEMA);
self->priv->builder = NULL;
}
......@@ -76,8 +76,8 @@ gth_image_saver_tiff_get_control (GthImageSaver *base)
int active_idx;
GthTiffCompression compression_type;
if (self->priv->builder == NULL)
self->priv->builder = _gtk_builder_new_from_file ("tiff-options.ui", "cairo_io");
_g_object_unref (self->priv->builder);
self->priv->builder = _gtk_builder_new_from_file ("tiff-options.ui", "cairo_io");
active_idx = 0;
extensions = g_strsplit (gth_image_saver_get_extensions (base), " ", -1);
......
......@@ -55,8 +55,8 @@ gth_image_saver_webp_get_control (GthImageSaver *base)
{
GthImageSaverWebp *self = GTH_IMAGE_SAVER_WEBP (base);
if (self->priv->builder == NULL)
self->priv->builder = _gtk_builder_new_from_file ("webp-options.ui", "cairo_io");
_g_object_unref (self->priv->builder);
self->priv->builder = _gtk_builder_new_from_file ("webp-options.ui", "cairo_io");
gtk_adjustment_set_value (GTK_ADJUSTMENT (GET_WIDGET ("quality_adjustment")),
g_settings_get_int (self->priv->settings, PREF_WEBP_QUALITY));
......@@ -395,4 +395,5 @@ gth_image_saver_webp_init (GthImageSaverWebp *self)
{
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_IMAGE_SAVER_WEBP, GthImageSaverWebpPrivate);
self->priv->settings = g_settings_new (GTHUMB_IMAGE_SAVERS_WEBP_SCHEMA);
self->priv->builder = NULL;
}
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