[gnome-control-center/wip/gbsneto/new-wifi-panel: 4/7] network: Cleanup code
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/wip/gbsneto/new-wifi-panel: 4/7] network: Cleanup code
- Date: Wed, 12 Jul 2017 12:57:48 +0000 (UTC)
commit db5c4224e1b3e11e22e52887e5115b32dc8f981a
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Tue Jul 11 13:36:12 2017 -0300
network: Cleanup code
Now that we're splitting the Network panel into the
Wi-Fi, we can make a few cleanups.
https://bugzilla.gnome.org/show_bug.cgi?id=784818
panels/network/cc-network-panel.c | 8 --------
panels/network/net-device-wifi.c | 20 ++++----------------
panels/network/network-wifi.ui | 13 ++-----------
3 files changed, 6 insertions(+), 35 deletions(-)
---
diff --git a/panels/network/cc-network-panel.c b/panels/network/cc-network-panel.c
index b144f3e..42b415f 100644
--- a/panels/network/cc-network-panel.c
+++ b/panels/network/cc-network-panel.c
@@ -1315,7 +1315,6 @@ cc_network_panel_init (CcNetworkPanel *panel)
GtkWidget *widget;
GtkWidget *toplevel;
GDBusConnection *system_bus;
- GtkCssProvider *provider;
const GPtrArray *connections;
guint i;
@@ -1408,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++)
diff --git a/panels/network/net-device-wifi.c b/panels/network/net-device-wifi.c
index 48112f5..ad7844f 100644
--- a/panels/network/net-device-wifi.c
+++ b/panels/network/net-device-wifi.c
@@ -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);
diff --git a/panels/network/network-wifi.ui b/panels/network/network-wifi.ui
index 5d62ebc..22287bd 100644
--- a/panels/network/network-wifi.ui
+++ b/panels/network/network-wifi.ui
@@ -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>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]