gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r5010 - in gnunet-gtk: . src/common src/include src/plugins


From: gnunet
Subject: [GNUnet-SVN] r5010 - in gnunet-gtk: . src/common src/include src/plugins/daemon src/plugins/fs src/plugins/peers src/plugins/stats
Date: Sun, 10 Jun 2007 19:39:24 -0600 (MDT)

Author: grothoff
Date: 2007-06-10 19:39:24 -0600 (Sun, 10 Jun 2007)
New Revision: 5010

Modified:
   gnunet-gtk/ChangeLog
   gnunet-gtk/TODO
   gnunet-gtk/gnunet-gtk.glade
   gnunet-gtk/src/common/Makefile.am
   gnunet-gtk/src/common/helper.c
   gnunet-gtk/src/include/gnunetgtk_common.h
   gnunet-gtk/src/plugins/daemon/daemon.c
   gnunet-gtk/src/plugins/fs/namespace.c
   gnunet-gtk/src/plugins/fs/namespace_create.c
   gnunet-gtk/src/plugins/fs/namespace_search.c
   gnunet-gtk/src/plugins/peers/peers.c
   gnunet-gtk/src/plugins/stats/functions.c
Log:
updated NS APIs, cleaning up glade texts

Modified: gnunet-gtk/ChangeLog
===================================================================
--- gnunet-gtk/ChangeLog        2007-06-11 01:39:00 UTC (rev 5009)
+++ gnunet-gtk/ChangeLog        2007-06-11 01:39:24 UTC (rev 5010)
@@ -1,3 +1,6 @@
+Sun Jun 10 19:32:33 MDT 2007
+       Completed support for namespaces.
+       
 Thu May 31 20:53:50 MDT 2007
        Added peer-info tab.  You must load the new "peers" module
        to see it.

Modified: gnunet-gtk/TODO
===================================================================
--- gnunet-gtk/TODO     2007-06-11 01:39:00 UTC (rev 5009)
+++ gnunet-gtk/TODO     2007-06-11 01:39:24 UTC (rev 5010)
@@ -4,10 +4,6 @@
   RC == Release Critical
 
 
-0.7.2 (goal: re-enable all 0.7.0 features):
-- test namespace search
-
-
 0.7.3 (goal: polish):
 - #1045: ability to pause a search => requires FSUI changes! [RC]
 - improve collection handling [RC]

Modified: gnunet-gtk/gnunet-gtk.glade
===================================================================
--- gnunet-gtk/gnunet-gtk.glade 2007-06-11 01:39:00 UTC (rev 5009)
+++ gnunet-gtk/gnunet-gtk.glade 2007-06-11 01:39:24 UTC (rev 5010)
@@ -87,7 +87,7 @@
                          <child>
                            <widget class="GtkLabel" id="titleLabel">
                              <property name="visible">True</property>
-                             <property name="label" 
translatable="yes">&lt;span size=&quot;x-large&quot;&gt;Welcome to gnunet-gtk 
0.7.1c&lt;/span&gt;</property>
+                             <property name="label" 
translatable="yes">&lt;span size=&quot;x-large&quot;&gt;Welcome to gnunet-gtk 
0.7.2&lt;/span&gt;</property>
                              <property name="use_underline">False</property>
                              <property name="use_markup">True</property>
                              <property 
name="justify">GTK_JUSTIFY_CENTER</property>
@@ -130,9 +130,9 @@
 
     The GNUnet Team
 
-&lt;span size=&quot;x-large&quot;&gt;Known problems&lt;/span&gt;
+&lt;span size=&quot;x-large&quot;&gt;Changes from gnunet-gtk 
0.7.1c:&lt;/span&gt;
 
-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/.
+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.
 
 &lt;span size=&quot;x-large&quot;&gt;Changes from gnunet-gtk 
0.7.1:&lt;/span&gt;
 
@@ -4227,7 +4227,7 @@
                <widget class="GtkTreeView" id="metaDataDialogMetaDataList">
                  <property agent="glademm" 
name="cxx_visibility">public</property>
                  <property name="visible">True</property>
-                 <property name="tooltip" translatable="yes">Select entries 
and use the context menu (right click) in order to delete keywords.</property>
+                 <property name="tooltip" translatable="yes">Select entries 
and use the button to delete keywords.</property>
                  <property name="can_focus">True</property>
                  <property name="headers_visible">False</property>
                  <property name="rules_hint">True</property>
@@ -4393,7 +4393,7 @@
                <widget class="GtkTreeView" id="metaDataDialogKeywordList">
                  <property agent="glademm" 
name="cxx_visibility">public</property>
                  <property name="visible">True</property>
-                 <property name="tooltip" translatable="yes">Select entries 
and use the context menu (right click) in order to delete keywords.</property>
+                 <property name="tooltip" translatable="yes">Select entries 
and use the button to delete keywords.</property>
                  <property name="can_focus">True</property>
                  <property name="headers_visible">False</property>
                  <property name="rules_hint">True</property>
@@ -5354,7 +5354,7 @@
   <property name="tooltip" translatable="yes">The gnunet-gtk about 
dialog</property>
   <property name="destroy_with_parent">False</property>
   <property name="name" translatable="yes">gnunet-gtk</property>
-  <property name="copyright" translatable="yes">(C) 2001-2006 Christian 
Grothoff (and other contributing authors)</property>
+  <property name="copyright" translatable="yes">(C) 2001-2007 Christian 
Grothoff (and other contributing authors)</property>
   <property name="comments" translatable="yes">https://gnunet.org/</property>
   <property name="license" translatable="yes">                    GNU GENERAL 
PUBLIC LICENSE
                        Version 2, June 1991
@@ -6143,7 +6143,7 @@
                <widget class="GtkTreeView" 
id="namespaceMetaDataDialogKeywordList">
                  <property agent="glademm" 
name="cxx_visibility">public</property>
                  <property name="visible">True</property>
-                 <property name="tooltip" translatable="yes">Select entries 
and use the context menu (right click) in order to delete keywords.</property>
+                 <property name="tooltip" translatable="yes">Select entries 
and use the button to delete keywords.</property>
                  <property name="can_focus">True</property>
                  <property name="headers_visible">True</property>
                  <property name="rules_hint">True</property>
@@ -6345,7 +6345,7 @@
                <widget class="GtkTreeView" 
id="namespaceMetaDataDialogMetaDataList">
                  <property agent="glademm" 
name="cxx_visibility">public</property>
                  <property name="visible">True</property>
-                 <property name="tooltip" translatable="yes">Metadata 
describing the namespace (used in advertisements).  Use the context menu 
(right-click) to delete selected entries.</property>
+                 <property name="tooltip" translatable="yes">Metadata 
describing the namespace (used in advertisements).</property>
                  <property name="can_focus">True</property>
                  <property name="headers_visible">True</property>
                  <property name="rules_hint">True</property>
@@ -7238,7 +7238,7 @@
                <widget class="GtkTreeView" id="collectionMetaDataTreeView">
                  <property agent="glademm" 
name="cxx_visibility">public</property>
                  <property name="visible">True</property>
-                 <property name="tooltip" translatable="yes">Select entries 
and use the context menu (right click) in order to delete keywords.</property>
+                 <property name="tooltip" translatable="yes">Select entries 
and use the button to delete keywords.</property>
                  <property name="can_focus">True</property>
                  <property name="headers_visible">True</property>
                  <property name="rules_hint">True</property>

Modified: gnunet-gtk/src/common/Makefile.am
===================================================================
--- gnunet-gtk/src/common/Makefile.am   2007-06-11 01:39:00 UTC (rev 5009)
+++ gnunet-gtk/src/common/Makefile.am   2007-06-11 01:39:24 UTC (rev 5010)
@@ -23,6 +23,7 @@
   $(INTLLIBS) \
   -lgnunetutil \
   -lgnunetutil_crypto \
+  -lgnunetutil_cron \
   -lgthread-2.0 \
   $(LIBNOTIFY_LIBS)
 

Modified: gnunet-gtk/src/common/helper.c
===================================================================
--- gnunet-gtk/src/common/helper.c      2007-06-11 01:39:00 UTC (rev 5009)
+++ gnunet-gtk/src/common/helper.c      2007-06-11 01:39:24 UTC (rev 5010)
@@ -27,6 +27,7 @@
 #include "platform.h"
 #include "gnunetgtk_common.h"
 #include <GNUnet/gnunet_util_crypto.h>
+#include <GNUnet/gnunet_util_cron.h>
 #include <glib.h>
 #include <gmodule.h>
 
@@ -83,6 +84,12 @@
 
 static struct GC_Configuration * cfg;
 
+static struct CronManager * cron;
+
+struct CronManager * gnunet_gtk_get_cron() {
+  return cron;
+}
+
 static gboolean saveCallWrapper(gpointer data) {
   SaveCall * call = data;
   int i;
@@ -293,6 +300,7 @@
   sclock = MUTEX_CREATE(YES);
   mainThread = PTHREAD_GET_SELF();
   saveCallsUp = YES;
+  cron = cron_create(ectx);
 
   /* load the interface */
   path = os_get_installation_path(IPK_DATADIR);
@@ -326,11 +334,13 @@
   loadPlugins(load);
   FREE(load);
   connectGladeWithPlugins(mainXML);
+  cron_start(cron);
 }
 
 void shutdownPlugins() {
   int i;
 
+  cron_stop(cron);
   /* unload the plugins */
   while (plugin != NULL) {
     Plugin * next;
@@ -362,6 +372,7 @@
 }
 
 void doneGNUnetGTKCommon() {
+  cron_destroy(cron);
   PTHREAD_REL_SELF(mainThread);
   MUTEX_DESTROY(sclock);
 }

Modified: gnunet-gtk/src/include/gnunetgtk_common.h
===================================================================
--- gnunet-gtk/src/include/gnunetgtk_common.h   2007-06-11 01:39:00 UTC (rev 
5009)
+++ gnunet-gtk/src/include/gnunetgtk_common.h   2007-06-11 01:39:24 UTC (rev 
5010)
@@ -1,7 +1,7 @@
 /*
      This file is part of GNUnet
-     (C) 2005, 2006 Christian Grothoff (and other contributing authors)
-
+     (C) 2005, 2006, 2007 Christian Grothoff (and other contributing authors)
+     
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
      by the Free Software Foundation; either version 2, or (at your
@@ -162,4 +162,7 @@
                            GtkTreeSelectionForeachFunc func,
                            gpointer data);
 
+
+struct CronManager * gnunet_gtk_get_cron(void);
+
 #endif

Modified: gnunet-gtk/src/plugins/daemon/daemon.c
===================================================================
--- gnunet-gtk/src/plugins/daemon/daemon.c      2007-06-11 01:39:00 UTC (rev 
5009)
+++ gnunet-gtk/src/plugins/daemon/daemon.c      2007-06-11 01:39:24 UTC (rev 
5010)
@@ -337,7 +337,6 @@
                                               col - 1),
                                               TRUE);
 
-  updateAppModelSafe(NULL);
   tab
     = glade_xml_get_widget(getMainXML(),
                           "daemonScrolledWindow");
@@ -358,7 +357,7 @@
   }
   FREE(daemon_config);
 
-  cron = cron_create(ectx);
+  cron = gnunet_gtk_get_cron();
   cron_add_job(cron,
               &cronCheckDaemon,
               0,
@@ -369,11 +368,9 @@
               5 * cronMINUTES,
               5 * cronMINUTES,
               NULL);
-  cron_start(cron);
 }
 
 void done_daemon() {
-  cron_stop(cron);
   cron_del_job(cron,
               &cronCheckDaemon,
               15 * cronSECONDS,
@@ -382,7 +379,6 @@
               &updateAppModel,
               5 * cronMINUTES,
               NULL);
-  cron_destroy(cron);
 }
 
 /**

Modified: gnunet-gtk/src/plugins/fs/namespace.c
===================================================================
--- gnunet-gtk/src/plugins/fs/namespace.c       2007-06-11 01:39:00 UTC (rev 
5009)
+++ gnunet-gtk/src/plugins/fs/namespace.c       2007-06-11 01:39:24 UTC (rev 
5010)
@@ -425,6 +425,11 @@
   GtkWidget * notebook;
   GtkWidget * del_menu;
 
+  if (OK != ECRS_testNamespaceExists(NULL,
+                                    cfg,
+                                    namespaceName,
+                                    namespaceId))
+    return OK;
   DEBUG_BEGIN();
   label = gtk_label_new(namespaceName);
   list = MALLOC(sizeof(NamespaceList));
@@ -625,7 +630,7 @@
                                cfg,
                                cls->anonymityLevel,
                                1000, /* FIXME: priority */
-                               get_time() + 999999, /* FIXME: expiration */
+                               get_time() + 2 * cronYEARS, /* FIXME: 
expiration */
                                cls->namespaceName,
                                cls->updateInterval,
                                cls->lastId,
@@ -1045,12 +1050,10 @@
                                 NULL);
   NS_listNamespaces(ectx,
                    cfg,
-                   YES,
                    &addTabForNamespace,
                    NULL);
   NS_registerDiscoveryCallback(ectx,
                               cfg,
-                              NO,
                               &namespace_discovered_cb,
                               NULL);
   DEBUG_END();

Modified: gnunet-gtk/src/plugins/fs/namespace_create.c
===================================================================
--- gnunet-gtk/src/plugins/fs/namespace_create.c        2007-06-11 01:39:00 UTC 
(rev 5009)
+++ gnunet-gtk/src/plugins/fs/namespace_create.c        2007-06-11 01:39:24 UTC 
(rev 5010)
@@ -216,7 +216,7 @@
                              gtk_spin_button_get_value_as_int
                              (GTK_SPIN_BUTTON(spin)),
                              1000, /* FIXME: priority */
-                             get_time() + 999999, /* FIXME: expiration */
+                             get_time() + 2 * cronYEARS, /* FIXME: expiration 
*/
                              namespaceName,
                              meta,
                              keywordURI,

Modified: gnunet-gtk/src/plugins/fs/namespace_search.c
===================================================================
--- gnunet-gtk/src/plugins/fs/namespace_search.c        2007-06-11 01:39:00 UTC 
(rev 5009)
+++ gnunet-gtk/src/plugins/fs/namespace_search.c        2007-06-11 01:39:24 UTC 
(rev 5010)
@@ -160,17 +160,20 @@
                                rating);
       gtk_widget_set_sensitive(spin,
                               TRUE);
+      keyword
+       = glade_xml_get_widget(getMainXML(),
+                              "fssearchKeywordComboBoxEntry");
       if (OK == NS_getNamespaceRoot(ectx,
                                    cfg,
                                    encStr,
                                    &root)) {
        hash2enc(&root,
                 &enc);
-       keyword
-         = glade_xml_get_widget(getMainXML(),
-                                "fssearchKeywordComboBoxEntry");
        gtk_entry_set_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN(keyword))),
                           (const gchar*) &enc);
+      } else {
+       gtk_entry_set_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN(keyword))),
+                          "");
       }
     }
   } else {
@@ -204,6 +207,8 @@
   GtkWidget * ncbe;
   char * desc;
   size_t n;
+  int found;
+  char * encName;
 
   DEBUG_BEGIN();
   ncbe
@@ -242,20 +247,40 @@
           desc,
           20,
           &enc);
-  infoMessage(YES,
-             _("Namespace found: %s - %.*s\n"),
-             desc,
-             20,
-             &enc);
-  gtk_list_store_append(model,
-                       &iter);
-  gtk_list_store_set(model,
-                    &iter,
-                    NS_SEARCH_DESCRIPTION, name,
-                    NS_SEARCH_ENCNAME, &enc,
-                    NS_SEARCH_METADATA, dmd,
-                    NS_SEARCH_RATING, nni->rating,
-                    -1);
+  /* check if present! */
+  found = NO;
+  if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(model),
+                                   &iter)) {
+    do {       
+      gtk_tree_model_get(GTK_TREE_MODEL(model),
+                        &iter,
+                        NS_SEARCH_ENCNAME, &encName,
+                        -1);
+      if ( (encName != NULL) &&
+          (0 == strcmp(encName,
+                       (const char*) &enc)) )
+       found =YES;
+      FREENONNULL(encName);
+    } while ( (found == NO) &&
+             (gtk_tree_model_iter_next(GTK_TREE_MODEL(model),
+                                       &iter)) );
+  }
+  if (found == NO) {
+    infoMessage(YES,
+               _("Namespace found: %s - %.*s\n"),
+               desc,
+               20,
+               &enc);
+    gtk_list_store_append(model,
+                         &iter);
+    gtk_list_store_set(model,
+                      &iter,
+                      NS_SEARCH_DESCRIPTION, name,
+                      NS_SEARCH_ENCNAME, &enc,
+                      NS_SEARCH_METADATA, dmd,
+                      NS_SEARCH_RATING, nni->rating,
+                      -1);
+  }
   FREE(name);
   DEBUG_END();
 

Modified: gnunet-gtk/src/plugins/peers/peers.c
===================================================================
--- gnunet-gtk/src/plugins/peers/peers.c        2007-06-11 01:39:00 UTC (rev 
5009)
+++ gnunet-gtk/src/plugins/peers/peers.c        2007-06-11 01:39:24 UTC (rev 
5010)
@@ -34,6 +34,8 @@
 #include <GNUnet/gnunet_util_network_client.h>
 #include <gtk/gtk.h>
 
+#define REFRESH_RATE (15 * cronSECONDS)
+
 static struct CronManager * cron;
 
 static struct GE_Context * ectx;
@@ -358,27 +360,23 @@
   FREE(fn);
   FREE(dir);
 
-  updatePeerInfo(NULL);
   tab
     = glade_xml_get_widget(getMainXML(),
                           "peersScrolledWindow");
   gtk_widget_show(tab);
-  cron = cron_create(ectx);
+  cron = gnunet_gtk_get_cron();
   cron_add_job(cron,
               &updatePeerInfo,
-              120 * cronSECONDS,
-              120 * cronSECONDS,
+              REFRESH_RATE,
+              REFRESH_RATE,
               NULL);
-  cron_start(cron);
 }
 
 void done_peers() {
-  cron_stop(cron);
   cron_del_job(cron,
               &updatePeerInfo,
-              120 * cronSECONDS,
+              REFRESH_RATE,
               NULL);
-  cron_destroy(cron);
   if (red != NULL)
     g_object_unref(red);
   if (green != NULL)

Modified: gnunet-gtk/src/plugins/stats/functions.c
===================================================================
--- gnunet-gtk/src/plugins/stats/functions.c    2007-06-11 01:39:00 UTC (rev 
5009)
+++ gnunet-gtk/src/plugins/stats/functions.c    2007-06-11 01:39:24 UTC (rev 
5010)
@@ -611,9 +611,7 @@
   sock = client_connection_create(ectx,
                                  cfg);
   lock = MUTEX_CREATE(NO);
-  updateStatValues(NULL);
-  updateConnectionGoal(NULL);
-  cron = cron_create(ectx);
+  cron = gnunet_gtk_get_cron();
   cron_add_job(cron,
               &updateStatValues,
               UPDATE_INTERVAL,
@@ -624,13 +622,11 @@
               5 * cronMINUTES,
               5 * cronMINUTES,
               NULL);
-  cron_start(cron);
 }
 
 void done_functions() {
   int i;
 
-  cron_stop(cron);
   cron_del_job(cron,
               &updateConnectionGoal,
               5 * cronMINUTES,
@@ -639,7 +635,6 @@
               &updateStatValues,
               UPDATE_INTERVAL,
               NULL);
-  cron_destroy(cron);
   MUTEX_DESTROY(lock);
   connection_destroy(sock);
   for (i=0;i<lsv_size;i++)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]