[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r4913 - in gnunet-gtk: . src/plugins/fs
From: |
gnunet |
Subject: |
[GNUnet-SVN] r4913 - in gnunet-gtk: . src/plugins/fs |
Date: |
Sun, 3 Jun 2007 17:17:21 -0600 (MDT) |
Author: grothoff
Date: 2007-06-03 17:17:21 -0600 (Sun, 03 Jun 2007)
New Revision: 4913
Added:
gnunet-gtk/src/plugins/fs/namespace_search.h
Modified:
gnunet-gtk/TODO
gnunet-gtk/gnunet-gtk.glade
gnunet-gtk/src/plugins/fs/Makefile.am
gnunet-gtk/src/plugins/fs/fs.c
gnunet-gtk/src/plugins/fs/helper.c
gnunet-gtk/src/plugins/fs/namespace.c
gnunet-gtk/src/plugins/fs/namespace_search.c
gnunet-gtk/src/plugins/fs/search.c
gnunet-gtk/src/plugins/fs/search_namespace.c
Log:
implementing namespace search
Modified: gnunet-gtk/TODO
===================================================================
--- gnunet-gtk/TODO 2007-06-03 22:13:33 UTC (rev 4912)
+++ gnunet-gtk/TODO 2007-06-03 23:17:21 UTC (rev 4913)
@@ -1,64 +1,50 @@
-Notes:
- RC == Release Critical
+This is just the current plan, plans change.
- All issues that are targeted for the NEXT release
- should also be filed on Mantis, except for "more testcases"
- which is always an ongoing issue.
+Annotations:
+ RC == Release Critical
- Features that are targeted for future releases do not have
- to be filed on Mantis (no need to bloat the database).
- Oh, and this is of course just a plan. And plans always change.
-
0.7.2 (goal: re-enable all 0.7.0 features):
- create custom gtk logger (via memory logger?) [see also #1027]
=> currently, "infoMessage" opens a window that cannot be closed
and that does not have a frame!!! [RC]
-- re-enable advanced/namespace menus [RC]
- + namespace search => FIX implementation (list namespaces!)
- + design and start use of short/nice namespace names/search URIs
-- re-enable advanced/collection menus
- + collection creation => untested
- + collection abortion => untested
- + collection "start"/"stop" menu item sensitivity => untested
- + show content of current collection (where!?) => do implementation
+- test namespace search
0.7.3 (goal: polish):
-- pop-up dialogs / context menus (show extra information,
- in particular full metadata) [ medium ]
-- add right button popup menu operations for
- Select by pattern
- in the search result list.
+- #1045: ability to pause a search => requires FSUI changes! [RC]
+- #1040: announce newly found namespaces to user [RC]
+- improve collection handling [RC]
+ + show content of current collection somewhere
+ + does it make sense to have "no update" for collections?
+ + for sporadically updated collection, have 'publish now' button
+- design and use of short/nice namespace names/search URIs
+- pop-up dialogs / context menus (show extra information, in particular full
metadata) [RC]
+- add right button popup menu operations for "Select by pattern" in the search
result list.
- for potentially long clists, add option to specify a string
pattern that must be matched for the lines to be displayed
(to further prune search results, for example)
- gnunet-setup plugin
-- #1045 ability to pause a search => requires FSUI changes!
-- announce newly found namespaces to user -- #1040
-- #747 (sharing stats for gnunet-gtk) [RC]
+- #747: sharing stats for gnunet-gtk
-0.7.4 (goal: expand features):
-- chat
+0.8.0 (goal: expand features):
+- chat [RC]
- add option to list all indexed files and delete from them
(ECRS now supports listing of indexed files!
- => but this ECRS functionality may need to be tested!)
+ => but this ECRS functionality may need to be tested!) [RC]
- implement search bookmarking (e.g. user could add/edit/delete
favourite namespace/key etc combinations)
-- allow tracking of files that have been (successfully/unsuccessfully)
- downloaded in the past or are locally indexed; indicate in search
- results!
1.0.0 (goal: "userfriendly"):
-- a completely new interactive namespace/directory building
+- a completely new interactive directory building
module that would allow importing files/directories from
disk and edit various parameters, file descriptions and
the dir tree structure before the insertion.
-- also allow creation of directory from known file IDs
+- also allow creation of directory from known file IDs [RC]
+ have sortability
+ have multiselection
+ print filenames as well
-- gnunet-tracekit plugin
+- gnunet-tracekit plugin [RC]
Modified: gnunet-gtk/gnunet-gtk.glade
===================================================================
--- gnunet-gtk/gnunet-gtk.glade 2007-06-03 22:13:33 UTC (rev 4912)
+++ gnunet-gtk/gnunet-gtk.glade 2007-06-03 23:17:21 UTC (rev 4913)
@@ -1906,6 +1906,7 @@
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
+ <signal name="clicked"
handler="on_open_menu_activate_" last_modification_time="Sun, 03 Jun 2007
23:16:34 GMT"/>
</widget>
<packing>
<property name="padding">0</property>
Modified: gnunet-gtk/src/plugins/fs/Makefile.am
===================================================================
--- gnunet-gtk/src/plugins/fs/Makefile.am 2007-06-03 22:13:33 UTC (rev
4912)
+++ gnunet-gtk/src/plugins/fs/Makefile.am 2007-06-03 23:17:21 UTC (rev
4913)
@@ -18,7 +18,7 @@
meta.c meta.h \
namespace.c namespace.h \
namespace_create.c \
- namespace_search.c \
+ namespace_search.c namespace_search.h \
search.c search.h \
download.c download.h \
upload.c upload.h
Modified: gnunet-gtk/src/plugins/fs/fs.c
===================================================================
--- gnunet-gtk/src/plugins/fs/fs.c 2007-06-03 22:13:33 UTC (rev 4912)
+++ gnunet-gtk/src/plugins/fs/fs.c 2007-06-03 23:17:21 UTC (rev 4913)
@@ -1,6 +1,6 @@
/*
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
@@ -431,11 +431,22 @@
GtkTreeViewColumn * column;
int col;
- /* search namespace selection setup */
+ /* keyword list setup */
searchCB
= GTK_COMBO_BOX_ENTRY(glade_xml_get_widget(getMainXML(),
"fssearchKeywordComboBoxEntry"));
+ model = gtk_list_store_new(1,
+ G_TYPE_STRING /* search string*/ );
+ gtk_combo_box_set_model(GTK_COMBO_BOX(searchCB),
+ GTK_TREE_MODEL(model));
+ gtk_combo_box_entry_set_text_column(searchCB,
+ 0);
+ /* search namespace selection setup */
+ searchCB
+ = GTK_COMBO_BOX_ENTRY(glade_xml_get_widget(getMainXML(),
+ "searchNamespaceComboBoxEntry"));
+
model = gtk_list_store_new(NS_SEARCH_NUM,
G_TYPE_STRING, /* what we show */
G_TYPE_STRING, /* EncName of namespace */
@@ -640,7 +651,7 @@
searchCB
= GTK_COMBO_BOX(glade_xml_get_widget(getMainXML(),
- "fssearchKeywordComboBoxEntry"));
+ "searchNamespaceComboBoxEntry"));
model = gtk_combo_box_get_model(searchCB);
if (gtk_tree_model_get_iter_first(model,
&iter)) {
Modified: gnunet-gtk/src/plugins/fs/helper.c
===================================================================
--- gnunet-gtk/src/plugins/fs/helper.c 2007-06-03 22:13:33 UTC (rev 4912)
+++ gnunet-gtk/src/plugins/fs/helper.c 2007-06-03 23:17:21 UTC (rev 4913)
@@ -1,6 +1,6 @@
/*
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
Modified: gnunet-gtk/src/plugins/fs/namespace.c
===================================================================
--- gnunet-gtk/src/plugins/fs/namespace.c 2007-06-03 22:13:33 UTC (rev
4912)
+++ gnunet-gtk/src/plugins/fs/namespace.c 2007-06-03 23:17:21 UTC (rev
4913)
@@ -30,6 +30,7 @@
#include "helper.h"
#include "meta.h"
#include "namespace.h"
+#include "namespace_search.h"
#include "content_tracking.h"
#include <GNUnet/gnunet_util_crypto.h>
#include <GNUnet/gnunet_uritrack_lib.h>
@@ -1047,11 +1048,18 @@
YES,
&addTabForNamespace,
NULL);
+ NS_registerDiscoveryCallback(ectx,
+ cfg,
+ NO,
+ &namespace_discovered_cb,
+ NULL);
DEBUG_END();
}
void fs_namespace_stop() {
+ NS_unregisterDiscoveryCallback(&namespace_discovered_cb,
+ NULL);
while (head != NULL)
frame_destroy(head->treeview);
URITRACK_unregisterTrackCallback(&updateViewSave,
Modified: gnunet-gtk/src/plugins/fs/namespace_search.c
===================================================================
--- gnunet-gtk/src/plugins/fs/namespace_search.c 2007-06-03 22:13:33 UTC
(rev 4912)
+++ gnunet-gtk/src/plugins/fs/namespace_search.c 2007-06-03 23:17:21 UTC
(rev 4913)
@@ -1,6 +1,6 @@
/*
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
@@ -185,3 +185,101 @@
free(encStr);
DEBUG_END();
}
+
+struct NewNamespaceInfo {
+ const char * namespaceName;
+ const HashCode512 * namespaceId;
+ const struct ECRS_MetaData * md;
+ int rating;
+};
+
+static void * saveDiscovery(void * cls) {
+ struct NewNamespaceInfo * nni = cls;
+
+ GtkListStore * model;
+ GtkTreeIter iter;
+ EncName enc;
+ char * name;
+ struct ECRS_MetaData * dmd;
+ GtkWidget * ncbe;
+ char * desc;
+ size_t n;
+
+ DEBUG_BEGIN();
+ ncbe
+ = glade_xml_get_widget(getMainXML(),
+ "searchNamespaceComboBoxEntry");
+ model = GTK_LIST_STORE(gtk_combo_box_get_model(GTK_COMBO_BOX(ncbe)));
+ hash2enc(nni->namespaceId,
+ &enc);
+ if (nni->md == NULL) {
+ dmd = NULL;
+ desc = STRDUP("");
+ } else {
+ dmd = ECRS_dupMetaData(nni->md);
+ desc = ECRS_getFirstFromMetaData(dmd,
+ EXTRACTOR_DESCRIPTION,
+ EXTRACTOR_TITLE,
+ EXTRACTOR_AUTHOR,
+ EXTRACTOR_GENRE,
+ EXTRACTOR_SUBJECT,
+ EXTRACTOR_CREATOR,
+ EXTRACTOR_PRODUCER,
+ EXTRACTOR_GROUP,
+ EXTRACTOR_CREATED_FOR,
+ EXTRACTOR_SUMMARY,
+ EXTRACTOR_OWNER,
+ -1);
+ if (desc == NULL)
+ desc = STRDUP("");
+ }
+
+ n = strlen(desc) + 64;
+ name = MALLOC(n);
+ SNPRINTF(name,
+ n,
+ "%s: %.*s",
+ 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();
+
+ return NULL;
+}
+
+
+
+/**
+ * Call this function to inform the user about
+ * newly found namespaces and to add them to the
+ * list of available namespaces in the search
+ * dialog.
+ *
+ * @param cls pass NULL
+ * @param rating the local rating of the namespace
+ * @return OK (always)
+ */
+int namespace_discovered_cb(void * cls,
+ const char * namespaceName,
+ const HashCode512 * namespaceId,
+ const struct ECRS_MetaData * md,
+ int rating) {
+ struct NewNamespaceInfo nni;
+ nni.namespaceName = namespaceName;
+ nni.namespaceId = namespaceId;
+ nni.md = md;
+ nni.rating = rating;
+ gtkSaveCall(&saveDiscovery,
+ &nni);
+ return OK;
+}
Added: gnunet-gtk/src/plugins/fs/namespace_search.h
===================================================================
--- gnunet-gtk/src/plugins/fs/namespace_search.h
(rev 0)
+++ gnunet-gtk/src/plugins/fs/namespace_search.h 2007-06-03 23:17:21 UTC
(rev 4913)
@@ -0,0 +1,47 @@
+/*
+ This file is part of GNUnet.
+ (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
+ option) any later version.
+
+ GNUnet is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNUnet; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+/**
+ * @file src/plugins/fs/namespace_search.h
+ * @brief code for namespace-related operations on the search frame
+ * @author Christian Grothoff
+ */
+#ifndef NAMESPACE_SEARCH_H
+#define NAMESPACE_SEARCH_H
+
+/**
+ * Call this function to inform the user about
+ * newly found namespaces and to add them to the
+ * list of available namespaces in the search
+ * dialog.
+ *
+ * @param cls pass NULL
+ * @param rating the local rating of the namespace
+ * @return OK (always)
+ */
+int namespace_discovered_cb(void * cls,
+ const char * namespaceName,
+ const HashCode512 * namespaceId,
+ const struct ECRS_MetaData * md,
+ int rating);
+
+
+
+#endif
Property changes on: gnunet-gtk/src/plugins/fs/namespace_search.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: gnunet-gtk/src/plugins/fs/search.c
===================================================================
--- gnunet-gtk/src/plugins/fs/search.c 2007-06-03 22:13:33 UTC (rev 4912)
+++ gnunet-gtk/src/plugins/fs/search.c 2007-06-03 23:17:21 UTC (rev 4913)
@@ -83,8 +83,10 @@
/* update tab title with the number of results */
new_title =
- g_strdup_printf("%s (%u)",
+ g_strdup_printf("%.*s%s (%u)",
+ 20,
searchContext->searchString,
+ strlen(searchContext->searchString) > 20 ? "..." : "",
searchContext->resultsReceived);
label = GTK_LABEL(glade_xml_get_widget(searchContext->labelXML,
"searchTabLabel"));
Modified: gnunet-gtk/src/plugins/fs/search_namespace.c
===================================================================
--- gnunet-gtk/src/plugins/fs/search_namespace.c 2007-06-03 22:13:33 UTC
(rev 4912)
+++ gnunet-gtk/src/plugins/fs/search_namespace.c 2007-06-03 23:17:21 UTC
(rev 4913)
@@ -1,3 +1,30 @@
+/*
+ This file is part of GNUnet.
+ (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
+ option) any later version.
+
+ GNUnet is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNUnet; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+/**
+ * @file src/plugins/fs/search.c
+ * @brief code for searching with gnunet-gtk
+ * @author Christian Grothoff
+ */
+
+
static int addNamespace(void * arg,
const char * namespaceName,
const HashCode512 * namespaceId,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r4913 - in gnunet-gtk: . src/plugins/fs,
gnunet <=