maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   Internet connection popup window (https://talk.maemo.org/showthread.php?t=85590)

marmistrz 2012-07-20 09:42

Internet connection popup window
 
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

rainisto 2012-07-27 21:39

Re: Internet connection popup window
 
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();


marmistrz 2012-08-08 15:10

Re: Internet connection popup window
 
Quote:

Originally Posted by rainisto (Post 1243937)
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


All times are GMT. The time now is 03:32.

vBulletin® Version 3.8.8