Sorry about the delay with this. I was trying to do something a little
more elegant. Anyway this will print a "Query queued" in the GTK2
meta-data column when a query is launched.
Next up, selective enabling of the popup options. Once I figured out how
to do it...
--
Alex, homepage: http://www.bennee.com/~alex/
Life without caffeine is stimulating enough. -- Sanka Ad
Index: src/ui/gtk/search.h
===================================================================
RCS file: /cvsroot/gtk-gnutella/gtk-gnutella-current/src/ui/gtk/search.h,v
retrieving revision 1.3
diff -u -b -r1.3 search.h
--- src/ui/gtk/search.h 4 Oct 2004 11:00:06 -0000 1.3
+++ src/ui/gtk/search.h 10 Oct 2004 21:11:49 -0000
@@ -1,4 +1,4 @@
-/*
+/* -*- mode: cc-mode; tab-width:4; -*-
* $Id: search.h,v 1.3 2004/10/04 11:00:06 rmanfredi Exp $
*
* Copyright (c) 2001-2003, Richard Eckart
@@ -136,10 +136,11 @@
#ifdef USE_GTK2
void gui_search_create_tree_view(GtkWidget **sw, GtkWidget **tree_view);
void gui_search_force_update_tab_label(struct search *, time_t now);
+GtkTreeIter * find_parent_with_sha1(GHashTable *ht, gpointer key);
#else
-GtkCTreeNode *find_parent_with_sha1(GHashTable *ht, gpointer key);
void gui_search_create_ctree(GtkWidget **sw, GtkCTree **ctree);
void gui_search_force_update_tab_label(struct search *);
+GtkCTreeNode *find_parent_with_sha1(GHashTable *ht, gpointer key);
#endif
void search_gui_expand_all();
@@ -161,6 +162,7 @@
*/
void search_gui_metadata_update(bitzi_data_t *data);
+void search_gui_queue_bitzi_by_sha1(record_t *rec, void *nothing);
/*
* Callbacks
Index: src/ui/gtk/gtk2/search_cb.c
===================================================================
RCS file: /cvsroot/gtk-gnutella/gtk-gnutella-current/src/ui/gtk/gtk2/search_cb.c,v
retrieving revision 1.3
diff -u -b -r1.3 search_cb.c
--- src/ui/gtk/gtk2/search_cb.c 4 Oct 2004 11:00:07 -0000 1.3
+++ src/ui/gtk/gtk2/search_cb.c 10 Oct 2004 21:11:50 -0000
@@ -1,4 +1,4 @@
-/*
+/* -*- mode: cc-mode; tab-width:4; -*-
* $Id: search_cb.c,v 1.3 2004/10/04 11:00:07 rmanfredi Exp $
*
* Copyright (c) 2001-2003, Raphael Manfredi, Richard Eckart
@@ -854,6 +854,7 @@
#ifdef HAS_LIBXML2
search_t *search;
GtkTreeSelection *selection;
+ GtkTreeModel *model;
GSList *sl,*l;
g_message("on_search_meta_data_active: called");
@@ -867,14 +868,27 @@
sl = tree_selection_collect_data(selection, gui_record_sha1_eq);
+
/* Queue up our requests */
g_message("on_search_meta_data: %d items",
g_slist_position(sl, g_slist_last(sl)) + 1);
for (l=sl; l; l=l->next)
{
- record_t *rec=l->data;
+ GtkTreeIter *parent;
+ record_t *rec;
+
+ rec=l->data;
guc_query_bitzi_by_urn(rec->sha1);
+
+ /* set the feedback */
+ parent = find_parent_with_sha1(search->parents, rec->sha1);
+ g_assert(parent!=NULL);
+ model = GTK_TREE_STORE(search->model);
+ gtk_tree_store_set(model, parent,
+ c_sr_meta, "Query queued",
+ (-1));
+
}
g_slist_free(sl);
Index: src/ui/gtk/gtk2/search.c
===================================================================
RCS file: /cvsroot/gtk-gnutella/gtk-gnutella-current/src/ui/gtk/gtk2/search.c,v
retrieving revision 1.10
diff -u -b -r1.10 search.c
--- src/ui/gtk/gtk2/search.c 4 Oct 2004 11:00:07 -0000 1.10
+++ src/ui/gtk/gtk2/search.c 10 Oct 2004 21:11:52 -0000
@@ -1,4 +1,4 @@
-/*
+/* -*- mode: cc-mode; tab-width:4; -*-
* $Id: search.c,v 1.10 2004/10/04 11:00:07 rmanfredi Exp $
*
* Copyright (c) 2001-2003, Raphael Manfredi, Richard Eckart
@@ -100,7 +100,7 @@
atom_sha1_free(key);
}
-static inline GtkTreeIter *
+GtkTreeIter *
find_parent_with_sha1(GHashTable *ht, gpointer key)
{
GtkTreeIter *iter = NULL;