Share dialog does not appear with latest SDK

Bug #1202201 reported by Omer Akram
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
gallery-app
Fix Released
High
Günter Schwann

Bug Description

qtdeclarative5-ubuntu-ui-toolkit-plugin 0.1.46+13.10.20130717-0ubuntu1

With a very recent update to the ui-toolkit, the share menu does not appear when clicked.

1. start the gallery-app
2. open a photo
3. reveal the panel and click the share button

What happens:
Nothing

What should happen:
the share menu must appear.

What printed in terminal is:
file:///usr/share/gallery-app/rc/qml/MediaViewer/MediaViewer.qml:459: ReferenceError: caller is not defined

Revision history for this message
Günter Schwann (schwann) wrote :

Reason for the bug is, that the
triggered() signal of the Action in the ToobarButton does not pass the caller anymore.
According to the documentation it should.
http://developer.ubuntu.com/api/devel/ubuntu-13.10/qml/ui-toolkit/qml-ubuntu-components0-action.html#triggered-signal

affects: gallery-app → ubuntu-ui-toolkit
Changed in ubuntu-ui-toolkit:
importance: Undecided → High
assignee: nobody → Tim Peeters (tpeeters)
Revision history for this message
Günter Schwann (schwann) wrote :

This started to occur with qtdeclarative5-ubuntu-ui-toolkit-plugin 0.1.46+13.10.20130717-0ubuntu1

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

The documentation you link is not up-to-date. I don't know why it is not, I thought it was now automatically updated.

Changed in ubuntu-ui-toolkit:
status: New → Confirmed
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.

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

So to make actions available in HUD, we added an 'actions' property to MainView and Page. It is briefly documented in the latest (not on webpage) UITK docs, but we haven't announced it yet because we still want to figure out some documentation issues that I mentioned above, to have a full proper documentation.

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

If you want the proper documentation now, get both the ubuntu-ui-toolkit-doc and unity-action-doc packages. Action in UITK is a subclass of the Action from unity actions.

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

Correction for the code that I pasted above that should be used.

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

So there is no 'caller' to be passed. Use the id of the button directly.

affects: ubuntu-ui-toolkit → gallery-app
Changed in gallery-app:
status: Confirmed → Fix Committed
assignee: Tim Peeters (tpeeters) → Günter Schwann (schwann)
Changed in gallery-app:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.