From: Jim Evins Date: Sat, 20 Nov 2010 20:52:35 +0000 (-0500) Subject: Fixed problem with creation of 1st barcode. X-Git-Tag: glabels-2_3_1~131 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a35071a7dd2b561b6cf479c46639fa62fbefb045;p=glabels Fixed problem with creation of 1st barcode. A change signal is apparently being delayed until the actual widget is being realized as a result of the gtk_widget_show of the object editor notebook. The proper fix is to use actual signal blockers rather than the simple "stop_signals" flag, since the flags assume callbacks are always called inline rather than being called asynchronously. --- diff --git a/src/object-editor-bc-page.c b/src/object-editor-bc-page.c index 06a7c57a..1c2d0cf5 100644 --- a/src/object-editor-bc-page.c +++ b/src/object-editor-bc-page.c @@ -310,6 +310,8 @@ gl_object_editor_set_bc_style (glObjectEditor *editor, gl_debug (DEBUG_EDITOR, "START"); + gl_object_editor_load_bc_styles (editor, bc_style->backend_id); + editor->priv->stop_signals = TRUE; backend_name = gl_barcode_backends_backend_id_to_name (bc_style->backend_id); @@ -357,7 +359,7 @@ gl_object_editor_set_bc_style (glObjectEditor *editor, gtk_widget_set_sensitive (editor->priv->data_digits_spin, !editor->priv->data_format_fixed_flag); } - + editor->priv->stop_signals = FALSE; gl_debug (DEBUG_EDITOR, "END"); diff --git a/src/object-editor.c b/src/object-editor.c index f7030dde..ef4329d6 100644 --- a/src/object-editor.c +++ b/src/object-editor.c @@ -284,7 +284,6 @@ set_object (glObjectEditor *editor, gchar *s; GtkTextBuffer *buffer; gint old_page, new_page; - glLabelBarcodeStyle *bc_style; gl_debug (DEBUG_EDITOR, "START"); @@ -413,10 +412,6 @@ set_object (glObjectEditor *editor, gtk_widget_hide (editor->priv->shadow_page_vbox); gtk_widget_hide (editor->priv->size_reset_image_button); - - bc_style = gl_label_barcode_get_style (GL_LABEL_BARCODE(object)); - gl_object_editor_load_bc_styles (editor, bc_style->backend_id); - gl_label_barcode_style_free (bc_style); } gtk_image_set_from_icon_name (GTK_IMAGE(editor->priv->title_image), @@ -432,7 +427,9 @@ set_object (glObjectEditor *editor, gtk_widget_set_sensitive (editor->priv->title_image, TRUE); gtk_widget_set_sensitive (editor->priv->title_label, TRUE); + editor->priv->stop_signals = TRUE; gtk_widget_show (editor->priv->notebook); + editor->priv->stop_signals = FALSE; /* if the old active page is no longer visible, set to 1st visible page. */ new_page = gtk_notebook_get_current_page (GTK_NOTEBOOK (editor->priv->notebook));