[Kde-hardware-devel] Making Konqueror(/kio?) network-aware
Will Stephenson
wstephenson at kde.org
Mon Nov 2 12:10:48 CET 2009
On Thursday 29 October 2009 17:04:39 Eduardo Robles Elvira wrote:
> Hello everyone,
>
> I'm curious about solid. I've seen in the tutorial [0] which shows how
> easy it is to detect if network is connected or not, but I don't
> really know how exactly could we use this in konqueror. Use case:
>
> 1. User starts the computer and KDE
> 2. User opens Konqueror and types www.kde.org.
> 3. Internet is not working yet, so konqueror shows an error about site
> not available.
>
> AFAIK this is what happens currently. Perhaps with the help of solid,
> this could be improved to:
>
> 3. Internet is not working yet, so konqueror tries to connect through
> network manager or whatever, while showing a message saying "page will
> start loading when network becomes available"
> 4. Konqueror somehow triggers network-manager to connect to some
> network, user enters kwalletmanager password or whatever it's needed,
> and finally network becomes available.
> 5. Konqueror automatically loads the webpage(s) pending.
>
> I don't know exactly if solid triggers network-manager
You can't do this atm. It would be possible of course to write a smart NM
client that would receive application demands for networking, and tell NM to
activate some connection, but NM already contains a lot of fuzzily-defined
intelligence of its own to automatically bring up connections, and I fear that
combining the two would result in a system which is incomprehensible and
frustrating to users.
> if we can get
> a signal when network becomes available, if the integration should be
> done at kio level instead, or if somebody is already working on this
> already. Any help would be welcome.
Yes, of course you can get a signal from Solid::Networking for this
You can manually handle the void statusChanged (Solid::Networking::Status
status) signal from Solid::Networking::Notifier
http://api.kde.org/4.x-api/kdelibs-
apidocs/solid/html/classSolid_1_1Networking_1_1Notifier.html
or you can set a connect policy and respond to the high-level shouldConnect()
and shouldDisconnect() signals
http://api.kde.org/4.x-api/kdelibs-
apidocs/solid/html/namespaceSolid_1_1Networking.html
Using this it would be possible for network operations to be suspended with
nice user feedback until networking becomes available:
Log in, Networking not available yet (waiting for kwallet open or something)
ioslaves return 'waiting for Internet/network connection' code rendered nicely
in browser.
ioslave calls Solid::Networking::setConnectPolicy(Managed);
User unlocks kwallet, KNetworkManager gives password to NetworkManager,
NetworkManager brings up connection
ioslave receives Solid::Networking::Notifier::shouldConnect() signal and does
its queued work.
Browser shows requested webpage without user having to F5.
I implemented this for KDE 3 for SUSE in a hacky way a couple of years ago -
I'm attaching the svn module diffs here so we don't restart from scratch -
there are more app patches in http://websvn.kde.org/branches/work/~wstephens
Will
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kde3_kdebase_offline_mode.diff.zip
Type: application/zip
Size: 65531 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kde-hardware-devel/attachments/20091102/188f1b75/attachment-0003.zip
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kde3_kdepim_offline_mode.diff.zip
Type: application/zip
Size: 3376 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kde-hardware-devel/attachments/20091102/188f1b75/attachment-0004.zip
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kde3_kdelibs_offline_mode.diff.zip
Type: application/zip
Size: 20005 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kde-hardware-devel/attachments/20091102/188f1b75/attachment-0005.zip
More information about the Kde-hardware-devel
mailing list