Comment 4 for bug 1202201

Revision history for this message
Tim Peeters (tpeeters) wrote :

You have this code there:

            ToolbarButton {
                objectName: "shareButton"
                action: Action {
                    text: i18n.tr("Share photo")
                    iconSource: "../../img/share.png"
                    onTriggered: {
                        PopupUtils.open(sharePopoverComponent, caller);
                    }
                }
                text: i18n.tr("Share")
            }

Please replace it by:

            ToolbarButton {
                objectName: "shareButton"
                iconSource: "../../img/share.png"
                onTriggered: {
                    PopupUtils.open(sharePopoverComponent, caller);
                }
                text: i18n.tr("Share")
            }

Action's onTriggered does not have a caller anymore. It was removed because the caller object cannot be passed over dbus (for the HUD), and the only use-case of the caller is to open a popover that points to a caller (button), and that is not something you want to do in the HUD.

So in all the cases where you pass a caller, only use ToolbarButton and no Action. If you use an Action in only one place, you may also simply use the ToolbarButton. Actions can be used for any action that you want in the HUD (although you can also use them to define the text/icon/triggered for any button/listitem). Its documentation is still a bit lacking because it is partially in the unity-action branch and partially in ubuntu-ui-toolkit and we need to figure out how to combine the documentation on the webpage.

If anything is unclear or you like me to update gallery-app, ping me on irc.