summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2016-04-29 13:50:41 +0200
committerBastien Nocera <hadess@hadess.net>2016-05-26 14:49:28 +0200
commit20b634b4544d1cfa62cf37932b20396198fd84d9 (patch)
tree9520c0c98ab94b3958dcf8567fde96ce303707d7
parentb3199dd641602474c1a0145eac4de441827c61d2 (diff)
downloadgnome-control-center-20b634b4544d1cfa62cf37932b20396198fd84d9.tar.gz
network: Remove bridge support
It is supported by Cockpit already: https://github.com/cockpit-project/cockpit/issues/459 https://bugzilla.gnome.org/show_bug.cgi?id=747443
-rw-r--r--panels/network/Makefile.am2
-rw-r--r--panels/network/cc-network-panel.c4
-rw-r--r--panels/network/connection-editor/net-connection-editor.c1
-rw-r--r--panels/network/gnome-network-panel.desktop.in.in2
-rw-r--r--panels/network/net-device-bridge.c190
-rw-r--r--panels/network/net-device-bridge.h58
-rw-r--r--po/POTFILES.in1
7 files changed, 1 insertions, 257 deletions
diff --git a/panels/network/Makefile.am b/panels/network/Makefile.am
index f78395d9f..ce2a2d08d 100644
--- a/panels/network/Makefile.am
+++ b/panels/network/Makefile.am
@@ -34,8 +34,6 @@ libnetwork_la_SOURCES = \
net-device-mobile.h \
net-device-bond.c \
net-device-bond.h \
- net-device-bridge.c \
- net-device-bridge.h \
net-virtual-device.c \
net-virtual-device.h \
net-vpn.c \
diff --git a/panels/network/cc-network-panel.c b/panels/network/cc-network-panel.c
index 306a371a7..1ecf8e63e 100644
--- a/panels/network/cc-network-panel.c
+++ b/panels/network/cc-network-panel.c
@@ -37,7 +37,6 @@
#include "net-device-wifi.h"
#include "net-device-ethernet.h"
#include "net-device-bond.h"
-#include "net-device-bridge.h"
#include "net-object.h"
#include "net-proxy.h"
#include "net-virtual-device.h"
@@ -729,7 +728,6 @@ panel_add_device (CcNetworkPanel *panel, NMDevice *device)
device_g_type = NET_TYPE_DEVICE_WIFI;
break;
case NM_DEVICE_TYPE_BOND:
- case NM_DEVICE_TYPE_BRIDGE:
case NM_DEVICE_TYPE_VLAN:
goto out;
default:
@@ -1179,8 +1177,6 @@ panel_add_virtual_device (CcNetworkPanel *panel, NMConnection *connection)
connection_type = nm_setting_connection_get_connection_type (s_con);
if (!strcmp (connection_type, NM_SETTING_BOND_SETTING_NAME))
device_g_type = NET_TYPE_DEVICE_BOND;
- else if (!strcmp (connection_type, NM_SETTING_BRIDGE_SETTING_NAME))
- device_g_type = NET_TYPE_DEVICE_BRIDGE;
else
device_g_type = NET_TYPE_VIRTUAL_DEVICE;
diff --git a/panels/network/connection-editor/net-connection-editor.c b/panels/network/connection-editor/net-connection-editor.c
index 047f7f2af..91a156367 100644
--- a/panels/network/connection-editor/net-connection-editor.c
+++ b/panels/network/connection-editor/net-connection-editor.c
@@ -585,7 +585,6 @@ static const NetConnectionType connection_types[] = {
#ifdef HAVE_NM_UNSTABLE
{ N_("Team"), nm_setting_team_get_type },
#endif /* NM_UNSTABLE */
- { N_("Bridge"), nm_setting_bridge_get_type },
{ N_("VLAN"), nm_setting_vlan_get_type }
};
static const NetConnectionType *vpn_connection_type = &connection_types[0];
diff --git a/panels/network/gnome-network-panel.desktop.in.in b/panels/network/gnome-network-panel.desktop.in.in
index 52c626629..d3cb39272 100644
--- a/panels/network/gnome-network-panel.desktop.in.in
+++ b/panels/network/gnome-network-panel.desktop.in.in
@@ -15,4 +15,4 @@ X-GNOME-Bugzilla-Product=gnome-control-center
X-GNOME-Bugzilla-Component=network
X-GNOME-Bugzilla-Version=@VERSION@
# Translators: those are keywords for the network control-center panel
-_Keywords=Network;Wireless;Wi-Fi;Wifi;IP;LAN;Proxy;WAN;Broadband;Modem;Bluetooth;vpn;vlan;bridge;bond;DNS;
+_Keywords=Network;Wireless;Wi-Fi;Wifi;IP;LAN;Proxy;WAN;Broadband;Modem;Bluetooth;vpn;vlan;bond;DNS;
diff --git a/panels/network/net-device-bridge.c b/panels/network/net-device-bridge.c
deleted file mode 100644
index 2335ff838..000000000
--- a/panels/network/net-device-bridge.c
+++ /dev/null
@@ -1,190 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
- *
- * Copyright (C) 2012 Red Hat, Inc.
- *
- * Licensed under the GNU General Public License Version 2
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#include "config.h"
-
-#include <glib-object.h>
-#include <glib/gi18n.h>
-
-#include <nm-client.h>
-#include <nm-device.h>
-#include <nm-device-bridge.h>
-#include <nm-remote-connection.h>
-
-#include "panel-common.h"
-#include "cc-network-panel.h"
-
-#include "net-device-bridge.h"
-
-#define NET_DEVICE_BRIDGE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NET_TYPE_DEVICE_BRIDGE, NetDeviceBridgePrivate))
-
-struct _NetDeviceBridgePrivate {
- char *slaves;
-};
-
-enum {
- PROP_0,
- PROP_SLAVES,
- PROP_LAST
-};
-
-G_DEFINE_TYPE (NetDeviceBridge, net_device_bridge, NET_TYPE_VIRTUAL_DEVICE)
-
-static void
-net_device_bridge_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- NetDeviceBridge *device_bridge = NET_DEVICE_BRIDGE (object);
- NetDeviceBridgePrivate *priv = device_bridge->priv;
-
- switch (prop_id) {
- case PROP_SLAVES:
- g_value_set_string (value, priv->slaves);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (device_bridge, prop_id, pspec);
- break;
-
- }
-}
-
-static void
-net_device_bridge_constructed (GObject *object)
-{
- NetDeviceBridge *device_bridge = NET_DEVICE_BRIDGE (object);
-
- net_virtual_device_add_row (NET_VIRTUAL_DEVICE (device_bridge),
- _("Bridge slaves"), "slaves");
-
- G_OBJECT_CLASS (net_device_bridge_parent_class)->constructed (object);
-}
-
-static void
-nm_device_slaves_changed (GObject *object,
- GParamSpec *pspec,
- gpointer user_data)
-{
- NetDeviceBridge *device_bridge = NET_DEVICE_BRIDGE (user_data);
- NetDeviceBridgePrivate *priv = device_bridge->priv;
- NMDeviceBridge *nm_device = NM_DEVICE_BRIDGE (object);
- CcNetworkPanel *panel;
- GPtrArray *net_devices;
- NetDevice *net_device;
- NMDevice *slave;
- const GPtrArray *slaves;
- int i, j;
- GString *str;
-
- g_free (priv->slaves);
-
- slaves = nm_device_bridge_get_slaves (nm_device);
- if (!slaves) {
- priv->slaves = g_strdup (_("(none)"));
- g_object_notify (G_OBJECT (device_bridge), "slaves");
- return;
- }
-
- panel = net_object_get_panel (NET_OBJECT (device_bridge));
- net_devices = cc_network_panel_get_devices (panel);
-
- str = g_string_new (NULL);
- for (i = 0; i < slaves->len; i++) {
- if (i > 0)
- g_string_append (str, ", ");
- slave = slaves->pdata[i];
-
- for (j = 0; j < net_devices->len; j++) {
- net_device = net_devices->pdata[j];
- if (slave == net_device_get_nm_device (net_device)) {
- g_string_append (str, net_object_get_title (NET_OBJECT (net_device)));
- break;
- }
- }
- if (j == net_devices->len)
- g_string_append (str, nm_device_get_iface (slave));
- }
- priv->slaves = g_string_free (str, FALSE);
- g_object_notify (G_OBJECT (device_bridge), "slaves");
-}
-
-static void
-net_device_bridge_device_set (NetVirtualDevice *virtual_device,
- NMDevice *nm_device)
-{
- NetDeviceBridge *device_bridge = NET_DEVICE_BRIDGE (virtual_device);
-
- g_signal_connect_object (nm_device, "notify::slaves",
- G_CALLBACK (nm_device_slaves_changed), device_bridge, 0);
- nm_device_slaves_changed (G_OBJECT (nm_device), NULL, device_bridge);
-}
-
-static void
-net_device_bridge_device_unset (NetVirtualDevice *virtual_device,
- NMDevice *nm_device)
-{
- NetDeviceBridge *device_bridge = NET_DEVICE_BRIDGE (virtual_device);
-
- g_signal_handlers_disconnect_by_func (nm_device,
- G_CALLBACK (nm_device_slaves_changed),
- device_bridge);
- nm_device_slaves_changed (G_OBJECT (nm_device), NULL, device_bridge);
-}
-
-static void
-net_device_bridge_finalize (GObject *object)
-{
- NetDeviceBridge *device_bridge = NET_DEVICE_BRIDGE (object);
- NetDeviceBridgePrivate *priv = device_bridge->priv;
-
- g_free (priv->slaves);
-
- G_OBJECT_CLASS (net_device_bridge_parent_class)->finalize (object);
-}
-
-static void
-net_device_bridge_class_init (NetDeviceBridgeClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
- NetVirtualDeviceClass *virtual_device_class = NET_VIRTUAL_DEVICE_CLASS (klass);
- GParamSpec *pspec;
-
- object_class->constructed = net_device_bridge_constructed;
- object_class->finalize = net_device_bridge_finalize;
- object_class->get_property = net_device_bridge_get_property;
-
- virtual_device_class->device_set = net_device_bridge_device_set;
- virtual_device_class->device_unset = net_device_bridge_device_unset;
-
- pspec = g_param_spec_string ("slaves", NULL, NULL,
- NULL,
- G_PARAM_READABLE);
- g_object_class_install_property (object_class, PROP_SLAVES, pspec);
-
- g_type_class_add_private (klass, sizeof (NetDeviceBridgePrivate));
-}
-
-static void
-net_device_bridge_init (NetDeviceBridge *device_bridge)
-{
- device_bridge->priv = NET_DEVICE_BRIDGE_GET_PRIVATE (device_bridge);
-}
diff --git a/panels/network/net-device-bridge.h b/panels/network/net-device-bridge.h
deleted file mode 100644
index a53ef0d03..000000000
--- a/panels/network/net-device-bridge.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
- *
- * Copyright (C) 2012 Red Hat, Inc.
- *
- * Licensed under the GNU General Public License Version 2
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#ifndef __NET_DEVICE_BRIDGE_H
-#define __NET_DEVICE_BRIDGE_H
-
-#include <glib-object.h>
-
-#include "net-virtual-device.h"
-
-G_BEGIN_DECLS
-
-#define NET_TYPE_DEVICE_BRIDGE (net_device_bridge_get_type ())
-#define NET_DEVICE_BRIDGE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), NET_TYPE_DEVICE_BRIDGE, NetDeviceBridge))
-#define NET_DEVICE_BRIDGE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), NET_TYPE_DEVICE_BRIDGE, NetDeviceBridgeClass))
-#define NET_IS_DEVICE_BRIDGE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), NET_TYPE_DEVICE_BRIDGE))
-#define NET_IS_DEVICE_BRIDGE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), NET_TYPE_DEVICE_BRIDGE))
-#define NET_DEVICE_BRIDGE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), NET_TYPE_DEVICE_BRIDGE, NetDeviceBridgeClass))
-
-typedef struct _NetDeviceBridgePrivate NetDeviceBridgePrivate;
-typedef struct _NetDeviceBridge NetDeviceBridge;
-typedef struct _NetDeviceBridgeClass NetDeviceBridgeClass;
-
-struct _NetDeviceBridge
-{
- NetVirtualDevice parent;
- NetDeviceBridgePrivate *priv;
-};
-
-struct _NetDeviceBridgeClass
-{
- NetVirtualDeviceClass parent_class;
-};
-
-GType net_device_bridge_get_type (void);
-
-G_END_DECLS
-
-#endif /* __NET_DEVICE_BRIDGE_H */
-
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 35bd09dc0..713ab3957 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -77,7 +77,6 @@ panels/network/connection-editor/vpn-helpers.c
[type: gettext/glade]panels/network/connection-editor/wifi-page.ui
panels/network/gnome-network-panel.desktop.in.in
panels/network/net-device-bond.c
-panels/network/net-device-bridge.c
panels/network/net-device-ethernet.c
panels/network/net-device-mobile.c
panels/network/net-device-team.c