~ubuntu-branches/ubuntu/saucy/network-manager-applet/saucy-updates

« back to all changes in this revision

Viewing changes to src/libnm-gtk/nm-ui-utils.c

  • Committer: Package Import Robot
  • Author(s): Mathieu Trudel-Lapierre
  • Date: 2013-02-05 16:15:00 UTC
  • mfrom: (1.2.33)
  • Revision ID: package-import@ubuntu.com-20130205161500-nax1yrh7klr0o8ir
Tags: 0.9.7.995+git201301311844.0376019-0ubuntu1
* upstream snapshot 2013-01-31 18:44:13 (GMT)
  + 03760194e54eaeaf493e9b45c4835e84524d8650
* debian/patches/nm-applet-use-indicator.patch: refreshed.
* debian/patches/lp1048516_dont_req_keyring_in_greeter.patch: refreshed.
* debian/patches/lp289466_always_show_tray_icon.patch: refreshed.
* debian/patches/lp829673_gconf_hide_applet.patch: refreshed.
* debian/patches/position_dialogs_to_center_of_the_screen.patch: refreshed.
* debian/patches/hide_policy_items_env_var.patch: refreshed.
* debian/patches/lp1048520_delay_pin_dialog_in_greeter.patch: refreshed.
* debian/patches/nm-applet-use-indicator.patch: fix the addition of separator
  menu items to avoid multiple separators added in a block.
* debian/control: bump network-manager Depends and Build-Depends to the
  appropriate snapshot version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
335
335
                return _("InfiniBand");
336
336
        case NM_DEVICE_TYPE_BOND:
337
337
                return _("Bond");
 
338
        case NM_DEVICE_TYPE_BRIDGE:
 
339
                return _("Bridge");
338
340
        case NM_DEVICE_TYPE_VLAN:
339
341
                return _("VLAN");
340
342
        case NM_DEVICE_TYPE_ADSL:
351
353
 
352
354
        switch (nm_device_get_device_type (device)) {
353
355
        case NM_DEVICE_TYPE_BOND:
 
356
        case NM_DEVICE_TYPE_BRIDGE:
354
357
        case NM_DEVICE_TYPE_VLAN:
355
358
                return g_strdup_printf ("%s (%s)", type_name, nm_device_get_iface (device));
356
359
        default:
528
531
        names[num_devices] = NULL;
529
532
        return names;
530
533
}
 
534
 
 
535
/**
 
536
 * nma_utils_get_connection_device_name:
 
537
 * @connection: an #NMConnection for a virtual device type
 
538
 *
 
539
 * Returns the name that nma_utils_disambiguate_device_names() would
 
540
 * return for the virtual device that would be created for @connection.
 
541
 * Eg, "VLAN (eth1.1)".
 
542
 *
 
543
 * Returns: (transfer full): the name of @connection's device
 
544
 */
 
545
char *
 
546
nma_utils_get_connection_device_name (NMConnection *connection)
 
547
{
 
548
        const char *iface, *type, *display_type;
 
549
        NMSettingConnection *s_con;
 
550
 
 
551
        iface = nm_connection_get_virtual_iface_name (connection);
 
552
        g_return_val_if_fail (iface != NULL, NULL);
 
553
 
 
554
        s_con = nm_connection_get_setting_connection (connection);
 
555
        g_return_val_if_fail (s_con != NULL, NULL);
 
556
        type = nm_setting_connection_get_connection_type (s_con);
 
557
 
 
558
        if (!strcmp (type, NM_SETTING_BOND_SETTING_NAME))
 
559
                display_type = _("Bond");
 
560
        else if (!strcmp (type, NM_SETTING_BRIDGE_SETTING_NAME))
 
561
                display_type = _("Bridge");
 
562
        else if (!strcmp (type, NM_SETTING_VLAN_SETTING_NAME))
 
563
                display_type = _("VLAN");
 
564
        else {
 
565
                g_warning ("Unrecognized virtual device type '%s'", type);
 
566
                display_type = type;
 
567
        }
 
568
 
 
569
        return g_strdup_printf ("%s (%s)", display_type, iface);
 
570
}