[SOLVED] Need help placing a custom DzAction in pane menu

Vholf3DVholf3D Posts: 63

Is it possible to put a custom DzAction in a pane menu (such as the SmartContent pane) as the screenshot bellow?

I have tried several different things from the SDK samples but no luck so far, I only managed to place it in a new menu in the toolbar by overriding "getDefaultMenuPath".

Thanks!

Edit:

This is what I am using currently according to the documentation but is not working

virtual QString	getDefaultMenuPath() const override { return "DzSmartContentPane::My Action"; }

 

Post edited by Vholf3D on

Comments

  • Vholf3DVholf3D Posts: 63

    Also, the action is being created, I can see it in the custom actions list, but is not being added automatically to the pane I specify in "getDefaultMenuPath".

  • OmnifluxOmniflux Posts: 373

    You said you've tried several different things, is it possible the return value ("DzSmartContentPane::My Action") is not the original value?

    Seeing as you've already loaded the plugin at least once without it working, I suspect the actions location is now saved in your workspace settings and changing the location in getDefaultMenuPath will not take effect automatically anymore.

    Try using "Window" -> "Workspace" -> "Update and Merge Menus" or launching with clean session UI files (See this post).

     

  • Vholf3DVholf3D Posts: 63

    Omniflux said:

    You said you've tried several different things, is it possible the return value ("DzSmartContentPane::My Action") is not the original value?

    Seeing as you've already loaded the plugin at least once without it working, I suspect the actions location is now saved in your workspace settings and changing the location in getDefaultMenuPath will not take effect automatically anymore.

    Try using "Window" -> "Workspace" -> "Update and Merge Menus" or launching with clean session UI files (See this post).

    Thank you! that did the trick.

    One more question, is it possible to place the custom action after a specific separator?, in the screenshot above, let's say I want to put the action right after "Stop CMS". Right now it goes to the bottom of the menu.

  • OmnifluxOmniflux Posts: 373

    You can do this with DzActionMenu, but I am not aware of a method to do this with getDefaultMenuPath, and getDefaultMenuPath is used for good reason.

    Perhaps @"Richard Haseltine" will chime in?

  • surrealsurreal Posts: 165

    It has been awhile since I played with adding items to options menus.

    The DzActionMenu class insert slots have "at" parameters which allow you to insert a new Action at a particular index in the menu.

    There was something I had problems with in regard to modifying other plugin options menus, however I don't recall what the problem was.

     

       
  • Vholf3DVholf3D Posts: 63

    Thank you, I will use DzActionMenu to place the action where required.

     

Sign In or Register to comment.