diff options
author | Christian Grothoff <christian@grothoff.org> | 2007-06-11 01:39:24 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2007-06-11 01:39:24 +0000 |
commit | ce729f1482f62a9fd96de6ae0acdc1b4c50149ab (patch) | |
tree | 784e045c13be4f1595ed067faf437893ddc97e3b | |
parent | e1d730dd67d617e6a10ff36b86cb86520593b45d (diff) | |
download | gnunet-gtk-ce729f1482f62a9fd96de6ae0acdc1b4c50149ab.tar.gz gnunet-gtk-ce729f1482f62a9fd96de6ae0acdc1b4c50149ab.zip |
updated NS APIs, cleaning up glade texts
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | TODO | 4 | ||||
-rw-r--r-- | gnunet-gtk.glade | 18 | ||||
-rw-r--r-- | src/common/Makefile.am | 1 | ||||
-rw-r--r-- | src/common/helper.c | 11 | ||||
-rw-r--r-- | src/include/gnunetgtk_common.h | 7 | ||||
-rw-r--r-- | src/plugins/daemon/daemon.c | 6 | ||||
-rw-r--r-- | src/plugins/fs/namespace.c | 9 | ||||
-rw-r--r-- | src/plugins/fs/namespace_create.c | 2 | ||||
-rw-r--r-- | src/plugins/fs/namespace_search.c | 59 | ||||
-rw-r--r-- | src/plugins/peers/peers.c | 14 | ||||
-rw-r--r-- | src/plugins/stats/functions.c | 7 |
12 files changed, 86 insertions, 55 deletions
@@ -1,3 +1,6 @@ | |||
1 | Sun Jun 10 19:32:33 MDT 2007 | ||
2 | Completed support for namespaces. | ||
3 | |||
1 | Thu May 31 20:53:50 MDT 2007 | 4 | Thu May 31 20:53:50 MDT 2007 |
2 | Added peer-info tab. You must load the new "peers" module | 5 | Added peer-info tab. You must load the new "peers" module |
3 | to see it. | 6 | to see it. |
@@ -4,10 +4,6 @@ Annotations: | |||
4 | RC == Release Critical | 4 | RC == Release Critical |
5 | 5 | ||
6 | 6 | ||
7 | 0.7.2 (goal: re-enable all 0.7.0 features): | ||
8 | - test namespace search | ||
9 | |||
10 | |||
11 | 0.7.3 (goal: polish): | 7 | 0.7.3 (goal: polish): |
12 | - #1045: ability to pause a search => requires FSUI changes! [RC] | 8 | - #1045: ability to pause a search => requires FSUI changes! [RC] |
13 | - improve collection handling [RC] | 9 | - improve collection handling [RC] |
diff --git a/gnunet-gtk.glade b/gnunet-gtk.glade index 88feee45..3f589dd4 100644 --- a/gnunet-gtk.glade +++ b/gnunet-gtk.glade | |||
@@ -87,7 +87,7 @@ | |||
87 | <child> | 87 | <child> |
88 | <widget class="GtkLabel" id="titleLabel"> | 88 | <widget class="GtkLabel" id="titleLabel"> |
89 | <property name="visible">True</property> | 89 | <property name="visible">True</property> |
90 | <property name="label" translatable="yes"><span size="x-large">Welcome to gnunet-gtk 0.7.1c</span></property> | 90 | <property name="label" translatable="yes"><span size="x-large">Welcome to gnunet-gtk 0.7.2</span></property> |
91 | <property name="use_underline">False</property> | 91 | <property name="use_underline">False</property> |
92 | <property name="use_markup">True</property> | 92 | <property name="use_markup">True</property> |
93 | <property name="justify">GTK_JUSTIFY_CENTER</property> | 93 | <property name="justify">GTK_JUSTIFY_CENTER</property> |
@@ -130,9 +130,9 @@ Thank you, | |||
130 | 130 | ||
131 | The GNUnet Team | 131 | The GNUnet Team |
132 | 132 | ||
133 | <span size="x-large">Known problems</span> | 133 | <span size="x-large">Changes from gnunet-gtk 0.7.1c:</span> |
134 | 134 | ||
135 | Advanced file-sharing features (in particular interactive assembly of directories and namespaces) still need work in this version. If you find any bugs, please report them to our bugtracking system at https://gnunet.org/mantis/. | 135 | This version implements the advanced file-sharing features (in particular interactive assembly of namespaces). Searching for content in namespace is also finally available. Namespaces that are found are announced in a message window. It is now also possible to do non-anonymous file-sharing by selecting an anonymity level of zero. You will be warned that you have no anonymity by the spin button turning red -- this does not indicate an error. A new tab showing the known peers, their current bandwidth allocation and trust levels has been added. |
136 | 136 | ||
137 | <span size="x-large">Changes from gnunet-gtk 0.7.1:</span> | 137 | <span size="x-large">Changes from gnunet-gtk 0.7.1:</span> |
138 | 138 | ||
@@ -4227,7 +4227,7 @@ Press ENTER to add the data.</atkproperty> | |||
4227 | <widget class="GtkTreeView" id="metaDataDialogMetaDataList"> | 4227 | <widget class="GtkTreeView" id="metaDataDialogMetaDataList"> |
4228 | <property agent="glademm" name="cxx_visibility">public</property> | 4228 | <property agent="glademm" name="cxx_visibility">public</property> |
4229 | <property name="visible">True</property> | 4229 | <property name="visible">True</property> |
4230 | <property name="tooltip" translatable="yes">Select entries and use the context menu (right click) in order to delete keywords.</property> | 4230 | <property name="tooltip" translatable="yes">Select entries and use the button to delete keywords.</property> |
4231 | <property name="can_focus">True</property> | 4231 | <property name="can_focus">True</property> |
4232 | <property name="headers_visible">False</property> | 4232 | <property name="headers_visible">False</property> |
4233 | <property name="rules_hint">True</property> | 4233 | <property name="rules_hint">True</property> |
@@ -4393,7 +4393,7 @@ Press ENTER to add the data.</atkproperty> | |||
4393 | <widget class="GtkTreeView" id="metaDataDialogKeywordList"> | 4393 | <widget class="GtkTreeView" id="metaDataDialogKeywordList"> |
4394 | <property agent="glademm" name="cxx_visibility">public</property> | 4394 | <property agent="glademm" name="cxx_visibility">public</property> |
4395 | <property name="visible">True</property> | 4395 | <property name="visible">True</property> |
4396 | <property name="tooltip" translatable="yes">Select entries and use the context menu (right click) in order to delete keywords.</property> | 4396 | <property name="tooltip" translatable="yes">Select entries and use the button to delete keywords.</property> |
4397 | <property name="can_focus">True</property> | 4397 | <property name="can_focus">True</property> |
4398 | <property name="headers_visible">False</property> | 4398 | <property name="headers_visible">False</property> |
4399 | <property name="rules_hint">True</property> | 4399 | <property name="rules_hint">True</property> |
@@ -5354,7 +5354,7 @@ Press ENTER to add the data.</atkproperty> | |||
5354 | <property name="tooltip" translatable="yes">The gnunet-gtk about dialog</property> | 5354 | <property name="tooltip" translatable="yes">The gnunet-gtk about dialog</property> |
5355 | <property name="destroy_with_parent">False</property> | 5355 | <property name="destroy_with_parent">False</property> |
5356 | <property name="name" translatable="yes">gnunet-gtk</property> | 5356 | <property name="name" translatable="yes">gnunet-gtk</property> |
5357 | <property name="copyright" translatable="yes">(C) 2001-2006 Christian Grothoff (and other contributing authors)</property> | 5357 | <property name="copyright" translatable="yes">(C) 2001-2007 Christian Grothoff (and other contributing authors)</property> |
5358 | <property name="comments" translatable="yes">https://gnunet.org/</property> | 5358 | <property name="comments" translatable="yes">https://gnunet.org/</property> |
5359 | <property name="license" translatable="yes"> GNU GENERAL PUBLIC LICENSE | 5359 | <property name="license" translatable="yes"> GNU GENERAL PUBLIC LICENSE |
5360 | Version 2, June 1991 | 5360 | Version 2, June 1991 |
@@ -6143,7 +6143,7 @@ Daniel Nylander <po@danielnylander.se> | |||
6143 | <widget class="GtkTreeView" id="namespaceMetaDataDialogKeywordList"> | 6143 | <widget class="GtkTreeView" id="namespaceMetaDataDialogKeywordList"> |
6144 | <property agent="glademm" name="cxx_visibility">public</property> | 6144 | <property agent="glademm" name="cxx_visibility">public</property> |
6145 | <property name="visible">True</property> | 6145 | <property name="visible">True</property> |
6146 | <property name="tooltip" translatable="yes">Select entries and use the context menu (right click) in order to delete keywords.</property> | 6146 | <property name="tooltip" translatable="yes">Select entries and use the button to delete keywords.</property> |
6147 | <property name="can_focus">True</property> | 6147 | <property name="can_focus">True</property> |
6148 | <property name="headers_visible">True</property> | 6148 | <property name="headers_visible">True</property> |
6149 | <property name="rules_hint">True</property> | 6149 | <property name="rules_hint">True</property> |
@@ -6345,7 +6345,7 @@ Daniel Nylander <po@danielnylander.se> | |||
6345 | <widget class="GtkTreeView" id="namespaceMetaDataDialogMetaDataList"> | 6345 | <widget class="GtkTreeView" id="namespaceMetaDataDialogMetaDataList"> |
6346 | <property agent="glademm" name="cxx_visibility">public</property> | 6346 | <property agent="glademm" name="cxx_visibility">public</property> |
6347 | <property name="visible">True</property> | 6347 | <property name="visible">True</property> |
6348 | <property name="tooltip" translatable="yes">Metadata describing the namespace (used in advertisements). Use the context menu (right-click) to delete selected entries.</property> | 6348 | <property name="tooltip" translatable="yes">Metadata describing the namespace (used in advertisements).</property> |
6349 | <property name="can_focus">True</property> | 6349 | <property name="can_focus">True</property> |
6350 | <property name="headers_visible">True</property> | 6350 | <property name="headers_visible">True</property> |
6351 | <property name="rules_hint">True</property> | 6351 | <property name="rules_hint">True</property> |
@@ -7238,7 +7238,7 @@ Daniel Nylander <po@danielnylander.se> | |||
7238 | <widget class="GtkTreeView" id="collectionMetaDataTreeView"> | 7238 | <widget class="GtkTreeView" id="collectionMetaDataTreeView"> |
7239 | <property agent="glademm" name="cxx_visibility">public</property> | 7239 | <property agent="glademm" name="cxx_visibility">public</property> |
7240 | <property name="visible">True</property> | 7240 | <property name="visible">True</property> |
7241 | <property name="tooltip" translatable="yes">Select entries and use the context menu (right click) in order to delete keywords.</property> | 7241 | <property name="tooltip" translatable="yes">Select entries and use the button to delete keywords.</property> |
7242 | <property name="can_focus">True</property> | 7242 | <property name="can_focus">True</property> |
7243 | <property name="headers_visible">True</property> | 7243 | <property name="headers_visible">True</property> |
7244 | <property name="rules_hint">True</property> | 7244 | <property name="rules_hint">True</property> |
diff --git a/src/common/Makefile.am b/src/common/Makefile.am index d34269b2..ab6699ce 100644 --- a/src/common/Makefile.am +++ b/src/common/Makefile.am | |||
@@ -23,6 +23,7 @@ libgnunetgtk_common_la_LIBADD = \ | |||
23 | $(INTLLIBS) \ | 23 | $(INTLLIBS) \ |
24 | -lgnunetutil \ | 24 | -lgnunetutil \ |
25 | -lgnunetutil_crypto \ | 25 | -lgnunetutil_crypto \ |
26 | -lgnunetutil_cron \ | ||
26 | -lgthread-2.0 \ | 27 | -lgthread-2.0 \ |
27 | $(LIBNOTIFY_LIBS) | 28 | $(LIBNOTIFY_LIBS) |
28 | 29 | ||
diff --git a/src/common/helper.c b/src/common/helper.c index 2a23799b..64a01a23 100644 --- a/src/common/helper.c +++ b/src/common/helper.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include "platform.h" | 27 | #include "platform.h" |
28 | #include "gnunetgtk_common.h" | 28 | #include "gnunetgtk_common.h" |
29 | #include <GNUnet/gnunet_util_crypto.h> | 29 | #include <GNUnet/gnunet_util_crypto.h> |
30 | #include <GNUnet/gnunet_util_cron.h> | ||
30 | #include <glib.h> | 31 | #include <glib.h> |
31 | #include <gmodule.h> | 32 | #include <gmodule.h> |
32 | 33 | ||
@@ -83,6 +84,12 @@ static struct GE_Context * ectx; | |||
83 | 84 | ||
84 | static struct GC_Configuration * cfg; | 85 | static struct GC_Configuration * cfg; |
85 | 86 | ||
87 | static struct CronManager * cron; | ||
88 | |||
89 | struct CronManager * gnunet_gtk_get_cron() { | ||
90 | return cron; | ||
91 | } | ||
92 | |||
86 | static gboolean saveCallWrapper(gpointer data) { | 93 | static gboolean saveCallWrapper(gpointer data) { |
87 | SaveCall * call = data; | 94 | SaveCall * call = data; |
88 | int i; | 95 | int i; |
@@ -293,6 +300,7 @@ void initGNUnetGTKCommon(struct GE_Context * e, | |||
293 | sclock = MUTEX_CREATE(YES); | 300 | sclock = MUTEX_CREATE(YES); |
294 | mainThread = PTHREAD_GET_SELF(); | 301 | mainThread = PTHREAD_GET_SELF(); |
295 | saveCallsUp = YES; | 302 | saveCallsUp = YES; |
303 | cron = cron_create(ectx); | ||
296 | 304 | ||
297 | /* load the interface */ | 305 | /* load the interface */ |
298 | path = os_get_installation_path(IPK_DATADIR); | 306 | path = os_get_installation_path(IPK_DATADIR); |
@@ -326,11 +334,13 @@ void initGNUnetGTKCommon(struct GE_Context * e, | |||
326 | loadPlugins(load); | 334 | loadPlugins(load); |
327 | FREE(load); | 335 | FREE(load); |
328 | connectGladeWithPlugins(mainXML); | 336 | connectGladeWithPlugins(mainXML); |
337 | cron_start(cron); | ||
329 | } | 338 | } |
330 | 339 | ||
331 | void shutdownPlugins() { | 340 | void shutdownPlugins() { |
332 | int i; | 341 | int i; |
333 | 342 | ||
343 | cron_stop(cron); | ||
334 | /* unload the plugins */ | 344 | /* unload the plugins */ |
335 | while (plugin != NULL) { | 345 | while (plugin != NULL) { |
336 | Plugin * next; | 346 | Plugin * next; |
@@ -362,6 +372,7 @@ void shutdownPlugins() { | |||
362 | } | 372 | } |
363 | 373 | ||
364 | void doneGNUnetGTKCommon() { | 374 | void doneGNUnetGTKCommon() { |
375 | cron_destroy(cron); | ||
365 | PTHREAD_REL_SELF(mainThread); | 376 | PTHREAD_REL_SELF(mainThread); |
366 | MUTEX_DESTROY(sclock); | 377 | MUTEX_DESTROY(sclock); |
367 | } | 378 | } |
diff --git a/src/include/gnunetgtk_common.h b/src/include/gnunetgtk_common.h index c1f37beb..52bc05f9 100644 --- a/src/include/gnunetgtk_common.h +++ b/src/include/gnunetgtk_common.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet | 2 | This file is part of GNUnet |
3 | (C) 2005, 2006 Christian Grothoff (and other contributing authors) | 3 | (C) 2005, 2006, 2007 Christian Grothoff (and other contributing authors) |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published | 6 | it under the terms of the GNU General Public License as published |
7 | by the Free Software Foundation; either version 2, or (at your | 7 | by the Free Software Foundation; either version 2, or (at your |
@@ -162,4 +162,7 @@ void ggc_tree_model_foreach(GtkTreeModel * model, | |||
162 | GtkTreeSelectionForeachFunc func, | 162 | GtkTreeSelectionForeachFunc func, |
163 | gpointer data); | 163 | gpointer data); |
164 | 164 | ||
165 | |||
166 | struct CronManager * gnunet_gtk_get_cron(void); | ||
167 | |||
165 | #endif | 168 | #endif |
diff --git a/src/plugins/daemon/daemon.c b/src/plugins/daemon/daemon.c index 252f6fdd..1898d979 100644 --- a/src/plugins/daemon/daemon.c +++ b/src/plugins/daemon/daemon.c | |||
@@ -337,7 +337,6 @@ void init_daemon(struct GE_Context * e, | |||
337 | col - 1), | 337 | col - 1), |
338 | TRUE); | 338 | TRUE); |
339 | 339 | ||
340 | updateAppModelSafe(NULL); | ||
341 | tab | 340 | tab |
342 | = glade_xml_get_widget(getMainXML(), | 341 | = glade_xml_get_widget(getMainXML(), |
343 | "daemonScrolledWindow"); | 342 | "daemonScrolledWindow"); |
@@ -358,7 +357,7 @@ void init_daemon(struct GE_Context * e, | |||
358 | } | 357 | } |
359 | FREE(daemon_config); | 358 | FREE(daemon_config); |
360 | 359 | ||
361 | cron = cron_create(ectx); | 360 | cron = gnunet_gtk_get_cron(); |
362 | cron_add_job(cron, | 361 | cron_add_job(cron, |
363 | &cronCheckDaemon, | 362 | &cronCheckDaemon, |
364 | 0, | 363 | 0, |
@@ -369,11 +368,9 @@ void init_daemon(struct GE_Context * e, | |||
369 | 5 * cronMINUTES, | 368 | 5 * cronMINUTES, |
370 | 5 * cronMINUTES, | 369 | 5 * cronMINUTES, |
371 | NULL); | 370 | NULL); |
372 | cron_start(cron); | ||
373 | } | 371 | } |
374 | 372 | ||
375 | void done_daemon() { | 373 | void done_daemon() { |
376 | cron_stop(cron); | ||
377 | cron_del_job(cron, | 374 | cron_del_job(cron, |
378 | &cronCheckDaemon, | 375 | &cronCheckDaemon, |
379 | 15 * cronSECONDS, | 376 | 15 * cronSECONDS, |
@@ -382,7 +379,6 @@ void done_daemon() { | |||
382 | &updateAppModel, | 379 | &updateAppModel, |
383 | 5 * cronMINUTES, | 380 | 5 * cronMINUTES, |
384 | NULL); | 381 | NULL); |
385 | cron_destroy(cron); | ||
386 | } | 382 | } |
387 | 383 | ||
388 | /** | 384 | /** |
diff --git a/src/plugins/fs/namespace.c b/src/plugins/fs/namespace.c index e0c58082..d125ba75 100644 --- a/src/plugins/fs/namespace.c +++ b/src/plugins/fs/namespace.c | |||
@@ -425,6 +425,11 @@ int addTabForNamespace(void * unused, | |||
425 | GtkWidget * notebook; | 425 | GtkWidget * notebook; |
426 | GtkWidget * del_menu; | 426 | GtkWidget * del_menu; |
427 | 427 | ||
428 | if (OK != ECRS_testNamespaceExists(NULL, | ||
429 | cfg, | ||
430 | namespaceName, | ||
431 | namespaceId)) | ||
432 | return OK; | ||
428 | DEBUG_BEGIN(); | 433 | DEBUG_BEGIN(); |
429 | label = gtk_label_new(namespaceName); | 434 | label = gtk_label_new(namespaceName); |
430 | list = MALLOC(sizeof(NamespaceList)); | 435 | list = MALLOC(sizeof(NamespaceList)); |
@@ -625,7 +630,7 @@ static void addToNamespaceCB(GtkTreeModel * model, | |||
625 | cfg, | 630 | cfg, |
626 | cls->anonymityLevel, | 631 | cls->anonymityLevel, |
627 | 1000, /* FIXME: priority */ | 632 | 1000, /* FIXME: priority */ |
628 | get_time() + 999999, /* FIXME: expiration */ | 633 | get_time() + 2 * cronYEARS, /* FIXME: expiration */ |
629 | cls->namespaceName, | 634 | cls->namespaceName, |
630 | cls->updateInterval, | 635 | cls->updateInterval, |
631 | cls->lastId, | 636 | cls->lastId, |
@@ -1045,12 +1050,10 @@ void fs_namespace_start() { | |||
1045 | NULL); | 1050 | NULL); |
1046 | NS_listNamespaces(ectx, | 1051 | NS_listNamespaces(ectx, |
1047 | cfg, | 1052 | cfg, |
1048 | YES, | ||
1049 | &addTabForNamespace, | 1053 | &addTabForNamespace, |
1050 | NULL); | 1054 | NULL); |
1051 | NS_registerDiscoveryCallback(ectx, | 1055 | NS_registerDiscoveryCallback(ectx, |
1052 | cfg, | 1056 | cfg, |
1053 | NO, | ||
1054 | &namespace_discovered_cb, | 1057 | &namespace_discovered_cb, |
1055 | NULL); | 1058 | NULL); |
1056 | DEBUG_END(); | 1059 | DEBUG_END(); |
diff --git a/src/plugins/fs/namespace_create.c b/src/plugins/fs/namespace_create.c index 2f8ae46e..cdd24912 100644 --- a/src/plugins/fs/namespace_create.c +++ b/src/plugins/fs/namespace_create.c | |||
@@ -216,7 +216,7 @@ void create_namespace_clicked_fs(GtkWidget * dummy1, | |||
216 | gtk_spin_button_get_value_as_int | 216 | gtk_spin_button_get_value_as_int |
217 | (GTK_SPIN_BUTTON(spin)), | 217 | (GTK_SPIN_BUTTON(spin)), |
218 | 1000, /* FIXME: priority */ | 218 | 1000, /* FIXME: priority */ |
219 | get_time() + 999999, /* FIXME: expiration */ | 219 | get_time() + 2 * cronYEARS, /* FIXME: expiration */ |
220 | namespaceName, | 220 | namespaceName, |
221 | meta, | 221 | meta, |
222 | keywordURI, | 222 | keywordURI, |
diff --git a/src/plugins/fs/namespace_search.c b/src/plugins/fs/namespace_search.c index 9a31e23d..61db35d7 100644 --- a/src/plugins/fs/namespace_search.c +++ b/src/plugins/fs/namespace_search.c | |||
@@ -160,17 +160,20 @@ void on_searchNamespaceComboBoxEntry_changed_fs(GtkWidget * dummy, | |||
160 | rating); | 160 | rating); |
161 | gtk_widget_set_sensitive(spin, | 161 | gtk_widget_set_sensitive(spin, |
162 | TRUE); | 162 | TRUE); |
163 | keyword | ||
164 | = glade_xml_get_widget(getMainXML(), | ||
165 | "fssearchKeywordComboBoxEntry"); | ||
163 | if (OK == NS_getNamespaceRoot(ectx, | 166 | if (OK == NS_getNamespaceRoot(ectx, |
164 | cfg, | 167 | cfg, |
165 | encStr, | 168 | encStr, |
166 | &root)) { | 169 | &root)) { |
167 | hash2enc(&root, | 170 | hash2enc(&root, |
168 | &enc); | 171 | &enc); |
169 | keyword | ||
170 | = glade_xml_get_widget(getMainXML(), | ||
171 | "fssearchKeywordComboBoxEntry"); | ||
172 | gtk_entry_set_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN(keyword))), | 172 | gtk_entry_set_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN(keyword))), |
173 | (const gchar*) &enc); | 173 | (const gchar*) &enc); |
174 | } else { | ||
175 | gtk_entry_set_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN(keyword))), | ||
176 | ""); | ||
174 | } | 177 | } |
175 | } | 178 | } |
176 | } else { | 179 | } else { |
@@ -204,6 +207,8 @@ static void * saveDiscovery(void * cls) { | |||
204 | GtkWidget * ncbe; | 207 | GtkWidget * ncbe; |
205 | char * desc; | 208 | char * desc; |
206 | size_t n; | 209 | size_t n; |
210 | int found; | ||
211 | char * encName; | ||
207 | 212 | ||
208 | DEBUG_BEGIN(); | 213 | DEBUG_BEGIN(); |
209 | ncbe | 214 | ncbe |
@@ -242,20 +247,40 @@ static void * saveDiscovery(void * cls) { | |||
242 | desc, | 247 | desc, |
243 | 20, | 248 | 20, |
244 | &enc); | 249 | &enc); |
245 | infoMessage(YES, | 250 | /* check if present! */ |
246 | _("Namespace found: %s - %.*s\n"), | 251 | found = NO; |
247 | desc, | 252 | if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(model), |
248 | 20, | 253 | &iter)) { |
249 | &enc); | 254 | do { |
250 | gtk_list_store_append(model, | 255 | gtk_tree_model_get(GTK_TREE_MODEL(model), |
251 | &iter); | 256 | &iter, |
252 | gtk_list_store_set(model, | 257 | NS_SEARCH_ENCNAME, &encName, |
253 | &iter, | 258 | -1); |
254 | NS_SEARCH_DESCRIPTION, name, | 259 | if ( (encName != NULL) && |
255 | NS_SEARCH_ENCNAME, &enc, | 260 | (0 == strcmp(encName, |
256 | NS_SEARCH_METADATA, dmd, | 261 | (const char*) &enc)) ) |
257 | NS_SEARCH_RATING, nni->rating, | 262 | found =YES; |
258 | -1); | 263 | FREENONNULL(encName); |
264 | } while ( (found == NO) && | ||
265 | (gtk_tree_model_iter_next(GTK_TREE_MODEL(model), | ||
266 | &iter)) ); | ||
267 | } | ||
268 | if (found == NO) { | ||
269 | infoMessage(YES, | ||
270 | _("Namespace found: %s - %.*s\n"), | ||
271 | desc, | ||
272 | 20, | ||
273 | &enc); | ||
274 | gtk_list_store_append(model, | ||
275 | &iter); | ||
276 | gtk_list_store_set(model, | ||
277 | &iter, | ||
278 | NS_SEARCH_DESCRIPTION, name, | ||
279 | NS_SEARCH_ENCNAME, &enc, | ||
280 | NS_SEARCH_METADATA, dmd, | ||
281 | NS_SEARCH_RATING, nni->rating, | ||
282 | -1); | ||
283 | } | ||
259 | FREE(name); | 284 | FREE(name); |
260 | DEBUG_END(); | 285 | DEBUG_END(); |
261 | 286 | ||
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 | |||
37 | static struct CronManager * cron; | 39 | static struct CronManager * cron; |
38 | 40 | ||
39 | static struct GE_Context * ectx; | 41 | static 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 | ||
375 | void done_peers() { | 375 | void 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) |
diff --git a/src/plugins/stats/functions.c b/src/plugins/stats/functions.c index 71671193..59690dfb 100644 --- a/src/plugins/stats/functions.c +++ b/src/plugins/stats/functions.c | |||
@@ -611,9 +611,7 @@ void init_functions(struct GE_Context * e, | |||
611 | sock = client_connection_create(ectx, | 611 | sock = client_connection_create(ectx, |
612 | cfg); | 612 | cfg); |
613 | lock = MUTEX_CREATE(NO); | 613 | lock = MUTEX_CREATE(NO); |
614 | updateStatValues(NULL); | 614 | cron = gnunet_gtk_get_cron(); |
615 | updateConnectionGoal(NULL); | ||
616 | cron = cron_create(ectx); | ||
617 | cron_add_job(cron, | 615 | cron_add_job(cron, |
618 | &updateStatValues, | 616 | &updateStatValues, |
619 | UPDATE_INTERVAL, | 617 | UPDATE_INTERVAL, |
@@ -624,13 +622,11 @@ void init_functions(struct GE_Context * e, | |||
624 | 5 * cronMINUTES, | 622 | 5 * cronMINUTES, |
625 | 5 * cronMINUTES, | 623 | 5 * cronMINUTES, |
626 | NULL); | 624 | NULL); |
627 | cron_start(cron); | ||
628 | } | 625 | } |
629 | 626 | ||
630 | void done_functions() { | 627 | void done_functions() { |
631 | int i; | 628 | int i; |
632 | 629 | ||
633 | cron_stop(cron); | ||
634 | cron_del_job(cron, | 630 | cron_del_job(cron, |
635 | &updateConnectionGoal, | 631 | &updateConnectionGoal, |
636 | 5 * cronMINUTES, | 632 | 5 * cronMINUTES, |
@@ -639,7 +635,6 @@ void done_functions() { | |||
639 | &updateStatValues, | 635 | &updateStatValues, |
640 | UPDATE_INTERVAL, | 636 | UPDATE_INTERVAL, |
641 | NULL); | 637 | NULL); |
642 | cron_destroy(cron); | ||
643 | MUTEX_DESTROY(lock); | 638 | MUTEX_DESTROY(lock); |
644 | connection_destroy(sock); | 639 | connection_destroy(sock); |
645 | for (i=0;i<lsv_size;i++) | 640 | for (i=0;i<lsv_size;i++) |