gl_debug (DEBUG_EDITOR, "START");
/* Extract widgets from XML tree. */
- editor->priv->lsize_page_vbox =
- glade_xml_get_widget (editor->priv->gui, "lsize_page_vbox");
- editor->priv->lsize_r_spin =
- glade_xml_get_widget (editor->priv->gui, "lsize_r_spin");
- editor->priv->lsize_theta_spin =
- glade_xml_get_widget (editor->priv->gui, "lsize_theta_spin");
- editor->priv->lsize_r_units_label =
- glade_xml_get_widget (editor->priv->gui, "lsize_r_units_label");
+ gl_util_get_builder_widgets (editor->priv->gui,
+ "lsize_page_vbox", &editor->priv->lsize_page_vbox,
+ "lsize_r_spin", &editor->priv->lsize_r_spin,
+ "lsize_theta_spin", &editor->priv->lsize_theta_spin,
+ "lsize_r_units_label", &editor->priv->lsize_r_units_label,
+ NULL);
/* Get configuration information */
units_string = gl_prefs_get_units_string ();
gl_debug (DEBUG_EDITOR, "START");
- g_signal_handlers_block_by_func (G_OBJECT(editor->priv->lsize_r_spin),
- gl_object_editor_changed_cb,
- editor);
- g_signal_handlers_block_by_func (G_OBJECT(editor->priv->lsize_theta_spin),
- gl_object_editor_changed_cb,
- editor);
+ editor->priv->stop_signals = TRUE;
/* save a copy in internal units */
editor->priv->dx = dx;
gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->lsize_theta_spin),
theta);
- g_signal_handlers_unblock_by_func (G_OBJECT(editor->priv->lsize_r_spin),
- gl_object_editor_changed_cb,
- editor);
- g_signal_handlers_unblock_by_func (G_OBJECT(editor->priv->lsize_theta_spin),
- gl_object_editor_changed_cb,
- editor);
+ editor->priv->stop_signals = FALSE;
gl_debug (DEBUG_EDITOR, "END");
}
gl_debug (DEBUG_EDITOR, "START");
- g_signal_handlers_block_by_func (G_OBJECT(editor->priv->lsize_r_spin),
- gl_object_editor_changed_cb,
- editor);
+ if (editor->priv->lsize_page_vbox)
+ {
- /* save a copy in internal units */
- editor->priv->dx_max = dx_max;
- editor->priv->dy_max = dy_max;
+ editor->priv->stop_signals = TRUE;
- /* 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);
+
+ /* 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);
+
+ editor->priv->stop_signals = FALSE;
- g_signal_handlers_unblock_by_func (G_OBJECT(editor->priv->lsize_r_spin),
- gl_object_editor_changed_cb,
- editor);
+ }
gl_debug (DEBUG_EDITOR, "END");
}
digits = gl_prefs_get_units_precision ();
/* Update characteristics of r_spin */
- g_signal_handlers_block_by_func (G_OBJECT(editor->priv->lsize_r_spin),
- gl_object_editor_changed_cb,
- editor);
+ 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, 10.0*climb_rate);
- g_signal_handlers_unblock_by_func (G_OBJECT(editor->priv->lsize_r_spin),
- gl_object_editor_changed_cb,
- editor);
+ editor->priv->stop_signals = FALSE;
/* Update r_units_label */
gtk_label_set_text (GTK_LABEL(editor->priv->lsize_r_units_label),