GNOME Bugzilla – Bug 755663
[RFE] support configuring Wi-Fi AP mode (Access Point) in nm-connection-editor
Last modified: 2015-11-04 15:05:37 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)...
There is a preliminary code in Red Hat bug https://bugzilla.redhat.com/show_bug.cgi?id=970752 already. It needs more work, though.
(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.
oh, and there is https://git.gnome.org/browse/network-manager-applet/commit/?h=dcbw/ap too...
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?)
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).
(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.
(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
(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.
(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.
LGTM except for "/* Set active metheod */" in page-ip4.c in the last patch.
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)
*** Bug 734589 has been marked as a duplicate of this bug. ***