[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r6943 - in gnunet-gtk: po src/plugins/chat src/plugins/fs
From: |
gnunet |
Subject: |
[GNUnet-SVN] r6943 - in gnunet-gtk: po src/plugins/chat src/plugins/fs |
Date: |
Sat, 31 May 2008 00:16:00 -0600 (MDT) |
Author: grothoff
Date: 2008-05-31 00:16:00 -0600 (Sat, 31 May 2008)
New Revision: 6943
Modified:
gnunet-gtk/po/Makefile.in
gnunet-gtk/src/plugins/chat/chat.c
gnunet-gtk/src/plugins/chat/chat.h
gnunet-gtk/src/plugins/fs/collection.c
gnunet-gtk/src/plugins/fs/namespace.c
gnunet-gtk/src/plugins/fs/namespace.h
gnunet-gtk/src/plugins/fs/namespace_create.c
gnunet-gtk/src/plugins/fs/namespace_search.c
gnunet-gtk/src/plugins/fs/namespace_search.h
Log:
adapting to new ns api
Modified: gnunet-gtk/po/Makefile.in
===================================================================
--- gnunet-gtk/po/Makefile.in 2008-05-31 05:05:50 UTC (rev 6942)
+++ gnunet-gtk/po/Makefile.in 2008-05-31 06:16:00 UTC (rev 6943)
@@ -20,7 +20,7 @@
top_srcdir = ..
-prefix = /home/grothoff
+prefix = /home/grothoff/
exec_prefix = ${prefix}
datadir = ${prefix}/share
localedir = $(datadir)/locale
Modified: gnunet-gtk/src/plugins/chat/chat.c
===================================================================
--- gnunet-gtk/src/plugins/chat/chat.c 2008-05-31 05:05:50 UTC (rev 6942)
+++ gnunet-gtk/src/plugins/chat/chat.c 2008-05-31 06:16:00 UTC (rev 6943)
@@ -28,6 +28,21 @@
#include "chat.h"
+struct GNUNET_CHAT_safe_write_struct
+{
+ GtkWidget *chatWindow;
+ const char *message;
+ const GNUNET_HashCode *sender;
+};
+
+struct GNUNET_CHAT_safe_nick_write_struct
+{
+ GtkWidget *nickList;
+ const char *nick;
+};
+
+
+
static struct GNUNET_ClientServerConnection *sock;
static struct GNUNET_Mutex *lock;
@@ -52,11 +67,11 @@
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (writeholder->chatWindow));
message_buf_size =
- snprintf (NULL, 0, "<%s> %s", writeholder->senderNick,
+ snprintf (NULL, 0, "<> %s", /* writeholder->senderNick,*/
writeholder->message);
message_buf = GNUNET_malloc (message_buf_size + 2);
- snprintf (message_buf, message_buf_size + 2, "<%s> %s\n",
- writeholder->senderNick, writeholder->message);
+ snprintf (message_buf, message_buf_size + 2, "<FIXME> %s\n",
+ /*writeholder->senderNick,*/ writeholder->message);
gtk_text_buffer_insert_at_cursor (buffer, message_buf,
message_buf_size + 1);
@@ -157,13 +172,12 @@
static int
receive_callback (void *cls,
struct GNUNET_CHAT_Room *room,
- const char *senderNick,
+ const GNUNET_HashCode *sender,
const char *message,
- GNUNET_CronTime timestamp, GNUNET_CHAT_MSG_OPTIONS options)
+ GNUNET_CHAT_MSG_OPTIONS options)
{
struct GNUNET_CHAT_gui_chat_client *client = cls;
GtkWidget *chattextviewer;
-
GList *children;
struct GNUNET_CHAT_safe_write_struct writearg;
@@ -177,7 +191,7 @@
writearg.chatWindow = chattextviewer;
writearg.message = message;
- writearg.senderNick = senderNick;
+ writearg.sender = sender;
GNUNET_GTK_save_call (&write_save_call, &writearg);
/*Write the message to the appropriate room...
@@ -189,30 +203,31 @@
}
static int
-member_list_callback (void *cls, const char *senderNick,
- int is_joining, GNUNET_CronTime timestamp)
+member_list_callback (void *cls,
+ const struct GNUNET_ECRS_MetaData * member_info,
+ const GNUNET_RSA_PublicKey * pkey)
{
struct GNUNET_CHAT_gui_chat_client *client = cls;
GtkWidget *chatnicklist;
+#if 0
struct GNUNET_CHAT_safe_nick_write_struct writearg;
-
+#endif
chatnicklist =
g_list_nth_data (gtk_container_get_children
(GTK_CONTAINER (client->chatFrame)), 1);
chatnicklist =
g_list_nth_data (gtk_container_get_children
(GTK_CONTAINER (chatnicklist)), 0);
-
+#if 0
/* chatnicklist is the GtkTextView object */
- writearg.nick = senderNick;
+ writearg.nick = member_info;
writearg.nickList = chatnicklist;
- g_print ("received nick %s calling safe write call\n", writearg.nick);
if (is_joining)
GNUNET_GTK_save_call (&write_nick_save_call, &writearg);
else
GNUNET_GTK_save_call (&remove_nick_save_call, &writearg);
-
+#endif
return GNUNET_OK;
}
@@ -275,6 +290,7 @@
struct GNUNET_CHAT_Room *chatRoom;
struct GNUNET_CHAT_gui_chat_client *client;
struct GNUNET_CHAT_gui_chat_client *pos;
+ struct GNUNET_ECRS_MetaData * meta;
chatnotebook =
glade_xml_get_widget (GNUNET_GTK_get_main_glade_XML (), "chatnotebook");
@@ -295,12 +311,15 @@
strcpy (client->room_name, room_name);
/* We do a silly strdup later on member_info... either check for NULL or
only pass "" for member_info!! */
+ meta = GNUNET_ECRS_meta_data_create();
chatRoom =
- GNUNET_CHAT_join_room (chat_ectx, chat_cfg, nick, room_name,
- "",
+ GNUNET_CHAT_join_room (chat_ectx, chat_cfg, nick,
+ meta,
+ room_name,
&receive_callback, client, &member_list_callback,
- client);
-
+ client,
+ NULL, NULL);
+ GNUNET_ECRS_meta_data_destroy(meta);
client->room = chatRoom;
client->chatFrame = newChatWindow;
client->number =
@@ -337,7 +356,7 @@
GtkWidget *curr_page;
GList *children;
GtkEntry *chat_entry;
-
+ unsigned int seq;
char *message;
const gchar *room_name;
struct GNUNET_CHAT_gui_chat_client *client;
@@ -387,8 +406,8 @@
else
return;
- GNUNET_CHAT_send_message (client->room, message, NULL,
- NULL, GNUNET_CHAT_MSG_OPTION_NONE, NULL);
+ GNUNET_CHAT_send_message (client->room, message,
+ GNUNET_CHAT_MSG_OPTION_NONE, NULL, &seq);
gtk_entry_set_text (chat_entry, "");
Modified: gnunet-gtk/src/plugins/chat/chat.h
===================================================================
--- gnunet-gtk/src/plugins/chat/chat.h 2008-05-31 05:05:50 UTC (rev 6942)
+++ gnunet-gtk/src/plugins/chat/chat.h 2008-05-31 06:16:00 UTC (rev 6943)
@@ -52,19 +52,6 @@
};
-struct GNUNET_CHAT_safe_write_struct
-{
- GtkWidget *chatWindow;
- const char *message;
- const char *senderNick;
-};
-
-struct GNUNET_CHAT_safe_nick_write_struct
-{
- GtkWidget *nickList;
- const char *nick;
-};
-
struct GNUNET_CHAT_member_list
{
struct GNUNET_CHAT_member_list *next;
Modified: gnunet-gtk/src/plugins/fs/collection.c
===================================================================
--- gnunet-gtk/src/plugins/fs/collection.c 2008-05-31 05:05:50 UTC (rev
6942)
+++ gnunet-gtk/src/plugins/fs/collection.c 2008-05-31 06:16:00 UTC (rev
6943)
@@ -65,10 +65,8 @@
void
createCollection_clicked_fs (GtkWidget * dummy1, GtkWidget * dummy2)
{
- const char *collectionName;
const char *updateIntervalString;
GtkWidget *w;
- GtkWidget *nameLine;
GtkWidget *dialog;
GtkWidget *spin;
struct GNUNET_ECRS_MetaData *meta;
@@ -110,12 +108,9 @@
meta = getMetaDataFromList (metaXML,
"collectionMetaDataTreeView", NULL);
spin = glade_xml_get_widget (metaXML, "collectionAnonymityLevel");
- nameLine = glade_xml_get_widget (metaXML, "collectionIdentifierEntry");
- collectionName = gtk_entry_get_text (GTK_ENTRY (nameLine));
root = NULL;
if (GNUNET_OK == GNUNET_CO_collection_start
(gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (spin)), 1000, /*
priority */
- updateInterval,
- collectionName, meta))
+ updateInterval, meta))
{
w =
glade_xml_get_widget (GNUNET_GTK_get_main_glade_XML (),
@@ -123,7 +118,7 @@
gtk_widget_set_sensitive (w, FALSE);
w =
glade_xml_get_widget (GNUNET_GTK_get_main_glade_XML (),
- "deleteCollection");
+ "deleteCollection");
gtk_widget_set_sensitive (w, TRUE);
}
else
@@ -135,8 +130,7 @@
GTK_DIALOG_MODAL,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE,
- _("Failed to start collection `%s' (consult logs)."),
- collectionName);
+ _("Failed to start collection (consult logs)."));
gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog);
}
@@ -176,15 +170,15 @@
fs_collection_start ()
{
GtkWidget *w;
- char *h;
-
+ struct GNUNET_ECRS_MetaData *h;
+
h = GNUNET_CO_collection_get_name ();
if (NULL != h)
{
w =
glade_xml_get_widget (GNUNET_GTK_get_main_glade_XML (),
"createCollection");
- GNUNET_free (h);
+ GNUNET_ECRS_meta_data_destroy (h);
}
else
w =
Modified: gnunet-gtk/src/plugins/fs/namespace.c
===================================================================
--- gnunet-gtk/src/plugins/fs/namespace.c 2008-05-31 05:05:50 UTC (rev
6942)
+++ gnunet-gtk/src/plugins/fs/namespace.c 2008-05-31 06:16:00 UTC (rev
6943)
@@ -35,6 +35,7 @@
#include <GNUnet/gnunet_util_crypto.h>
#include <GNUnet/gnunet_uritrack_lib.h>
#include <GNUnet/gnunet_namespace_lib.h>
+#include <GNUnet/gnunet_pseudonym_lib.h>
#include <extractor.h>
/**
@@ -402,7 +403,6 @@
*/
int
addTabForNamespace (void *unused,
- const char *namespaceName,
const GNUNET_HashCode * namespaceId,
const struct GNUNET_ECRS_MetaData *md, int rating)
{
@@ -410,12 +410,14 @@
GtkWidget *label;
GtkWidget *notebook;
GtkWidget *del_menu;
+ char * namespaceName;
if (GNUNET_OK !=
- GNUNET_ECRS_namespace_test_exists (NULL, cfg, namespaceName,
+ GNUNET_ECRS_namespace_test_exists (NULL, cfg,
namespaceId))
return GNUNET_OK;
GNUNET_GTK_DEBUG_BEGIN ();
+ namespaceName = GNUNET_PSEUDO_id_to_name(ectx, cfg, namespaceId);
label = gtk_label_new (namespaceName);
list = GNUNET_malloc (sizeof (NamespaceList));
list->name = GNUNET_strdup (namespaceName);
@@ -441,6 +443,7 @@
glade_xml_get_widget (GNUNET_GTK_get_main_glade_XML (),
"namespaceDelete");
gtk_widget_set_sensitive (del_menu, TRUE);
+ GNUNET_free(namespaceName);
return GNUNET_OK;
}
@@ -990,9 +993,9 @@
(GTK_TREE_VIEW (contentList), col - 1),
TRUE);
GNUNET_URITRACK_register_track_callback (ectx, cfg, &updateViewSave, NULL);
- GNUNET_NS_namespace_list_all (ectx, cfg, &addTabForNamespace, NULL);
- GNUNET_NS_register_discovery_callback (ectx, cfg, &namespace_discovered_cb,
- NULL);
+ GNUNET_PSEUDO_list_all (ectx, cfg, &addTabForNamespace, NULL);
+ GNUNET_PSEUDO_register_discovery_callback (ectx, cfg,
&namespace_discovered_cb,
+ NULL);
GNUNET_GTK_DEBUG_END ();
}
@@ -1000,7 +1003,7 @@
void
fs_namespace_stop ()
{
- GNUNET_NS_unregister_discovery_callback (&namespace_discovered_cb, NULL);
+ GNUNET_PSEUDO_unregister_discovery_callback (&namespace_discovered_cb, NULL);
while (head != NULL)
frame_destroy (head->treeview);
GNUNET_URITRACK_unregister_track_callback (&updateViewSave, NULL);
Modified: gnunet-gtk/src/plugins/fs/namespace.h
===================================================================
--- gnunet-gtk/src/plugins/fs/namespace.h 2008-05-31 05:05:50 UTC (rev
6942)
+++ gnunet-gtk/src/plugins/fs/namespace.h 2008-05-31 06:16:00 UTC (rev
6943)
@@ -31,7 +31,6 @@
* Add a tab for the given namespace.
*/
int addTabForNamespace (void *unused,
- const char *namespaceName,
const GNUNET_HashCode * namespaceId,
const struct GNUNET_ECRS_MetaData *md, int rating);
Modified: gnunet-gtk/src/plugins/fs/namespace_create.c
===================================================================
--- gnunet-gtk/src/plugins/fs/namespace_create.c 2008-05-31 05:05:50 UTC
(rev 6942)
+++ gnunet-gtk/src/plugins/fs/namespace_create.c 2008-05-31 06:16:00 UTC
(rev 6943)
@@ -249,12 +249,12 @@
namespaceName = gtk_entry_get_text (GTK_ENTRY (nameLine));
root = GNUNET_NS_namespace_create (ectx, cfg,
gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (spin)), 1000, /* FIXME:
priority */
GNUNET_get_time () + 2 *
GNUNET_CRON_YEARS, /* FIXME: expiration */
- namespaceName, meta, keywordURI,
+ meta, keywordURI,
&rootEntry);
if (root != NULL)
{
GNUNET_ECRS_uri_get_namespace_from_sks (root, &namespaceId);
- addTabForNamespace (NULL, namespaceName, &namespaceId, meta, 0);
+ addTabForNamespace (NULL, &namespaceId, meta, 0);
GNUNET_ECRS_uri_destroy (root);
}
else
Modified: gnunet-gtk/src/plugins/fs/namespace_search.c
===================================================================
--- gnunet-gtk/src/plugins/fs/namespace_search.c 2008-05-31 05:05:50 UTC
(rev 6942)
+++ gnunet-gtk/src/plugins/fs/namespace_search.c 2008-05-31 06:16:00 UTC
(rev 6943)
@@ -32,6 +32,7 @@
#include <GNUnet/gnunet_util_crypto.h>
#include <GNUnet/gnunet_uritrack_lib.h>
#include <GNUnet/gnunet_namespace_lib.h>
+#include <GNUnet/gnunet_pseudonym_lib.h>
#include <extractor.h>
@@ -82,7 +83,7 @@
GNUNET_enc_to_hash(encStr,
&nsid);
newrating = gtk_spin_button_get_value (GTK_SPIN_BUTTON (spin));
- rating = GNUNET_NS_namespace_rank (ectx,
+ rating = GNUNET_PSEUDO_rank (ectx,
cfg, &nsid,
newrating - rating);
if (rating != newrating)
@@ -192,7 +193,7 @@
struct NewNamespaceInfo
{
- const char *namespaceName;
+ char *namespaceName;
const GNUNET_HashCode *namespaceId;
const struct GNUNET_ECRS_MetaData *md;
int rating;
@@ -296,15 +297,16 @@
*/
int
namespace_discovered_cb (void *cls,
- const char *namespaceName,
const GNUNET_HashCode * namespaceId,
const struct GNUNET_ECRS_MetaData *md, int rating)
{
struct NewNamespaceInfo nni;
- nni.namespaceName = namespaceName;
+
+ nni.namespaceName = GNUNET_PSEUDO_id_to_name(ectx, cfg, namespaceId);
nni.namespaceId = namespaceId;
nni.md = md;
nni.rating = rating;
GNUNET_GTK_save_call (&saveDiscovery, &nni);
+ GNUNET_free(nni.namespaceName);
return GNUNET_OK;
}
Modified: gnunet-gtk/src/plugins/fs/namespace_search.h
===================================================================
--- gnunet-gtk/src/plugins/fs/namespace_search.h 2008-05-31 05:05:50 UTC
(rev 6942)
+++ gnunet-gtk/src/plugins/fs/namespace_search.h 2008-05-31 06:16:00 UTC
(rev 6943)
@@ -37,7 +37,6 @@
* @return GNUNET_OK (always)
*/
int namespace_discovered_cb (void *cls,
- const char *namespaceName,
const GNUNET_HashCode * namespaceId,
const struct GNUNET_ECRS_MetaData *md,
int rating);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r6943 - in gnunet-gtk: po src/plugins/chat src/plugins/fs,
gnunet <=