Re: [Planner Dev] Task dialog undo



Hi!

El mié, 02-06-2004 a las 08:55, Richard Hult escribió:
> On tis, 2004-06-01 at 07:39 +0000, Alvaro del Castillo wrote:
> > +static gboolean
> > +task_dialog_work_focus_out_cb (GtkWidget     *w,
> > +                              GdkEventFocus *event,
> > +                              DialogData    *data)
> > +{
> > +       MrpProject   *project;
> > +       MrpCalendar  *calendar;
> > +       gint          work;
> > +       gint          current_work;
> > +       gint          work_per_day;
> > +       gdouble      *focus_in_work;
> > +       GValue        value = { 0 };
> > +       PlannerCmd   *cmd;
> > +
> > +       g_assert (MRP_IS_TASK (data->task));
> > +
> > +       g_object_get (data->task, "project", &project, NULL);
> > +       calendar = mrp_project_get_calendar (project);
> > +       work_per_day = mrp_calendar_day_get_total_work (calendar,
> > +                                                       mrp_day_get_work ());
> > +
> > +       focus_in_work = g_object_get_data (G_OBJECT (data->task),
> > "focus_in_work");
> 
> Isn't work always an integer? If so we don't need to allocate memory for
> it, just set the data with GINT_TO_POINTER.
> 

Hmmm, work as we read from the task dialog could be a double because we
can use for example, "2.4". The same for duration. But for complete and
priority yes, they are always integer so we can use this.

> Same with duration and the others.
> 
> Other than that, the patch should be fine to commit.

I will change that and commit. With the patch I have 2 problems:

1. The complete field in the Task Dialog doesn't get updated when I
change the complete value for a task. I have invest sometime trying to
know why, but prority seems to use the same code in all the places
(mrp-task.c and planner-task-dialog.c) and works ok. This is a problem
because when you undo a complete change, the undo is done ok but the
field complete remains with the previous value, not with the undoed
value. You can see that it works ok looking to the gantt chart, to the
task complete bar that appears inside the bar task.

2. I have to update the spinbuttons manually in some places:

/* FIXME: Why spin button isn't updated when is modified with direct
entry
	 from keyboard with correct values? */
	gtk_spin_button_update (GTK_SPIN_BUTTON (w));

I have seem that the policy for spinbuttons are that only update when
they have a correct value. But with correct values that have been
introduced using the keyboard, also they doesn't update.


Cheers

-- Alvaro

> 
> Thanks,
> Richard

Attachment: signature.asc
Description: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada digitalmente



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]