~ubuntu-branches/ubuntu/utopic/network-manager-applet/utopic-proposed

« back to all changes in this revision

Viewing changes to src/connection-editor/page-wifi.c

  • Committer: Package Import Robot
  • Author(s): Mathieu Trudel-Lapierre
  • Date: 2014-01-06 22:29:40 UTC
  • mfrom: (1.2.35) (0.5.25 sid)
  • Revision ID: package-import@ubuntu.com-20140106222940-kxvsf0nrqhukudst
Tags: 0.9.8.4-1ubuntu1
* Merge changes from Debian, remaining changes:
  - Don't keep a postinst script; we don't need to worry about migration
    from versions prior to 0.9.0.
  - Build-Depend on dh-translations, libappindicator3-dev, docbook-to-man.
  - Different Descriptions for libnm-gtk packages.
  - debian/rules: ship extra icons, use --enable-indicators, export
    translations for Launchpad and fail if any files are missing from
    .install files, or not being installed.
  - debian/rules: use -delete to remove .la/.a files.
  - No notice about netdev group in README.Debian.
  - 11-user-connections.patch: don't use this patch, keep secrets system-wide
    as meant by upstream.
  - 12-force-online.patch: don't use this patch, we deal with the online
    state a different way...
  - lp289466_always_show_tray_icon.patch: always show the tray icon, even
    if NM is not running.
  - lp328572-dxteam-connect-text.patch,
    lp330571_dxteam_wired_connect_text.patch,
    lp330608_dxteam_gsm_connect_text.patch: update notification text to be
    prettier.
  - lp341684_device_sensitive_disconnect_notify.patch: show correct
    notification messages for disconnect events, to be in line with the other
    *connect*text patches.
  - lp460144_correctly_update_notification.patch: cleaner notification
    messages, and allow for messages to be updated instead of cleared.
  - applet-wifi-menu-before-vpn.patch: show Create New and Connect to Hidden
    wifi menu items with the other Wifi items, rather than separated by
    the VPN menus.
  - clear-notification-actions.patch: clear notification actions before
    adding new ones, to not append extra "Don't show this again" buttons.
  - key-certificate-extensions.patch: allow for the extra certificate file
    extension ".key".
  - lp829673_gconf_hide_applet.patch: allow for a gsettings key that disables
    ever showing the applet on the notification area.
  - nm-applet-use-indicator.patch: patch to support showing nm-applet as an
    appindicator in Unity.
  - position_dialogs_to_center_of_the_screen.patch: position dialogs to the
    center of the screen.
  - make_menu_items_insensitive_based_on_permissions.patch,
    hide_policy_items_env_var.patch: provide a method to desensitize or hide
    menu items which are useless given the current policykit policy level of
    the user.
  - applet_adhoc_use_wpa_rsn_part1.patch: enable Ad-Hoc using WPA RSN.
  - lp1048516_dont_req_keyring_in_greeter.patch: don't try to load the
    keyring if the user has no permissions to edit their own connections.
  - lp1048520_delay_pin_dialog_in_greeter.patch: only ask for PIN entry when
    a connection is being established rather than when a modem is detected.
  - rebuild_menu_after_init.patch: force a rebuild of the menu to avoid it
    staying empty on login.

Show diffs side-by-side

added added

removed removed

Lines of Context:
261
261
        CEPageWifi *self = CE_PAGE_WIFI (user_data);
262
262
        CEPageWifiPrivate *priv = CE_PAGE_WIFI_GET_PRIVATE (self);
263
263
        CEPage *parent = CE_PAGE (self);
264
 
        GtkWidget *widget;
265
 
        gboolean show;
 
264
        GtkWidget *widget_band_label, *widget_chan_label, *widget_bssid_label;
 
265
        gboolean adhoc;
266
266
 
267
267
        switch (gtk_combo_box_get_active (GTK_COMBO_BOX (combo))) {
268
268
        case 1: /* adhoc */
269
 
                show = TRUE;
 
269
                adhoc = TRUE;
270
270
                break;
271
271
        default: /* infrastructure */
272
 
                show = FALSE;
 
272
                adhoc = FALSE;
273
273
                break;
274
274
        }
275
275
 
276
 
        if (show) {
277
 
                widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "wifi_band_label"));
278
 
                gtk_widget_show (widget);
 
276
        widget_band_label = GTK_WIDGET (gtk_builder_get_object (parent->builder, "wifi_band_label"));
 
277
        widget_chan_label = GTK_WIDGET (gtk_builder_get_object (parent->builder, "wifi_channel_label"));
 
278
        widget_bssid_label = GTK_WIDGET (gtk_builder_get_object (parent->builder, "wifi_bssid_label"));
 
279
 
 
280
        if (adhoc) {
 
281
                /* For Ad-Hoc show Band and Channel */
 
282
                gtk_widget_show (widget_band_label);
279
283
                gtk_widget_show (GTK_WIDGET (priv->band));
280
 
                widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "wifi_channel_label"));
281
 
                gtk_widget_show (widget);
 
284
                gtk_widget_show (widget_chan_label);
282
285
                gtk_widget_show (GTK_WIDGET (priv->channel));
 
286
 
 
287
                /* and hide BSSID
 
288
                 * BSSID is random and is created by kernel for Ad-Hoc networks
 
289
                 * http://lxr.linux.no/linux+v3.7.6/net/mac80211/ibss.c#L685
 
290
                 */
 
291
                gtk_widget_hide (widget_bssid_label);
 
292
                gtk_widget_hide (GTK_WIDGET (priv->bssid));
283
293
        } else {
284
 
                widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "wifi_band_label"));
285
 
                gtk_widget_hide (widget);
 
294
                /* Do opposite for Infrastructure mode */
 
295
                gtk_widget_hide (widget_band_label);
286
296
                gtk_widget_hide (GTK_WIDGET (priv->band));
287
 
                widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "wifi_channel_label"));
288
 
                gtk_widget_hide (widget);
 
297
                gtk_widget_hide (widget_chan_label);
289
298
                gtk_widget_hide (GTK_WIDGET (priv->channel));
 
299
 
 
300
                gtk_widget_show (widget_bssid_label);
 
301
                gtk_widget_show (GTK_WIDGET (priv->bssid));
290
302
        }
291
303
 
292
 
        widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "wifi_band_label"));
293
 
        gtk_widget_set_sensitive (GTK_WIDGET (widget), show);
294
 
        gtk_widget_set_sensitive (GTK_WIDGET (priv->band), show);
295
 
        widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "wifi_channel_label"));
296
 
        gtk_widget_set_sensitive (GTK_WIDGET (widget), show);
297
 
        gtk_widget_set_sensitive (GTK_WIDGET (priv->channel), show);
 
304
        gtk_widget_set_sensitive (widget_band_label, adhoc);
 
305
        gtk_widget_set_sensitive (GTK_WIDGET (priv->band), adhoc);
 
306
        gtk_widget_set_sensitive (widget_chan_label, adhoc);
 
307
        gtk_widget_set_sensitive (GTK_WIDGET (priv->channel), adhoc);
 
308
        gtk_widget_set_sensitive (widget_bssid_label, !adhoc);
 
309
        gtk_widget_set_sensitive (GTK_WIDGET (priv->bssid), !adhoc);
298
310
 
299
311
        ce_page_changed (CE_PAGE (self));
300
312
}
541
553
        }
542
554
 
543
555
        entry = gtk_bin_get_child (GTK_BIN (priv->bssid));
544
 
        if (entry)
 
556
        /* BSSID is only valid for infrastructure not for adhoc */
 
557
        if (entry && mode && strcmp (mode, "adhoc") != 0)
545
558
                bssid = ce_page_entry_to_mac (GTK_ENTRY (entry), ARPHRD_ETHER, NULL);
546
559
        entry = gtk_bin_get_child (GTK_BIN (priv->device_mac));
547
560
        if (entry)