]> git.sur5r.net Git - glabels/commitdiff
Fixed problem with creation of 1st barcode.
authorJim Evins <evins@snaught.com>
Sat, 20 Nov 2010 20:52:35 +0000 (15:52 -0500)
committerJim Evins <evins@snaught.com>
Sat, 20 Nov 2010 20:52:35 +0000 (15:52 -0500)
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.

src/object-editor-bc-page.c
src/object-editor.c

index 06a7c57a043d734297de5b644dd726e2a2280e48..1c2d0cf5c5ec327b650b5180c395b035d4da6c90 100644 (file)
@@ -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");
index f7030dde55d993327d5da7d1c03c87989414a370..ef4329d6b04b94571d0d01bf818435cdd115e2b6 100644 (file)
@@ -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));