Active Topics

 


Reply
Thread Tools
Posts: 3,328 | Thanked: 4,476 times | Joined on May 2011 @ Poland
#1
Hi,
I'm working on an app which downloads content from internet. I'm using libcurl for downloading file.
How can I display popup to ask for internet connection and wait with download until internet connection is available?
Thanks in advance
__________________
If you want to support my work, you can donate by PayPal or Flattr

Projects no longer actively developed: here
 

The Following User Says Thank You to marmistrz For This Useful Post:
Posts: 1,067 | Thanked: 2,383 times | Joined on Jan 2012 @ Finland
#2
For example add following to your main.cpp, it doesn't even ask for popup if user has allowed background connections:

Code:
QNetworkConfigurationManager manager;
QNetworkConfiguration cfg = manager.defaultConfiguration();
QNetworkSession* session = new QNetworkSession(cfg);
session->setSessionProperty("ConnectInBackground", true);
session->open();
__________________
IRC: jonni@freenode
Sailfish: ¤ Qt5 SailfishTouchExample ¤ Qt5 MultiPointTouchArea Example ¤ ipaddress ¤ stoken ¤ Sailbox (Dropbox client) ¤
Harmattan: ¤ Presence VNC for Harmattan ¤ Live-F1 ¤ BTinput-terminal ¤ BabyLock ¤ BabyLock Trial ¤ QML TextTV ¤
Disclaimer: all my posts in this forum are personal trolling and I never post in any official capacity on behalf of any company.
 

The Following User Says Thank You to rainisto For This Useful Post:
Posts: 3,328 | Thanked: 4,476 times | Joined on May 2011 @ Poland
#3
Originally Posted by rainisto View Post
For example add following to your main.cpp, it doesn't even ask for popup if user has allowed background connections:

Code:
QNetworkConfigurationManager manager;
QNetworkConfiguration cfg = manager.defaultConfiguration();
QNetworkSession* session = new QNetworkSession(cfg);
session->setSessionProperty("ConnectInBackground", true);
session->open();
I added it to both main.cpp and download function and no popup is shown
__________________
If you want to support my work, you can donate by PayPal or Flattr

Projects no longer actively developed: here
 
Reply


 
Forum Jump


All times are GMT. The time now is 04:53.