Thanks, food for thought. However, I think this would be difficult to do with the current code base, due to the way the kindlet invokes the parser - one shot, control doesn't go back and forth, data is passed back in a single stream
Thread history: I
learned the hard way that KUAL development likes a simple incremental path.
Q for all: is a two-level nested menu, that is no sub-sub-... menus, just sub-menu, not enough for the vast majority of kindle use cases?
Quote:
Originally Posted by DuckieTigger
Just had a possibly simple idea on how to implement sub-sub-menues. It only requires minor adjustments and a non-suicidal button.
- add a optional tag to config.xml called "do-not-recurse" with a name for the button to open sub-menu
- when parser reads a do-not-recurse, ignore all sub-directories with further config.xml, create a button with the sub-menu name that will invoke clearing of all buttons in KUAL, reinvoking the parser starting at the directory the config.xml sat in
- when parser is invoked from a certain directory other than /mnt/us/extensions do 2 things: ignore the config.xml in the start-directory, only recurse down. Add a button at the top "MAIN" that will clear the buttons and reinvoke the parser at /mnt/us/extensions.
Minimal changes, only one tag and name added to config.xml. Extension developer does not need to know how to clear buttons (as the command for MAIN button in sub-menu and the button to open the sub-menu will be created by parser). It will work recursive, so sub-sub-sub-menues can easily be done.
Not completely elegant: the only way to get out of sub-menu is to go back to top hierarchy. The good though? No need to keep track of how you got to a sub-menu - it is always a sub-menu when not started from /mnt/us/extensions.
Things that would be nice: non-suicidal buttons that will keep you in a submenu, or remember which sub-menu you last used.
edit: Of course this is not the dynamic menu either. Problems may arise when sorting is concerned - and your internal data structure. Pure dynamic you have to ensure they stay grouped and visibly different. You would not want to explode a submenu and have them mixed in with the other buttons? No restart of KUAL needed, so it is kind of dynamic - my hack requires it, because after all it is a hack.
|