network: Sort out symbolic icons
In bug 689638, the designers only asked for the list icons to be symbolic, not the big icons in the page headings. The current code was failing on both ends: virtual devices like vlan still had non-symbolic icons in the list, and several pages (e.g mobile and proxy) had symbolic icons in the headings. https://bugzilla.gnome.org/show_bug.cgi?id=693001
This commit is contained in:
parent
f85aed9516
commit
7f13d109d7
10 changed files with 25 additions and 18 deletions
|
@ -625,7 +625,7 @@ state_changed_cb (NMDevice *device,
|
|||
"liststore_devices"));
|
||||
|
||||
gtk_list_store_set (store, &iter,
|
||||
PANEL_DEVICES_COLUMN_ICON, panel_device_to_icon_name (device),
|
||||
PANEL_DEVICES_COLUMN_ICON, panel_device_to_icon_name (device, TRUE),
|
||||
-1);
|
||||
}
|
||||
|
||||
|
@ -704,7 +704,7 @@ panel_add_device (CcNetworkPanel *panel, NMDevice *device)
|
|||
gtk_list_store_append (liststore_devices, &iter);
|
||||
gtk_list_store_set (liststore_devices,
|
||||
&iter,
|
||||
PANEL_DEVICES_COLUMN_ICON, panel_device_to_icon_name (device),
|
||||
PANEL_DEVICES_COLUMN_ICON, panel_device_to_icon_name (device, TRUE),
|
||||
PANEL_DEVICES_COLUMN_SORT, panel_device_to_sortable_string (device),
|
||||
PANEL_DEVICES_COLUMN_OBJECT, net_device,
|
||||
-1);
|
||||
|
@ -1136,7 +1136,7 @@ panel_add_virtual_device (CcNetworkPanel *panel, NMConnection *connection)
|
|||
gtk_list_store_append (liststore_devices, &iter);
|
||||
gtk_list_store_set (liststore_devices,
|
||||
&iter,
|
||||
PANEL_DEVICES_COLUMN_ICON, "network-wired",
|
||||
PANEL_DEVICES_COLUMN_ICON, "network-wired-symbolic",
|
||||
PANEL_DEVICES_COLUMN_SORT, "2",
|
||||
PANEL_DEVICES_COLUMN_OBJECT, net_virt,
|
||||
-1);
|
||||
|
|
|
@ -218,7 +218,7 @@ device_ethernet_refresh_ui (NetDeviceEthernet *device)
|
|||
|
||||
widget = GTK_WIDGET (gtk_builder_get_object (device->builder, "image_device"));
|
||||
gtk_image_set_from_icon_name (GTK_IMAGE (widget),
|
||||
panel_device_to_icon_name (nm_device),
|
||||
panel_device_to_icon_name (nm_device, FALSE),
|
||||
GTK_ICON_SIZE_DIALOG);
|
||||
|
||||
widget = GTK_WIDGET (gtk_builder_get_object (device->builder, "device_off_switch"));
|
||||
|
|
|
@ -108,7 +108,7 @@ nm_device_simple_refresh_ui (NetDeviceSimple *device_simple)
|
|||
g_object_bind_property (device_simple, "title", widget, "label", 0);
|
||||
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "image_device"));
|
||||
gtk_image_set_from_icon_name (GTK_IMAGE (widget),
|
||||
panel_device_to_icon_name (nm_device),
|
||||
panel_device_to_icon_name (nm_device, FALSE),
|
||||
GTK_ICON_SIZE_DIALOG);
|
||||
|
||||
/* set up the device on/off switch */
|
||||
|
|
|
@ -398,7 +398,7 @@ net_proxy_init (NetProxy *proxy)
|
|||
widget = GTK_WIDGET (gtk_builder_get_object (proxy->priv->builder,
|
||||
"image_proxy_device"));
|
||||
gtk_image_set_from_icon_name (GTK_IMAGE (widget),
|
||||
"preferences-system-network-symbolic",
|
||||
"preferences-system-network",
|
||||
GTK_ICON_SIZE_DIALOG);
|
||||
widget = GTK_WIDGET (gtk_builder_get_object (proxy->priv->builder,
|
||||
"label_proxy_device"));
|
||||
|
|
|
@ -166,7 +166,7 @@ net_virtual_device_refresh (NetObject *object)
|
|||
/* set device kind */
|
||||
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "image_device"));
|
||||
gtk_image_set_from_icon_name (GTK_IMAGE (widget),
|
||||
disconnected ? "network-wired-disconnected-symbolic" : "network-wired-symbolic",
|
||||
disconnected ? "network-wired-disconnected" : "network-wired",
|
||||
GTK_ICON_SIZE_DIALOG);
|
||||
|
||||
/* set up the device on/off switch */
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
<property name="valign">start</property>
|
||||
<property name="xalign">1</property>
|
||||
<property name="pixel_size">48</property>
|
||||
<property name="icon_name">network-cellular-connected-symbolic</property>
|
||||
<property name="icon_name">network-cellular-connected</property>
|
||||
<property name="icon-size">6</property>
|
||||
</object>
|
||||
<packing>
|
||||
|
|
|
@ -57,7 +57,7 @@
|
|||
<property name="valign">start</property>
|
||||
<property name="xalign">1</property>
|
||||
<property name="pixel_size">48</property>
|
||||
<property name="icon_name">preferences-system-network-symbolic</property>
|
||||
<property name="icon_name">preferences-system-network</property>
|
||||
<property name="icon-size">6</property>
|
||||
</object>
|
||||
<packing>
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
<property name="valign">start</property>
|
||||
<property name="xalign">1</property>
|
||||
<property name="pixel_size">48</property>
|
||||
<property name="icon_name">network-vpn-symbolic</property>
|
||||
<property name="icon_name">network-vpn</property>
|
||||
<property name="icon-size">6</property>
|
||||
</object>
|
||||
<packing>
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
* panel_device_to_icon_name:
|
||||
**/
|
||||
const gchar *
|
||||
panel_device_to_icon_name (NMDevice *device)
|
||||
panel_device_to_icon_name (NMDevice *device, gboolean symbolic)
|
||||
{
|
||||
const gchar *value = NULL;
|
||||
NMDeviceState state;
|
||||
|
@ -45,25 +45,31 @@ panel_device_to_icon_name (NMDevice *device)
|
|||
case NM_DEVICE_TYPE_ETHERNET:
|
||||
state = nm_device_get_state (device);
|
||||
if (state <= NM_DEVICE_STATE_DISCONNECTED) {
|
||||
value = "network-wired-disconnected-symbolic";
|
||||
value = symbolic ? "network-wired-disconnected-symbolic"
|
||||
: "network-wired-disconnected";
|
||||
} else {
|
||||
value = "network-wired-symbolic";
|
||||
value = symbolic ? "network-wired-symbolic"
|
||||
: "network-wired";
|
||||
}
|
||||
break;
|
||||
case NM_DEVICE_TYPE_WIFI:
|
||||
case NM_DEVICE_TYPE_BT:
|
||||
case NM_DEVICE_TYPE_OLPC_MESH:
|
||||
value = "network-wireless-signal-excellent-symbolic";
|
||||
value = symbolic ? "network-wireless-signal-excellent-symbolic"
|
||||
: "network-wireless-signal-excellent";
|
||||
break;
|
||||
case NM_DEVICE_TYPE_MODEM:
|
||||
caps = nm_device_modem_get_current_capabilities (NM_DEVICE_MODEM (device));
|
||||
if ((caps & NM_DEVICE_MODEM_CAPABILITY_GSM_UMTS) ||
|
||||
(caps & NM_DEVICE_MODEM_CAPABILITY_CDMA_EVDO)) {
|
||||
value = "network-wireless-signal-excellent-symbolic";
|
||||
}
|
||||
value = symbolic ? "network-wireless-signal-excellent-symbolic"
|
||||
: "network-wireless-signal-excellent";
|
||||
break;
|
||||
}
|
||||
/* fall thru */
|
||||
default:
|
||||
value = "network-idle-symbolic";
|
||||
value = symbolic ? "network-idle-symbolic"
|
||||
: "network-idle";
|
||||
break;
|
||||
}
|
||||
return value;
|
||||
|
|
|
@ -30,7 +30,8 @@
|
|||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
const gchar *panel_device_to_icon_name (NMDevice *device);
|
||||
const gchar *panel_device_to_icon_name (NMDevice *device,
|
||||
gboolean symbolic);
|
||||
const gchar *panel_device_to_localized_string (NMDevice *device);
|
||||
const gchar *panel_device_to_sortable_string (NMDevice *device);
|
||||
const gchar *panel_ap_mode_to_localized_string (NM80211Mode mode);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue