+2007-03-24 Jim Evins <evins@snaught.com>
+
+ * src/object-editor-image-page.c:
+ (gl_object_editor_prepare_image_page),
+ (gl_object_editor_set_image), (img_selection_changed_cb):
+ Workaround for GtkFileChooserButton bug # 327243. This the root
+ cause for gLabels bug # 1192884. I have actually observed 3 delayed
+ "selection-changed" signals -- the first 2 return NULL -- this is
+ what caused the image to reset to the default followed by setting
+ it back to the original image, trying to fit it into a new bounding
+ box. This sequence of events is much more evident with the new
+ cairo rendering.
+
2007-03-23 Jim Evins <evins@snaught.com>
Merged all changes from experimental cairo branch to trunk.
gpointer data);
static void add_image_filters_to_chooser (GtkFileChooser *file_chooser);
+static void img_selection_changed_cb (glObjectEditor *editor);
\f
/*--------------------------------------------------------------------------*/
/* Connect signals */
g_signal_connect_swapped (G_OBJECT (editor->priv->img_file_button),
"selection-changed",
- G_CALLBACK (gl_object_editor_changed_cb),
+ G_CALLBACK (img_selection_changed_cb),
G_OBJECT (editor));
g_signal_connect_swapped (G_OBJECT (editor->priv->img_key_combo),
"changed",
g_signal_handlers_block_by_func (G_OBJECT (editor->priv->img_key_combo),
G_CALLBACK (gl_object_editor_changed_cb),
editor);
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->img_file_radio),
+ G_CALLBACK (img_radio_toggled_cb),
+ editor);
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->img_key_radio),
+ G_CALLBACK (img_radio_toggled_cb),
+ editor);
gtk_widget_set_sensitive (editor->priv->img_key_radio, merge_flag);
g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->img_key_combo),
G_CALLBACK (gl_object_editor_changed_cb),
editor);
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->img_file_radio),
+ G_CALLBACK (img_radio_toggled_cb),
+ editor);
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->img_key_radio),
+ G_CALLBACK (img_radio_toggled_cb),
+ editor);
gl_debug (DEBUG_EDITOR, "END");
}
}
g_slist_free (filters);
}
+
+/*--------------------------------------------------------------------------*/
+/* PRIVATE. Selection changed callback. */
+/*--------------------------------------------------------------------------*/
+static void
+img_selection_changed_cb (glObjectEditor *editor)
+{
+ gchar *filename;
+
+ gl_debug (DEBUG_EDITOR, "START");
+
+ filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER(editor->priv->img_file_button));
+ if (filename != NULL)
+ {
+ /* Emit our "changed" signal */
+ g_signal_emit (G_OBJECT (editor), gl_object_editor_signals[CHANGED], 0);
+ }
+ g_free (filename);
+
+ gl_debug (DEBUG_EDITOR, "END");
+}
+