Re: Patch for Delete key behavior (for dia-0.96.1) - save/load accels
- From: Lars Clausen <lars raeder dk>
- To: discussions about usage and development of dia <dia-list gnome org>
- Subject: Re: Patch for Delete key behavior (for dia-0.96.1) - save/load accels
- Date: Fri, 28 Sep 2007 18:04:15 +0200
On Thu, 2007-09-27 at 16:07 +0200, Ondrej Mikle wrote:
Lars Clausen wrote:
On Tue, 2007-09-25 at 20:52 +0200, Ondrej Mikle wrote:
I send a patch that makes the saving and loading of accel keys work. The
accel keys are stored in the old menurc file ($HOME/.dia/menurc), but
the file has different format (the glib key-file -
http://library.gnome.org/devel/glib/2.12/glib-Key-value-file-parser.html),
perhaps you may wish to change the name of the file.
Thank you. I tried the patch, and it appears to work. However, even
without the patch, if I just remove the ; before a line, it also works,
so I a) can't tell if your patch works better or not, and b) don't see
the reason to change the format to something less standard that requires
our code to do special parsing of something that there exists a parser
for.
Yeah, I discovered it too. The problem was lack of verbose documenation
to behavior of gtk_accel_map_load and the file format (by looking at the
gtk parsing code I thought at first that the semicolon token is simply
skipped, but it actually meant that the whole line was skipped).
I guess I'd send a patch to gtk developers that just makes the
documentation more verbose - how to load/save accels properly (since
only comments will be changed, there should be no problem in accepting it).
I also don't see how your patch fixes the original problem:
Also, menus_init() (at app/menus.c:465, where ~/.dia/menurc shortcuts
are set up) is called before menus_initialize_updatable_items
(app/menus.c:768), which makes Dia ditch all user-chosen settings in
the
menurc file.
You haven't moved this call with your patch, AFAICT.
Yes, I haven't. With my patch, it could be moved and the functionality
would be preserved. That's because gtk_accel_map_add_entry won't change
existing accel (which is called from functions such as
gtk_accel_map_load and gtk_action_group_add_actions), but
gtk_accel_map_change_entry works anytime (which my patch used).
That's why gtk_accel_map_load must be called *before* creating all the
accels (so it is in the right place in Dia, albeit the call order may
seem counter-intuitive). This should be mentioned in the gtk docs as well.
Then why did the unpatched version work for me? Different version of
GTK?
So the accel loading/saving was correct, it would just need an entry in
FAQ about editing the menurc file (the syntax and an example). Sorry
about the confusion ;-) I'd update the FAQ, but I couldn't find the file
in the svn repository or anywhere among the sources.
http://live.gnome.org/Dia/Faq
-Lars
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]