aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/peers/peers.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/peers/peers.c')
-rw-r--r--src/plugins/peers/peers.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/plugins/peers/peers.c b/src/plugins/peers/peers.c
index 8d2343a6..09c133b6 100644
--- a/src/plugins/peers/peers.c
+++ b/src/plugins/peers/peers.c
@@ -34,6 +34,8 @@
34#include <GNUnet/gnunet_util_network_client.h> 34#include <GNUnet/gnunet_util_network_client.h>
35#include <gtk/gtk.h> 35#include <gtk/gtk.h>
36 36
37#define REFRESH_RATE (15 * cronSECONDS)
38
37static struct CronManager * cron; 39static struct CronManager * cron;
38 40
39static struct GE_Context * ectx; 41static struct GE_Context * ectx;
@@ -358,27 +360,23 @@ void init_peers(struct GE_Context * e,
358 FREE(fn); 360 FREE(fn);
359 FREE(dir); 361 FREE(dir);
360 362
361 updatePeerInfo(NULL);
362 tab 363 tab
363 = glade_xml_get_widget(getMainXML(), 364 = glade_xml_get_widget(getMainXML(),
364 "peersScrolledWindow"); 365 "peersScrolledWindow");
365 gtk_widget_show(tab); 366 gtk_widget_show(tab);
366 cron = cron_create(ectx); 367 cron = gnunet_gtk_get_cron();
367 cron_add_job(cron, 368 cron_add_job(cron,
368 &updatePeerInfo, 369 &updatePeerInfo,
369 120 * cronSECONDS, 370 REFRESH_RATE,
370 120 * cronSECONDS, 371 REFRESH_RATE,
371 NULL); 372 NULL);
372 cron_start(cron);
373} 373}
374 374
375void done_peers() { 375void done_peers() {
376 cron_stop(cron);
377 cron_del_job(cron, 376 cron_del_job(cron,
378 &updatePeerInfo, 377 &updatePeerInfo,
379 120 * cronSECONDS, 378 REFRESH_RATE,
380 NULL); 379 NULL);
381 cron_destroy(cron);
382 if (red != NULL) 380 if (red != NULL)
383 g_object_unref(red); 381 g_object_unref(red);
384 if (green != NULL) 382 if (green != NULL)