Menu vs module improvements (split from patch thread) - page 2 - General Discussion and Assistance - CHDK Forum supplierdeeply

Menu vs module improvements (split from patch thread)

  • 36 Replies
  • 5667 Views
Re: Menu vs module improvements (split from patch thread)
« Reply #10 on: 12 / June / 2017, 08:44:08 »
Advertisements
Fixed.

The semantics of MENUITEM_SUBMENU_PROC is changed to accept CMenu** and populate it (without displaying), with module_run() being a notable exception; I am hoping to remove that special handling once modular menus are implemented.

This fix should have allowed items in Games and Tools to be added to the user menu, but for some reason that didn't happen.
« Last Edit: 12 / June / 2017, 08:46:38 by dmitrys »
Author of CHIMP, Canon Hack Installation and Management Platform

Re: Menu vs module improvements (split from patch thread)
« Reply #11 on: 12 / June / 2017, 13:39:44 »
One possible application of dynamic menus is allowing the user menu to become the first item in the root menu.

I successfully implemented this (I'm not sure why, but chdkptp Live stopped working). The downside is that the user menu is empty ATM :)

Any ideas?
« Last Edit: 12 / June / 2017, 13:52:17 by dmitrys »
Author of CHIMP, Canon Hack Installation and Management Platform

*

Offline reyalp

  • ******
  • 12162
Re: Menu vs module improvements (split from patch thread)
« Reply #12 on: 12 / June / 2017, 13:40:54 »
This fix should have allowed items in Games and Tools to be added to the user menu, but for some reason that didn't happen.
Haven't looked at the patch yet, but this isn't really clear to me. Do you mean the patch is supposed to fix adding to the user menu, but doesn't work for some reason you don't understand?

When you post a patch, please be clear whether you are asking for feedback, or requesting that it be added to the trunk. We try to keep the trunk usable, so anything posted for inclusion should be tested and reasonably complete. I'd also prefer not to spend the limited time I have available for CHDK integrating a bunch of work in progress versions of the same change.
Don't forget what the H stands for.

Re: Menu vs module improvements (split from patch thread)
« Reply #13 on: 12 / June / 2017, 13:45:37 »
Do you mean the patch is supposed to fix adding to the user menu, but doesn't work for some reason you don't understand?

Yes, I'm sorry for not clarifying that. The patch has the limited functionality of hiding empty Games and Tools menus, but I'm asking for a solution for adding items from dynamically generated menus. The menu editor is able to add them, but they disappear from the user menu after rebooting.
Author of CHIMP, Canon Hack Installation and Management Platform


Re: Menu vs module improvements (split from patch thread)
« Reply #14 on: 17 / June / 2017, 11:58:05 »
Maybe try a slightly different approach?
« Last Edit: 17 / June / 2017, 12:00:02 by dmitrys »
Author of CHIMP, Canon Hack Installation and Management Platform

*

Offline reyalp

  • ******
  • 12162
Re: Menu vs module improvements (split from patch thread)
« Reply #15 on: 17 / June / 2017, 13:48:25 »
Maybe try a slightly different approach?
I'm not sure what you are suggesting here. If you are suggesting a PC based configuration, I certainly wouldn't want that to be required, but having it as an option certainly wouldn't hurt. Zeno also made a cfg editor: http://zenoshrdlu.com/cfgedit/chdkcfgedit.html

As far as the menu patch goes, I apologize for the lack of feedback. I haven't spent much time with the user menu code, and haven't done anything with the menu code recently, so giving useful input will require me to find some time to dig into the code.
Don't forget what the H stands for.

Re: Menu vs module improvements (split from patch thread)
« Reply #16 on: 17 / June / 2017, 14:02:30 »
I'm not sure what you are suggesting here. If you are suggesting a PC based configuration, I certainly wouldn't want that to be required, but having it as an option certainly wouldn't hurt.

Of course this would be optional.

Quote from: reyalp
Zeno also made a cfg editor: http://zenoshrdlu.com/cfgedit/chdkcfgedit.html

I believe it doesn't handle the user menu, just cchdk.cfg and osd.cfg.

Quote from: reyalp
As far as the menu patch goes, I apologize for the lack of feedback.

No need to apologize. I was hoping @philmoz could shed some light on the problem, but he seems to be unavailable.
Author of CHIMP, Canon Hack Installation and Management Platform

Re: Menu vs module improvements (split from patch thread)
« Reply #17 on: 17 / June / 2017, 18:09:06 »
So here's the reason I'm porting the metadata generation code to run on the camera.

The idea is rather than scan the MODULES directory twice (or up to 4 times in the trunk implementation) and read each module's info (again, up to 4 times), the entire metadata will be stored in a single file, which should only be generated during initial CHDK run (or upon request from the user). The same file will also be used by CHIMP to gather module data during updates and, better yet, generated by it to make things even easier for CHDK.

This should make more sense if implemented along with dynamic menu initialization, which I'm still hoping to crack with Phil's help.

P.S. The module scanner in trunk tries to open the CFG dir as a module file.
« Last Edit: 17 / June / 2017, 18:19:12 by dmitrys »
Author of CHIMP, Canon Hack Installation and Management Platform


*

Offline reyalp

  • ******
  • 12162
Re: Menu vs module improvements (split from patch thread)
« Reply #18 on: 17 / June / 2017, 19:11:53 »
The idea is rather than scan the MODULES directory twice (or up to 4 times in the trunk implementation) and read each module's info (again, up to 4 times)
Have you checked whether scanning 4x actually takes a meaningful amount of time?

I would be concerned about what happens if the module info gets out of sync.

Quote
P.S. The module scanner in trunk tries to open the CFG dir as a module file.
Can you clarify? readdir should list only the stuff inside the directory. This includes . and .. on some cameras, but the code excludes them.
Don't forget what the H stands for.

Re: Menu vs module improvements (split from patch thread)
« Reply #19 on: 17 / June / 2017, 19:22:46 »
Have you checked whether scanning 4x actually takes a meaningful amount of time?

It doesn't really, but I just don't like the idea :)

Quote
I would be concerned about what happens if the module info gets out of sync.

Nothing bad ATM (possible extra menu items that point to missing modules).

Another option is to keep the second scan and only use the metadata as a hint for the module count, but IMHO that would be too much work for too little gain.

Quote
Can you clarify? readdir should list only the stuff inside the directory. This includes . and .. on some cameras, but the code excludes them.

A/CHDK/MODULES/CFG is only used by Sokoban, but is a required directory. The code in gui.c doesn't exclude it.
Author of CHIMP, Canon Hack Installation and Management Platform

 

Related Topics