RE: Panel foot menu favorites

Hash: SHA1


> No, it has not been done, and it seems a very good idea.

I'm just brimming with good ideas ;)
> I would love to integrate this code.

I knocked out a little design that parses the bookmarks file (it does
it recursively, but that shouldn't matter - anyone who has hundreds of
levels of depth in their bookmarks needs a head exam!).

The code is almost working (I did manage to totally break it about 5
minutes ago so I still have a bit of fixing up to do), but I'm not
going to do a huge amount of work to integrate it with the panel - I
would need to spend more time grokking the code for that than writing
the code for this. It'll be a stand alone app that just makes files in
the existing menu directories. It's a pretty modular design, so it
could easily be integrated with the main panel code by someone who
knows their way around it.

Hopefully it should be finished some time tomorrow after I've nabbed a
few hours kip.

I put a little representation of the structure of the algorithm below
so that anyone who has any violent objections can make them now.

- ---
 _____ _         _       _____
| __  | |___ ___| |_ ___|   __|_ _ ___        Chris "Ng" Jones
| __ -| | .'|  _| '_|___|__   | | |   |
|_____|_|__,|___|_,_|   |_____|___|_|_|
            S o f t w a r e

 "Linux is beating Windows" - David Cole, Microsoft Executive


 o do until EOF
	o read next line                    /* All bookmarks are limited to a
single line, they never wrap */
	o if line starts with "<DL>"        /* Identifies that a new depth
level is required */
		o goto start:                 /* Actually a recursive call of this
function */
	o else if line starts with "<DT>"   /* Identifies that this is a
bookmark item */
		o if item is of type folder   /* Recognised by "<H3>" after the
"<DT>" */
			o create a new folder   /* i.e. a mkdir */
			o set cwd to new folder /* pwd is now the new folder */
		o else if item is of type url /* Recognised by "<A HREF" after the
"<DT" */
			o create a file         /* Makes a .desktop file for this url */
		o end if
	o else if line starts with "</DL>"  /* Identifies we should move up a
depth level */
		o set cwd to ".."             /* i.e. pwd is now the folder above */
	o end if
 o loop

Version: PGPfreeware 5.5.3i for non-commercial use <>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]