Bug 238325 - [PATCH] Adding "Enable networking" button to knetworkmanager
Summary: [PATCH] Adding "Enable networking" button to knetworkmanager
Status: RESOLVED FIXED
Alias: None
Product: knetworkmanager
Classification: Miscellaneous
Component: general (show other bugs)
Version: unspecified
Platform: RedHat Enterprise Linux Linux
: NOR wishlist
Target Milestone: ---
Assignee: Will Stephenson
URL:
Keywords:
: 223030 232531 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-05-20 19:38 UTC by Jirka Klimes
Modified: 2010-10-25 16:00 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Add "Enable networking" button (4.23 KB, patch)
2010-05-20 19:40 UTC, Jirka Klimes
Details
patch1 (3.03 KB, patch)
2010-05-27 14:25 UTC, Jirka Klimes
Details
patch2 (5.51 KB, patch)
2010-05-27 14:26 UTC, Jirka Klimes
Details
patch3 (1.98 KB, patch)
2010-05-27 14:27 UTC, Jirka Klimes
Details
patch4 (6.25 KB, patch)
2010-05-27 14:29 UTC, Jirka Klimes
Details
patch4: use 'enabled' parameter in NMPopup::managerNetworkingEnabledChanged() (6.72 KB, patch)
2010-09-16 10:28 UTC, Jirka Klimes
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jirka Klimes 2010-05-20 19:38:18 UTC
Version:            (using KDE 4.4.2)
OS:                Linux
Installed from:    RedHat RPMs

The patch adds "Enable networking" button to knetworkmanager. This allows users to put asleep or awake NetworkManaer daemon.
It is especially handy when starting with NetworkManager in the asleep state. Without that, users don't have an option to enable networking and are often confused.
Comment 1 Jirka Klimes 2010-05-20 19:40:10 UTC
Created attachment 43751 [details]
Add "Enable networking" button
Comment 2 Jirka Klimes 2010-05-27 14:23:44 UTC
A few days ago Dan Williams added Enable() method and NetworkingEnabled property to org.freedesktop.NetworkManager.
These are meant to be used instead of Sleep() by clients (Sleep() is now dedicated to suspend/resume). More info in https://bugzilla.redhat.com/show_bug.cgi?id=589108 and NetworkManager commit 5ca1a9d546be81b54e57d525b54ff92597de6115 (0.7.x branch).

Patches here add the new functionality to solid, knetworkmanager and plasma applet with proper handling when new functionality is not available:
1) kde-solid-net-enable.patch
patch for xmls for Solid by Dan
2) kde-solid-net-enable2.patch
uses the new D-Bus bits in Solid networkmanager; fall back to Sleep() when older NetworkManager is in use
3) kde-solid-net-enable3.patch
adds snetworkingEnabledChanged() signal to abstract class for Solid::Control
4) knetworkmanager_applet_enable_networking.patch
adds proper "Enable networking" functionality to both knetworkmanager and plasma applet; obsoletes my first patch in comment #1
Comment 3 Jirka Klimes 2010-05-27 14:25:18 UTC
Created attachment 43936 [details]
patch1
Comment 4 Jirka Klimes 2010-05-27 14:26:29 UTC
Created attachment 43937 [details]
patch2
Comment 5 Jirka Klimes 2010-05-27 14:27:14 UTC
Created attachment 43938 [details]
patch3
Comment 6 Jirka Klimes 2010-05-27 14:29:48 UTC
Created attachment 43939 [details]
patch4
Comment 7 p92 2010-06-03 02:20:04 UTC
can solve  ?
bug #232531 There is no easy way to enable disabled networking
bug #235477 knetworkmanager does not have an option to enable/disable networking
bug #226615 network manager disabled button
Comment 8 Bartosz Brachaczek 2010-06-03 20:39:46 UTC
(In reply to comment #7)
> can solve  ?
> bug #232531 There is no easy way to enable disabled networking
> bug #235477 knetworkmanager does not have an option to enable/disable
> networking
> bug #226615 network manager disabled button

And maybe the following?
bug #223030 Knetworkmanager can not "able networking"
Comment 9 Rex Dieter 2010-06-11 18:18:53 UTC
I'm testing these out on fedora 13 against kde-4.4.4 and a recent networkmanagement snapshot, and I can report I think we have a winner.  (though a small oddity that I'm not sure how I feel about yet is that when networking enabled is deselected, the knm systray icon gets hidden)

Now, considering this includes some modifications to solid, even if they seem simple, obvious, and correct to my naive eyes, how best to move forward here?
Comment 10 Rex Dieter 2010-09-14 21:26:50 UTC
Asked onlist for further feedback, see
http://mail.kde.org/pipermail/kde-networkmanager/2010-September/000578.html

One comment to improve the patch is:

	Please change this slot to use the parameter enabled instead of doing a 
solid call, the parameter is there for that reason:

+void NMPopup::managerNetworkingEnabledChanged(bool enabled)
+{
+    kDebug() << "NM daemon changed networking enable state" << enabled;
+    m_networkingCheckBox-
>setChecked(Solid::Control::NetworkManager::isNetworkingEnabled());
+}
+
Comment 11 Jirka Klimes 2010-09-16 10:23:07 UTC
(In reply to comment #10)
> Asked onlist for further feedback, see
> http://mail.kde.org/pipermail/kde-networkmanager/2010-September/000578.html
> 

Thanks for the info. I'll comment there.

> One comment to improve the patch is:
> 
>     Please change this slot to use the parameter enabled instead of doing a 
> solid call, the parameter is there for that reason:
> 
> +void NMPopup::managerNetworkingEnabledChanged(bool enabled)
> +{
> +    kDebug() << "NM daemon changed networking enable state" << enabled;
> +    m_networkingCheckBox-
> >setChecked(Solid::Control::NetworkManager::isNetworkingEnabled());
> +}
> +

Yes, that's a good point. It's better to keep things simple ;)  The 'enabled' parameter passing by the signal can be used here.
Tested and including corrected patch.
Comment 12 Jirka Klimes 2010-09-16 10:28:25 UTC
Created attachment 51708 [details]
patch4: use 'enabled' parameter in NMPopup::managerNetworkingEnabledChanged()

Using 'enabled' parameter in slot NMPopup::managerNetworkingEnabledChanged() is simpler than calling a Solid method.
Comment 13 Lamarque V. Souza 2010-09-19 01:24:29 UTC
SVN commit 1176872 by lvsouza:

Patch from Jirka Klimes to adapt Network Manager backend to a change in NM 0.8.1.
Now sleep/wake is used just for that (making NM sleep and wake up), to enable/disable
NM there is a new method called Enable.

CCBUG: 238325
CCMAIL: kde-networkmanager@kde.org


 M  +5 -0      libs/solid/control/ifaces/networkmanager.h  
 M  +2 -0      libs/solid/control/networkmanager.cpp  
 M  +4 -0      libs/solid/control/networkmanager.h  
 M  +6 -0      solid/networkmanager-0.7/dbus/introspection/nm-manager-client.xml  
 M  +28 -1     solid/networkmanager-0.7/dbus/introspection/nm-manager.xml  
 M  +12 -1     solid/networkmanager-0.7/dbus/nm-manager-clientinterface.h  
 M  +33 -1     solid/networkmanager-0.7/manager.cpp  
 M  +2 -0      solid/networkmanager-0.7/manager_p.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1176872
Comment 14 Lamarque V. Souza 2010-09-19 01:43:57 UTC
SVN commit 1176882 by lvsouza:

Patch from Jirka Klimes to reflect a change in Solid Network Manager backend.

CCBUG: 238325
CCMAIL: kde-networkmanager@kde.org


 M  +8 -0      nmpopup.cpp  
 M  +2 -0      nmpopup.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1176882
Comment 15 Rex Dieter 2010-10-09 20:23:04 UTC
marking fixed per previous commits, thanks.
Comment 16 Lamarque V. Souza 2010-10-11 15:18:22 UTC
SVN commit 1184819 by lvsouza:

Patch from Jirka Klimes against monolithic KNM to reflect a change in Solid Network Manager backend.

CCBUG: 238325
CCMAIL: kde-networkmanager@kde.org
CCMAIL: kde-hardware-devel@kde.org


 M  +30 -1     knetworkmanagertrayicon.cpp  
 M  +10 -0     knetworkmanagertrayicon.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1184819
Comment 17 Rex Dieter 2010-10-25 16:00:11 UTC
*** Bug 223030 has been marked as a duplicate of this bug. ***
Comment 18 Rex Dieter 2010-10-25 16:00:26 UTC
*** Bug 232531 has been marked as a duplicate of this bug. ***