~khurshid-alam/unity-control-center/libnm-port-test

« back to all changes in this revision

Viewing changes to panels/network/connection-editor/ce-page-wifi.c

  • Committer: Khurshid Alam
  • Date: 2018-06-05 14:47:56 UTC
  • Revision ID: khurshid.alam@linuxmail.org-20180605144756-or0tftb2kddhvhq2
Update connection editor pages and wireless security from Gnome-3.26

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
G_DEFINE_TYPE (CEPageWifi, ce_page_wifi, CE_TYPE_PAGE)
35
35
 
36
36
static void
37
 
all_user_changed (GtkToggleButton *b, CEPageWifi *page)
38
 
{
39
 
        gboolean all_users;
40
 
        NMSettingConnection *sc;
41
 
 
42
 
        sc = nm_connection_get_setting_connection (CE_PAGE (page)->connection);
43
 
        all_users = gtk_toggle_button_get_active (b);
44
 
 
45
 
        g_object_set (sc, "permissions", NULL, NULL);
46
 
        if (!all_users)
47
 
                nm_setting_connection_add_permission (sc, "user", g_get_user_name (), NULL);
48
 
}
49
 
 
50
 
static void
51
37
connect_wifi_page (CEPageWifi *page)
52
38
{
53
 
        NMSettingConnection *sc;
54
39
        GtkWidget *widget;
55
40
        GBytes *ssid;
56
41
        gchar *utf8_ssid;
104
89
        cloned_mac = nm_setting_wireless_get_cloned_mac_address (page->setting);
105
90
        gtk_entry_set_text (GTK_ENTRY (widget), cloned_mac ? cloned_mac : "");
106
91
        g_signal_connect_swapped (widget, "changed", G_CALLBACK (ce_page_changed), page);
107
 
 
108
 
        widget = GTK_WIDGET (gtk_builder_get_object (CE_PAGE (page)->builder,
109
 
                                                     "auto_connect_check"));
110
 
        sc = nm_connection_get_setting_connection (CE_PAGE (page)->connection);
111
 
        g_object_bind_property (sc, "autoconnect",
112
 
                                widget, "active",
113
 
                                G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
114
 
        g_signal_connect_swapped (widget, "toggled", G_CALLBACK (ce_page_changed), page);
115
 
 
116
 
        widget = GTK_WIDGET (gtk_builder_get_object (CE_PAGE (page)->builder,
117
 
                                                     "all_user_check"));
118
 
        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget),
119
 
                                      nm_setting_connection_get_num_permissions (sc) == 0);
120
 
        g_signal_connect (widget, "toggled",
121
 
                          G_CALLBACK (all_user_changed), page);
122
 
        g_signal_connect_swapped (widget, "toggled", G_CALLBACK (ce_page_changed), page);
123
 
 
124
 
        widget = GTK_WIDGET (gtk_builder_get_object (CE_PAGE (page)->builder, "combo_zone"));
125
92
}
126
93
 
127
94
static void