After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 755663 - [RFE] support configuring Wi-Fi AP mode (Access Point) in nm-connection-editor
[RFE] support configuring Wi-Fi AP mode (Access Point) in nm-connection-editor
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: nm-connection-editor
git master
Other Linux
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
https://bugzilla.redhat.com/show_bug....
: 734589 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2015-09-26 12:26 UTC by Thomas Haller
Modified: 2015-11-04 15:05 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Thomas Haller 2015-09-26 12:26:47 UTC
*subject*

plasma-nm (kde-nm-connection-editor) supports this
(e.g. http://ubuntuhandbook.org/index.php/2014/06/share-internet-with-android-ubuntu-1404/ )


I think there is limited support in gnome-control-center (bug 755507)...
Comment 1 Jiri Klimes 2015-10-01 11:41:17 UTC
There is a preliminary code in Red Hat bug https://bugzilla.redhat.com/show_bug.cgi?id=970752 already. It needs more work, though.
Comment 2 Thomas Haller 2015-10-01 12:34:35 UTC
(In reply to Jiri Klimes from comment #1)
> There is a preliminary code in Red Hat bug
> https://bugzilla.redhat.com/show_bug.cgi?id=970752 already. It needs more
> work, though.

Thank Jirka.

As the downstream bug is closed, I took the patch and pushed it to a branch:

jk/wifi-ap-mode-bgo755663

https://git.gnome.org/browse/network-manager-applet/commit/?h=jk/wifi-ap-mode-bgo755663&id=b379e7406f137acbb05e5a97ab8b4df8b2addaa1


Let's pick it up from there.
Comment 3 Thomas Haller 2015-10-01 12:36:03 UTC
oh, and there is

https://git.gnome.org/browse/network-manager-applet/commit/?h=dcbw/ap

too...
Comment 4 Jiri Klimes 2015-10-02 13:17:56 UTC
I have re-pushed the jk/wifi-ap-mode-bgo755663 branch.

It basically:
* takes the patch from dcbw/ap
* adds some modifications to it
* allows page inter-dependent changes
* changes IPv4/IPv6 methods when Wi-Fi mode changes
  (is there any other change that should be made?)
Comment 5 Dan Williams 2015-10-02 22:10:20 UTC
There's some debugging code left in page-ip4.c.

Other than that, seems OK to me.  But we also should disable all IPv4 methods except "disabled" and "Shared", and disable all Ipv6 methods except "Ignore".  Otherwise you can end up with an invalid configuration (or at least one NM doesn't support).
Comment 6 Jiri Klimes 2015-10-07 08:58:23 UTC
(In reply to Dan Williams from comment #5)
> There's some debugging code left in page-ip4.c.
> 
Removed.

> Other than that, seems OK to me.  But we also should disable all IPv4
> methods except "disabled" and "Shared", and disable all Ipv6 methods except
> "Ignore".  Otherwise you can end up with an invalid configuration (or at
> least one NM doesn't support).
I was not able to find any way how to disable the items in a combo box. So I have done that by switching a model (list store) for the combos.

Re-pushed the branch.
Comment 7 Thomas Haller 2015-10-07 14:14:46 UTC
(In reply to Jiri Klimes from comment #6)
> (In reply to Dan Williams from comment #5)
> > There's some debugging code left in page-ip4.c.
> > 
> Removed.
> 
> > Other than that, seems OK to me.  But we also should disable all IPv4
> > methods except "disabled" and "Shared", and disable all Ipv6 methods except
> > "Ignore".  Otherwise you can end up with an invalid configuration (or at
> > least one NM doesn't support).
> I was not able to find any way how to disable the items in a combo box. So I
> have done that by switching a model (list store) for the combos.
> 
> Re-pushed the branch.

When the user changes the Wi-Fi mode, the IP settings are disabled and cleared.
When the user changes back, the previous values were lost.

That might be acceptable, but is a bit annoying.


Other then that, it tests good and code LGTM
Comment 8 Dan Williams 2015-10-10 19:17:55 UTC
(In reply to Jiri Klimes from comment #6)
> (In reply to Dan Williams from comment #5)
> > There's some debugging code left in page-ip4.c.
> > 
> Removed.
> 
> > Other than that, seems OK to me.  But we also should disable all IPv4
> > methods except "disabled" and "Shared", and disable all Ipv6 methods except
> > "Ignore".  Otherwise you can end up with an invalid configuration (or at
> > least one NM doesn't support).
> I was not able to find any way how to disable the items in a combo box. So I
> have done that by switching a model (list store) for the combos.
> 
> Re-pushed the branch.

The IPv6 page has code to do that actually (see METHOD_COL_ENABLED).  You add another boolean column to the ListStore that backs the ComboBox, and then tell the CellRenderer for the Combo to attach the "sensitive" property to a specific column in the list:

	priv->method = GTK_COMBO_BOX (gtk_builder_get_object (builder, "ip6_method"));
	cells = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (priv->method));
	gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (priv->method), cells->data,
								   "sensitive", METHOD_COL_ENABLED);

Then you can just toggle METHOD_COL_ENABLED true/false when the inter_page_change() depending on the mode, and possibly update the selected item in the combo.
Comment 9 Jiri Klimes 2015-10-13 13:35:59 UTC
(In reply to Dan Williams from comment #8)
> (In reply to Jiri Klimes from comment #6)
> > (In reply to Dan Williams from comment #5)
> > > There's some debugging code left in page-ip4.c.
> > > 
> > Removed.
> > 
> > > Other than that, seems OK to me.  But we also should disable all IPv4
> > > methods except "disabled" and "Shared", and disable all Ipv6 methods except
> > > "Ignore".  Otherwise you can end up with an invalid configuration (or at
> > > least one NM doesn't support).
> > I was not able to find any way how to disable the items in a combo box. So I
> > have done that by switching a model (list store) for the combos.
> > 
> > Re-pushed the branch.
> 
> The IPv6 page has code to do that actually (see METHOD_COL_ENABLED).  You
> add another boolean column to the ListStore that backs the ComboBox, and
> then tell the CellRenderer for the Combo to attach the "sensitive" property
> to a specific column in the list:
> 
> 	priv->method = GTK_COMBO_BOX (gtk_builder_get_object (builder,
> "ip6_method"));
> 	cells = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (priv->method));
> 	gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (priv->method), cells->data,
> 								   "sensitive", METHOD_COL_ENABLED);
> 
> Then you can just toggle METHOD_COL_ENABLED true/false when the
> inter_page_change() depending on the mode, and possibly update the selected
> item in the combo.

Great, thanks for the pointer. I have re-done it to make use of that. I also added METHOD_COL_ENABLED column for IPv4 and use that too for disabling the methods.


(In reply to Thomas Haller from comment #7)
> 
> When the user changes the Wi-Fi mode, the IP settings are disabled and
> cleared.
> When the user changes back, the previous values were lost.
> 
> That might be acceptable, but is a bit annoying.
The previous value of the method is stored and set back. If you are talking about e.g. losing manual IP addresses, that's true. But it is the same behaviour as for switching the method manually.

Branch re-pushed.
Comment 10 Dan Williams 2015-10-13 16:35:04 UTC
LGTM except for "/* Set active metheod */" in page-ip4.c in the last patch.
Comment 11 Jiri Klimes 2015-10-14 08:04:16 UTC
Fixed and pushed to master and nma-1-0

master:
8ef1a4c merge: hotspot mode support for the editor (bgo #755663)
0294378 editor: change properties on IP4/IP6 pages if Wi-Fi mode changes
65e0025 editor: allow toggling sensitivity of combo box IP methods on IPv4 page
bd5e89a editor: (trivial) fix indenting in page-ip6.c
cc2c827 editor: allow changes on one page modify other pages
4cf81f6 editor: move Ad-Hoc mode to the end, rename "Infrastructure" to "Client"
4394032 editor: initial hotspot mode support (bgo #755663)

nma-1-0:
e6b5f32 merge: hotspot mode support for the editor (bgo #755663)
de7d399 editor: change properties on IP4/IP6 pages if Wi-Fi mode changes
4fc0db7 editor: allow toggling sensitivity of combo box IP methods on IPv4 page
ef68dcb editor: (trivial) fix indenting in page-ip6.c
a492a5d editor: allow changes on one page modify other pages
0f525b9 editor: move Ad-Hoc mode to the end, rename "Infrastructure" to "Client"
f89d33f editor: initial hotspot mode support (bgo #755663)
Comment 12 Dan Williams 2015-11-04 15:05:37 UTC
*** Bug 734589 has been marked as a duplicate of this bug. ***