GNOME Bugzilla – Bug 154535
Update weather data when network comes up
Last modified: 2008-06-18 15:36:22 UTC
When I bring my laptop from home to work (or back again), unsuspend it, and connect a network cable, the weather applet shows a question mark for about 5 minutes. Ideally the applet should notice that the network came up and automatically update weather data. However until a universal D-BUS "we have network" notification appears in the GNOME desktop in general (and my laptop in particular) it would be nice if gweather-applet interpreted SIGHUP as a request to update weather data -- then I could just add killall -HUP gweather-applet-2 to an ifup script.
A D-Bus listener would probably be better (D-Bus is a dependancy of the desktop) it will also allow us to easily listen on the right bus for network events from NetworkManager and such. Your script can use dbus-send to send the network status information.
I think this one should go a step further. Gweather should be a "hardware" applet. The hardware that it should correspond to should be the "internet connection" pseudodevice. When the network cable is unplugged, the applet disappears. It comes back when replugged (after DHCP or whatever has configured the interface). This also avoids logistic problems involved with having out of date weather information displayed if we can't get an update. Only problem: I'm not sure HAL does anything like this yet. It will let us look at individual interfaces, but as far as I know it has no concept of "I am on the net" (and perhaps HAL isn't the right place for this, anyway).
No, HAL should not know this. It's the domain of your network management layer (ie. NetworkManager or equivilent) not the hardware management layer. HAL knows if you have a physical link, but not if that physical link means anything. The idea of making "web service applets" like GTik and GWeather a type of hardware applet is an interesting idea. However, I think that having them disappear because your network goes AWOL for 5 minutes might be misinterpretted as a bug. Perhaps our web services applets should instead display a nice little 'offline' icon composited over their other icon when the network is reported to go away. Applets vanishing with respect to hardware should only really happen when hardware is physically removed from the machine. That is, you have instigated some tactile operation that has resulted in a state change.
*** Bug 309492 has been marked as a duplicate of this bug. ***
*** Bug 313062 has been marked as a duplicate of this bug. ***
*** Bug 334317 has been marked as a duplicate of this bug. ***
To the original bug reported, when I come back from suspend it still has either the ? or stale data, and sits there saying "Updating"... and sits there... and sits there... until I manually right click on it and select Update. Surely, if the dbus signal isn't practical, a shorter timeout/retry would be possible? AfC
Ubuntu bug about that: https://launchpad.net/products/gnome-applets/+bug/50115
*** Bug 339242 has been marked as a duplicate of this bug. ***
*** Bug 347598 has been marked as a duplicate of this bug. ***
*** Bug 349146 has been marked as a duplicate of this bug. ***
*** Bug 156417 has been marked as a duplicate of this bug. ***
*** Bug 338534 has been marked as a duplicate of this bug. ***
I agree that a "killall -HUP" or a "kill -HUP `pidof gweather-applet-2`" would be very useful. I use dial-up networking (actually, a custom script to use my cell phone). On connection, I can do an NTP time sync from /etc/ppp/ip-up. The ability to signal the weather applet to get the current forecast would be a *very* nice addition to my GNOME desktop.
Any news about this bug? Maybe the weather applet can use network-manager, and if it detects that there is a connection, then it updates it. I know this is possible, because there are some apps doing this (liferea, for example). And as network-manager is going to be default in gnome, it's a great option. Regards Pochu
You meant dbus?
Works fine now in Ubuntu Feisty Fawn up-to-date.
*** Bug 403544 has been marked as a duplicate of this bug. ***
*** Bug 358350 has been marked as a duplicate of this bug. ***
488824 has a patch *** This bug has been marked as a duplicate of 488824 ***