On 08/19/2017 06:13 AM, Carlos R. Mafra wrote:
Thanks Doug.

I have one comment:

On Fri, 18 Aug 2017 at 20:37:46 -0400, Doug Torrance wrote:
Previously, WPrefs could only be used to edit the menu specified in
WMRootMenu.

In a recent commit, the ability to specify a menu in proplist format defined
in another file which is referenced by WMRootMenu was added.  However, if a
user attempted to edit such a menu in WPrefs, an error dialog appeared.

We add the ability for WPrefs to read such a menu.

That's nice!

After the user makes any changes, the result is stored in WMRootMenu,
and *not* the original file.

This is unexpected and will probably defeat the purpose of
having a separate file for the menu in the first place.

What is the technical challenge to save the changes back
into the original file? That would be much better.

There is a chance that the original file is read-only.

For example, the default menu in the Debian package is stored in /usr/share/WindowMaker/menu.hook (which is actually a symbolic link to /etc/GNUstep/Defaults/plmenu.Debian), and WMRootMenu consists of the single line:
"menu.hook"

As of the lastest version of the Debian package (0.95.8-2), this file is now in proplist format, and so WPrefs can read it (this was my original impetus for writing this patch), but it can't write back to it.

I suppose a solution would be to write back to the original file if possible. Otherwise, copy the modified version of the file to the user directory.

So for example, in the Debian case, after modifying the menu, we create a new file, ~/GNUstep/Library/WindowMaker/menu.hook. Since we look in the user directory before the system directory for menu files, WMRootMenu will now point us to the new, modified version.

One issue with this would be in the case that WMRootMenu references the full path, e.g.,
"/usr/share/WindowMaker/menu.hook"

Then we would need to also modify WMRootMenu to point to the new version.

If this seems reasonable, I'll work on a patch.

Doug


--
To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.

Reply via email to