]> git.sur5r.net Git - glabels/commitdiff
Fixed problem with creation of 1st barcode, again.
authorJim Evins <evins@snaught.com>
Sat, 27 Nov 2010 02:27:25 +0000 (21:27 -0500)
committerJim Evins <evins@snaught.com>
Sat, 27 Nov 2010 02:33:02 +0000 (21:33 -0500)
Previous fix only temporarily masked the problem.  The problem is that
the first time the barcode tabs are made visible, the digits spin button
would emit a "changed" signal.  The fix is to connect to the "value-changed"
signal instead.

This commit also includes replacing the stop_signals flag with explicit
signal blockers.

12 files changed:
src/object-editor-bc-page.c
src/object-editor-data-page.c
src/object-editor-fill-page.c
src/object-editor-image-page.c
src/object-editor-line-page.c
src/object-editor-lsize-page.c
src/object-editor-position-page.c
src/object-editor-private.h
src/object-editor-shadow-page.c
src/object-editor-size-page.c
src/object-editor-text-page.c
src/object-editor.c

index 1c2d0cf5c5ec327b650b5180c395b035d4da6c90..ca3aaff6a9846a29caed399ec8922874a5c835bf 100644 (file)
@@ -172,7 +172,7 @@ gl_object_editor_prepare_bc_page (glObjectEditor       *editor)
                                  G_CALLBACK (bc_radio_toggled_cb),
                                  G_OBJECT (editor));
        g_signal_connect_swapped (G_OBJECT (editor->priv->data_digits_spin),
-                                 "changed",
+                                 "value-changed",
                                  G_CALLBACK (data_digits_spin_changed_cb),
                                  G_OBJECT (editor));
 
@@ -190,8 +190,6 @@ backend_changed_cb (glObjectEditor       *editor)
        const gchar    *backend_id;
         const gchar    *style_name;
 
-        if (editor->priv->stop_signals) return;
-
         backend_name =
                gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (editor->priv->bc_backend_combo));
 
@@ -220,8 +218,6 @@ style_changed_cb (glObjectEditor       *editor)
        gchar          *ex_string = NULL;
        guint           digits;
 
-        if (editor->priv->stop_signals) return;
-
         backend_name =
                gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (editor->priv->bc_backend_combo));
 
@@ -284,13 +280,15 @@ gl_object_editor_load_bc_styles (glObjectEditor      *editor,
  
        gl_debug (DEBUG_EDITOR, "START");
 
-        editor->priv->stop_signals = TRUE;
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->bc_style_combo),
+                                         style_changed_cb, editor);
 
        styles = gl_barcode_backends_get_styles_list (backend_id);
        gl_combo_util_set_strings (GTK_COMBO_BOX_TEXT(editor->priv->bc_style_combo), styles);
        gl_barcode_backends_free_styles_list (styles);
 
-        editor->priv->stop_signals = FALSE;
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->bc_style_combo),
+                                         style_changed_cb, editor);
 
        gl_debug (DEBUG_EDITOR, "END");
 }
@@ -312,7 +310,18 @@ gl_object_editor_set_bc_style (glObjectEditor            *editor,
 
         gl_object_editor_load_bc_styles (editor, bc_style->backend_id);
 
-        editor->priv->stop_signals = TRUE;
+
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->bc_backend_combo),
+                                         backend_changed_cb, editor);
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->bc_style_combo),
+                                         style_changed_cb, editor);
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->bc_text_check),
+                                         gl_object_editor_changed_cb, editor);
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->bc_cs_check),
+                                         gl_object_editor_changed_cb, editor);
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->data_digits_spin),
+                                         data_digits_spin_changed_cb, editor);
+
 
         backend_name = gl_barcode_backends_backend_id_to_name (bc_style->backend_id);
         style_name   = gl_barcode_backends_style_id_to_name (bc_style->backend_id, bc_style->id);
@@ -360,7 +369,18 @@ gl_object_editor_set_bc_style (glObjectEditor            *editor,
                                          !editor->priv->data_format_fixed_flag);
        }
 
-        editor->priv->stop_signals = FALSE;
+
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->bc_backend_combo),
+                                           backend_changed_cb, editor);
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->bc_style_combo),
+                                           style_changed_cb, editor);
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->bc_text_check),
+                                           gl_object_editor_changed_cb, editor);
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->bc_cs_check),
+                                           gl_object_editor_changed_cb, editor);
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->data_digits_spin),
+                                           data_digits_spin_changed_cb, editor);
+
 
        gl_debug (DEBUG_EDITOR, "END");
 }
@@ -415,16 +435,25 @@ gl_object_editor_set_bc_color (glObjectEditor      *editor,
 {
        gl_debug (DEBUG_EDITOR, "START");
 
-        editor->priv->stop_signals = TRUE;
 
-       gtk_widget_set_sensitive (editor->priv->bc_key_radio, merge_flag);
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->bc_color_combo),
+                                         gl_object_editor_changed_cb, editor);
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->bc_color_radio),
+                                         bc_radio_toggled_cb, editor);
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->bc_key_radio),
+                                         bc_radio_toggled_cb, editor);
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->bc_key_combo),
+                                         gl_object_editor_changed_cb, editor);
 
-       if ( color_node->color == GL_COLOR_NONE ) {
-
-               gl_color_combo_set_to_default (GL_COLOR_COMBO(editor->priv->bc_color_combo));
 
-       } else {
+       gtk_widget_set_sensitive (editor->priv->bc_key_radio, merge_flag);
 
+       if ( color_node->color == GL_COLOR_NONE )
+        {
+               gl_color_combo_set_to_default (GL_COLOR_COMBO(editor->priv->bc_color_combo));
+       }
+        else
+        {
                gl_color_combo_set_color (GL_COLOR_COMBO(editor->priv->bc_color_combo),
                                           color_node->color);
        }
@@ -445,7 +474,16 @@ gl_object_editor_set_bc_color (glObjectEditor      *editor,
                                            color_node->key);
        }       
        
-        editor->priv->stop_signals = FALSE;
+
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->bc_color_combo),
+                                           gl_object_editor_changed_cb, editor);
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->bc_color_radio),
+                                           bc_radio_toggled_cb, editor);
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->bc_key_radio),
+                                           bc_radio_toggled_cb, editor);
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->bc_key_combo),
+                                           gl_object_editor_changed_cb, editor);
+
        
        gl_debug (DEBUG_EDITOR, "END");
 }
@@ -495,8 +533,6 @@ gl_object_editor_get_bc_color (glObjectEditor      *editor)
 static void
 bc_radio_toggled_cb (glObjectEditor *editor)
 {
-        if (editor->priv->stop_signals) return;
-
         gl_debug (DEBUG_EDITOR, "START");
        
        if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->bc_color_radio))) {
@@ -525,8 +561,6 @@ data_digits_spin_changed_cb (glObjectEditor *editor)
         guint           digits;
         gchar          *ex_string;
 
-        if (editor->priv->stop_signals) return;
-
         backend_name = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (editor->priv->bc_backend_combo));
         backend_id = gl_barcode_backends_backend_name_to_id (backend_name);
 
index bb2ba930aaaeff094732ddec4d83332890102590..009adbcae7e7085810b1eab12fed29d715d4271a 100644 (file)
@@ -111,8 +111,6 @@ gl_object_editor_prepare_data_page (glObjectEditor *editor)
 static void
 data_radio_toggled_cb (glObjectEditor *editor)
 {
-        if (editor->priv->stop_signals) return;
-
         gl_debug (DEBUG_WDGT, "START");
  
        if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->data_literal_radio))) {
@@ -150,14 +148,23 @@ gl_object_editor_set_data (glObjectEditor      *editor,
         gint pos;
  
         gl_debug (DEBUG_EDITOR, "START");
+
  
-        editor->priv->stop_signals = TRUE;
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->data_literal_radio),
+                                         data_radio_toggled_cb, editor);
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->data_key_radio),
+                                         data_radio_toggled_cb, editor);
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->data_text_entry),
+                                         gl_object_editor_changed_cb, editor);
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->data_key_combo),
+                                         gl_object_editor_changed_cb, editor);
+
 
         gtk_widget_set_sensitive (editor->priv->data_key_radio, merge_flag);
  
-        if (!text_node->field_flag || !merge_flag) {
-                gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
+        if (!text_node->field_flag || !merge_flag)
+        {
+                 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
                                               (editor->priv->data_literal_radio), TRUE); 
                 gtk_widget_set_sensitive (editor->priv->data_text_entry, TRUE);
                 gtk_widget_set_sensitive (editor->priv->data_key_combo, FALSE);
@@ -168,15 +175,16 @@ gl_object_editor_set_data (glObjectEditor      *editor,
  
                 gtk_editable_delete_text (GTK_EDITABLE (editor->priv->data_text_entry), 0, -1);
                 pos = 0;
-                if (text_node->data != NULL ) {
+                if (text_node->data != NULL )
+                {
                        gtk_editable_insert_text (GTK_EDITABLE (editor->priv->data_text_entry),
                                                  text_node->data,
                                                  strlen (text_node->data),
                                                  &pos);
                 }
-
-        } else {
-                                                                                
+        }
+        else
+        {
                 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
                                               (editor->priv->data_key_radio), TRUE);
                                                                                 
@@ -195,14 +203,22 @@ gl_object_editor_set_data (glObjectEditor      *editor,
         }
                                                                                 
 
-        editor->priv->stop_signals = FALSE;
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->data_literal_radio),
+                                           data_radio_toggled_cb, editor);
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->data_key_radio),
+                                           data_radio_toggled_cb, editor);
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->data_text_entry),
+                                           gl_object_editor_changed_cb, editor);
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->data_key_combo),
+                                           gl_object_editor_changed_cb, editor);
+
 
         gl_debug (DEBUG_EDITOR, "END");
 }
 
 
 /*****************************************************************************/
-/* Query data.                                                              */
+/* Query data.                                                               */
 /*****************************************************************************/
 glTextNode *
 gl_object_editor_get_data (glObjectEditor      *editor)
@@ -213,12 +229,14 @@ gl_object_editor_get_data (glObjectEditor      *editor)
  
         text_node = g_new0(glTextNode,1);
  
-        if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->data_literal_radio))) {
+        if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->data_literal_radio)))
+        {
                 text_node->field_flag = FALSE;
                 text_node->data =
-                    gtk_editable_get_chars (GTK_EDITABLE (editor->priv->data_text_entry),
-                                            0, -1);
-        } else {
+                    gtk_editable_get_chars (GTK_EDITABLE (editor->priv->data_text_entry), 0, -1);
+        }
+        else
+        {
                 text_node->field_flag = TRUE;
                 text_node->data =
                        gl_field_button_get_key (GL_FIELD_BUTTON (editor->priv->data_key_combo));
index 45895d72554cac258ecb052e554ad9027db62134..528219be2e0d7aec5abb9f006725791bd87a128e 100644 (file)
@@ -134,38 +134,54 @@ gl_object_editor_set_fill_color (glObjectEditor      *editor,
                 return;
         }
 
-        editor->priv->stop_signals = TRUE;
 
-       gtk_widget_set_sensitive (editor->priv->fill_key_radio, merge_flag);
-
-       if ( color_node->color == GL_COLOR_NONE ) {
-
-               gl_color_combo_set_to_default (GL_COLOR_COMBO(editor->priv->fill_color_combo));
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->fill_color_combo),
+                                         gl_object_editor_changed_cb, editor);
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->fill_color_radio),
+                                         fill_radio_toggled_cb, editor);
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->fill_key_radio),
+                                         fill_radio_toggled_cb, editor);
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->fill_key_combo),
+                                         gl_object_editor_changed_cb, editor);
 
-       } else {
 
-               gl_color_combo_set_color (GL_COLOR_COMBO(editor->priv->fill_color_combo),
-                                          color_node->color);
+       gtk_widget_set_sensitive (editor->priv->fill_key_radio, merge_flag);
 
+       if ( color_node->color == GL_COLOR_NONE )
+        {
+                gl_color_combo_set_to_default (GL_COLOR_COMBO(editor->priv->fill_color_combo));
+       }
+        else
+        {
+                gl_color_combo_set_color (GL_COLOR_COMBO(editor->priv->fill_color_combo), color_node->color);
        }
        
-       if (!color_node->field_flag || !merge_flag) {
-               gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
-                                                 (editor->priv->fill_color_radio), TRUE); 
+       if (!color_node->field_flag || !merge_flag)
+        {
+               gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->fill_color_radio), TRUE); 
                gtk_widget_set_sensitive (editor->priv->fill_color_combo, TRUE);
                gtk_widget_set_sensitive (editor->priv->fill_key_combo, FALSE);
                
-       } else {
-               gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
-                                                 (editor->priv->fill_key_radio), TRUE); 
+       }
+        else
+        {
+               gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->fill_key_radio), TRUE); 
                gtk_widget_set_sensitive (editor->priv->fill_color_combo, FALSE);
                gtk_widget_set_sensitive (editor->priv->fill_key_combo, TRUE);
                
-               gl_field_button_set_key (GL_FIELD_BUTTON (editor->priv->fill_key_combo),
-                                         color_node->key);
+               gl_field_button_set_key (GL_FIELD_BUTTON (editor->priv->fill_key_combo), color_node->key);
        }
        
-        editor->priv->stop_signals = FALSE;
+
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->fill_color_combo),
+                                           gl_object_editor_changed_cb, editor);
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->fill_color_radio),
+                                           fill_radio_toggled_cb, editor);
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->fill_key_radio),
+                                           fill_radio_toggled_cb, editor);
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->fill_key_combo),
+                                           gl_object_editor_changed_cb, editor);
+
 
        gl_debug (DEBUG_EDITOR, "END");
 }
@@ -212,17 +228,17 @@ gl_object_editor_get_fill_color (glObjectEditor      *editor)
 static void
 fill_radio_toggled_cb (glObjectEditor *editor)
 {
-        if (editor->priv->stop_signals) return;
-
         gl_debug (DEBUG_EDITOR, "START");
        
-       if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->fill_color_radio))) {
+       if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->fill_color_radio)))
+        {
                 gtk_widget_set_sensitive (editor->priv->fill_color_combo, TRUE);
                 gtk_widget_set_sensitive (editor->priv->fill_key_combo, FALSE);
-    } else {
+        }
+        else
+        {
                 gtk_widget_set_sensitive (editor->priv->fill_color_combo, FALSE);
                 gtk_widget_set_sensitive (editor->priv->fill_key_combo, TRUE);
-               
        }
  
         gl_object_editor_changed_cb (editor);
index c655a113d6935499b5b590c3ca7ee71728f65331..e4dd6dd34c61f491430f44b696215a5588c71bea 100644 (file)
@@ -128,8 +128,6 @@ gl_object_editor_prepare_image_page (glObjectEditor *editor)
 static void
 img_radio_toggled_cb (glObjectEditor *editor)
 {
-        if (editor->priv->stop_signals) return;
-
         gl_debug (DEBUG_WDGT, "START");
  
        if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->img_file_radio))) {
@@ -156,27 +154,38 @@ gl_object_editor_set_image (glObjectEditor      *editor,
 {
         gl_debug (DEBUG_EDITOR, "START");
  
-        editor->priv->stop_signals = TRUE;
+
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->img_file_radio),
+                                         img_radio_toggled_cb, editor);
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->img_key_radio),
+                                         img_radio_toggled_cb, editor);
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->img_file_button),
+                                         img_selection_changed_cb, editor);
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->img_key_combo),
+                                         gl_object_editor_changed_cb, editor);
+
 
         gtk_widget_set_sensitive (editor->priv->img_key_radio, merge_flag);
  
-        if (!text_node->field_flag || !merge_flag) {
-                gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
-                                              (editor->priv->img_file_radio), TRUE); 
+        if (!text_node->field_flag || !merge_flag)
+        {
+                gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->img_file_radio), TRUE); 
                 gtk_widget_set_sensitive (editor->priv->img_file_button, TRUE);
                 gtk_widget_set_sensitive (editor->priv->img_key_combo, FALSE);
  
-                if (text_node->data != NULL ) {
+                if (text_node->data != NULL )
+                {
                        gtk_file_chooser_set_filename (GTK_FILE_CHOOSER(editor->priv->img_file_button),
                                                        text_node->data);
-                } else {
+                }
+                else
+                {
                        gtk_file_chooser_unselect_all (GTK_FILE_CHOOSER(editor->priv->img_file_button));
                 }
-        } else {
-                                                                                
-                gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
-                                              (editor->priv->img_key_radio), TRUE);
+        }
+        else
+        {
+                gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->img_key_radio), TRUE);
                                                                                 
                 gtk_widget_set_sensitive (editor->priv->img_file_button, FALSE);
                 gtk_widget_set_sensitive (editor->priv->img_key_combo, TRUE);
@@ -185,7 +194,16 @@ gl_object_editor_set_image (glObjectEditor      *editor,
                                          text_node->data);
         }
                                                                                 
-        editor->priv->stop_signals = FALSE;
+
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->img_file_radio),
+                                           img_radio_toggled_cb, editor);
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->img_key_radio),
+                                           img_radio_toggled_cb, editor);
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->img_file_button),
+                                           img_selection_changed_cb, editor);
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->img_key_combo),
+                                           gl_object_editor_changed_cb, editor);
+
                                                                                 
         gl_debug (DEBUG_EDITOR, "END");
 }
@@ -203,11 +221,14 @@ gl_object_editor_get_image (glObjectEditor      *editor)
  
         text_node = g_new0(glTextNode,1);
  
-        if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->img_file_radio))) {
+        if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->img_file_radio)))
+        {
                 text_node->field_flag = FALSE;
                 text_node->data =
                        gtk_file_chooser_get_filename (GTK_FILE_CHOOSER(editor->priv->img_file_button));
-        } else {
+        }
+        else
+        {
                 text_node->field_flag = TRUE;
                 text_node->data =
                        gl_field_button_get_key (GL_FIELD_BUTTON (editor->priv->img_key_combo));
@@ -237,7 +258,8 @@ update_preview_cb (GtkFileChooser *file_chooser, gpointer data)
         preview = GTK_WIDGET (data);
         filename = gtk_file_chooser_get_preview_filename (file_chooser);
 
-        if (filename) {
+        if (filename)
+        {
                 gl_debug (DEBUG_EDITOR, "filename =\"%s\"", filename);
                 pixbuf = gdk_pixbuf_new_from_file_at_size (filename, 128, 128, NULL);
                 if (pixbuf != NULL)
@@ -249,7 +271,9 @@ update_preview_cb (GtkFileChooser *file_chooser, gpointer data)
                                                                     TRUE);
                 }
                 g_free (filename);
-        } else {
+        }
+        else
+        {
                 gtk_file_chooser_set_preview_widget_active (file_chooser, FALSE);
         }
 
@@ -284,7 +308,8 @@ add_image_filters_to_chooser (GtkFileChooser *chooser)
 
        /* Individual image filters */
        formats = gdk_pixbuf_get_formats ();
-       for (it = formats; it != NULL; it = it->next) {
+       for (it = formats; it != NULL; it = it->next)
+        {
                gchar *filter_name;
                GdkPixbufFormat *format;
                filter = gtk_file_filter_new ();
@@ -302,14 +327,16 @@ add_image_filters_to_chooser (GtkFileChooser *chooser)
                g_free (filter_name);
 
                mime_types = gdk_pixbuf_format_get_mime_types ((GdkPixbufFormat *) it->data);
-               for (i = 0; mime_types[i] != NULL; i++) {
+               for (i = 0; mime_types[i] != NULL; i++)
+                {
                        gtk_file_filter_add_mime_type (filter, mime_types[i]);
                        gtk_file_filter_add_mime_type (all_img_filter, mime_types[i]);
                }
                g_strfreev (mime_types);
  
                pattern = gdk_pixbuf_format_get_extensions ((GdkPixbufFormat *) it->data);
-               for (i = 0; pattern[i] != NULL; i++) {
+               for (i = 0; pattern[i] != NULL; i++)
+                {
                        tmp = g_strconcat ("*.", pattern[i], NULL);
                        gtk_file_filter_add_pattern (filter, tmp);
                        gtk_file_filter_add_pattern (all_img_filter, tmp);
@@ -342,8 +369,6 @@ img_selection_changed_cb (glObjectEditor *editor)
 {
         gchar *filename;
 
-        if (editor->priv->stop_signals) return;
-
        gl_debug (DEBUG_EDITOR, "START");
 
         filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER(editor->priv->img_file_button));
index 5622be76d65d5feae0fd82731435a963406de7c4..9557a20235cf0c1e57432c1299fe207a6aaa70ee 100644 (file)
@@ -102,7 +102,7 @@ gl_object_editor_prepare_line_page (glObjectEditor *editor)
 
        /* Connect signals */
        g_signal_connect_swapped (G_OBJECT (editor->priv->line_width_spin),
-                                 "changed",
+                                 "value-changed",
                                  G_CALLBACK (gl_object_editor_changed_cb),
                                  G_OBJECT (editor));
        g_signal_connect_swapped (G_OBJECT (editor->priv->line_color_combo),
@@ -135,13 +135,19 @@ gl_object_editor_set_line_width (glObjectEditor      *editor,
 {
        gl_debug (DEBUG_EDITOR, "START");
 
-        editor->priv->stop_signals = TRUE;
+
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->line_width_spin),
+                                         gl_object_editor_changed_cb, editor);
+
 
        /* Set widget values */
        gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->line_width_spin),
                                   width);
 
-        editor->priv->stop_signals = FALSE;
+
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->line_width_spin),
+                                           gl_object_editor_changed_cb, editor);
+
 
        gl_debug (DEBUG_EDITOR, "END");
 }
@@ -180,7 +186,16 @@ gl_object_editor_set_line_color (glObjectEditor      *editor,
                 return;
         }
 
-        editor->priv->stop_signals = TRUE;
+
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->line_color_combo),
+                                         gl_object_editor_changed_cb, editor);
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->line_color_radio),
+                                         line_radio_toggled_cb, editor);
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->line_key_radio),
+                                         line_radio_toggled_cb, editor);
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->line_key_combo),
+                                         gl_object_editor_changed_cb, editor);
+
 
        gl_debug (DEBUG_EDITOR, "color field %s(%d) / %X", color_node->key, color_node->field_flag, color_node->color);
        gtk_widget_set_sensitive (editor->priv->line_key_radio, merge_flag);
@@ -212,7 +227,16 @@ gl_object_editor_set_line_color (glObjectEditor      *editor,
                                          color_node->key);
        }
 
-        editor->priv->stop_signals = FALSE;
+
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->line_color_combo),
+                                           gl_object_editor_changed_cb, editor);
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->line_color_radio),
+                                           line_radio_toggled_cb, editor);
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->line_key_radio),
+                                           line_radio_toggled_cb, editor);
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->line_key_combo),
+                                           gl_object_editor_changed_cb, editor);
+
 
        gl_debug (DEBUG_EDITOR, "END");
 }
@@ -259,8 +283,6 @@ gl_object_editor_get_line_color (glObjectEditor      *editor)
 static void
 line_radio_toggled_cb (glObjectEditor *editor)
 {
-        if (editor->priv->stop_signals) return;
-
         gl_debug (DEBUG_EDITOR, "START");
        
        if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->line_color_radio))) {
index f283d7fd2ec3e65f1cfc10459cbccde2e3ae2879..5b4663dedaeeafb595f571e3be516c21ac7b9e5c 100644 (file)
@@ -99,11 +99,11 @@ gl_object_editor_prepare_lsize_page (glObjectEditor       *editor)
 
        /* Connect signals */
        g_signal_connect_swapped (G_OBJECT (editor->priv->lsize_r_spin),
-                                 "changed",
+                                 "value-changed",
                                  G_CALLBACK (gl_object_editor_size_changed_cb),
                                  G_OBJECT (editor));
        g_signal_connect_swapped (G_OBJECT (editor->priv->lsize_theta_spin),
-                                 "changed",
+                                 "value-changed",
                                  G_CALLBACK (gl_object_editor_size_changed_cb),
                                  G_OBJECT (editor));
 
@@ -123,7 +123,12 @@ gl_object_editor_set_lsize (glObjectEditor      *editor,
 
        gl_debug (DEBUG_EDITOR, "START");
 
-        editor->priv->stop_signals = TRUE;
+
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->lsize_r_spin),
+                                         gl_object_editor_size_changed_cb, editor);
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->lsize_theta_spin),
+                                         gl_object_editor_size_changed_cb, editor);
+
 
        /* save a copy in internal units */
        editor->priv->dx = dx;
@@ -143,7 +148,12 @@ gl_object_editor_set_lsize (glObjectEditor      *editor,
        gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->lsize_theta_spin),
                                   theta);
 
-        editor->priv->stop_signals = FALSE;
+
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->lsize_r_spin),
+                                           gl_object_editor_size_changed_cb, editor);
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->lsize_theta_spin),
+                                           gl_object_editor_size_changed_cb, editor);
+
 
        gl_debug (DEBUG_EDITOR, "END");
 }
@@ -161,30 +171,35 @@ gl_object_editor_set_max_lsize (glObjectEditor      *editor,
 
        gl_debug (DEBUG_EDITOR, "START");
 
-        if (editor->priv->lsize_page_vbox)
-        {
 
-                editor->priv->stop_signals = TRUE;
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->lsize_r_spin),
+                                         gl_object_editor_size_changed_cb, editor);
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->lsize_theta_spin),
+                                         gl_object_editor_size_changed_cb, editor);
 
-                /* save a copy in internal units */
-                editor->priv->dx_max = dx_max;
-                editor->priv->dy_max = dy_max;
 
-                /* convert internal units to displayed units */
-                gl_debug (DEBUG_EDITOR, "internal dx_max,dy_max = %g, %g", dx_max, dy_max);
-                dx_max *= editor->priv->units_per_point;
-                dy_max *= editor->priv->units_per_point;
-                gl_debug (DEBUG_EDITOR, "display dx_max,dy_max = %g, %g", dx_max, dy_max);
+        /* save a copy in internal units */
+        editor->priv->dx_max = dx_max;
+        editor->priv->dy_max = dy_max;
 
-                /* Set widget values */
-                tmp = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->lsize_r_spin));
-                gtk_spin_button_set_range (GTK_SPIN_BUTTON (editor->priv->lsize_r_spin),
-                                           0.0, 2.0*LENGTH (dx_max, dy_max));
-                gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->lsize_r_spin), tmp);
+        /* convert internal units to displayed units */
+        gl_debug (DEBUG_EDITOR, "internal dx_max,dy_max = %g, %g", dx_max, dy_max);
+        dx_max *= editor->priv->units_per_point;
+        dy_max *= editor->priv->units_per_point;
+        gl_debug (DEBUG_EDITOR, "display dx_max,dy_max = %g, %g", dx_max, dy_max);
 
-                editor->priv->stop_signals = FALSE;
+        /* Set widget values */
+        tmp = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->lsize_r_spin));
+        gtk_spin_button_set_range (GTK_SPIN_BUTTON (editor->priv->lsize_r_spin),
+                                   0.0, 2.0*LENGTH (dx_max, dy_max));
+        gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->lsize_r_spin), tmp);
+
+
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->lsize_r_spin),
+                                           gl_object_editor_size_changed_cb, editor);
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->lsize_theta_spin),
+                                           gl_object_editor_size_changed_cb, editor);
 
-        }
 
        gl_debug (DEBUG_EDITOR, "END");
 }
@@ -233,6 +248,13 @@ lsize_prefs_changed_cb (glObjectEditor *editor)
 
        gl_debug (DEBUG_EDITOR, "START");
 
+
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->lsize_r_spin),
+                                         gl_object_editor_size_changed_cb, editor);
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->lsize_theta_spin),
+                                         gl_object_editor_size_changed_cb, editor);
+
+
         /* Get new configuration information */
         units = gl_prefs_model_get_units (gl_prefs);
         units_string = lgl_units_get_name (units);
@@ -241,12 +263,8 @@ lsize_prefs_changed_cb (glObjectEditor *editor)
         digits = gl_units_util_get_precision (units);
 
        /* Update characteristics of r_spin */
-        editor->priv->stop_signals = TRUE;
-       gtk_spin_button_set_digits (GTK_SPIN_BUTTON(editor->priv->lsize_r_spin),
-                                   digits);
-       gtk_spin_button_set_increments (GTK_SPIN_BUTTON(editor->priv->lsize_r_spin),
-                                       climb_rate, 0);
-        editor->priv->stop_signals = FALSE;
+       gtk_spin_button_set_digits (GTK_SPIN_BUTTON(editor->priv->lsize_r_spin), digits);
+       gtk_spin_button_set_increments (GTK_SPIN_BUTTON(editor->priv->lsize_r_spin), climb_rate, 0);
 
        /* Update r_units_label */
        gtk_label_set_text (GTK_LABEL(editor->priv->lsize_r_units_label),
@@ -260,6 +278,13 @@ lsize_prefs_changed_cb (glObjectEditor *editor)
                                        editor->priv->dx_max,
                                        editor->priv->dy_max);
 
+
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->lsize_r_spin),
+                                           gl_object_editor_size_changed_cb, editor);
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->lsize_theta_spin),
+                                           gl_object_editor_size_changed_cb, editor);
+
+
        gl_debug (DEBUG_EDITOR, "END");
 }
 
index de180a0e48c932438c7fc7636afc8fd7b2ed9eed..43e7802495e140b966d7d522f193f1f0c6cf74af 100644 (file)
@@ -99,11 +99,11 @@ gl_object_editor_prepare_position_page (glObjectEditor *editor)
 
        /* Connect signals */
        g_signal_connect_swapped (G_OBJECT (editor->priv->pos_x_spin),
-                                 "changed",
+                                 "value-changed",
                                  G_CALLBACK (gl_object_editor_changed_cb),
                                  G_OBJECT (editor));
        g_signal_connect_swapped (G_OBJECT (editor->priv->pos_y_spin),
-                                 "changed",
+                                 "value-changed",
                                  G_CALLBACK (gl_object_editor_changed_cb),
                                  G_OBJECT (editor));
 
@@ -121,7 +121,12 @@ gl_object_editor_set_position (glObjectEditor      *editor,
 {
        gl_debug (DEBUG_EDITOR, "START");
 
-        editor->priv->stop_signals = TRUE;
+
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->pos_x_spin),
+                                         gl_object_editor_changed_cb, editor);
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->pos_y_spin),
+                                         gl_object_editor_changed_cb, editor);
+
 
        /* save a copy in internal units */
        editor->priv->x = x;
@@ -137,7 +142,12 @@ gl_object_editor_set_position (glObjectEditor      *editor,
        gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->pos_x_spin), x);
        gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->pos_y_spin), y);
 
-        editor->priv->stop_signals = FALSE;
+
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->pos_x_spin),
+                                           gl_object_editor_changed_cb, editor);
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->pos_y_spin),
+                                           gl_object_editor_changed_cb, editor);
+
 
        gl_debug (DEBUG_EDITOR, "END");
 }
@@ -155,7 +165,12 @@ gl_object_editor_set_max_position (glObjectEditor      *editor,
 
        gl_debug (DEBUG_EDITOR, "START");
 
-        editor->priv->stop_signals = TRUE;
+
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->pos_x_spin),
+                                         gl_object_editor_changed_cb, editor);
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->pos_y_spin),
+                                         gl_object_editor_changed_cb, editor);
+
 
        /* save a copy in internal units */
        editor->priv->x_max = x_max;
@@ -169,15 +184,18 @@ gl_object_editor_set_max_position (glObjectEditor      *editor,
 
        /* Set widget values */
        tmp = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->pos_x_spin));
-       gtk_spin_button_set_range (GTK_SPIN_BUTTON (editor->priv->pos_x_spin),
-                                  -x_max, 2.0*x_max);
+       gtk_spin_button_set_range (GTK_SPIN_BUTTON (editor->priv->pos_x_spin), -x_max, 2.0*x_max);
        gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->pos_x_spin), tmp);
        tmp = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->pos_y_spin));
-       gtk_spin_button_set_range (GTK_SPIN_BUTTON (editor->priv->pos_y_spin),
-                                  -y_max, 2.0*y_max);
+       gtk_spin_button_set_range (GTK_SPIN_BUTTON (editor->priv->pos_y_spin), -y_max, 2.0*y_max);
        gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->pos_y_spin), tmp);
 
-        editor->priv->stop_signals = FALSE;
+
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->pos_x_spin),
+                                           gl_object_editor_changed_cb, editor);
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->pos_y_spin),
+                                           gl_object_editor_changed_cb, editor);
+
 
        gl_debug (DEBUG_EDITOR, "END");
 }
@@ -222,6 +240,13 @@ position_prefs_changed_cb (glObjectEditor *editor)
 
        gl_debug (DEBUG_EDITOR, "START");
 
+
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->pos_x_spin),
+                                         gl_object_editor_changed_cb, editor);
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->pos_y_spin),
+                                         gl_object_editor_changed_cb, editor);
+
+
         /* Get new configuration information */
         units = gl_prefs_model_get_units (gl_prefs);
         units_string = lgl_units_get_name (units);
@@ -230,16 +255,13 @@ position_prefs_changed_cb (glObjectEditor *editor)
         digits = gl_units_util_get_precision (units);
 
        /* Update characteristics of x_spin/y_spin */
-        editor->priv->stop_signals = TRUE;
-       gtk_spin_button_set_digits (GTK_SPIN_BUTTON(editor->priv->pos_x_spin),
-                                   digits);
-       gtk_spin_button_set_digits (GTK_SPIN_BUTTON(editor->priv->pos_y_spin),
-                                   digits);
+       gtk_spin_button_set_digits (GTK_SPIN_BUTTON(editor->priv->pos_x_spin), digits);
+       gtk_spin_button_set_digits (GTK_SPIN_BUTTON(editor->priv->pos_y_spin), digits);
        gtk_spin_button_set_increments (GTK_SPIN_BUTTON(editor->priv->pos_x_spin),
                                        climb_rate, 10.0*climb_rate);
        gtk_spin_button_set_increments (GTK_SPIN_BUTTON(editor->priv->pos_y_spin),
                                        climb_rate, 10.0*climb_rate);
-        editor->priv->stop_signals = FALSE;
+
 
        /* Update units_labels */
        gtk_label_set_text (GTK_LABEL(editor->priv->pos_x_units_label),
@@ -248,12 +270,15 @@ position_prefs_changed_cb (glObjectEditor *editor)
                            units_string);
 
        /* Update values of x_spin/y_spin */
-       gl_object_editor_set_position (editor,
-                                      editor->priv->x,
-                                      editor->priv->y);
-       gl_object_editor_set_max_position (editor,
-                                          editor->priv->x_max,
-                                          editor->priv->y_max);
+       gl_object_editor_set_position (editor, editor->priv->x, editor->priv->y);
+       gl_object_editor_set_max_position (editor, editor->priv->x_max, editor->priv->y_max);
+
+
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->pos_x_spin),
+                                           gl_object_editor_changed_cb, editor);
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->pos_y_spin),
+                                           gl_object_editor_changed_cb, editor);
+
 
        gl_debug (DEBUG_EDITOR, "END");
 }
index 5bfdbc2d8e0f055a17fcbf8c26548e6834951876..09175d07b1e3cc1e0fc504802ca89e9ba602183e 100644 (file)
@@ -167,8 +167,6 @@ struct _glObjectEditorPrivate {
        gdouble     shadow_x_max;
        gdouble     shadow_y_max;
 
-        /* Prevent recursion */
-       gboolean    stop_signals;
 };
 
 enum {
index 6f9b06202f1cfba36cda6c5778ae8bc624b075a3..d003e963ae1bb2718a38c7497d14ab70fb4a32eb 100644 (file)
@@ -128,11 +128,11 @@ gl_object_editor_prepare_shadow_page (glObjectEditor *editor)
                                  G_CALLBACK (shadow_enable_check_toggled_cb),
                                  G_OBJECT (editor));                             
        g_signal_connect_swapped (G_OBJECT (editor->priv->shadow_x_spin),
-                                 "changed",
+                                 "value-changed",
                                  G_CALLBACK (gl_object_editor_changed_cb),
                                  G_OBJECT (editor));
        g_signal_connect_swapped (G_OBJECT (editor->priv->shadow_y_spin),
-                                 "changed",
+                                 "value-changed",
                                  G_CALLBACK (gl_object_editor_changed_cb),
                                  G_OBJECT (editor));
        g_signal_connect_swapped (G_OBJECT (editor->priv->shadow_color_combo),
@@ -152,7 +152,7 @@ gl_object_editor_prepare_shadow_page (glObjectEditor *editor)
                                  G_CALLBACK (shadow_color_radio_toggled_cb),
                                  G_OBJECT (editor));                             
        g_signal_connect_swapped (G_OBJECT (editor->priv->shadow_opacity_spin),
-                                 "changed",
+                                 "value-changed",
                                  G_CALLBACK (gl_object_editor_changed_cb),
                                  G_OBJECT (editor));
 
@@ -169,13 +169,18 @@ gl_object_editor_set_shadow_state (glObjectEditor      *editor,
 {
        gl_debug (DEBUG_EDITOR, "START");
 
-        editor->priv->stop_signals = TRUE;
 
-       gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->shadow_enable_check),
-                                      state);
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->shadow_enable_check),
+                                         shadow_enable_check_toggled_cb, editor);
+
+
+       gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->shadow_enable_check), state);
         gtk_widget_set_sensitive (editor->priv->shadow_controls_table, state);
 
-        editor->priv->stop_signals = FALSE;
+
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->shadow_enable_check),
+                                           shadow_enable_check_toggled_cb, editor);
+
 
        gl_debug (DEBUG_EDITOR, "END");
 }
@@ -188,7 +193,12 @@ gl_object_editor_set_shadow_offset (glObjectEditor      *editor,
 {
        gl_debug (DEBUG_EDITOR, "START");
 
-        editor->priv->stop_signals = TRUE;
+
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->shadow_x_spin),
+                                         gl_object_editor_changed_cb, editor);
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->shadow_y_spin),
+                                         gl_object_editor_changed_cb, editor);
+
 
        /* save a copy in internal units */
        editor->priv->shadow_x = x;
@@ -204,7 +214,12 @@ gl_object_editor_set_shadow_offset (glObjectEditor      *editor,
        gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->shadow_x_spin), x);
        gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->shadow_y_spin), y);
 
-        editor->priv->stop_signals = FALSE;
+
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->shadow_x_spin),
+                                           gl_object_editor_changed_cb, editor);
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->shadow_y_spin),
+                                           gl_object_editor_changed_cb, editor);
+
 
        gl_debug (DEBUG_EDITOR, "END");
 }
@@ -222,30 +237,39 @@ gl_object_editor_set_shadow_color (glObjectEditor      *editor,
                 return;
         }
 
-        editor->priv->stop_signals = TRUE;
 
-       gtk_widget_set_sensitive (editor->priv->shadow_key_radio, merge_flag);
-
-       if ( color_node->color == GL_COLOR_NONE ) {
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->shadow_color_combo),
+                                         gl_object_editor_changed_cb, editor);
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->shadow_color_radio),
+                                         shadow_color_radio_toggled_cb, editor);
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->shadow_key_radio),
+                                         shadow_color_radio_toggled_cb, editor);
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->shadow_key_combo),
+                                         gl_object_editor_changed_cb, editor);
 
-               gl_color_combo_set_to_default (GL_COLOR_COMBO(editor->priv->shadow_color_combo));
 
-       } else {
+       gtk_widget_set_sensitive (editor->priv->shadow_key_radio, merge_flag);
 
+       if ( color_node->color == GL_COLOR_NONE )
+        {
+               gl_color_combo_set_to_default (GL_COLOR_COMBO(editor->priv->shadow_color_combo));
+       }
+        else
+        {
                gl_color_combo_set_color (GL_COLOR_COMBO(editor->priv->shadow_color_combo),
                                           color_node->color);
-
        }
        
-       if (!color_node->field_flag || !merge_flag) {
-               gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
-                                                 (editor->priv->shadow_color_radio), TRUE); 
+       if (!color_node->field_flag || !merge_flag)
+        {
+               gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->shadow_color_radio), TRUE); 
                gtk_widget_set_sensitive (editor->priv->shadow_color_combo, TRUE);
                gtk_widget_set_sensitive (editor->priv->shadow_key_combo, FALSE);
                
-       } else {
-               gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
-                                                 (editor->priv->shadow_key_radio), TRUE); 
+       }
+        else
+        {
+               gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->shadow_key_radio), TRUE); 
                gtk_widget_set_sensitive (editor->priv->shadow_color_combo, FALSE);
                gtk_widget_set_sensitive (editor->priv->shadow_key_combo, TRUE);
                
@@ -253,7 +277,16 @@ gl_object_editor_set_shadow_color (glObjectEditor      *editor,
                                          color_node->key);
        }
        
-        editor->priv->stop_signals = FALSE;
+
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->shadow_color_combo),
+                                           gl_object_editor_changed_cb, editor);
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->shadow_color_radio),
+                                           shadow_color_radio_toggled_cb, editor);
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->shadow_key_radio),
+                                           shadow_color_radio_toggled_cb, editor);
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->shadow_key_combo),
+                                           gl_object_editor_changed_cb, editor);
+
 
        gl_debug (DEBUG_EDITOR, "END");
 }
@@ -265,12 +298,17 @@ gl_object_editor_set_shadow_opacity (glObjectEditor      *editor,
 {
        gl_debug (DEBUG_EDITOR, "START");
 
-        editor->priv->stop_signals = TRUE;
 
-       gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->shadow_opacity_spin),
-                                  alpha * 100.0);
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->shadow_opacity_spin),
+                                         gl_object_editor_changed_cb, editor);
+
+
+       gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->shadow_opacity_spin), alpha * 100.0);
+
+
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->shadow_opacity_spin),
+                                           gl_object_editor_changed_cb, editor);
 
-        editor->priv->stop_signals = FALSE;
 
        gl_debug (DEBUG_EDITOR, "END");
 }
@@ -288,34 +326,37 @@ gl_object_editor_set_max_shadow_offset (glObjectEditor      *editor,
 
        gl_debug (DEBUG_EDITOR, "START");
 
-        if (editor->priv->shadow_page_vbox)
-        {
 
-                editor->priv->stop_signals = TRUE;
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->shadow_x_spin),
+                                         gl_object_editor_changed_cb, editor);
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->shadow_y_spin),
+                                         gl_object_editor_changed_cb, editor);
 
-                /* save a copy in internal units */
-                editor->priv->shadow_x_max = x_max;
-                editor->priv->shadow_y_max = y_max;
 
-                /* convert internal units to displayed units */
-                gl_debug (DEBUG_EDITOR, "internal x_max,y_max = %g, %g", x_max, y_max);
-                x_max *= editor->priv->units_per_point;
-                y_max *= editor->priv->units_per_point;
-                gl_debug (DEBUG_EDITOR, "display x_max,y_max = %g, %g", x_max, y_max);
+        /* save a copy in internal units */
+        editor->priv->shadow_x_max = x_max;
+        editor->priv->shadow_y_max = y_max;
 
-                /* Set widget values */
-                tmp = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->shadow_x_spin));
-                gtk_spin_button_set_range (GTK_SPIN_BUTTON (editor->priv->shadow_x_spin),
-                                           -x_max, x_max);
-                gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->shadow_x_spin), tmp);
-                tmp = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->shadow_y_spin));
-                gtk_spin_button_set_range (GTK_SPIN_BUTTON (editor->priv->shadow_y_spin),
-                                           -y_max, y_max);
-                gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->shadow_y_spin), tmp);
+        /* convert internal units to displayed units */
+        gl_debug (DEBUG_EDITOR, "internal x_max,y_max = %g, %g", x_max, y_max);
+        x_max *= editor->priv->units_per_point;
+        y_max *= editor->priv->units_per_point;
+        gl_debug (DEBUG_EDITOR, "display x_max,y_max = %g, %g", x_max, y_max);
 
-                editor->priv->stop_signals = FALSE;
+        /* Set widget values */
+        tmp = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->shadow_x_spin));
+        gtk_spin_button_set_range (GTK_SPIN_BUTTON (editor->priv->shadow_x_spin), -x_max, x_max);
+        gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->shadow_x_spin), tmp);
+        tmp = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->shadow_y_spin));
+        gtk_spin_button_set_range (GTK_SPIN_BUTTON (editor->priv->shadow_y_spin), -y_max, y_max);
+        gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->shadow_y_spin), tmp);
+
+
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->shadow_x_spin),
+                                           gl_object_editor_changed_cb, editor);
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->shadow_y_spin),
+                                           gl_object_editor_changed_cb, editor);
 
-        }
 
        gl_debug (DEBUG_EDITOR, "END");
 }
@@ -422,6 +463,13 @@ shadow_prefs_changed_cb (glObjectEditor *editor)
 
        gl_debug (DEBUG_EDITOR, "START");
 
+
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->shadow_x_spin),
+                                         gl_object_editor_changed_cb, editor);
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->shadow_y_spin),
+                                         gl_object_editor_changed_cb, editor);
+
+
         /* Get new configuration information */
         units = gl_prefs_model_get_units (gl_prefs);
         units_string = lgl_units_get_name (units);
@@ -430,7 +478,6 @@ shadow_prefs_changed_cb (glObjectEditor *editor)
         digits = gl_units_util_get_precision (units);
 
        /* Update characteristics of x_spin/y_spin */
-        editor->priv->stop_signals = TRUE;
        gtk_spin_button_set_digits (GTK_SPIN_BUTTON(editor->priv->shadow_x_spin),
                                    digits);
        gtk_spin_button_set_digits (GTK_SPIN_BUTTON(editor->priv->shadow_y_spin),
@@ -439,7 +486,6 @@ shadow_prefs_changed_cb (glObjectEditor *editor)
                                        climb_rate, 10.0*climb_rate);
        gtk_spin_button_set_increments (GTK_SPIN_BUTTON(editor->priv->shadow_y_spin),
                                        climb_rate, 10.0*climb_rate);
-        editor->priv->stop_signals = FALSE;
 
        /* Update units_labels */
        gtk_label_set_text (GTK_LABEL(editor->priv->shadow_x_units_label),
@@ -455,6 +501,13 @@ shadow_prefs_changed_cb (glObjectEditor *editor)
                                                editor->priv->shadow_x_max,
                                                editor->priv->shadow_y_max);
 
+
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->shadow_x_spin),
+                                           gl_object_editor_changed_cb, editor);
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->shadow_y_spin),
+                                           gl_object_editor_changed_cb, editor);
+
+
        gl_debug (DEBUG_EDITOR, "END");
 }
 
@@ -467,8 +520,6 @@ shadow_enable_check_toggled_cb (glObjectEditor *editor)
 {
        gboolean state;
 
-        if (editor->priv->stop_signals) return;
-
         gl_debug (DEBUG_EDITOR, "START");
 
        state = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->shadow_enable_check));
@@ -487,8 +538,6 @@ shadow_enable_check_toggled_cb (glObjectEditor *editor)
 static void
 shadow_color_radio_toggled_cb (glObjectEditor *editor)
 {
-        if (editor->priv->stop_signals) return;
-
         gl_debug (DEBUG_EDITOR, "START");
        
        if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->shadow_color_radio))) {
index 4af4a6cb7faffde8596ba390c619c9fdcd29a929..ce7e6d521190b39a422f7c211960e9ea92d42832 100644 (file)
@@ -118,11 +118,11 @@ gl_object_editor_prepare_size_page (glObjectEditor       *editor)
                                  G_CALLBACK (aspect_toggle_cb),
                                  G_OBJECT (editor));
        g_signal_connect_swapped (G_OBJECT (editor->priv->size_w_spin),
-                                 "changed",
+                                 "value-changed",
                                  G_CALLBACK (w_spin_cb),
                                  G_OBJECT (editor));
        g_signal_connect_swapped (G_OBJECT (editor->priv->size_h_spin),
-                                 "changed",
+                                 "value-changed",
                                  G_CALLBACK (h_spin_cb),
                                  G_OBJECT (editor));
         g_signal_connect_swapped (G_OBJECT (editor->priv->size_reset_image_button),
@@ -143,8 +143,6 @@ aspect_toggle_cb (glObjectEditor *editor)
         glWdgtChainButton *toggle;
        gdouble            w, h;
 
-        if (editor->priv->stop_signals) return;
-
        gl_debug (DEBUG_EDITOR, "START");
 
        toggle = GL_WDGT_CHAIN_BUTTON (editor->priv->size_aspect_checkbutton);
@@ -171,8 +169,6 @@ w_spin_cb (glObjectEditor *editor)
        gdouble            w, h;
         glWdgtChainButton *toggle;
 
-        if (editor->priv->stop_signals) return;
-
        gl_debug (DEBUG_EDITOR, "START");
 
        toggle = GL_WDGT_CHAIN_BUTTON (editor->priv->size_aspect_checkbutton);
@@ -184,9 +180,9 @@ w_spin_cb (glObjectEditor *editor)
                 h = w * editor->priv->size_aspect_ratio;
                                                                                 
                 /* Update our sibling control, blocking recursion. */
-                editor->priv->stop_signals = TRUE;
+                g_signal_handlers_block_by_func (G_OBJECT (editor->priv->size_h_spin), h_spin_cb, editor);
                 gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->size_h_spin), h);
-                editor->priv->stop_signals = FALSE;
+                g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->size_h_spin), h_spin_cb, editor);
         }
                                                                                 
         gl_object_editor_size_changed_cb (editor);
@@ -204,8 +200,6 @@ h_spin_cb (glObjectEditor *editor)
        gdouble            w, h;
         glWdgtChainButton *toggle;
 
-        if (editor->priv->stop_signals) return;
-
        gl_debug (DEBUG_EDITOR, "START");
 
         toggle = GL_WDGT_CHAIN_BUTTON (editor->priv->size_aspect_checkbutton);
@@ -217,9 +211,9 @@ h_spin_cb (glObjectEditor *editor)
                 w = h / editor->priv->size_aspect_ratio;
                                                                                 
                 /* Update our sibling control, blocking recursion. */
-                editor->priv->stop_signals = TRUE;
+                g_signal_handlers_block_by_func (G_OBJECT (editor->priv->size_w_spin), w_spin_cb, editor);
                 gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->size_w_spin), w);
-                editor->priv->stop_signals = FALSE;
+                g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->size_w_spin), w_spin_cb, editor);
         }
                                                                                 
         gl_object_editor_size_changed_cb (editor);
@@ -238,11 +232,12 @@ size_reset_cb (glObjectEditor *editor)
        gdouble w_max, h_max, wh_max;
        gdouble aspect_ratio;
 
-        if (editor->priv->stop_signals) return;
-
        gl_debug (DEBUG_EDITOR, "START");
 
-        editor->priv->stop_signals = TRUE;
+
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->size_w_spin), w_spin_cb, editor);
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->size_h_spin), h_spin_cb, editor);
+
 
        w_base = editor->priv->w_base;
        h_base = editor->priv->h_base;
@@ -273,7 +268,10 @@ size_reset_cb (glObjectEditor *editor)
        gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->size_h_spin),
                                   h_base);
 
-        editor->priv->stop_signals = FALSE;
+
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->size_w_spin), w_spin_cb, editor);
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->size_h_spin), h_spin_cb, editor);
+
 
         gl_object_editor_size_changed_cb (editor);
 
@@ -286,12 +284,15 @@ size_reset_cb (glObjectEditor *editor)
 /*****************************************************************************/
 void
 gl_object_editor_set_size (glObjectEditor      *editor,
-                            gdouble                w,
-                            gdouble                h)
+                           gdouble              w,
+                           gdouble              h)
 {
        gl_debug (DEBUG_EDITOR, "START");
 
-        editor->priv->stop_signals = TRUE;
+
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->size_w_spin), w_spin_cb, editor);
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->size_h_spin), h_spin_cb, editor);
+
 
        /* save a copy in internal units */
        editor->priv->w = w;
@@ -310,7 +311,10 @@ gl_object_editor_set_size (glObjectEditor      *editor,
        /* Update aspect ratio */
        editor->priv->size_aspect_ratio = h / w;
 
-        editor->priv->stop_signals = FALSE;
+
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->size_w_spin), w_spin_cb, editor);
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->size_h_spin), h_spin_cb, editor);
+
 
        gl_debug (DEBUG_EDITOR, "END");
 }
@@ -329,35 +333,36 @@ gl_object_editor_set_max_size (glObjectEditor      *editor,
 
        gl_debug (DEBUG_EDITOR, "START");
 
-        if (editor->priv->size_page_vbox)
-        {
 
-                editor->priv->stop_signals = TRUE;
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->size_w_spin), w_spin_cb, editor);
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->size_h_spin), h_spin_cb, editor);
 
-                /* save a copy in internal units */
-                editor->priv->w_max = w_max;
-                editor->priv->h_max = h_max;
 
-                /* convert internal units to displayed units */
-                gl_debug (DEBUG_EDITOR, "internal w_max,h_max = %g, %g", w_max, h_max);
-                w_max *= editor->priv->units_per_point;
-                h_max *= editor->priv->units_per_point;
-                wh_max = MAX( w_max, h_max );
-                gl_debug (DEBUG_EDITOR, "display w_max,h_max = %g, %g", w_max, h_max);
+        /* save a copy in internal units */
+        editor->priv->w_max = w_max;
+        editor->priv->h_max = h_max;
 
-                /* Set widget values */
-                tmp = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->size_w_spin));
-                gtk_spin_button_set_range (GTK_SPIN_BUTTON (editor->priv->size_w_spin),
-                                           0.0, 2.0*wh_max);
-                gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->size_w_spin), tmp);
-                tmp = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->size_h_spin));
-                gtk_spin_button_set_range (GTK_SPIN_BUTTON (editor->priv->size_h_spin),
-                                           0.0, 2.0*wh_max);
-                gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->size_h_spin), tmp);
+        /* convert internal units to displayed units */
+        gl_debug (DEBUG_EDITOR, "internal w_max,h_max = %g, %g", w_max, h_max);
+        w_max *= editor->priv->units_per_point;
+        h_max *= editor->priv->units_per_point;
+        wh_max = MAX( w_max, h_max );
+        gl_debug (DEBUG_EDITOR, "display w_max,h_max = %g, %g", w_max, h_max);
 
-                editor->priv->stop_signals = FALSE;
+        /* Set widget values */
+        tmp = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->size_w_spin));
+        gtk_spin_button_set_range (GTK_SPIN_BUTTON (editor->priv->size_w_spin),
+                                   0.0, 2.0*wh_max);
+        gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->size_w_spin), tmp);
+        tmp = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->size_h_spin));
+        gtk_spin_button_set_range (GTK_SPIN_BUTTON (editor->priv->size_h_spin),
+                                   0.0, 2.0*wh_max);
+        gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->size_h_spin), tmp);
+
+
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->size_w_spin), w_spin_cb, editor);
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->size_h_spin), h_spin_cb, editor);
 
-        }
 
        gl_debug (DEBUG_EDITOR, "END");
 }
@@ -419,6 +424,11 @@ size_prefs_changed_cb (glObjectEditor *editor)
 
        gl_debug (DEBUG_EDITOR, "START");
 
+
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->size_w_spin), w_spin_cb, editor);
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->size_h_spin), h_spin_cb, editor);
+
+
         /* Get new configuration information */
         units = gl_prefs_model_get_units (gl_prefs);
         units_string = lgl_units_get_name (units);
@@ -427,16 +437,12 @@ size_prefs_changed_cb (glObjectEditor *editor)
         digits = gl_units_util_get_precision (units);
 
        /* Update characteristics of w_spin/h_spin */
-        editor->priv->stop_signals = TRUE;
-       gtk_spin_button_set_digits (GTK_SPIN_BUTTON(editor->priv->size_w_spin),
-                                   digits);
-       gtk_spin_button_set_digits (GTK_SPIN_BUTTON(editor->priv->size_h_spin),
-                                   digits);
+       gtk_spin_button_set_digits (GTK_SPIN_BUTTON(editor->priv->size_w_spin), digits);
+       gtk_spin_button_set_digits (GTK_SPIN_BUTTON(editor->priv->size_h_spin), digits);
        gtk_spin_button_set_increments (GTK_SPIN_BUTTON(editor->priv->size_w_spin),
                                        climb_rate, 10.0*climb_rate);
        gtk_spin_button_set_increments (GTK_SPIN_BUTTON(editor->priv->size_h_spin),
                                        climb_rate, 10.0*climb_rate);
-        editor->priv->stop_signals = FALSE;
 
        /* Update units_labels */
        gtk_label_set_text (GTK_LABEL(editor->priv->size_w_units_label),
@@ -445,12 +451,13 @@ size_prefs_changed_cb (glObjectEditor *editor)
                            units_string);
 
        /* Update values of w_spin/h_spin */
-       gl_object_editor_set_size (editor,
-                                  editor->priv->w,
-                                  editor->priv->h);
-       gl_object_editor_set_max_size (editor,
-                                      editor->priv->w_max,
-                                      editor->priv->h_max);
+       gl_object_editor_set_size (editor, editor->priv->w, editor->priv->h);
+       gl_object_editor_set_max_size (editor, editor->priv->w_max, editor->priv->h_max);
+
+
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->size_w_spin), w_spin_cb, editor);
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->size_h_spin), h_spin_cb, editor);
+
 
        gl_debug (DEBUG_EDITOR, "END");
 }
index b19d212dcc2ab51df5f0d4fc2e5d8ddf1a3bc691..7c82ec900740d3583a8d140c05f120d4bf70305b 100644 (file)
@@ -121,7 +121,7 @@ gl_object_editor_prepare_text_page (glObjectEditor       *editor)
                                  G_CALLBACK (gl_object_editor_changed_cb),
                                  G_OBJECT (editor));
        g_signal_connect_swapped (G_OBJECT (editor->priv->text_size_spin),
-                                 "changed",
+                                 "value-changed",
                                  G_CALLBACK (gl_object_editor_changed_cb),
                                  G_OBJECT (editor));
        g_signal_connect_swapped (G_OBJECT (editor->priv->text_bold_toggle),
@@ -163,7 +163,7 @@ gl_object_editor_prepare_text_page (glObjectEditor       *editor)
                          G_OBJECT (editor));
 
        g_signal_connect_swapped (G_OBJECT (editor->priv->text_line_spacing_spin),
-                                 "changed",
+                                 "value-changed",
                                  G_CALLBACK (gl_object_editor_changed_cb),
                                  G_OBJECT (editor));
 
@@ -183,8 +183,6 @@ static void
 align_toggle_cb (GtkToggleButton *toggle,
                 glObjectEditor  *editor)
 {
-        if (editor->priv->stop_signals) return;
-
         if (gtk_toggle_button_get_active (toggle)) {
  
                 if (GTK_WIDGET (toggle) == GTK_WIDGET (editor->priv->text_left_toggle)) {
@@ -234,7 +232,10 @@ gl_object_editor_set_font_family (glObjectEditor      *editor,
 
        gl_debug (DEBUG_EDITOR, "START");
 
-        editor->priv->stop_signals = TRUE;
+
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->text_family_combo),
+                                         gl_object_editor_changed_cb, editor);
+
 
        old_font_family = gl_font_combo_get_family (GL_FONT_COMBO (editor->priv->text_family_combo));
 
@@ -246,7 +247,10 @@ gl_object_editor_set_font_family (glObjectEditor      *editor,
 
         g_free (old_font_family);
 
-        editor->priv->stop_signals = FALSE;
+
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->text_family_combo),
+                                           gl_object_editor_changed_cb, editor);
+
 
        gl_debug (DEBUG_EDITOR, "END");
 }
@@ -279,12 +283,18 @@ gl_object_editor_set_font_size (glObjectEditor      *editor,
 {
        gl_debug (DEBUG_EDITOR, "START");
 
-        editor->priv->stop_signals = TRUE;
+
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->text_size_spin),
+                                         gl_object_editor_changed_cb, editor);
+
 
         gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->text_size_spin),
                                    font_size);
 
-        editor->priv->stop_signals = FALSE;
+
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->text_size_spin),
+                                           gl_object_editor_changed_cb, editor);
+
 
        gl_debug (DEBUG_EDITOR, "END");
 }
@@ -318,12 +328,18 @@ gl_object_editor_set_font_weight (glObjectEditor      *editor,
 {
        gl_debug (DEBUG_EDITOR, "START");
 
-        editor->priv->stop_signals = TRUE;
+
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->text_bold_toggle),
+                                         gl_object_editor_changed_cb, editor);
+
 
         gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->text_bold_toggle),
                                       (font_weight == PANGO_WEIGHT_BOLD));
 
-        editor->priv->stop_signals = FALSE;
+
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->text_bold_toggle),
+                                           gl_object_editor_changed_cb, editor);
+
 
        gl_debug (DEBUG_EDITOR, "END");
 }
@@ -361,12 +377,18 @@ gl_object_editor_set_font_italic_flag (glObjectEditor      *editor,
 {
        gl_debug (DEBUG_EDITOR, "START");
 
-        editor->priv->stop_signals = TRUE;
+
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->text_italic_toggle),
+                                         gl_object_editor_changed_cb, editor);
+
 
         gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->text_italic_toggle),
                                       font_italic_flag);
 
-        editor->priv->stop_signals = FALSE;
+
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->text_italic_toggle),
+                                           gl_object_editor_changed_cb, editor);
+
 
        gl_debug (DEBUG_EDITOR, "END");
 }
@@ -401,7 +423,11 @@ gl_object_editor_set_text_alignment (glObjectEditor      *editor,
 {
        gl_debug (DEBUG_EDITOR, "START");
 
-        editor->priv->stop_signals = TRUE;
+
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->text_left_toggle), align_toggle_cb, editor);
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->text_center_toggle), align_toggle_cb, editor);
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->text_right_toggle), align_toggle_cb, editor);
+
 
         gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->text_left_toggle),
                                       (align == PANGO_ALIGN_LEFT));
@@ -410,7 +436,11 @@ gl_object_editor_set_text_alignment (glObjectEditor      *editor,
         gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->text_right_toggle),
                                       (align == PANGO_ALIGN_RIGHT));
 
-        editor->priv->stop_signals = FALSE;
+
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->text_left_toggle), align_toggle_cb, editor);
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->text_center_toggle), align_toggle_cb, editor);
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->text_right_toggle), align_toggle_cb, editor);
+
 
        gl_debug (DEBUG_EDITOR, "END");
 }
@@ -462,9 +492,19 @@ gl_object_editor_set_text_color (glObjectEditor      *editor,
                 return;
         }
 
-        editor->priv->stop_signals = TRUE;
 
-       gl_debug (DEBUG_EDITOR, "color field %s(%d) / %X", text_color_node->key, text_color_node->field_flag, text_color_node->color);
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->text_color_combo),
+                                         gl_object_editor_changed_cb, editor);
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->text_color_radio),
+                                         text_radio_toggled_cb, editor);
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->text_color_key_radio),
+                                         text_radio_toggled_cb, editor);
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->text_color_key_combo),
+                                         gl_object_editor_changed_cb, editor);
+
+
+       gl_debug (DEBUG_EDITOR, "color field %s(%d) / %X",
+                  text_color_node->key, text_color_node->field_flag, text_color_node->color);
        
        gtk_widget_set_sensitive (editor->priv->text_color_key_radio, merge_flag);
 
@@ -478,24 +518,34 @@ gl_object_editor_set_text_color (glObjectEditor      *editor,
                                           text_color_node->color);
        }
        
-       if (!text_color_node->field_flag || !merge_flag) {
+       if (!text_color_node->field_flag || !merge_flag)
+        {
                gl_debug (DEBUG_EDITOR, "color field false");
-               gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
-                                                 (editor->priv->text_color_radio), TRUE); 
+               gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->text_color_radio), TRUE); 
                gtk_widget_set_sensitive (editor->priv->text_color_combo, TRUE);
                gtk_widget_set_sensitive (editor->priv->text_color_key_combo, FALSE);
                
-       } else {
+       }
+        else
+        {
                gl_debug (DEBUG_EDITOR, "color field true");
-               gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
-                                                 (editor->priv->text_color_key_radio), TRUE); 
+               gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->text_color_key_radio), TRUE); 
                gtk_widget_set_sensitive (editor->priv->text_color_combo, FALSE);
                gtk_widget_set_sensitive (editor->priv->text_color_key_combo, TRUE);
                
                gl_field_button_set_key (GL_FIELD_BUTTON (editor->priv->text_color_key_combo), "");
        }
 
-        editor->priv->stop_signals = FALSE;
+
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->text_color_combo),
+                                           gl_object_editor_changed_cb, editor);
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->text_color_radio),
+                                           text_radio_toggled_cb, editor);
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->text_color_key_radio),
+                                           text_radio_toggled_cb, editor);
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->text_color_key_combo),
+                                           gl_object_editor_changed_cb, editor);
+
 
        gl_debug (DEBUG_EDITOR, "END");
 }
@@ -548,12 +598,18 @@ gl_object_editor_set_text_line_spacing (glObjectEditor      *editor,
 {
        gl_debug (DEBUG_EDITOR, "START");
 
-        editor->priv->stop_signals = TRUE;
+
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->text_line_spacing_spin),
+                                         gl_object_editor_changed_cb, editor);
+
 
         gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->text_line_spacing_spin),
                                    text_line_spacing);
 
-        editor->priv->stop_signals = FALSE;
+
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->text_line_spacing_spin),
+                                           gl_object_editor_changed_cb, editor);
+
 
        gl_debug (DEBUG_EDITOR, "END");
 }
@@ -587,12 +643,18 @@ gl_object_editor_set_text_auto_shrink (glObjectEditor      *editor,
 {
        gl_debug (DEBUG_EDITOR, "START");
 
-        editor->priv->stop_signals = TRUE;
+
+        g_signal_handlers_block_by_func (G_OBJECT (editor->priv->text_auto_shrink_check),
+                                         gl_object_editor_changed_cb, editor);
+
 
        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->text_auto_shrink_check),
                                       auto_shrink);
 
-        editor->priv->stop_signals = FALSE;
+
+        g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->text_auto_shrink_check),
+                                           gl_object_editor_changed_cb, editor);
+
 
        gl_debug (DEBUG_EDITOR, "END");
 }
@@ -622,8 +684,6 @@ gboolean    gl_object_editor_get_text_auto_shrink (glObjectEditor      *editor)
 static void
 text_radio_toggled_cb (glObjectEditor *editor)
 {
-        if (editor->priv->stop_signals) return;
-
         gl_debug (DEBUG_EDITOR, "START");
        
        if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->text_color_radio))) {
index ef4329d6b04b94571d0d01bf818435cdd115e2b6..e302ac5ab6770de862b46b0ee489ed9dabf4589a 100644 (file)
@@ -427,9 +427,7 @@ 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));
@@ -756,9 +754,6 @@ object_changed_cb (glLabelObject  *object,
 
         gl_debug (DEBUG_EDITOR, "BEGIN");
 
-        if (editor->priv->stop_signals) return;
-        editor->priv->stop_signals = TRUE;
-
 
         gl_label_object_get_position (object, &x, &y);
         gl_object_editor_set_position (editor, x, y);
@@ -872,8 +867,6 @@ object_changed_cb (glLabelObject  *object,
         gl_color_node_free (&shadow_color_node);
 
 
-        editor->priv->stop_signals = FALSE;
-
         gl_debug (DEBUG_EDITOR, "END");
 }
 
@@ -910,8 +903,8 @@ gl_object_editor_changed_cb (glObjectEditor *editor)
 
         gl_debug (DEBUG_EDITOR, "BEGIN");
 
-        if (editor->priv->stop_signals) return;
-        editor->priv->stop_signals = TRUE;
+
+        g_signal_handlers_block_by_func (G_OBJECT (object), object_changed_cb, editor);
 
 
         gl_object_editor_get_position (editor, &x, &y);
@@ -1023,7 +1016,7 @@ gl_object_editor_changed_cb (glObjectEditor *editor)
         gl_color_node_free (&shadow_color_node);
 
 
-        editor->priv->stop_signals = FALSE;
+        g_signal_handlers_unblock_by_func (G_OBJECT (object), object_changed_cb, editor);
 
         gl_debug (DEBUG_EDITOR, "END");
 }
@@ -1040,8 +1033,7 @@ gl_object_editor_size_changed_cb (glObjectEditor *editor)
 
         gl_debug (DEBUG_EDITOR, "BEGIN");
 
-        if (editor->priv->stop_signals) return;
-        editor->priv->stop_signals = TRUE;
+        g_signal_handlers_block_by_func (G_OBJECT (object), object_changed_cb, editor);
 
 
         if ( GL_IS_LABEL_LINE (object) )
@@ -1056,7 +1048,7 @@ gl_object_editor_size_changed_cb (glObjectEditor *editor)
         gl_label_object_set_size (object, w, h, TRUE);
 
 
-        editor->priv->stop_signals = FALSE;
+        g_signal_handlers_unblock_by_func (G_OBJECT (object), object_changed_cb, editor);
 
         gl_debug (DEBUG_EDITOR, "END");
 }