[network-manager-applet/lr/libnmicide: 1/2] wireless-security: remove GTK4 API use



commit 6c3e7ce1a5fcf38501e4129cc9388b1c625bc53d
Author: Lubomir Rintel <lkundrak v3 sk>
Date:   Mon Oct 14 09:43:38 2019 +0200

    wireless-security: remove GTK4 API use
    
    This partly reverts commit 94518cf90edd05c550202ed0dc583e0fd211fdea.

 src/mobile-helpers.c                      |  4 +--
 src/wireless-security/eap-method-fast.c   |  5 ++--
 src/wireless-security/eap-method-leap.c   | 37 +++++++++++---------------
 src/wireless-security/eap-method-peap.c   |  9 +++----
 src/wireless-security/eap-method-simple.c | 44 ++++++++++++-------------------
 src/wireless-security/eap-method-tls.c    | 13 +++++----
 src/wireless-security/eap-method-ttls.c   |  9 +++----
 src/wireless-security/helpers.c           |  4 +--
 src/wireless-security/ws-leap.c           | 11 ++++----
 src/wireless-security/ws-sae.c            |  7 +++--
 src/wireless-security/ws-wep-key.c        | 17 ++++++------
 src/wireless-security/ws-wpa-psk.c        |  7 +++--
 12 files changed, 71 insertions(+), 96 deletions(-)
---
diff --git a/src/mobile-helpers.c b/src/mobile-helpers.c
index 54f250b8..0621a81b 100644
--- a/src/mobile-helpers.c
+++ b/src/mobile-helpers.c
@@ -7,7 +7,7 @@
  */
 
 #include "nm-default.h"
-#include "nma-private.h"
+
 #include <ctype.h>
 
 #include <libsecret/secret.h>
@@ -469,7 +469,7 @@ ask_for_pin (GtkEntry **out_secret_entry)
        w = gtk_entry_new ();
        *out_secret_entry = GTK_ENTRY (w);
        gtk_entry_set_max_length (GTK_ENTRY (w), 8);
-       gtk_editable_set_width_chars (GTK_EDITABLE (w), 8);
+       gtk_entry_set_width_chars (GTK_ENTRY (w), 8);
        gtk_entry_set_activates_default (GTK_ENTRY (w), TRUE);
        gtk_entry_set_visibility (GTK_ENTRY (w), FALSE);
        gtk_box_pack_start (box, w, FALSE, FALSE, 0);
diff --git a/src/wireless-security/eap-method-fast.c b/src/wireless-security/eap-method-fast.c
index 32674739..311371c3 100644
--- a/src/wireless-security/eap-method-fast.c
+++ b/src/wireless-security/eap-method-fast.c
@@ -6,7 +6,6 @@
  */
 
 #include "nm-default.h"
-#include "nma-private.h"
 
 #include <ctype.h>
 #include <string.h>
@@ -132,7 +131,7 @@ fill_connection (EAPMethod *parent, NMConnection *connection)
 
        widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_fast_anon_identity_entry"));
        g_assert (widget);
-       text = gtk_editable_get_text (GTK_EDITABLE (widget));
+       text = gtk_entry_get_text (GTK_ENTRY (widget));
        if (text && strlen (text))
                g_object_set (s_8021x, NM_SETTING_802_1X_ANONYMOUS_IDENTITY, text, NULL);
 
@@ -383,7 +382,7 @@ eap_method_fast_new (WirelessSecurity *ws_parent,
 
        widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_fast_anon_identity_entry"));
        if (s_8021x && nm_setting_802_1x_get_anonymous_identity (s_8021x))
-               gtk_editable_set_text (GTK_EDITABLE (widget), nm_setting_802_1x_get_anonymous_identity 
(s_8021x));
+               gtk_entry_set_text (GTK_ENTRY (widget), nm_setting_802_1x_get_anonymous_identity (s_8021x));
        g_signal_connect (G_OBJECT (widget), "changed",
                          (GCallback) wireless_security_changed_cb,
                          ws_parent);
diff --git a/src/wireless-security/eap-method-leap.c b/src/wireless-security/eap-method-leap.c
index ee45257b..2f43ab85 100644
--- a/src/wireless-security/eap-method-leap.c
+++ b/src/wireless-security/eap-method-leap.c
@@ -7,7 +7,6 @@
  */
 
 #include "nm-default.h"
-#include "nma-private.h"
 
 #include <ctype.h>
 #include <string.h>
@@ -47,7 +46,7 @@ validate (EAPMethod *parent, GError **error)
        const char *text;
        gboolean ret = TRUE;
 
-       text = gtk_editable_get_text (GTK_EDITABLE (method->username_entry));
+       text = gtk_entry_get_text (method->username_entry);
        if (!text || !strlen (text)) {
                widget_set_error (GTK_WIDGET (method->username_entry));
                g_set_error_literal (error, NMA_ERROR, NMA_ERROR_GENERIC, _("missing EAP-LEAP username"));
@@ -55,7 +54,7 @@ validate (EAPMethod *parent, GError **error)
        } else
                widget_unset_error (GTK_WIDGET (method->username_entry));
 
-       text = gtk_editable_get_text (GTK_EDITABLE (method->password_entry));
+       text = gtk_entry_get_text (method->password_entry);
        if (!text || !strlen (text)) {
                widget_set_error (GTK_WIDGET (method->password_entry));
                if (ret) {
@@ -95,10 +94,8 @@ fill_connection (EAPMethod *parent, NMConnection *connection)
 
        nm_setting_802_1x_add_eap_method (s_8021x, "leap");
 
-       g_object_set (s_8021x,
-                     NM_SETTING_802_1X_IDENTITY, gtk_editable_get_text (GTK_EDITABLE 
(method->username_entry)),
-                     NM_SETTING_802_1X_PASSWORD, gtk_editable_get_text (GTK_EDITABLE 
(method->password_entry)),
-                     NULL);
+       g_object_set (s_8021x, NM_SETTING_802_1X_IDENTITY, gtk_entry_get_text (method->username_entry), NULL);
+       g_object_set (s_8021x, NM_SETTING_802_1X_PASSWORD, gtk_entry_get_text (method->password_entry), NULL);
 
        passwd_entry = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_leap_password_entry"));
        g_assert (passwd_entry);
@@ -129,19 +126,15 @@ update_secrets (EAPMethod *parent, NMConnection *connection)
 static void
 set_userpass_ui (EAPMethodLEAP *method)
 {
-       if (method->ws_parent->username) {
-               gtk_editable_set_text (GTK_EDITABLE (method->username_entry),
-                                      method->ws_parent->username);
-       } else {
-               gtk_editable_set_text (GTK_EDITABLE (method->username_entry), "");
-       }
-
-       if (method->ws_parent->password && !method->ws_parent->always_ask) {
-               gtk_editable_set_text (GTK_EDITABLE (method->password_entry),
-                                      method->ws_parent->password);
-       } else {
-               gtk_editable_set_text (GTK_EDITABLE (method->password_entry), "");
-       }
+       if (method->ws_parent->username)
+               gtk_entry_set_text (method->username_entry, method->ws_parent->username);
+       else
+               gtk_entry_set_text (method->username_entry, "");
+
+       if (method->ws_parent->password && !method->ws_parent->always_ask)
+               gtk_entry_set_text (method->password_entry, method->ws_parent->password);
+       else
+               gtk_entry_set_text (method->password_entry, "");
 
        gtk_toggle_button_set_active (method->show_password, method->ws_parent->show_password);
 }
@@ -156,8 +149,8 @@ static void
 widgets_unrealized (GtkWidget *widget, EAPMethodLEAP *method)
 {
        wireless_security_set_userpass (method->ws_parent,
-                                       gtk_editable_get_text (GTK_EDITABLE (method->username_entry)),
-                                       gtk_editable_get_text (GTK_EDITABLE (method->password_entry)),
+                                       gtk_entry_get_text (method->username_entry),
+                                       gtk_entry_get_text (method->password_entry),
                                        (gboolean) -1,
                                        gtk_toggle_button_get_active (method->show_password));
 }
diff --git a/src/wireless-security/eap-method-peap.c b/src/wireless-security/eap-method-peap.c
index a7dd3e59..4c765dbc 100644
--- a/src/wireless-security/eap-method-peap.c
+++ b/src/wireless-security/eap-method-peap.c
@@ -7,7 +7,6 @@
  */
 
 #include "nm-default.h"
-#include "nma-private.h"
 
 #include <ctype.h>
 #include <string.h>
@@ -143,14 +142,14 @@ fill_connection (EAPMethod *parent, NMConnection *connection)
 
        widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_peap_anon_identity_entry"));
        g_assert (widget);
-       text = gtk_editable_get_text (GTK_EDITABLE (widget));
+       text = gtk_entry_get_text (GTK_ENTRY (widget));
        if (text && strlen (text))
                g_object_set (s_8021x, NM_SETTING_802_1X_ANONYMOUS_IDENTITY, text, NULL);
 
 #if LIBNM_BUILD
        widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_peap_domain_entry"));
        g_assert (widget);
-       text = gtk_editable_get_text (GTK_EDITABLE (widget));
+       text = gtk_entry_get_text (GTK_ENTRY (widget));
        if (text && strlen (text))
                g_object_set (s_8021x, NM_SETTING_802_1X_DOMAIN_SUFFIX_MATCH, text, NULL);
 #endif
@@ -456,7 +455,7 @@ eap_method_peap_new (WirelessSecurity *ws_parent,
 
        widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_peap_anon_identity_entry"));
        if (s_8021x && nm_setting_802_1x_get_anonymous_identity (s_8021x))
-               gtk_editable_set_text (GTK_EDITABLE (widget), nm_setting_802_1x_get_anonymous_identity 
(s_8021x));
+               gtk_entry_set_text (GTK_ENTRY (widget), nm_setting_802_1x_get_anonymous_identity (s_8021x));
        g_signal_connect (G_OBJECT (widget), "changed",
                          (GCallback) wireless_security_changed_cb,
                          ws_parent);
@@ -464,7 +463,7 @@ eap_method_peap_new (WirelessSecurity *ws_parent,
        widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_peap_domain_entry"));
 #if LIBNM_BUILD
        if (s_8021x && nm_setting_802_1x_get_domain_suffix_match (s_8021x))
-               gtk_editable_set_text (GTK_EDITABLE (widget), nm_setting_802_1x_get_domain_suffix_match 
(s_8021x));
+               gtk_entry_set_text (GTK_ENTRY (widget), nm_setting_802_1x_get_domain_suffix_match (s_8021x));
        g_signal_connect (G_OBJECT (widget), "changed",
                          (GCallback) wireless_security_changed_cb,
                          ws_parent);
diff --git a/src/wireless-security/eap-method-simple.c b/src/wireless-security/eap-method-simple.c
index 26aef0de..20322868 100644
--- a/src/wireless-security/eap-method-simple.c
+++ b/src/wireless-security/eap-method-simple.c
@@ -7,7 +7,6 @@
  */
 
 #include "nm-default.h"
-#include "nma-private.h"
 
 #include <ctype.h>
 #include <string.h>
@@ -71,7 +70,7 @@ validate (EAPMethod *parent, GError **error)
        gboolean ret = TRUE;
 
        if (method->username_requested) {
-               text = gtk_editable_get_text (GTK_EDITABLE (method->username_entry));
+               text = gtk_entry_get_text (method->username_entry);
                if (!text || !strlen (text)) {
                        widget_set_error (GTK_WIDGET (method->username_entry));
                        g_set_error_literal (error, NMA_ERROR, NMA_ERROR_GENERIC, _("missing EAP username"));
@@ -85,7 +84,7 @@ validate (EAPMethod *parent, GError **error)
                if (always_ask_selected (method->password_entry))
                        widget_unset_error (GTK_WIDGET (method->password_entry));
                else {
-                       text = gtk_editable_get_text (GTK_EDITABLE (method->password_entry));
+                       text = gtk_entry_get_text (method->password_entry);
                        if (!text || !strlen (text)) {
                                widget_set_error (GTK_WIDGET (method->password_entry));
                                if (ret) {
@@ -99,7 +98,7 @@ validate (EAPMethod *parent, GError **error)
        }
 
        if (method->pkey_passphrase_requested) {
-               text = gtk_editable_get_text (GTK_EDITABLE (method->pkey_passphrase_entry));
+               text = gtk_entry_get_text (method->pkey_passphrase_entry);
                if (!text || !strlen (text)) {
                        widget_set_error (GTK_WIDGET (method->pkey_passphrase_entry));
                        if (ret) {
@@ -194,11 +193,8 @@ fill_connection (EAPMethod *parent, NMConnection *connection)
                        nm_setting_802_1x_add_eap_method (s_8021x, eap_type->name);
        }
 
-       if (method->username_requested) {
-               g_object_set (s_8021x, NM_SETTING_802_1X_IDENTITY,
-                             gtk_editable_get_text (GTK_EDITABLE (method->username_entry)),
-                             NULL);
-       }
+       if (method->username_requested)
+               g_object_set (s_8021x, NM_SETTING_802_1X_IDENTITY, gtk_entry_get_text 
(method->username_entry), NULL);
 
        if (method->password_requested) {
                /* Save the password always ask setting */
@@ -213,8 +209,7 @@ fill_connection (EAPMethod *parent, NMConnection *connection)
                 */
                if (!(method->flags & EAP_METHOD_SIMPLE_FLAG_IS_EDITOR) || not_saved == FALSE) {
                        g_object_set (s_8021x, NM_SETTING_802_1X_PASSWORD,
-                                     gtk_editable_get_text (GTK_EDITABLE (method->password_entry)),
-                                     NULL);
+                                     gtk_entry_get_text (method->password_entry), NULL);
                }
 
                /* Update secret flags and popup when editing the connection */
@@ -230,8 +225,7 @@ fill_connection (EAPMethod *parent, NMConnection *connection)
 
        if (method->pkey_passphrase_requested) {
                g_object_set (s_8021x, NM_SETTING_802_1X_PRIVATE_KEY_PASSWORD,
-                             gtk_editable_get_text (GTK_EDITABLE (method->pkey_passphrase_entry)),
-                             NULL);
+                             gtk_entry_get_text (method->pkey_passphrase_entry), NULL);
        }
 }
 
@@ -286,19 +280,15 @@ password_storage_changed (GObject *entry,
 static void
 set_userpass_ui (EAPMethodSimple *method)
 {
-       if (method->ws_parent->username) {
-               gtk_editable_set_text (GTK_EDITABLE (method->username_entry),
-                                      method->ws_parent->username);
-       } else {
-               gtk_editable_set_text (GTK_EDITABLE (method->username_entry), "");
-       }
+       if (method->ws_parent->username)
+               gtk_entry_set_text (method->username_entry, method->ws_parent->username);
+       else
+               gtk_entry_set_text (method->username_entry, "");
 
-       if (method->ws_parent->password && !method->ws_parent->always_ask) {
-               gtk_editable_set_text (GTK_EDITABLE (method->password_entry),
-                                                    method->ws_parent->password);
-       } else {
-               gtk_editable_set_text (GTK_EDITABLE (method->password_entry), "");
-       }
+       if (method->ws_parent->password && !method->ws_parent->always_ask)
+               gtk_entry_set_text (method->password_entry, method->ws_parent->password);
+       else
+               gtk_entry_set_text (method->password_entry, "");
 
        gtk_toggle_button_set_active (method->show_password, method->ws_parent->show_password);
        password_storage_changed (NULL, NULL, method);
@@ -314,8 +304,8 @@ static void
 widgets_unrealized (GtkWidget *widget, EAPMethodSimple *method)
 {
        wireless_security_set_userpass (method->ws_parent,
-                                       gtk_editable_get_text (GTK_EDITABLE (method->username_entry)),
-                                       gtk_editable_get_text (GTK_EDITABLE (method->password_entry)),
+                                       gtk_entry_get_text (method->username_entry),
+                                       gtk_entry_get_text (method->password_entry),
                                        always_ask_selected (method->password_entry),
                                        gtk_toggle_button_get_active (method->show_password));
 }
diff --git a/src/wireless-security/eap-method-tls.c b/src/wireless-security/eap-method-tls.c
index 79f296dc..12374e87 100644
--- a/src/wireless-security/eap-method-tls.c
+++ b/src/wireless-security/eap-method-tls.c
@@ -8,7 +8,6 @@
  */
 
 #include "nm-default.h"
-#include "nma-private.h"
 
 #include <ctype.h>
 #include <string.h>
@@ -45,7 +44,7 @@ validate (EAPMethod *parent, GError **error)
 
        widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_tls_identity_entry"));
        g_assert (widget);
-       identity = gtk_editable_get_text (GTK_EDITABLE (widget));
+       identity = gtk_entry_get_text (GTK_ENTRY (widget));
        if (!identity || !strlen (identity)) {
                widget_set_error (widget);
                g_set_error_literal (error, NMA_ERROR, NMA_ERROR_GENERIC, _("missing EAP-TLS identity"));
@@ -115,14 +114,14 @@ fill_connection (EAPMethod *parent, NMConnection *connection)
 
        widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_tls_identity_entry"));
        g_assert (widget);
-       g_object_set (s_8021x, NM_SETTING_802_1X_IDENTITY, gtk_editable_get_text (GTK_EDITABLE (widget)), 
NULL);
+       g_object_set (s_8021x, NM_SETTING_802_1X_IDENTITY, gtk_entry_get_text (GTK_ENTRY (widget)), NULL);
 
 #if LIBNM_BUILD
        widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_tls_domain_entry"));
        g_assert (widget);
        g_object_set (s_8021x,
                      parent->phase2 ? NM_SETTING_802_1X_PHASE2_DOMAIN_SUFFIX_MATCH : 
NM_SETTING_802_1X_DOMAIN_SUFFIX_MATCH,
-                     gtk_editable_get_text (GTK_EDITABLE (widget)), NULL);
+                     gtk_entry_get_text (GTK_ENTRY (widget)), NULL);
 #endif
 
        /* TLS private key */
@@ -399,7 +398,7 @@ eap_method_tls_new (WirelessSecurity *ws_parent,
                          (GCallback) wireless_security_changed_cb,
                          ws_parent);
        if (s_8021x && nm_setting_802_1x_get_identity (s_8021x))
-               gtk_editable_set_text (GTK_EDITABLE (widget), nm_setting_802_1x_get_identity (s_8021x));
+               gtk_entry_set_text (GTK_ENTRY (widget), nm_setting_802_1x_get_identity (s_8021x));
 
        widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_tls_domain_entry"));
        g_assert (widget);
@@ -409,10 +408,10 @@ eap_method_tls_new (WirelessSecurity *ws_parent,
                          ws_parent);
        if (phase2) {
                if (s_8021x && nm_setting_802_1x_get_phase2_domain_suffix_match (s_8021x))
-                       gtk_editable_set_text (GTK_EDITABLE (widget), 
nm_setting_802_1x_get_phase2_domain_suffix_match (s_8021x));
+                       gtk_entry_set_text (GTK_ENTRY (widget), 
nm_setting_802_1x_get_phase2_domain_suffix_match (s_8021x));
        } else {
                if (s_8021x && nm_setting_802_1x_get_domain_suffix_match (s_8021x))
-                       gtk_editable_set_text (GTK_EDITABLE (widget), 
nm_setting_802_1x_get_domain_suffix_match (s_8021x));
+                       gtk_entry_set_text (GTK_ENTRY (widget), nm_setting_802_1x_get_domain_suffix_match 
(s_8021x));
        }
 #else
        gtk_widget_hide (widget);
diff --git a/src/wireless-security/eap-method-ttls.c b/src/wireless-security/eap-method-ttls.c
index 1d589ee7..c94a9deb 100644
--- a/src/wireless-security/eap-method-ttls.c
+++ b/src/wireless-security/eap-method-ttls.c
@@ -7,7 +7,6 @@
  */
 
 #include "nm-default.h"
-#include "nma-private.h"
 
 #include <ctype.h>
 #include <string.h>
@@ -139,14 +138,14 @@ fill_connection (EAPMethod *parent, NMConnection *connection)
 
        widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_ttls_anon_identity_entry"));
        g_assert (widget);
-       text = gtk_editable_get_text (GTK_EDITABLE (widget));
+       text = gtk_entry_get_text (GTK_ENTRY (widget));
        if (text && strlen (text))
                g_object_set (s_8021x, NM_SETTING_802_1X_ANONYMOUS_IDENTITY, text, NULL);
 
 #if LIBNM_BUILD
        widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_ttls_domain_entry"));
        g_assert (widget);
-       text = gtk_editable_get_text (GTK_EDITABLE (widget));
+       text = gtk_entry_get_text (GTK_ENTRY (widget));
        if (text && strlen (text))
                g_object_set (s_8021x, NM_SETTING_802_1X_DOMAIN_SUFFIX_MATCH, text, NULL);
 #endif
@@ -488,7 +487,7 @@ eap_method_ttls_new (WirelessSecurity *ws_parent,
 
        widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_ttls_anon_identity_entry"));
        if (s_8021x && nm_setting_802_1x_get_anonymous_identity (s_8021x))
-               gtk_editable_set_text (GTK_EDITABLE (widget), nm_setting_802_1x_get_anonymous_identity 
(s_8021x));
+               gtk_entry_set_text (GTK_ENTRY (widget), nm_setting_802_1x_get_anonymous_identity (s_8021x));
        g_signal_connect (G_OBJECT (widget), "changed",
                          (GCallback) wireless_security_changed_cb,
                          ws_parent);
@@ -496,7 +495,7 @@ eap_method_ttls_new (WirelessSecurity *ws_parent,
        widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_ttls_domain_entry"));
 #if LIBNM_BUILD
        if (s_8021x && nm_setting_802_1x_get_domain_suffix_match (s_8021x))
-               gtk_editable_set_text (GTK_EDITABLE (widget), nm_setting_802_1x_get_domain_suffix_match 
(s_8021x));
+               gtk_entry_set_text (GTK_ENTRY (widget), nm_setting_802_1x_get_domain_suffix_match (s_8021x));
        g_signal_connect (G_OBJECT (widget), "changed",
                          (GCallback) wireless_security_changed_cb,
                          ws_parent);
diff --git a/src/wireless-security/helpers.c b/src/wireless-security/helpers.c
index 31009cb2..5cb86377 100644
--- a/src/wireless-security/helpers.c
+++ b/src/wireless-security/helpers.c
@@ -7,7 +7,7 @@
  */
 
 #include "nm-default.h"
-#include "nma-private.h"
+
 #include "helpers.h"
 
 void
@@ -32,7 +32,7 @@ helper_fill_secret_entry (NMConnection *connection,
                if (tmp) {
                        widget = GTK_WIDGET (gtk_builder_get_object (builder, entry_name));
                        g_assert (widget);
-                       gtk_editable_set_text (GTK_EDITABLE (widget), tmp);
+                       gtk_entry_set_text (GTK_ENTRY (widget), tmp);
                }
        }
 }
diff --git a/src/wireless-security/ws-leap.c b/src/wireless-security/ws-leap.c
index e400a10a..f102fc6a 100644
--- a/src/wireless-security/ws-leap.c
+++ b/src/wireless-security/ws-leap.c
@@ -7,7 +7,6 @@
  */
 
 #include "nm-default.h"
-#include "nma-private.h"
 
 #include <string.h>
 
@@ -45,7 +44,7 @@ validate (WirelessSecurity *parent, GError **error)
 
        entry = GTK_WIDGET (gtk_builder_get_object (parent->builder, "leap_username_entry"));
        g_assert (entry);
-       text = gtk_editable_get_text (GTK_EDITABLE (entry));
+       text = gtk_entry_get_text (GTK_ENTRY (entry));
        if (!text || !strlen (text)) {
                widget_set_error (entry);
                g_set_error_literal (error, NMA_ERROR, NMA_ERROR_GENERIC, _("missing leap-username"));
@@ -57,7 +56,7 @@ validate (WirelessSecurity *parent, GError **error)
        g_assert (entry);
 
        secret_flags = nma_utils_menu_to_secret_flags (entry);
-       text = gtk_editable_get_text (GTK_EDITABLE (entry));
+       text = gtk_entry_get_text (GTK_ENTRY (entry));
 
         if (   secret_flags & NM_SETTING_SECRET_FLAG_NOT_SAVED
             || secret_flags & NM_SETTING_SECRET_FLAG_NOT_REQUIRED
@@ -100,11 +99,11 @@ fill_connection (WirelessSecurity *parent, NMConnection *connection)
        nm_connection_add_setting (connection, (NMSetting *) s_wireless_sec);
 
        widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "leap_username_entry"));
-       leap_username = gtk_editable_get_text (GTK_EDITABLE (widget));
+       leap_username = gtk_entry_get_text (GTK_ENTRY (widget));
 
        widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "leap_password_entry"));
        passwd_entry = widget;
-       leap_password = gtk_editable_get_text (GTK_EDITABLE (widget));
+       leap_password = gtk_entry_get_text (GTK_ENTRY (widget));
 
        g_object_set (s_wireless_sec,
                      NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "ieee8021x",
@@ -191,7 +190,7 @@ ws_leap_new (NMConnection *connection, gboolean secrets_only)
                          (GCallback) wireless_security_changed_cb,
                          sec);
        if (wsec)
-               gtk_editable_set_text (GTK_EDITABLE (widget), nm_setting_wireless_security_get_leap_username 
(wsec));
+               gtk_entry_set_text (GTK_ENTRY (widget), nm_setting_wireless_security_get_leap_username 
(wsec));
 
        if (secrets_only)
                gtk_widget_hide (widget);
diff --git a/src/wireless-security/ws-sae.c b/src/wireless-security/ws-sae.c
index 4bebf138..7fa95c68 100644
--- a/src/wireless-security/ws-sae.c
+++ b/src/wireless-security/ws-sae.c
@@ -4,7 +4,6 @@
  */
 
 #include "nm-default.h"
-#include "nma-private.h"
 
 #include <ctype.h>
 #include <string.h>
@@ -47,7 +46,7 @@ validate (WirelessSecurity *parent, GError **error)
        g_assert (entry);
 
        secret_flags = nma_utils_menu_to_secret_flags (entry);
-       key = gtk_editable_get_text (GTK_EDITABLE (entry));
+       key = gtk_entry_get_text (GTK_ENTRY (entry));
 
         if (   secret_flags & NM_SETTING_SECRET_FLAG_NOT_SAVED
             || secret_flags & NM_SETTING_SECRET_FLAG_NOT_REQUIRED) {
@@ -99,7 +98,7 @@ fill_connection (WirelessSecurity *parent, NMConnection *connection)
 
        widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "psk_entry"));
        passwd_entry = widget;
-       key = gtk_editable_get_text (GTK_EDITABLE (widget));
+       key = gtk_entry_get_text (GTK_ENTRY (widget));
        g_object_set (s_wireless_sec, NM_SETTING_WIRELESS_SECURITY_PSK, key, NULL);
 
        /* Save PSK_FLAGS to the connection */
@@ -168,7 +167,7 @@ ws_sae_new (NMConnection *connection, gboolean secrets_only)
        g_signal_connect (G_OBJECT (widget), "changed",
                          (GCallback) wireless_security_changed_cb,
                          sec);
-       gtk_editable_set_width_chars (GTK_EDITABLE (widget), 28);
+       gtk_entry_set_width_chars (GTK_ENTRY (widget), 28);
 
        /* Create password-storage popup menu for password entry under entry's secondary icon */
        if (connection)
diff --git a/src/wireless-security/ws-wep-key.c b/src/wireless-security/ws-wep-key.c
index fc5a4b74..caedfa5f 100644
--- a/src/wireless-security/ws-wep-key.c
+++ b/src/wireless-security/ws-wep-key.c
@@ -7,7 +7,6 @@
  */
 
 #include "nm-default.h"
-#include "nma-private.h"
 
 #include <string.h>
 
@@ -50,7 +49,7 @@ key_index_combo_changed_cb (GtkWidget *combo, WirelessSecurity *parent)
 
        /* Save WEP key for old key index */
        entry = GTK_WIDGET (gtk_builder_get_object (parent->builder, "wep_key_entry"));
-       key = gtk_editable_get_text (GTK_EDITABLE (entry));
+       key = gtk_entry_get_text (GTK_ENTRY (entry));
        if (key)
                g_strlcpy (sec->keys[sec->cur_index], key, sizeof (sec->keys[sec->cur_index]));
        else
@@ -61,7 +60,7 @@ key_index_combo_changed_cb (GtkWidget *combo, WirelessSecurity *parent)
        g_return_if_fail (key_index >= 0);
 
        /* Populate entry with key from new index */
-       gtk_editable_set_text (GTK_EDITABLE (entry), sec->keys[key_index]);
+       gtk_entry_set_text (GTK_ENTRY (entry), sec->keys[key_index]);
        sec->cur_index = key_index;
 
        wireless_security_changed_cb (combo, parent);
@@ -90,7 +89,7 @@ validate (WirelessSecurity *parent, GError **error)
        g_assert (entry);
 
        secret_flags = nma_utils_menu_to_secret_flags (entry);
-       key = gtk_editable_get_text (GTK_EDITABLE (entry));
+       key = gtk_entry_get_text (GTK_ENTRY (entry));
 
         if (   secret_flags & NM_SETTING_SECRET_FLAG_NOT_SAVED
             || secret_flags & NM_SETTING_SECRET_FLAG_NOT_REQUIRED) {
@@ -167,7 +166,7 @@ fill_connection (WirelessSecurity *parent, NMConnection *connection)
 
        widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "wep_key_entry"));
        passwd_entry = widget;
-       key = gtk_editable_get_text (GTK_EDITABLE (widget));
+       key = gtk_entry_get_text (GTK_ENTRY (widget));
        g_strlcpy (sec->keys[sec->cur_index], key, sizeof (sec->keys[sec->cur_index]));
 
        /* Blow away the old security setting by adding a clear one */
@@ -218,7 +217,7 @@ update_secrets (WirelessSecurity *parent, NMConnection *connection)
 {
        WirelessSecurityWEPKey *sec = (WirelessSecurityWEPKey *) parent;
        NMSettingWirelessSecurity *s_wsec;
-       GtkEditable *entry;
+       GtkWidget *widget;
        const char *tmp;
        int i;
 
@@ -229,9 +228,9 @@ update_secrets (WirelessSecurity *parent, NMConnection *connection)
                        g_strlcpy (sec->keys[i], tmp, sizeof (sec->keys[i]));
        }
 
-       entry = GTK_EDITABLE (gtk_builder_get_object (parent->builder, "wep_key_entry"));
+       widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "wep_key_entry"));
        if (strlen (sec->keys[sec->cur_index]))
-               gtk_editable_set_text (entry, sec->keys[sec->cur_index]);
+               gtk_entry_set_text (GTK_ENTRY (widget), sec->keys[sec->cur_index]);
 }
 
 WirelessSecurityWEPKey *
@@ -268,7 +267,7 @@ ws_wep_key_new (NMConnection *connection,
 
        widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "wep_key_entry"));
        g_assert (widget);
-       gtk_editable_set_width_chars (GTK_EDITABLE (widget), 28);
+       gtk_entry_set_width_chars (GTK_ENTRY (widget), 28);
 
        /* Create password-storage popup menu for password entry under entry's secondary icon */
        if (connection)
diff --git a/src/wireless-security/ws-wpa-psk.c b/src/wireless-security/ws-wpa-psk.c
index 5f0df4db..eba22a79 100644
--- a/src/wireless-security/ws-wpa-psk.c
+++ b/src/wireless-security/ws-wpa-psk.c
@@ -7,7 +7,6 @@
  */
 
 #include "nm-default.h"
-#include "nma-private.h"
 
 #include <ctype.h>
 #include <string.h>
@@ -52,7 +51,7 @@ validate (WirelessSecurity *parent, GError **error)
        g_assert (entry);
 
        secret_flags = nma_utils_menu_to_secret_flags (entry);
-       key = gtk_editable_get_text (GTK_EDITABLE (entry));
+       key = gtk_entry_get_text (GTK_ENTRY (entry));
        len = key ? strlen (key) : 0;
 
         if (   secret_flags & NM_SETTING_SECRET_FLAG_NOT_SAVED
@@ -116,7 +115,7 @@ fill_connection (WirelessSecurity *parent, NMConnection *connection)
 
        widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "wpa_psk_entry"));
        passwd_entry = widget;
-       key = gtk_editable_get_text (GTK_EDITABLE (widget));
+       key = gtk_entry_get_text (GTK_ENTRY (widget));
        g_object_set (s_wireless_sec, NM_SETTING_WIRELESS_SECURITY_PSK, key, NULL);
 
        /* Save PSK_FLAGS to the connection */
@@ -185,7 +184,7 @@ ws_wpa_psk_new (NMConnection *connection, gboolean secrets_only)
        g_signal_connect (G_OBJECT (widget), "changed",
                          (GCallback) wireless_security_changed_cb,
                          sec);
-       gtk_editable_set_width_chars (GTK_EDITABLE (widget), 28);
+       gtk_entry_set_width_chars (GTK_ENTRY (widget), 28);
 
        /* Create password-storage popup menu for password entry under entry's secondary icon */
        if (connection)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]