network: Don't manage Wi-Fi devices

The Wi-Fi devices are going to be managed with the
to-be-introduced Wi-Fi panel, and don't need to
be available in the Network panel anymore.

This patch then blacklists Wi-Fi devices and doesn't
let the Network panel manage them.

https://bugzilla.gnome.org/show_bug.cgi?id=784818
This commit is contained in:
Georges Basile Stavracas Neto 2017-07-11 13:11:52 -03:00
parent 158591a346
commit 3317e88de8
3 changed files with 7 additions and 37 deletions

View file

@ -775,9 +775,8 @@ panel_add_device (CcNetworkPanel *panel, NMDevice *device)
case NM_DEVICE_TYPE_MODEM:
device_g_type = NET_TYPE_DEVICE_MOBILE;
break;
/* Let the wi-fi panel take care of wifi devices */
case NM_DEVICE_TYPE_WIFI:
device_g_type = NET_TYPE_DEVICE_WIFI;
break;
/* not going to set up a cluster in GNOME */
case NM_DEVICE_TYPE_VETH:
/* enterprise features */
@ -1316,7 +1315,6 @@ cc_network_panel_init (CcNetworkPanel *panel)
GtkWidget *widget;
GtkWidget *toplevel;
GDBusConnection *system_bus;
GtkCssProvider *provider;
const GPtrArray *connections;
guint i;
@ -1409,13 +1407,6 @@ cc_network_panel_init (CcNetworkPanel *panel)
"vbox1"));
gtk_container_add (GTK_CONTAINER (panel), widget);
provider = gtk_css_provider_new ();
gtk_css_provider_load_from_data (provider, ".circular-button { border-radius: 20px; -gtk-outline-radius: 20px; }", -1, NULL);
gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
GTK_STYLE_PROVIDER (provider),
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
g_object_unref (provider);
/* Cold-plug existing connections */
connections = nm_client_get_connections (panel->priv->client);
for (i = 0; i < connections->len; i++)

View file

@ -1418,16 +1418,13 @@ client_connection_removed_cb (NMClient *client,
NMRemoteConnection *connection,
NetDeviceWifi *device_wifi)
{
GtkWidget *swin;
GtkWidget *list;
GList *rows, *l;
const char *uuid;
uuid = nm_connection_get_uuid (NM_CONNECTION (connection));
swin = GTK_WIDGET (gtk_builder_get_object (device_wifi->priv->builder,
"scrolledwindow_list"));
list = gtk_bin_get_child (GTK_BIN (gtk_bin_get_child (GTK_BIN (swin))));
list = GTK_WIDGET (gtk_builder_get_object (device_wifi->priv->builder, "listbox"));
rows = gtk_container_get_children (GTK_CONTAINER (list));
for (l = rows; l != NULL; l = l->next) {
GtkWidget *row = l->data;
@ -1770,7 +1767,7 @@ make_row (GtkSizeGroup *rows,
gtk_widget_show (image);
widget = gtk_button_new ();
gtk_style_context_add_class (gtk_widget_get_style_context (widget), "image-button");
gtk_style_context_add_class (gtk_widget_get_style_context (widget), "circular-button");
gtk_style_context_add_class (gtk_widget_get_style_context (widget), "circular");
gtk_widget_show (widget);
gtk_container_add (GTK_CONTAINER (widget), image);
gtk_widget_set_halign (widget, GTK_ALIGN_CENTER);
@ -2031,7 +2028,6 @@ open_history (NetDeviceWifi *device_wifi)
static void
populate_ap_list (NetDeviceWifi *device_wifi)
{
GtkWidget *swin;
GtkWidget *list;
GtkSizeGroup *rows;
GtkSizeGroup *icons;
@ -2046,9 +2042,7 @@ populate_ap_list (NetDeviceWifi *device_wifi)
GtkWidget *button;
GList *children, *child;
swin = GTK_WIDGET (gtk_builder_get_object (device_wifi->priv->builder,
"scrolledwindow_list"));
list = gtk_bin_get_child (GTK_BIN (gtk_bin_get_child (GTK_BIN (swin))));
list = GTK_WIDGET (gtk_builder_get_object (device_wifi->priv->builder, "listbox"));
children = gtk_container_get_children (GTK_CONTAINER (list));
for (child = children; child; child = child->next) {
@ -2148,7 +2142,6 @@ net_device_wifi_init (NetDeviceWifi *device_wifi)
{
GError *error = NULL;
GtkWidget *widget;
GtkWidget *swin;
GtkWidget *list;
GtkSizeGroup *rows;
GtkSizeGroup *icons;
@ -2175,14 +2168,9 @@ net_device_wifi_init (NetDeviceWifi *device_wifi)
g_signal_connect (widget, "notify::active",
G_CALLBACK (device_off_toggled), device_wifi);
swin = GTK_WIDGET (gtk_builder_get_object (device_wifi->priv->builder,
"scrolledwindow_list"));
list = GTK_WIDGET (gtk_list_box_new ());
gtk_widget_show (list);
gtk_list_box_set_selection_mode (GTK_LIST_BOX (list), GTK_SELECTION_NONE);
list = GTK_WIDGET (gtk_builder_get_object (device_wifi->priv->builder, "listbox"));
gtk_list_box_set_header_func (GTK_LIST_BOX (list), cc_list_box_update_header_func, NULL, NULL);
gtk_list_box_set_sort_func (GTK_LIST_BOX (list), (GtkListBoxSortFunc)ap_sort, NULL, NULL);
gtk_container_add (GTK_CONTAINER (swin), list);
g_signal_connect (list, "row-activated",
G_CALLBACK (ap_activated), device_wifi);

View file

@ -1586,22 +1586,13 @@ here</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow" id="scrolledwindow_list">
<property name="height_request">300</property>
<object class="GtkListBox" id="listbox">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="margin_start">12</property>
<property name="margin_end">12</property>
<property name="selection_mode">none</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="hscrollbar_policy">never</property>
<property name="shadow_type">in</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>