Reply
Thread Tools
Posts: 58 | Thanked: 10 times | Joined on Dec 2009
#1
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?
 
qwerty12's Avatar
Posts: 4,274 | Thanked: 5,358 times | Joined on Sep 2007 @ Looking at y'all and sighing
#2
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.
 

The Following User Says Thank You to qwerty12 For This Useful Post:
Posts: 58 | Thanked: 10 times | Joined on Dec 2009
#3
Thanks for the info.

But how do you get the connection dialog if no network is connected?
 
Posts: 58 | Thanked: 10 times | Joined on Dec 2009
#4
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?
 
qwerty12's Avatar
Posts: 4,274 | Thanked: 5,358 times | Joined on Sep 2007 @ Looking at y'all and sighing
#5
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.
 

The Following User Says Thank You to qwerty12 For This Useful Post:
Posts: 58 | Thanked: 10 times | Joined on Dec 2009
#6
Originally Posted by qwerty12 View Post
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.
Yes, I'm using Qt.

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?
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 13:38.