Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sat 20 Sep 2014, 00:06
All times are UTC - 4
 Forum index » Taking the Puppy out for a walk » Suggestions
Handling of menus and helpfile for DotPup and multiple WMs
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [5 Posts]  
Author Message
papaschtroumpf


Joined: 17 Jun 2005
Posts: 250

PostPosted: Thu 23 Jun 2005, 17:10    Post subject:  Handling of menus and helpfile for DotPup and multiple WMs  

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
Back to top
View user's profile Send private message 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 7047
Location: Perth, Western Australia

PostPosted: Fri 24 Jun 2005, 09:33    Post subject:  

Yes, a w.m. independent template is definitely the way to go!
Back to top
View user's profile Send private message Visit poster's website 
Flash
Official Dog Handler


Joined: 04 May 2005
Posts: 11068
Location: Arizona USA

PostPosted: Fri 24 Jun 2005, 10:07    Post subject: Re: Handling of menus and helpfile for DotPup and multiple W  

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.


Quote:
<>
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.
Back to top
View user's profile Send private message 
papaschtroumpf


Joined: 17 Jun 2005
Posts: 250

PostPosted: Sat 25 Jun 2005, 00:13    Post subject:  

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
Back to top
View user's profile Send private message 
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15117
Location: Paradox Realm

PostPosted: Sat 25 Jun 2005, 02:21    Post subject:  

Quote:
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 Cool and do the lot

Quote:
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 WIKI
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 1 [5 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Taking the Puppy out for a walk » Suggestions
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0692s ][ Queries: 12 (0.0052s) ][ GZIP on ]