diff options
author | Christian Grothoff <christian@grothoff.org> | 2008-07-13 20:53:18 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2008-07-13 20:53:18 +0000 |
commit | d6266254c8d41fd065acc152e1135fa674e870ac (patch) | |
tree | 4bd2bcd4bb3b630e6370d406de7cdb8a04a3cd98 | |
parent | 30a9ef1d14ccbae0fe54b5ce7ec8edc057920823 (diff) | |
download | gnunet-gtk-d6266254c8d41fd065acc152e1135fa674e870ac.tar.gz gnunet-gtk-d6266254c8d41fd065acc152e1135fa674e870ac.zip |
better metadata handling and indicator for new search results
-rw-r--r-- | src/plugins/fs/meta.c | 6 | ||||
-rw-r--r-- | src/plugins/fs/status.c | 8 | ||||
-rw-r--r-- | src/plugins/fs/upload.c | 6 |
3 files changed, 19 insertions, 1 deletions
diff --git a/src/plugins/fs/meta.c b/src/plugins/fs/meta.c index ee4bfdd9..43e1531a 100644 --- a/src/plugins/fs/meta.c +++ b/src/plugins/fs/meta.c | |||
@@ -38,6 +38,8 @@ publishMetaData (EXTRACTOR_KeywordType type, const char *data, void *cls) | |||
38 | const char *stype; | 38 | const char *stype; |
39 | GtkTreeIter iter; | 39 | GtkTreeIter iter; |
40 | 40 | ||
41 | if (EXTRACTOR_isBinaryType(type)) | ||
42 | return GNUNET_OK; | ||
41 | stype = EXTRACTOR_getKeywordTypeAsString (type); | 43 | stype = EXTRACTOR_getKeywordTypeAsString (type); |
42 | if (stype == NULL) /* wrong LE version!? */ | 44 | if (stype == NULL) /* wrong LE version!? */ |
43 | stype = _("unknown"); | 45 | stype = _("unknown"); |
@@ -186,6 +188,10 @@ createMetaTypeComboBox (GladeXML * xml, const char *name) | |||
186 | GTK_TREE_MODEL (keywordTypeModel)); | 188 | GTK_TREE_MODEL (keywordTypeModel)); |
187 | for (type = 0; type < EXTRACTOR_getHighestKeywordTypeNumber (); type++) | 189 | for (type = 0; type < EXTRACTOR_getHighestKeywordTypeNumber (); type++) |
188 | { | 190 | { |
191 | if ( (type == EXTRACTOR_SPLIT) || | ||
192 | (type == EXTRACTOR_LOWERCASE) || | ||
193 | (EXTRACTOR_isBinaryType(type)) ) | ||
194 | continue; /* these are not legal... */ | ||
189 | stype = EXTRACTOR_getKeywordTypeAsString (type); | 195 | stype = EXTRACTOR_getKeywordTypeAsString (type); |
190 | gtk_list_store_append (keywordTypeModel, &iter); | 196 | gtk_list_store_append (keywordTypeModel, &iter); |
191 | gtk_list_store_set (keywordTypeModel, | 197 | gtk_list_store_set (keywordTypeModel, |
diff --git a/src/plugins/fs/status.c b/src/plugins/fs/status.c index a191794e..45a0e540 100644 --- a/src/plugins/fs/status.c +++ b/src/plugins/fs/status.c | |||
@@ -49,6 +49,8 @@ getColorCode (enum GNUNET_URITRACK_STATE state) | |||
49 | if (state & | 49 | if (state & |
50 | (GNUNET_URITRACK_SEARCH_RESULT | GNUNET_URITRACK_DIRECTORY_FOUND)) | 50 | (GNUNET_URITRACK_SEARCH_RESULT | GNUNET_URITRACK_DIRECTORY_FOUND)) |
51 | return "gray"; | 51 | return "gray"; |
52 | if (0 == state) | ||
53 | return "aquamarine"; | ||
52 | return NULL; | 54 | return NULL; |
53 | } | 55 | } |
54 | 56 | ||
@@ -72,6 +74,8 @@ getStatusName (enum GNUNET_URITRACK_STATE state) | |||
72 | if (state & | 74 | if (state & |
73 | (GNUNET_URITRACK_SEARCH_RESULT | GNUNET_URITRACK_DIRECTORY_FOUND)) | 75 | (GNUNET_URITRACK_SEARCH_RESULT | GNUNET_URITRACK_DIRECTORY_FOUND)) |
74 | return ""; | 76 | return ""; |
77 | if (0 == state) | ||
78 | return _("new"); | ||
75 | return ""; | 79 | return ""; |
76 | } | 80 | } |
77 | 81 | ||
@@ -99,6 +103,10 @@ getStatusLogo (enum GNUNET_URITRACK_STATE state) | |||
99 | return gtk_icon_theme_load_icon (gtk_icon_theme_get_default (), | 103 | return gtk_icon_theme_load_icon (gtk_icon_theme_get_default (), |
100 | GTK_STOCK_CANCEL, 16, 0, | 104 | GTK_STOCK_CANCEL, 16, 0, |
101 | (GError **) NULL); | 105 | (GError **) NULL); |
106 | if (0 == state) | ||
107 | return gtk_icon_theme_load_icon (gtk_icon_theme_get_default (), | ||
108 | GTK_STOCK_NEW, 16, 0, | ||
109 | (GError **) NULL); | ||
102 | return NULL; | 110 | return NULL; |
103 | } | 111 | } |
104 | 112 | ||
diff --git a/src/plugins/fs/upload.c b/src/plugins/fs/upload.c index 4b17e2c6..d126c17a 100644 --- a/src/plugins/fs/upload.c +++ b/src/plugins/fs/upload.c | |||
@@ -447,10 +447,14 @@ on_fsinsertuploadbutton_clicked_fs (gpointer dummy, GtkWidget * uploadButton) | |||
447 | while ((filenamerest > filename) && (filenamerest[-1] != DIR_SEPARATOR)) | 447 | while ((filenamerest > filename) && (filenamerest[-1] != DIR_SEPARATOR)) |
448 | filenamerest--; | 448 | filenamerest--; |
449 | GNUNET_meta_data_insert (meta, EXTRACTOR_FILENAME, filenamerest); | 449 | GNUNET_meta_data_insert (meta, EXTRACTOR_FILENAME, filenamerest); |
450 | keywordURI = GNUNET_meta_data_to_uri (meta); | ||
451 | while (GNUNET_OK == | ||
452 | GNUNET_meta_data_delete (meta, EXTRACTOR_SPLIT, NULL)); | ||
453 | while (GNUNET_OK == | ||
454 | GNUNET_meta_data_delete (meta, EXTRACTOR_LOWERCASE, NULL)); | ||
450 | createMetaDataListTreeView (metaXML, | 455 | createMetaDataListTreeView (metaXML, |
451 | "metaDataDialogMetaDataList", | 456 | "metaDataDialogMetaDataList", |
452 | "previewImage", meta); | 457 | "previewImage", meta); |
453 | keywordURI = GNUNET_meta_data_to_uri (meta); | ||
454 | GNUNET_meta_data_destroy (meta); | 458 | GNUNET_meta_data_destroy (meta); |
455 | createKeywordListTreeView (metaXML, | 459 | createKeywordListTreeView (metaXML, |
456 | "metaDataDialogKeywordList", keywordURI); | 460 | "metaDataDialogKeywordList", keywordURI); |