Handling of menus and helpfile for DotPup and multiple WMs

What features/apps/bugfixes needed in a future Puppy
Post Reply
Message
Author
User avatar
papaschtroumpf
Posts: 250
Joined: Fri 17 Jun 2005, 04:23

Handling of menus and helpfile for DotPup and multiple WMs

#1 Post by papaschtroumpf »

The way menus are currently handled is as follows:
- The 0root_skeleton package provides a menu template that puts every known pupget/unleashed application where it belongs in the menu, except that all the lines in the template are commented out.
There is a menu template for each window manager since they have different syntaxes

- when the ISO is created by the createpuppy script, the script goes through the list of the pupgets/unleashed that were actually installed and uncomments the corresponding line in the template file for every windows manager (currently only 2 are supported: fvwm95 and JWM)

- when you add/remove a package using PupGet, PuGet goes through a similar process and comments or uncomments the corresponding line in the template.

This works great but it assumes that all possible applications are known when the template is built. This is mostly true for pupget/unleashed packages, but this model breaks down when you throw DotPup packages in the mix: there is no way to know in advance what applications might be added and where they go into the menu
The writer of the DotPup package might be nice enough to implement some code in the dotpup.sh script to manually insert a menu item in the menu or he may not.

The other problem with this approach is that if you add new windows manager (iceWM, PAWM, fluxbox, ...):
The person creating the unleashed package for the windows manager can provide a template and the commenting/uncommenting funtions described above as part of the pinstall.sh, but this only work for the ISO, the PupGet application will not know that other windows manager are present and will not know how to handle their template.
And what of DotPups? All DotPups released before the windows manager was release will not have support for it, even if they did provide support for inserting their app in the window managers they knew about



I propose we change the way menus are inserted as follows:

1) define a common windows manager independent menu template
This would be a file that is designed to be easy to edit and would be very readable and easily parsed by a script, maybe something like:


--------------------------
[section title]
{App 1}
{App 2}
{App 3}
--------------------------
[section title]
{App 4}
<Subsection>
{App 5}
{App 6}
{App 7}
{App 8}


ect...
or maybe we can use XML, or....


2) define WM specific "entry points" and a formal way of enumerating window managers
may done through a directory called
some path/WM_API/UpdateFvwm95Menu.sh
some path/WM_API/UpdateJWMMenu.sh
some path/WM_API/UpdateIceWMMenu.sh
some path/WM_API/UpdateFluxboxMenu.sh
etc...


3) whenever a new package is installed (through DotPup or PupGet or whatever) the author of the package provides the code to insert the menu item in the template defined at step1
It could still be done in a way similar to how unleashed are handled, where you simply comment or uncomment a line that has been place in a predetermined logical place.
DotPups and other programs that were not known at the time the template was created can insert themselves based on what they know of the template. For example if your DotPup is a new word processor, you can insert your app in the line that follows AbiWord, even if AbiWaord is uncommented.
If another word processor installs itself the same way, it will simply be inserted between Abiword and the first additional word processor.
Of course the creator of the DotPup can use any rule they want, even create a brand new section, etc...

The good thing is that the DotPup creator has to deal with only a single well know file format, that of the template which is WM independent, so it makes it easier to write the code that manipulates it. It also allows to have generic examples that anyone can use if they create a DotPup, even if they're no programming wiz.

4) everytime the template is updated, the script that updated it (dotpup.sh for example) calls a script called updateWMmenus (or whatever)
what that script does is to call every function in some path/WM_API/ (or every function that starts with Update)
What each UpdateXXXXMenu.sh in that path does does is parse the template and translate it from the common format to the WM specific format expected by the WM
This means that whoever provides a WM for puppy must write the corresponding updateXXXXMenu.sh for it.
The good news is that they only have to deal with that one WM they're working on, and anyone making a WM package should be able to write such a script (or get help from someone that can)


5) The Help file (index.html) is currently handled in a similar way, where PupGet uncomments a line in a predefined list of packages and DotPups do whatever they want, whcih is probably nothing.
We could have a script that would need to be written once called updateHelpFile and that would take 3 arguments: the name of the application, the path to its help file and the name of the unleashed application that precedes it in the help file
This would require no programming on the part of the DotPup packager, just a one liner:

updateHelpFile "MyWord" "/sur/share/doc/MyWord.htm" "Abiword"




as a side note, this would also resolve the problem where you can't easily remove a menu item from the fvwm menu because of the different format for the first menu item in each section.
Mandriva LE 2005 user and puppy newbie

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#2 Post by BarryK »

Yes, a w.m. independent template is definitely the way to go!

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

Re: Handling of menus and helpfile for DotPup and multiple W

#3 Post by Flash »

papaschtroumpf wrote:<>
3) whenever a new package is installed (through DotPup or PupGet or whatever) the author of the package provides the code to insert the menu item in the template defined at step1
How to get the word out, so everyone knows to do it every time? It won't work to just post it somewhere. It needs to somehow be built-in, and easy to use, or won't get done. Or at least not done thoroughly and consistently.

<>
This means that whoever provides a WM for puppy must write the corresponding updateXXXXMenu.sh for it.
The good news is that they only have to deal with that one WM they're working on, and anyone making a WM package should be able to write such a script (or get help from someone that can)
See my comment above.

User avatar
papaschtroumpf
Posts: 250
Joined: Fri 17 Jun 2005, 04:23

#4 Post by papaschtroumpf »

We can at least post that information on the "how to make a DotPup" page of the wiki, since it's likely that anyone new to making a DotPup will end up there.
If we provide examples of scripts that are easy to tweak, people will be morel ikely to do the right thing.

I also meant to try the Visual DotPup maker. I haven't checked it out so I don't know if one of its goals is to automate things such as menu insertion, but that sure would be a useful feature.


As far as inventing a more generic menux insertion mechanims, we should look at what the FreeDesktop group is doing, they have a generic menu standard here: http://www.freedesktop.org/wiki/Standards_2fmenu_2dspec

IceWM is already supports deriving its menus from that standard, and if we stick with an existing standard we might be able to get "menu editing" utilities that others wrote
Mandriva LE 2005 user and puppy newbie

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#5 Post by Lobster »

We can at least post that information on the "how to make a DotPup" page of the wiki, since it's likely that anyone new to making a DotPup will end up there.
The "how to make a Dotpup" MAY be protected - chances are it is owned by GuestToo - you can leave a pup lick (public) notice here, Send a private message by clicking on Member list, leave comments on the wiki - or if the page is editable double click and add the text

- or you can be 8) and do the lot
I also meant to try the Visual DotPup maker. I haven't checked it out so I don't know if one of its goals is to automate things such as menu insertion, but that sure would be a useful feature.
Your right it would
This is excellent developing program is being created by Xanatos and seems to be rather complex but maybe it will be simplified.
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

Post Reply