Re: Now look what you made me do



Lars Clausen wrote:
On Sun, 2007-09-30 at 14:38 +0200, Lars Clausen wrote:
So all this talk about delete key make me think more about how edit mode
would happen, and eventually I sat down and did the first essentials.
The current SVN uses edit mode, entering it automatically when an object
with text is created or on Enter or F2, and exiting on deselecting the
object or Escape.  It doesn't fix the menus or anything, but I'm piling
up remaining tasks on
<URL:http://live.gnome.org/Dia/CurrentDevelopment>.

Forgot to say that everybody's welcome to join in the fray and make
patches or suggestions for these tasks, or for tasks that have not been
noticed yet.  If testing, please make sure to check any problems you
find are not covered by the remaining tasks before complaining about
them.  Then hopefully next weekend we can have a bug-closing fest, as
this enables us to get through a number of old problems.


Cool. The new behavior looks good. Here are few suggestions for the
remaining tasks:

1) "Figure out how to handle changing between multiple diagrams."

- I'd suggest each diagram has its own focus instead of switching the
focus object pointer each time diagram loses/gains focus. This would
also preserve the edit mode per diagram which is IMHO better than having
to press Enter each time user exits and enters the diagram (when he had
left with some text focused in textedit mode). This would require adding
something like Focus* diagram_focus and gboolean diagram_textedit_mode
to struct _DDisplay.

Then there is question what to do with active_focus_ptr? Two possibilities:
a) it remains as the "really active" focus, i.e. the one where text
would be added when user presses the keystrokes
b) we wouldn't need it anymore and functions such as request_focus,
give_focus, remove_focus would first ask ddisplay_active and work with
the active's display focus (I like this option better, but I have to
check what happens if one of them is called while no display has focus).

2) "Make sure text edit mode is properly left at appropriate times."

There is a minor bug that text edit mode is quit twice when Delete is
pressed (edit_delete_callback) while in text mode. I'll look at it
during the week when I have a bit of time.

First it is removed here:
#0  remove_focus_object (obj=0x20d35d0) at focus.c:173
#1  0x0000000000466274 in textedit_remove_focus (obj=0x20d35d0,
diagram=0x2045000) at textedit.c:238
#2  0x000000000041f705 in diagram_unselect_object (diagram=0x2045000,
obj=0x20d35d0) at diagram.c:671
#3  0x000000000041f7da in diagram_unselect_objects (dia=0x2045000,
obj_list=0x2212980) at diagram.c:690
#4  0x0000000000427903 in delete_objects_apply (change=0x200d1a0,
dia=0x2045000) at undo.c:576
#5  0x000000000042e0a6 in edit_delete_callback (action=0x1d2fd30) at
commands.c:527

And then again:
#0  0x00002b3402074626 in raise () from /lib/libc.so.6
#1  0x00002b3402075710 in abort () from /lib/libc.so.6
#2  0x00002b34016df6a5 in g_logv () from /usr/lib/libglib-2.0.so.0
#3  0x00002b34016df725 in g_log () from /usr/lib/libglib-2.0.so.0
#4  0x00002b34016df793 in g_assert_warning () from /usr/lib/libglib-2.0.so.0
#5  0x0000000000465f8e in textedit_end_edit (ddisp=0x204a3d0,
focus=0x20c4cc0) at textedit.c:107
#6  0x0000000000466289 in textedit_remove_focus (obj=0x20d6e60,
diagram=0x2045000) at textedit.c:240
#7  0x000000000041f705 in diagram_unselect_object (diagram=0x2045000,
obj=0x20d6e60) at diagram.c:671
#8  0x000000000041f7da in diagram_unselect_objects (dia=0x2045000,
obj_list=0x20e2100) at diagram.c:690
#9  0x0000000000427903 in delete_objects_apply (change=0x220fbb0,
dia=0x2045000) at undo.c:576
#10 0x000000000042e0a6 in edit_delete_callback (action=0x1d2fd30) at
commands.c:527

Ondrej Mikle



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