diff options
Diffstat (limited to 'meta-gnome/recipes-connectivity/network-manager-applet/files/0003-Use-AP-mode-for-network-sharing-if-device-supports-it.patch')
-rw-r--r-- | meta-gnome/recipes-connectivity/network-manager-applet/files/0003-Use-AP-mode-for-network-sharing-if-device-supports-it.patch | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/meta-gnome/recipes-connectivity/network-manager-applet/files/0003-Use-AP-mode-for-network-sharing-if-device-supports-it.patch b/meta-gnome/recipes-connectivity/network-manager-applet/files/0003-Use-AP-mode-for-network-sharing-if-device-supports-it.patch new file mode 100644 index 000000000..e2156463d --- /dev/null +++ b/meta-gnome/recipes-connectivity/network-manager-applet/files/0003-Use-AP-mode-for-network-sharing-if-device-supports-it.patch | |||
@@ -0,0 +1,48 @@ | |||
1 | From 7343b16113e378d04e40012abfe5bd96ca776968 Mon Sep 17 00:00:00 2001 | ||
2 | From: "Marius B. Kotsbak" <marius@kotsbak.com> | ||
3 | Date: Tue, 12 Aug 2014 11:15:20 +0200 | ||
4 | Subject: [PATCH 2/2] Use AP mode for network sharing if device supports it. | ||
5 | |||
6 | Logic taken from similar functionality in gnome-control-center. | ||
7 | |||
8 | Upstream-Status: Backport [1] | ||
9 | |||
10 | [1] https://bug734589.bugzilla-attachments.gnome.org/attachment.cgi?id=283165 | ||
11 | --- | ||
12 | src/libnm-gtk/nm-wifi-dialog.c | 18 +++++++++++++++++- | ||
13 | 1 file changed, 17 insertions(+), 1 deletion(-) | ||
14 | |||
15 | diff --git a/src/libnm-gtk/nm-wifi-dialog.c b/src/libnm-gtk/nm-wifi-dialog.c | ||
16 | index 3532caa..ca72c96 100644 | ||
17 | --- a/src/libnm-gtk/nm-wifi-dialog.c | ||
18 | +++ b/src/libnm-gtk/nm-wifi-dialog.c | ||
19 | @@ -1226,10 +1226,26 @@ nma_wifi_dialog_get_connection (NMAWifiDialog *self, | ||
20 | s_wireless = (NMSettingWireless *) nm_setting_wireless_new (); | ||
21 | g_object_set (s_wireless, NM_SETTING_WIRELESS_SSID, validate_dialog_ssid (self), NULL); | ||
22 | |||
23 | + /* Fill device */ | ||
24 | + if (device) { | ||
25 | + combo = GTK_WIDGET (gtk_builder_get_object (priv->builder, "device_combo")); | ||
26 | + gtk_combo_box_get_active_iter (GTK_COMBO_BOX (combo), &iter); | ||
27 | + gtk_tree_model_get (priv->device_model, &iter, D_DEV_COLUMN, device, -1); | ||
28 | + g_object_unref (*device); | ||
29 | + } | ||
30 | + | ||
31 | if (priv->adhoc_create) { | ||
32 | NMSettingIP4Config *s_ip4; | ||
33 | |||
34 | - g_object_set (s_wireless, NM_SETTING_WIRELESS_MODE, "adhoc", NULL); | ||
35 | + const char *mode; | ||
36 | + | ||
37 | + /* Use real AP mode if the device supports it */ | ||
38 | + if (device && nm_device_wifi_get_capabilities (NM_DEVICE_WIFI (*device)) & NM_WIFI_DEVICE_CAP_AP) | ||
39 | + mode = NM_SETTING_WIRELESS_MODE_AP; | ||
40 | + else | ||
41 | + mode = NM_SETTING_WIRELESS_MODE_ADHOC; | ||
42 | + | ||
43 | + g_object_set (s_wireless, NM_SETTING_WIRELESS_MODE, mode, NULL); | ||
44 | |||
45 | s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new (); | ||
46 | g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_SHARED, NULL); | ||
47 | -- | ||
48 | 1.8.3.1 | ||