We have moved to a new Sailfish OS Forum. Please start new discussions there.
1

Trigger the "Select Internet Connection" dialog from qml

asked 2014-07-31 21:33:26 +0300

pa4wdh gravatar image

updated 2014-07-31 21:33:49 +0300

HI All,

I"m writing my first app where i download some information from the internet, i used the javascript XMLHttpRequest class for that, and in the emulator it works fine. When i run it on the real device i expected this to trigger the "Select internet connection" dialog where the user can select a mobile data or wlan connection, but this didn't happen and the download failed if there was no connection available. Then i found this message: http://stackoverflow.com/questions/12439379/no-internet-popup-qt-qml-mobile-devices I made the changes to my cpp file and removed the ConnectInBackground setting as suggested in a reply to the message, and expected the dialog to pop up whenever i start the app. Also this didn't work.

How do i trigger this dialog from QML ?

edit retag flag offensive close delete

2 Answers

Sort by » oldest newest most voted
0

answered 2014-08-01 10:32:23 +0300

Sthocs gravatar image

Hello. Normally, simply doing the request should trigger it. I remember that it was the case before update 2 or 3 I think. But since then, you have to run the request a second time for the popup to appear. Try it, the popup should appear (like in the Tidings app for example, you need to hit "refresh" 2 times).

I see that as a bug and I hope that it will be fixed in a future Sailfish version.

edit flag offensive delete publish link more

Comments

One of my functions that uses XMLHttpRequest is triggered by a button on the screen, i've tried to push it several times, but it still doesn't give the connection dialog.

Lets hope this is a bug and it will be fixed soon.

pa4wdh ( 2014-08-03 19:32:54 +0300 )edit
0

answered 2014-08-01 12:02:17 +0300

kimmoli gravatar image

You can make a call over dbus to request showing the popup, com.jolla.lipstick.ConnectionSelectorIf.openConnection

iirc it also emits signal when the popup is closed.

edit flag offensive delete publish link more

Comments

I've tried this, but it didn't work (maybe because i'm very unfamiliar with dbus), i simply couldn't get any running code. Do you have an example on how to make such a call ? I've already added "QT += dbus" to my project file and included QtDbus in my cpp file.

Thanks in advance.

pa4wdh ( 2014-08-03 19:35:10 +0300 )edit
Login/Signup to Answer

Question tools

Follow
2 followers

Stats

Asked: 2014-07-31 21:33:26 +0300

Seen: 401 times

Last updated: Aug 01 '14