Hi Wim.

The simplest thing to do, is to wait for the page under your dialog to be 
re-activated - when the page status is 'PageStaus.Active' again, then you know 
that the pop transition has finished and you can issue a new page stack change.

However, what you should probably do in this case, is verify that the dialog 
content is valid before you let the user accept the Dialog.  You can prevent 
the dialog being accepetd by binding an expression which evaluates to false to 
the 'canAccept' property of the Dialog.  When you detect that the user has 
entered a name which already exists, you can show a TextSwitch for the user to 
confirm that they wish to overwrite the existing file.  When you're happy that 
the choice is intentional, make the 'canAccept' expression evaluate to true.

You may also like to look at the text field examples in the component gallery, 
which demonstrate how to visually indicate that the content of a field is not 
currently in a valid state.

Thanks,
Matt

________________________________
From: devel-boun...@lists.sailfishos.org [devel-boun...@lists.sailfishos.org] 
on behalf of Wim de Vries [wsvr...@xs4all.nl]
Sent: Thursday, August 15, 2013 7:21 PM
To: devel@lists.sailfishos.org
Subject: [SailfishDevel] yet another pop problem (Dialog)

I am sorry, but some things that are so simple in QtWidgets do become quite 
complex in Sailfish-QML.
case:
textedit->save-as(menu)
push Dailog (usr inputs filename)
C++ evaluates filename: file already exists!

now I want push a "overwrite?" Dialog.
But any of the PageStack  actions causes "Warning: cannot pop while transition 
is in progress".
The problem here is that the Dialog is always popped by the user. So pagestack 
goes in transition and I cannot do anything on the pagestack (immediately) 
after that.
Thanks.


_______________________________________________
SailfishOS.org Devel mailing list

Reply via email to