Exemple #1
0
ObjectChange *
object_apply_props_from_dialog(DiaObject *obj, WIDGET *dialog_widget)
{
  ObjectChange *change;
  PropDialog *dialog = prop_dialog_from_widget(dialog_widget);
  GPtrArray *props = g_ptr_array_new ();
  guint i;

  prop_get_data_from_widgets(dialog);
  /* only stuff which is actually changed */
  for (i = 0; i < dialog->props->len; ++i) {
    Property *p = g_ptr_array_index (dialog->props, i);
    if (p->descr->flags & PROP_FLAG_WIDGET_ONLY)
      continue;
    if ((p->experience & PXP_NOTSET) == 0)
      g_ptr_array_add(props, p);
  }
  /* with an empty list there is no change at all but simply
   * returning NULL is against the contract ...
   */
  if (!obj->ops->apply_properties_list) {
    g_warning("using a fallback function to apply properties;"
              " undo may not work correctly");
    change = object_apply_props(obj, props);
  } else {
    change = obj->ops->apply_properties_list(obj, props);
  }
  g_ptr_array_free(props, TRUE);
  return change;
}
Exemple #2
0
static ObjectChange *
compound_apply_properties_dialog (Compound * comp, GtkWidget * dialog_widget)
{
  CompoundState * state;
  PropDialog *dialog = prop_dialog_from_widget(dialog_widget);

  state = compound_state_new (comp);

  prop_get_data_from_widgets(dialog);
  compound_apply_props (comp, dialog->props, FALSE);
  return (ObjectChange *) compound_change_new (comp, state);
}
Exemple #3
0
static void 
prop_dialog_signal_destroy(GtkWidget *dialog_widget)
{
  prop_dialog_destroy(prop_dialog_from_widget(dialog_widget));
}