aboutsummaryrefslogtreecommitdiff
path: root/src/peerinfo/gnunet-peerinfo-gtk.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/peerinfo/gnunet-peerinfo-gtk.c')
-rw-r--r--src/peerinfo/gnunet-peerinfo-gtk.c56
1 files changed, 19 insertions, 37 deletions
diff --git a/src/peerinfo/gnunet-peerinfo-gtk.c b/src/peerinfo/gnunet-peerinfo-gtk.c
index 7ff8acb5..d205ad88 100644
--- a/src/peerinfo/gnunet-peerinfo-gtk.c
+++ b/src/peerinfo/gnunet-peerinfo-gtk.c
@@ -165,8 +165,7 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
165 * @param address address as a string, NULL on error 165 * @param address address as a string, NULL on error
166 */ 166 */
167static void 167static void
168peer_address_string_cb (void *cls, 168peer_address_string_cb (void *cls, const char *address)
169 const char *address)
170{ 169{
171 struct PeerInfo *info = cls; 170 struct PeerInfo *info = cls;
172 GtkListStore *ls; 171 GtkListStore *ls;
@@ -183,16 +182,11 @@ peer_address_string_cb (void *cls,
183 path = gtk_tree_row_reference_get_path (info->rr); 182 path = gtk_tree_row_reference_get_path (info->rr);
184 GNUNET_assert (NULL != path); 183 GNUNET_assert (NULL != path);
185 GNUNET_assert (TRUE == gtk_tree_model_get_iter (tm, &iter, path)); 184 GNUNET_assert (TRUE == gtk_tree_model_get_iter (tm, &iter, path));
186 gtk_tree_path_free (path); 185 gtk_tree_path_free (path);
187 if (NULL == address) 186 if (NULL == address)
188 { 187 {
189 /* error */ 188 /* error */
190 gtk_list_store_set (ls, &iter, 189 gtk_list_store_set (ls, &iter, 1, 1, 2, NULL, 3, NULL, 6, "<error>", -1);
191 1, 1,
192 2, NULL,
193 3, NULL,
194 6, "<error>",
195 -1);
196 } 190 }
197 else 191 else
198 { 192 {
@@ -207,12 +201,8 @@ peer_address_string_cb (void *cls,
207 if ('.' == *dot) 201 if ('.' == *dot)
208 country = GNUNET_strndup (&dot[1], (colon - dot) - 1); 202 country = GNUNET_strndup (&dot[1], (colon - dot) - 1);
209 } 203 }
210 gtk_list_store_set (ls, &iter, 204 gtk_list_store_set (ls, &iter, 1, 1, 2, country, 3,
211 1, 1, 205 GNUNET_PEERINFO_GTK_get_flag (country), 6, address, -1);
212 2, country,
213 3, GNUNET_PEERINFO_GTK_get_flag (country),
214 6, address,
215 -1);
216 GNUNET_free (country); 206 GNUNET_free (country);
217 } 207 }
218} 208}
@@ -226,9 +216,8 @@ peer_address_string_cb (void *cls,
226 * @param address NULL on disconnect, otherwise 0-terminated printable UTF-8 string 216 * @param address NULL on disconnect, otherwise 0-terminated printable UTF-8 string
227 */ 217 */
228static void 218static void
229peer_address_cb (void *cls, 219peer_address_cb (void *cls, const struct GNUNET_PeerIdentity *peer,
230 const struct GNUNET_PeerIdentity *peer, 220 const struct GNUNET_HELLO_Address *address)
231 const struct GNUNET_HELLO_Address *address)
232{ 221{
233 struct PeerInfo *info = cls; 222 struct PeerInfo *info = cls;
234 GtkListStore *ls; 223 GtkListStore *ls;
@@ -245,22 +234,17 @@ peer_address_cb (void *cls,
245 GNUNET_assert (NULL != path); 234 GNUNET_assert (NULL != path);
246 GNUNET_assert (TRUE == gtk_tree_model_get_iter (tm, &iter, path)); 235 GNUNET_assert (TRUE == gtk_tree_model_get_iter (tm, &iter, path));
247 gtk_tree_path_free (path); 236 gtk_tree_path_free (path);
248 gtk_list_store_set (ls, &iter, 237 gtk_list_store_set (ls, &iter, 1, 0, 2, NULL, 3, NULL, 6, "<disconnected>",
249 1, 0, 238 -1);
250 2, NULL,
251 3, NULL,
252 6, "<disconnected>",
253 -1);
254 return; 239 return;
255 } 240 }
256 if (NULL != info->tos) 241 if (NULL != info->tos)
257 GNUNET_TRANSPORT_address_to_string_cancel (info->tos); 242 GNUNET_TRANSPORT_address_to_string_cancel (info->tos);
258 info->tos = GNUNET_TRANSPORT_address_to_string (get_configuration (), 243 info->tos =
259 address, 244 GNUNET_TRANSPORT_address_to_string (get_configuration (), address,
260 GNUNET_NO, 245 GNUNET_NO,
261 GNUNET_TIME_UNIT_FOREVER_REL, 246 GNUNET_TIME_UNIT_FOREVER_REL,
262 &peer_address_string_cb, 247 &peer_address_string_cb, info);
263 info);
264} 248}
265 249
266 250
@@ -319,9 +303,9 @@ peerinfo_processor (void *cls, const struct GNUNET_PeerIdentity *peer,
319 { 303 {
320 info->palc = 304 info->palc =
321 GNUNET_TRANSPORT_peer_get_active_addresses (get_configuration (), peer, 305 GNUNET_TRANSPORT_peer_get_active_addresses (get_configuration (), peer,
322 GNUNET_NO, 306 GNUNET_NO,
323 GNUNET_TIME_UNIT_FOREVER_REL, 307 GNUNET_TIME_UNIT_FOREVER_REL,
324 &peer_address_cb, info); 308 &peer_address_cb, info);
325 } 309 }
326} 310}
327 311
@@ -401,9 +385,7 @@ run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
401 exit (1); 385 exit (1);
402 } 386 }
403#if FIXME 387#if FIXME
404 ats = 388 ats = GNUNET_ATS_connect (get_configuration (), &status_cb, NULL);
405 GNUNET_ATS_connect (get_configuration (),
406 &status_cb, NULL);
407#endif 389#endif
408 /* setup main window */ 390 /* setup main window */
409 main_window = GTK_WIDGET (get_object ("GNUNET_PEERINFO_GTK_main_window")); 391 main_window = GTK_WIDGET (get_object ("GNUNET_PEERINFO_GTK_main_window"));