Re: [Planner Dev] Testing group undo ( assertion `PLANNER_IS_LIST_MODEL (model)' failed )




Alvaro,
	hi - I think this is what you're working on so
address directly to you but its got points on the undo
for strings. I was checking Task edit dialog and noticed
this,

In planner-resource-dialog.c in function resource_dialog_email_changed_cb ()
at around line, 695, there is...

		g_value_set_object (&value, g_strdup (email));

but this value has been cast to string thus it should be,

		g_value_set_string (&value, g_strdup (email));

else you will get a ...

(planner:6539): GLib-GObject-CRITICAL **: file gobject.c: line 1543
(g_value_set_object): assertion `G_VALUE_HOLDS_OBJECT (value)' failed

per-keystroke when editing email with dialog. I guess thats the
issue of the undo per-keystroke.

My angle on per-keystrock undo is as follows. For strings we just
want a per-string undo not a per-keystroke undo. To effect that we
need to compress the many per-key messages for 1 combination of

cmd = resource_cmd_edit_property (data->main_window, data->resource, "email", &value);

We can do this by comparing the value of
a) data->main_window == data->main_windows (LAST)
b) data->resource == data->resource (LAST)
c) field 3 == field 3 (LAST)
and
d) that the type of field 4 is a string.

If the above 4 conditions are true then don't store undo
value as old value and add to undo queue but store into
temp values.

When either,
1) Undo hit,
2) Redo hit,
or
3) any of the above (a)->(d)tests are not true then before
processing command do a cmd = resource_cmd_edit_property (data->main_window,
data->resource, <field3>, &value); using the lst temp values and then proceed
to the new command or event.

Rgds,
Lincoln.

Alvaro del Castillo wrote:

Hi!

El mié, 11-02-2004 a las 13:05, lincoln phipps openmutual net escribió:

Is bugzilla better to track this or just the mailing list ?.


(I'm using ddd i.e. ddd planner to get the tracing errors. ddd
seems OK - a bit cantankerous but does the job. Anyone know a
better gui for gdb ?. )

Problem 1.
=========
Click Resources ICON
Click Group ICON
Click Add button
Give group name of Group1 and check as default
Close dialog.

Then Undo Default Group
Then Undo Edit Group Property

and you get (from DDD GDB point of view).....


(planner:31891): GLib-GObject-WARNING **: invalid cast from `GdkPixbuf' to `GtkTreeModel'

(planner:31891): GLib-GObject-WARNING **: invalid cast from `GdkPixbuf' to `PlannerListModel'

(planner:31891): Planner-CRITICAL **: file planner-list-model.c: line 490 (planner_list_model_get_path): assertion `PLANNER_IS_LIST_MODEL (model)' failed
^C

It doesn't seg fault here but the assertion `PLANNER_IS_LIST_MODEL (model)' failed always happens.



Yes, I can reproduce it here, and something is wrong. For the end users,
everything is working because you can undo/redo all the commands without
fail, but is is clear that we are doing something wrong playing with
list models. I will look at it.


Problem 2.  !! this is resource one so you probably
haven't finished code yet.
===========
Insert a resource.
Give it a name,
Do Undo Edit Resource Property
   Undo Insert Resource

Then Redo Insert Resource
 Redo Edit Resource Property

 and you'll find the Resource name is missing.
 Funny  thing being if you do simply Undo Edit Resource Property,
 Redo Edit Resource Property it keeps it there so sound like
 something isn't being remembered exactly right.


Hmmm, now it works correctly so maybe, I haven't finished this code in
that moment.

Thanks and sorry for answering too late ...

Cheers




Alvaro del Castillo wrote:


Hi guys!

We have finished the group undo work and now, as undo/redo system is
very young code, we will love some testing before releases with this
code.

If you are using Planner from CVS, please play a little with group
undo/redo. It is easy:

- Go to the resources view
- Push over the group button
- Add/remove/modify properties from a group
- Try to undo/redo all the commands you can do as a user.

We continue with the work in resources now. The plan is that every thing
that a user can do with Planner, could be undo.

Cheers



------------------------------------------------------------------------

_______________________________________________
Planner-dev mailing list
Planner-dev lists imendio com
http://lists.imendio.com/mailman/listinfo/planner-dev

_______________________________________________
Planner-dev mailing list
Planner-dev lists imendio com
http://lists.imendio.com/mailman/listinfo/planner-dev



------------------------------------------------------------------------

_______________________________________________
Planner-dev mailing list
Planner-dev lists imendio com
http://lists.imendio.com/mailman/listinfo/planner-dev



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