Skip to content
This repository has been archived by the owner on Mar 27, 2021. It is now read-only.

popupUtils.open() 'caller' is deprecated for Dialog #78

Closed
mymike00 opened this issue May 5, 2020 · 6 comments
Closed

popupUtils.open() 'caller' is deprecated for Dialog #78

mymike00 opened this issue May 5, 2020 · 6 comments

Comments

@mymike00
Copy link
Contributor

mymike00 commented May 5, 2020

When I want to open a Dialog and I want to pass some params to it, I need to call PopupUtils.open() passing a caller in addition to my Dialog and to the params I want to pass. However, I get a log line saying

'caller' is DEPRECATED. It has no effect.

can we get rid of the caller parameter without breaking all the existing apps?

@cibersheep
Copy link
Contributor

cibersheep commented May 29, 2020

I think the only use I found for the caller is here: https://gitlab.com/bhdouglass/dice-roller/-/blob/master/qml/MainPage.qml#L424

Do we have a workaround?

Setting parent first?

@mymike00
Copy link
Contributor Author

I found out caller is deprecated only with the Dialog component (see code) while it is still needed for others, like the Popover that is placed near the caller if possible (docs)

@cibersheep in the code you linked the caller is useless, but you have to put it if you want to pass some parameters to the Dialog...

@cibersheep
Copy link
Contributor

cibersheep commented May 29, 2020

I see... I remember I had to specify the caller but I don't remember why :) sounds like to pass the parameters as you say.

Would be save to remove it then? How can be done and not breaking the existing code? Parsing caller as optional? So, if it's more than 2 parameters, take the last one as parameter for the Dialog?

@balcy
Copy link
Contributor

balcy commented Aug 22, 2020

for some popup requests in morph without the caller parameter the dialogs were shown in the wrong window, see:
ubports/morph-browser#167
ubports/morph-browser#173
(ubports/morph-browser@1cd46e9)
So I think it should still be supported and not be removed, unless issues like that with morph can be solved differently.

@mymike00 mymike00 changed the title popupUtils.open() 'caller' is deprecated popupUtils.open() 'caller' is deprecated for Dialog Aug 24, 2020
@mymike00
Copy link
Contributor Author

Yeah, I think we can do nothing about it because popupUtils.open() is used for different components while the caller parameter is deprecated only if passed to a Dialog. We can update the docs to say to puss null as caller when opening a Dialog to not get the warning line in the logs, and well, because it has no effects.

@UniversalSuperBox
Copy link
Member

Ubuntu UI Toolkit has moved to https://gitlab.com/ubports/core/lomiri-ui-toolkit. If this issue is still relevant, please file it again at https://gitlab.com/ubports/core/lomiri-ui-toolkit/-/issues.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants