]> code.ossystems Code Review - openembedded-core.git/blob
bcc435f08178b684413d1717af43531657898930
[openembedded-core.git] /
1 From f24d6e26f81e205769cecf0dae7e6cf90b23f9e9 Mon Sep 17 00:00:00 2001
2 Message-Id: <f24d6e26f81e205769cecf0dae7e6cf90b23f9e9.1334369310.git.paul.eggleton@linux.intel.com>
3 In-Reply-To: <cover.1334369310.git.paul.eggleton@linux.intel.com>
4 References: <cover.1334369310.git.paul.eggleton@linux.intel.com>
5 From: Paul Eggleton <paul.eggleton@linux.intel.com>
6 Date: Sat, 14 Apr 2012 02:37:55 +0100
7 Subject: [PATCH 5/6] Remove all handling of Passphrase property
8
9 Services no longer have a Passphrase property in ConnMan 0.79 -
10 credentials are handled entirely through the agent.
11
12 Upstream-Status: Submitted
13
14 Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
15 ---
16  common/connman-client.c |   51 -----------------------------------------------
17  common/connman-client.h |    4 ---
18  common/connman-dbus.c   |   11 +---------
19  properties/advanced.h   |    1 -
20  properties/wifi.c       |   48 --------------------------------------------
21  5 files changed, 1 insertions(+), 114 deletions(-)
22
23 diff --git a/common/connman-client.c b/common/connman-client.c
24 index e4441ad..dec9867 100644
25 --- a/common/connman-client.c
26 +++ b/common/connman-client.c
27 @@ -112,7 +112,6 @@ static void connman_client_init(ConnmanClient *client)
28                                 G_TYPE_BOOLEAN, /* favorite */
29                                 G_TYPE_UINT,    /* strength */
30                                 G_TYPE_STRING,  /* security */
31 -                               G_TYPE_STRING,  /* passphrase */
32                                 G_TYPE_STRING,  /* method */
33                                 G_TYPE_STRING,  /* address */
34                                 G_TYPE_STRING,  /* netmask */
35 @@ -501,56 +500,6 @@ gchar *connman_client_get_security(ConnmanClient *client, const gchar *network)
36         return security;
37  }
38  
39 -gchar *connman_client_get_passphrase(ConnmanClient *client, const gchar *network)
40 -{
41 -       ConnmanClientPrivate *priv = CONNMAN_CLIENT_GET_PRIVATE(client);
42 -       GtkTreeIter iter;
43 -       gchar *passphrase;
44 -
45 -       DBG("client %p", client);
46 -
47 -       if (network == NULL)
48 -               return NULL;
49 -
50 -       if (connman_dbus_get_iter(priv->store, network, &iter) == FALSE)
51 -               return NULL;
52 -
53 -       gtk_tree_model_get(GTK_TREE_MODEL(priv->store), &iter,
54 -                               CONNMAN_COLUMN_PASSPHRASE, &passphrase, -1);
55 -
56 -       return passphrase;
57 -}
58 -
59 -gboolean connman_client_set_passphrase(ConnmanClient *client, const gchar *network,
60 -                                               const gchar *passphrase)
61 -{
62 -       ConnmanClientPrivate *priv = CONNMAN_CLIENT_GET_PRIVATE(client);
63 -       DBusGProxy *proxy;
64 -       GValue value = { 0 };
65 -       gboolean ret = FALSE;
66 -
67 -       DBG("client %p", client);
68 -
69 -       if (network == NULL)
70 -               goto done;
71 -
72 -       proxy = connman_dbus_get_proxy(priv->store, network);
73 -       if (proxy == NULL)
74 -               goto done;
75 -
76 -       g_value_init(&value, G_TYPE_STRING);
77 -       g_value_set_string(&value, passphrase);
78 -
79 -       ret = connman_set_property(proxy, "Passphrase", &value, NULL);
80 -
81 -       g_value_unset(&value);
82 -
83 -       g_object_unref(proxy);
84 -
85 -done:
86 -       return ret;
87 -}
88 -
89  void connman_client_set_callback(ConnmanClient *client,
90                         ConnmanClientCallback callback, gpointer user_data)
91  {
92 diff --git a/common/connman-client.h b/common/connman-client.h
93 index 6fe772c..bb36a2f 100644
94 --- a/common/connman-client.h
95 +++ b/common/connman-client.h
96 @@ -77,9 +77,6 @@ void connman_client_disconnect(ConnmanClient *client, const gchar *network);
97  gchar *connman_client_get_security(ConnmanClient *client, const gchar *network);
98  void connman_client_connect_async(ConnmanClient *client, const gchar *network,
99                                 connman_connect_reply callback, gpointer userdata);
100 -gchar *connman_client_get_passphrase(ConnmanClient *client, const gchar *network);
101 -gboolean connman_client_set_passphrase(ConnmanClient *client, const gchar *network,
102 -                                               const gchar *passphrase);
103  void connman_client_set_remember(ConnmanClient *client, const gchar *network,
104                                                         gboolean remember);
105  
106 @@ -108,7 +105,6 @@ enum {
107         CONNMAN_COLUMN_FAVORITE,        /* G_TYPE_BOOLEAN */
108         CONNMAN_COLUMN_STRENGTH,        /* G_TYPE_UINT    */
109         CONNMAN_COLUMN_SECURITY,        /* G_TYPE_STRING  */
110 -       CONNMAN_COLUMN_PASSPHRASE,      /* G_TYPE_STRING  */
111         CONNMAN_COLUMN_METHOD,          /* G_TYPE_STRING  */
112         CONNMAN_COLUMN_ADDRESS,         /* G_TYPE_STRING  */
113         CONNMAN_COLUMN_NETMASK,         /* G_TYPE_STRING  */
114 diff --git a/common/connman-dbus.c b/common/connman-dbus.c
115 index 4eb77b6..f46a750 100644
116 --- a/common/connman-dbus.c
117 +++ b/common/connman-dbus.c
118 @@ -389,11 +389,6 @@ static void service_changed(DBusGProxy *proxy, const char *property,
119                 gtk_tree_store_set(store, &iter,
120                                         CONNMAN_COLUMN_SECURITY, security,
121                                         -1);
122 -       } else if (g_str_equal(property, "PassPhrase") == TRUE) {
123 -               const char *passphrase = value ? g_value_get_string(value) : NULL;
124 -               gtk_tree_store_set(store, &iter,
125 -                                       CONNMAN_COLUMN_PASSPHRASE, passphrase,
126 -                                       -1);
127         } else if (g_str_equal(property, "Strength") == TRUE) {
128                 guint strength = g_value_get_uchar(value);
129                 gtk_tree_store_set(store, &iter,
130 @@ -406,7 +401,7 @@ static void service_properties(DBusGProxy *proxy, GHashTable *hash,
131  {
132         GtkTreeStore *store = user_data;
133         GValue *value;
134 -       const gchar *name, *icon, *passphrase, *security, *state;
135 +       const gchar *name, *icon, *security, *state;
136         guint type, strength;
137         gboolean favorite;
138         GtkTreeIter iter;
139 @@ -439,9 +434,6 @@ static void service_properties(DBusGProxy *proxy, GHashTable *hash,
140         value = g_hash_table_lookup(hash, "Security");
141         security = value ? g_strjoinv(" ", g_value_get_boxed(value)) : NULL;
142  
143 -       value = g_hash_table_lookup(hash, "PassPhrase");
144 -       passphrase = value ? g_value_get_string(value) : NULL;
145 -
146         DBG("name %s type %d icon %s", name, type, icon);
147  
148         value = g_hash_table_lookup(hash, "IPv4.Configuration");
149 @@ -499,7 +491,6 @@ static void service_properties(DBusGProxy *proxy, GHashTable *hash,
150                                 CONNMAN_COLUMN_STATE, state,
151                                 CONNMAN_COLUMN_FAVORITE, favorite,
152                                 CONNMAN_COLUMN_SECURITY, security,
153 -                               CONNMAN_COLUMN_PASSPHRASE, passphrase,
154                                 CONNMAN_COLUMN_STRENGTH, strength,
155                                 CONNMAN_COLUMN_METHOD, method,
156                                 CONNMAN_COLUMN_ADDRESS, addr,
157 diff --git a/properties/advanced.h b/properties/advanced.h
158 index d8f4117..553a15e 100644
159 --- a/properties/advanced.h
160 +++ b/properties/advanced.h
161 @@ -53,7 +53,6 @@ struct config_data {
162                 GtkWidget *name;
163                 GtkWidget *security;
164                 GtkWidget *strength;
165 -               GtkWidget *passphrase;
166                 GtkWidget *connect_info;
167                 GtkWidget *connect;
168                 GtkWidget *disconnect;
169 diff --git a/properties/wifi.c b/properties/wifi.c
170 index 038d35a..bd325ef 100644
171 --- a/properties/wifi.c
172 +++ b/properties/wifi.c
173 @@ -57,17 +57,6 @@ static void connect_callback(GtkWidget *editable, gpointer user_data)
174         gboolean ret;
175         gint active;
176  
177 -       if (data->wifi.passphrase) {
178 -               char *passphrase;
179 -               passphrase = (gchar *)gtk_entry_get_text(GTK_ENTRY(data->wifi.passphrase));
180 -               ret = connman_client_set_passphrase(data->client, data->device,
181 -                               passphrase);
182 -
183 -               if (ret == FALSE) {
184 -                       return;
185 -               }
186 -       }
187 -
188         active = gtk_combo_box_get_active(GTK_COMBO_BOX(data->policy.config));
189         data->ipv4_config.method = active ? "manual" : "dhcp";
190         data->ipv4_config.address = active ? gtk_entry_get_text(GTK_ENTRY(data->ipv4.entry[0])) : NULL;
191 @@ -250,22 +239,11 @@ static void wifi_ipconfig(GtkWidget *table, struct config_data *data, GtkTreeIte
192                         G_CALLBACK(changed_callback), data);
193  }
194  
195 -static void toggled_callback(GtkWidget *button, gpointer user_data)
196 -{
197 -       GtkWidget *entry = user_data;
198 -       gboolean mode;
199 -
200 -       mode = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button));
201 -
202 -       gtk_entry_set_visibility(GTK_ENTRY(entry), mode);
203 -}
204 -
205  void add_wifi_service(GtkWidget *mainbox, GtkTreeIter *iter, struct config_data *data)
206  {
207         GtkWidget *vbox;
208         GtkWidget *table;
209         GtkWidget *label;
210 -       GtkWidget *entry;
211         GtkWidget *button;
212  
213         const char *name, *security, *icon, *state;
214 @@ -308,32 +286,6 @@ void add_wifi_service(GtkWidget *mainbox, GtkTreeIter *iter, struct config_data
215         gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
216         data->wifi.security = label;
217  
218 -       label = gtk_label_new(_("Passphrase:"));
219 -       gtk_table_attach_defaults(GTK_TABLE(table), label, 1, 2, 2, 3);
220 -
221 -       if (g_str_equal(security, "none") != TRUE &&
222 -                       g_str_equal(security, "unknown") != TRUE) {
223 -               entry = gtk_entry_new();
224 -               gtk_entry_set_max_length (GTK_ENTRY (entry), 64);
225 -               gtk_table_attach_defaults(GTK_TABLE(table), entry, 2, 4, 2, 3);
226 -               gtk_entry_set_visibility(GTK_ENTRY(entry), 0);
227 -               data->wifi.passphrase = entry;
228 -
229 -               button = gtk_check_button_new_with_label(_("Show input"));
230 -               gtk_table_attach_defaults(GTK_TABLE(table), button, 4, 5, 2, 3);
231 -
232 -               g_signal_connect(G_OBJECT(button), "toggled",
233 -                               G_CALLBACK(toggled_callback), entry);
234 -
235 -
236 -       } else {
237 -               label = gtk_label_new(_("none"));
238 -               gtk_table_attach_defaults(GTK_TABLE(table), label, 2, 4, 2, 3);
239 -               gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT);
240 -               gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
241 -               data->wifi.passphrase = NULL;
242 -       }
243 -
244         label = gtk_label_new(_(""));
245         gtk_table_attach_defaults(GTK_TABLE(table), label, 2, 3, 8, 9);
246         gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0);
247 -- 
248 1.7.5.4
249