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

[transfer-engine] fix example qml #4

Merged
merged 1 commit into from Sep 13, 2021
Merged

Conversation

attah
Copy link
Contributor

@attah attah commented Sep 1, 2021

I have no idea what i'm doing, but this was needed for my plug-in and for the example to stop throwing errors.

@chriadam
Copy link

chriadam commented Sep 2, 2021

@blammit can you please check this one

@attah
Copy link
Contributor Author

attah commented Sep 3, 2021

It might also not be entirely optimal to call this SilicaFlickable "root", since the enclosing component is also called that, and you may want to call dismiss() on it. At least i did, mostly because i couldn't figure out how to say "we're done here" from the C++ side of things.

@blammit
Copy link
Contributor

blammit commented Sep 6, 2021

LGTM.

I'm not sure what the enclosing component is, but the "root" naming should not matter if the scope namespace is respected (which is not always the case). The "root" name could be removed in any case now since it's no longer used.

In regards to calling dismiss() to close the dialog from the C++ side, yes that's the expected way to do it.

@attah
Copy link
Contributor Author

attah commented Sep 6, 2021

With "enclosing component" i mean the SystemDialog, i.e. SystemShareDialog.qml that encloses the plugged in qml (with a Loader in-between, but anyway). SystemShareDialog is named root too, and that's how the close button calls it. I don't know of any other way to get hold of it than by id (maybe i'm somehow violating scope, but it works just fine), so that means removing the shadowing root id here.

However, the better solution is of course to do this from the C++ side of things, but i can't for the life of me figure out how. Could that perhaps be added to the example code?

@blammit
Copy link
Contributor

blammit commented Sep 7, 2021

Right I see, actually I referred to the wrong function earlier. Instead of calling dismiss() the preferred route is to call shareAction.done() to close the dialog. In SystemShareDialog.qml it calls dismiss() when the done() signal is received.

@attah
Copy link
Contributor Author

attah commented Sep 8, 2021

Okay, thanks. Right, shareAction.done() in QML should be very doable even without un-shadowing root.
In that case i think this is complete enough to merge.

I still can't figure out how to signal done from the C++ side of things though. Would it be possible to add that to the example?

@blammit
Copy link
Contributor

blammit commented Sep 13, 2021

I still can't figure out how to signal done from the C++ side of things though. Would it be possible to add that to the example?

There isn't a way to do this yet unfortunately. Perhaps in future there could be a method available from the dbus API to trigger this.

@blammit blammit merged commit 3bc6a91 into sailfishos:master Sep 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants