![]() |
Check internet connection on application start?
Hi,
I am developing an application for N900. It requires an Internet connection to work. The initial data is fetched from a web service. So, on startup I need to check is there an internet connection. If true continue loading the application, if not show the connections dialog (like in email application when you click send/recieve but no internet is connected). Otherwise it will print errors in my comboboxes. How to do this in Python? |
Re: Check internet connection on application start?
https://vcs.maemo.org/svn/pymaemo/pa...atic_events.py
What you need to look at is the instantiation of the Conic.Connection object, the setting of a callback function - look at what it does when the state == conic.STATUS_CONNECTED and the setting of the "automatic-connection-events" property to True. |
Re: Check internet connection on application start?
Thanks for the info.
But how do you get the connection dialog if no network is connected? |
Re: Check internet connection on application start?
I have been trying to get this running, but I run into some problems.
I initialise the gobject and the loop. But the problem is that it loops all the time, and doesn't show my application main form. I need to check connectivity just once, before the form is show. How can I do that? |
Re: Check internet connection on application start?
Are you using Qt? I have no idea then, sorry. Qt probably has a connectivity wrapper somewhere; you could try using that, instead, if it exists.
Alternatively, just use QDBus. ICD2 emits signals and has methods for getting the current state etc. |
Re: Check internet connection on application start?
Quote:
Btw. When I try to execute https://vcs.maemo.org/svn/pymaemo/pa...est_connect.py It just prints "connect()" No callback is done. On the phone and in scrathcbox. Can you give me some more info on QDBus? |
All times are GMT. The time now is 08:00. |
vBulletin® Version 3.8.8