Re: Patch for Delete key behavior (for dia-0.96.1) - save/load accels
- From: Ondrej Mikle <ondrej mikle gmail com>
- 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: Sat, 29 Sep 2007 23:27:06 +0200
Lars Clausen wrote:
On Thu, 2007-09-27 at 16:07 +0200, Ondrej Mikle wrote:
Lars Clausen wrote:
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?
No, as I wrote before, I didn't get right the syntax of menurc file the
first time (since it is not documented anywhere, thought that leading
semicolon was a part of syntax).
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: I knew where it was on the web, just not how to edit it. Let's do
it this way: since you're the maintainer of the FAQ, I'd suggest you'd
replace the answer to "1.2.4. How can I set or change an accelerator key
for a function in the menu?" with the following:
---
This is possible, however it may not be the most user-friendly way. Find
the file ".dia/menurc" in your home directory (that would be
"C:\Documents and Settings\yourlogin\.dia\menurc" on Windows or
"/home/yourlogin/.dia/menurc" on *nix systems like Linux). Open the file
with a text editor (e.g. notepad in Windows or gedit in Linux).
Find a line that contains the accelerator (shortcut) you wish to change,
e.g. if you want to change the "Delete" key for Edit/Delete, this would
be the line:
; (gtk_accel_path "<Actions>/display-actions/EditDelete" "Delete")
Let's say you want to change it to Control+Delete, so change the line to:
(gtk_accel_path "<Actions>/display-actions/EditDelete" "<Control>Delete")
Notice that you have to delete the leading semicolon. The modifier keys
(Ctrl, Alt, Shift) are written as <Control>, <Alt>, <Shift> and can be
combined, e.g. "<Control><Shift>d" is a valid accelerator for
Ctrl+Shift+d. Special keys such as Return, Insert, Delete are written as
Return, Insert, Delete.
Save the file then. Note that Dia may not be running while you edit this
file.
---
Just a few notes:
1) it might be better to instruct Windows users to use Start->Run, write
"notepad %USERPROFILE%\.dia\menurc", since the homedir does not always
have to be at the mentioned location
2) there should be a mention which is the least version of dia that
supports this, I noticed someone mentioning that 0.94 did not support this
3) Mark Dexter wrote about sending updated docs, which have not yet been
incorporated (including the shortcut changing); the accel question comes
up often on the mailing list, so it would be a really good idea to put
this into FAQ
Regards
O. Mikle
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]