[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r29149 - gnunet-gtk/src/fs
From: |
gnunet |
Subject: |
[GNUnet-SVN] r29149 - gnunet-gtk/src/fs |
Date: |
Tue, 10 Sep 2013 12:37:17 +0200 |
Author: grothoff
Date: 2013-09-10 12:37:17 +0200 (Tue, 10 Sep 2013)
New Revision: 29149
Modified:
gnunet-gtk/src/fs/gnunet-fs-gtk_common.c
Log:
-handle SKS uri from command line
Modified: gnunet-gtk/src/fs/gnunet-fs-gtk_common.c
===================================================================
--- gnunet-gtk/src/fs/gnunet-fs-gtk_common.c 2013-09-10 10:31:39 UTC (rev
29148)
+++ gnunet-gtk/src/fs/gnunet-fs-gtk_common.c 2013-09-10 10:37:17 UTC (rev
29149)
@@ -273,16 +273,12 @@
GNUNET_FS_GTK_handle_uri (const struct GNUNET_FS_Uri *uri,
guint anonymity_level)
{
- GtkTreeIter iter;
- GtkTreeModel *namespace_treestore;
- GtkTreeView *namespace_tree;
- gchar *value;
- GtkLabel *sel_namespace_label;
- GtkTreePath *treepath;
GtkEntry *query_entry;
- struct GNUNET_CRYPTO_EccPublicKey *nsid;
+ GtkComboBox *ns_cb;
+ GtkEntry *ns_entry;
struct GNUNET_CRYPTO_EccPublicKey want;
+
if (GNUNET_FS_uri_test_chk (uri) || GNUNET_FS_uri_test_loc (uri))
{
struct DownloadEntry *de;
@@ -294,15 +290,8 @@
return;
}
query_entry = GTK_ENTRY (GNUNET_FS_GTK_get_main_window_object
("main_window_search_entry"));
- namespace_tree =
- GTK_TREE_VIEW (GNUNET_FS_GTK_get_main_window_object
- ("namespace_selector_treeview"));
- namespace_treestore =
- GTK_TREE_MODEL (GNUNET_FS_GTK_get_main_window_object
- ("main_window_search_namespace_treestore"));
- sel_namespace_label =
- GTK_LABEL (GNUNET_FS_GTK_get_main_window_object
("main_window_search_selected_namespace_label"));
-
+ ns_cb = GTK_COMBO_BOX (GNUNET_FS_GTK_get_main_window_object
("main_window_search_namespace_combobox"));
+ ns_entry = GTK_ENTRY (gtk_bin_get_child (GTK_BIN (ns_cb)));
if (GNUNET_FS_uri_test_sks (uri))
{
/* select the namespace */
@@ -312,43 +301,13 @@
GNUNET_break (0);
return;
}
- if (! gtk_tree_model_get_iter_first (namespace_treestore, &iter))
{
- GNUNET_break (0);
- return;
+ const char *ns_zkey;
+
+ ns_zkey = GNUNET_NAMESTORE_pkey_to_zkey (&want);
+ gtk_entry_set_text (ns_entry,
+ ns_zkey);
}
- gtk_tree_model_get (namespace_treestore, &iter,
- GNUNET_GTK_FS_MAIN_WINDOW_SEARCH_NAMESPACE_MC_KEY,
- &nsid,
- -1);
- while ( ( (NULL == nsid) ||
- (0 != memcmp (nsid,
- &want,
- sizeof (struct GNUNET_CRYPTO_EccPublicKey))) ) &&
- (gtk_tree_model_iter_next (namespace_treestore, &iter)) )
- gtk_tree_model_get (namespace_treestore, &iter,
- GNUNET_GTK_FS_MAIN_WINDOW_SEARCH_NAMESPACE_MC_KEY,
- &nsid,
- -1);
- if ( (NULL == nsid) ||
- (0 != memcmp (nsid,
- &want,
- sizeof (struct GNUNET_CRYPTO_EccPublicKey))) )
- {
- /* namespace unknown / not in list!? */
- GNUNET_break (0);
- return;
- }
- gtk_tree_selection_select_iter (gtk_tree_view_get_selection
- (namespace_tree), &iter);
- treepath = gtk_tree_model_get_path (namespace_treestore,
- &iter);
- if (GNUNET_GTK_get_tree_string (namespace_tree, treepath,
-
GNUNET_GTK_FS_MAIN_WINDOW_SEARCH_NAMESPACE_MC_NAME,
- &value))
- gtk_label_set_text (sel_namespace_label, value);
- gtk_tree_path_free (treepath);
-
/* set search entry to the namespace identifier */
{
char *query_string;
@@ -363,19 +322,7 @@
if (GNUNET_FS_uri_test_ksk (uri))
{
- /* select "no" namespace, which should be the first entry
- in the namespace */
- if (gtk_tree_model_get_iter_first (namespace_treestore, &iter))
- {
- gtk_tree_selection_select_iter (gtk_tree_view_get_selection
- (namespace_tree), &iter);
- treepath = gtk_tree_model_get_path (namespace_treestore, &iter);
- if (GNUNET_GTK_get_tree_string (namespace_tree, treepath,
-
GNUNET_GTK_FS_MAIN_WINDOW_SEARCH_NAMESPACE_MC_NAME,
- &value))
- gtk_label_set_text (sel_namespace_label, value);
- gtk_tree_path_free (treepath);
- }
+ gtk_entry_set_text (ns_entry, "");
/* set search entry to the query string */
{
char *query_string;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r29149 - gnunet-gtk/src/fs,
gnunet <=