Nothing Special   »   [go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

menu.xml and "CDATA" #972

Closed
ncmprhnsbl opened this issue Jul 1, 2023 · 6 comments
Closed

menu.xml and "CDATA" #972

ncmprhnsbl opened this issue Jul 1, 2023 · 6 comments

Comments

@ncmprhnsbl
Copy link
ncmprhnsbl commented Jul 1, 2023

i've noticed that some menu generators (eg. obmenu-generator and obamenu.py) output their xml execute sections enclosed in <![CDATA[foo]]> tags, which it appears labwc doesn't support?
could be out of scope and not a huge deal with labwc/wayland specific generators in the works.

also, as a work around it's fairly easy to hack those two examples being just scripts and remove the CDATA parts.

@johanmalm
Copy link
Collaborator

Hi. Thanks for raising.
We need to use xmlNodeGetContent(node) instead of just node->content for those <command> tags.
It's not super-trivial, but I'll have a go later at a patch for discussion.

johanmalm added a commit to johanmalm/labwc that referenced this issue Jul 2, 2023
...in order to support obmenu-generator output such as this:

  <menu id="root-menu" label="Applications">
    <item label="File Manager"><action name="Execute"><command><![CDATA[xdg-open .]]></command></action></item>
    <item label="Terminal"><action name="Execute"><command><![CDATA[xterm]]></command></action></item>
    <item label="Web Browser"><action name="Execute"><command><![CDATA[xdg-open http://]]></command></action></item>
    <item label="Run command"><action name="Execute"><command><![CDATA[gmrun]]></command></action></item>
  </menu>

References:
- https://github.com/trizen/obmenu-generator
- https://aur.archlinux.org/packages/obmenu-generator
- https://trizenx.blogspot.com/2012/02/obmenu-generator.html

Fixes: issue labwc#972
@ncmprhnsbl
Copy link
Author

cool, initial testing of above the commit seems to be partially working, in that entries on the main menu work, but not on submenus.
caveat: i'm just replacing menu.c in labwc/labwc git head

@johanmalm
Copy link
Collaborator

Submenus work for me (with obmenu-generator)

Pipemenus are not supported if that’s what you mean (dynamic menus)

Could you post your menu.xml

@johanmalm
Copy link
Collaborator

Sorry - I get it now. My bad. I'll sort tonight.

johanmalm added a commit to johanmalm/labwc that referenced this issue Jul 3, 2023
...in order to support obmenu-generator output such as this:

  <menu id="root-menu" label="Applications">
    <item label="File Manager"><action name="Execute"><command><![CDATA[xdg-open .]]></command></action></item>
    <item label="Terminal"><action name="Execute"><command><![CDATA[xterm]]></command></action></item>
    <item label="Web Browser"><action name="Execute"><command><![CDATA[xdg-open http://]]></command></action></item>
    <item label="Run command"><action name="Execute"><command><![CDATA[gmrun]]></command></action></item>
  </menu>

References:
- https://github.com/trizen/obmenu-generator
- https://aur.archlinux.org/packages/obmenu-generator
- https://trizenx.blogspot.com/2012/02/obmenu-generator.html

Fixes: issue labwc#972
@johanmalm
Copy link
Collaborator

Okay. All working now.

Would appreciate another test drive (...because my testing skills are evidently not what they ought to be 🐒 )

johanmalm added a commit to johanmalm/labwc that referenced this issue Jul 3, 2023
...in order to support obmenu-generator output such as this:

  <menu id="root-menu" label="Applications">
    <item label="File Manager"><action name="Execute"><command><![CDATA[xdg-open .]]></command></action></item>
    <item label="Terminal"><action name="Execute"><command><![CDATA[xterm]]></command></action></item>
    <item label="Web Browser"><action name="Execute"><command><![CDATA[xdg-open http://]]></command></action></item>
    <item label="Run command"><action name="Execute"><command><![CDATA[gmrun]]></command></action></item>
  </menu>

References:
- https://github.com/trizen/obmenu-generator
- https://aur.archlinux.org/packages/obmenu-generator
- https://trizenx.blogspot.com/2012/02/obmenu-generator.html

Fixes: issue labwc#972
@ncmprhnsbl
Copy link
Author

:) passes testing here, all levels of submenu working for me.

johanmalm added a commit that referenced this issue Jul 4, 2023
...in order to support obmenu-generator output such as this:

  <menu id="root-menu" label="Applications">
    <item label="File Manager"><action name="Execute"><command><![CDATA[xdg-open .]]></command></action></item>
    <item label="Terminal"><action name="Execute"><command><![CDATA[xterm]]></command></action></item>
    <item label="Web Browser"><action name="Execute"><command><![CDATA[xdg-open http://]]></command></action></item>
    <item label="Run command"><action name="Execute"><command><![CDATA[gmrun]]></command></action></item>
  </menu>

References:
- https://github.com/trizen/obmenu-generator
- https://aur.archlinux.org/packages/obmenu-generator
- https://trizenx.blogspot.com/2012/02/obmenu-generator.html

Fixes: issue #972
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants