diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-09-15 20:00:02 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-09-15 20:00:02 +0000 |
commit | b5290908f7ee34c85d197c5382a194f18f06f0f2 (patch) | |
tree | f5c10246c4b55204fc12dc921507d35d281e8a87 /src | |
parent | dbbf5c6f679877488dfb6c84b5ce15784c02f15d (diff) | |
download | gnunet-gtk-b5290908f7ee34c85d197c5382a194f18f06f0f2.tar.gz gnunet-gtk-b5290908f7ee34c85d197c5382a194f18f06f0f2.zip |
-remove tailing whitespaces
Diffstat (limited to 'src')
37 files changed, 802 insertions, 802 deletions
diff --git a/src/fs/gnunet-fs-gtk.c b/src/fs/gnunet-fs-gtk.c index 739ff005..4b3f0c35 100644 --- a/src/fs/gnunet-fs-gtk.c +++ b/src/fs/gnunet-fs-gtk.c | |||
@@ -192,12 +192,12 @@ main_window_save_position (GtkWidget *main_window) | |||
192 | GNUNET_CONFIGURATION_set_value_number (cfg, "gnunet-fs-gtk", | 192 | GNUNET_CONFIGURATION_set_value_number (cfg, "gnunet-fs-gtk", |
193 | "MAIN_WINDOW_HEIGHT", window_height); | 193 | "MAIN_WINDOW_HEIGHT", window_height); |
194 | GNUNET_CONFIGURATION_set_value_string (cfg, "gnunet-fs-gtk", | 194 | GNUNET_CONFIGURATION_set_value_string (cfg, "gnunet-fs-gtk", |
195 | "MAIN_WINDOW_MAXIMIZED", | 195 | "MAIN_WINDOW_MAXIMIZED", |
196 | (maximized == GNUNET_YES) ? "YES" : "NO"); | 196 | (maximized == GNUNET_YES) ? "YES" : "NO"); |
197 | 197 | ||
198 | cfgDefault = GNUNET_CONFIGURATION_create (); | 198 | cfgDefault = GNUNET_CONFIGURATION_create (); |
199 | (void) GNUNET_CONFIGURATION_load (cfgDefault, NULL); /* load defaults only */ | 199 | (void) GNUNET_CONFIGURATION_load (cfgDefault, NULL); /* load defaults only */ |
200 | GNUNET_CONFIGURATION_write_diffs (cfgDefault, cfg, | 200 | GNUNET_CONFIGURATION_write_diffs (cfgDefault, cfg, |
201 | GNUNET_GTK_main_loop_get_configuration_file (ml)); | 201 | GNUNET_GTK_main_loop_get_configuration_file (ml)); |
202 | GNUNET_CONFIGURATION_destroy (cfgDefault); | 202 | GNUNET_CONFIGURATION_destroy (cfgDefault); |
203 | } | 203 | } |
@@ -231,7 +231,7 @@ GNUNET_GTK_main_window_configure_event_cb (GtkWidget *main_window, | |||
231 | */ | 231 | */ |
232 | static void | 232 | static void |
233 | shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 233 | shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
234 | { | 234 | { |
235 | struct SearchLookup *sl; | 235 | struct SearchLookup *sl; |
236 | struct PseuLookupContext *lctx; | 236 | struct PseuLookupContext *lctx; |
237 | 237 | ||
@@ -267,10 +267,10 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
267 | GNUNET_IDENTITY_disconnect (main_context.identity); | 267 | GNUNET_IDENTITY_disconnect (main_context.identity); |
268 | main_context.identity = NULL; | 268 | main_context.identity = NULL; |
269 | } | 269 | } |
270 | while (NULL != (sl = main_context.sl_head)) | 270 | while (NULL != (sl = main_context.sl_head)) |
271 | abort_search_lookup (sl); | 271 | abort_search_lookup (sl); |
272 | while (NULL != (lctx = main_context.lctx_head)) | 272 | while (NULL != (lctx = main_context.lctx_head)) |
273 | abort_pseu_lookup (lctx); | 273 | abort_pseu_lookup (lctx); |
274 | if (NULL != main_context.zm) | 274 | if (NULL != main_context.zm) |
275 | { | 275 | { |
276 | GNUNET_NAMESTORE_zone_monitor_stop (main_context.zm); | 276 | GNUNET_NAMESTORE_zone_monitor_stop (main_context.zm); |
@@ -372,7 +372,7 @@ process_paste (GtkClipboard *cb, | |||
372 | * TRUE if there is now a pop-up menu | 372 | * TRUE if there is now a pop-up menu |
373 | */ | 373 | */ |
374 | gboolean | 374 | gboolean |
375 | GNUNET_FS_GTK_main_window_button_press_event (GtkWidget * widget, | 375 | GNUNET_FS_GTK_main_window_button_press_event (GtkWidget * widget, |
376 | GdkEvent * event, | 376 | GdkEvent * event, |
377 | gpointer user_data) | 377 | gpointer user_data) |
378 | { | 378 | { |
@@ -500,8 +500,8 @@ format_service_list (unsigned int count, const char *const*list) | |||
500 | 500 | ||
501 | 501 | ||
502 | static void | 502 | static void |
503 | service_list_callback (void *cls, | 503 | service_list_callback (void *cls, |
504 | enum GNUNET_ARM_RequestStatus rs, | 504 | enum GNUNET_ARM_RequestStatus rs, |
505 | unsigned int count, | 505 | unsigned int count, |
506 | const char *const*list) | 506 | const char *const*list) |
507 | { | 507 | { |
@@ -537,7 +537,7 @@ arm_connection_state_change (void *cls, | |||
537 | 537 | ||
538 | static void | 538 | static void |
539 | service_status_change (void *cls, | 539 | service_status_change (void *cls, |
540 | const char *service, | 540 | const char *service, |
541 | enum GNUNET_ARM_ServiceStatus status) | 541 | enum GNUNET_ARM_ServiceStatus status) |
542 | { | 542 | { |
543 | /* Very crude, we can probably do better. | 543 | /* Very crude, we can probably do better. |
@@ -545,7 +545,7 @@ service_status_change (void *cls, | |||
545 | * to service status changes, then update the indicator, | 545 | * to service status changes, then update the indicator, |
546 | * without requesting a list from ARM every goddamned time? | 546 | * without requesting a list from ARM every goddamned time? |
547 | */ | 547 | */ |
548 | GNUNET_ARM_request_service_list (arm, | 548 | GNUNET_ARM_request_service_list (arm, |
549 | SERVICE_LIST_TIMEOUT, | 549 | SERVICE_LIST_TIMEOUT, |
550 | &service_list_callback, cls); | 550 | &service_list_callback, cls); |
551 | } | 551 | } |
@@ -563,7 +563,7 @@ service_status_change (void *cls, | |||
563 | * @param rd_count number of entries in @a rd array; 0 on removal | 563 | * @param rd_count number of entries in @a rd array; 0 on removal |
564 | * @param rd array of records for the label | 564 | * @param rd array of records for the label |
565 | */ | 565 | */ |
566 | static void | 566 | static void |
567 | monitor_zone_records (void *cls, | 567 | monitor_zone_records (void *cls, |
568 | const struct GNUNET_CRYPTO_EccPrivateKey *zone, | 568 | const struct GNUNET_CRYPTO_EccPrivateKey *zone, |
569 | const char *label, | 569 | const char *label, |
@@ -591,7 +591,7 @@ monitor_zone_records (void *cls, | |||
591 | if (gtk_tree_model_get_iter_first (tm, &iter)) | 591 | if (gtk_tree_model_get_iter_first (tm, &iter)) |
592 | do | 592 | do |
593 | { | 593 | { |
594 | gtk_tree_model_get (tm, &iter, | 594 | gtk_tree_model_get (tm, &iter, |
595 | 0, &id, | 595 | 0, &id, |
596 | -1); | 596 | -1); |
597 | if (0 == strcmp (id, label_gnu)) | 597 | if (0 == strcmp (id, label_gnu)) |
@@ -635,7 +635,7 @@ handle_sks_zone_identity (void *cls, | |||
635 | const char *name) | 635 | const char *name) |
636 | { | 636 | { |
637 | main_context.id_op = NULL; | 637 | main_context.id_op = NULL; |
638 | 638 | ||
639 | if (NULL == ego) | 639 | if (NULL == ego) |
640 | { | 640 | { |
641 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 641 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
@@ -649,7 +649,7 @@ handle_sks_zone_identity (void *cls, | |||
649 | main_context.zm = GNUNET_NAMESTORE_zone_monitor_start (main_context.cfg, | 649 | main_context.zm = GNUNET_NAMESTORE_zone_monitor_start (main_context.cfg, |
650 | main_context.sks_zone, | 650 | main_context.sks_zone, |
651 | &monitor_zone_records, | 651 | &monitor_zone_records, |
652 | NULL, | 652 | NULL, |
653 | NULL); | 653 | NULL); |
654 | } | 654 | } |
655 | 655 | ||
@@ -739,7 +739,7 @@ run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
739 | /* If anything is wrong - play safe and show it maximized */ | 739 | /* If anything is wrong - play safe and show it maximized */ |
740 | gtk_window_maximize (GTK_WINDOW (main_context.main_window)); | 740 | gtk_window_maximize (GTK_WINDOW (main_context.main_window)); |
741 | } | 741 | } |
742 | 742 | ||
743 | /* Allow multiple selection in metadata view; */ | 743 | /* Allow multiple selection in metadata view; */ |
744 | /* FIXME-GTK3: this can be done within (modern versions of) glade */ | 744 | /* FIXME-GTK3: this can be done within (modern versions of) glade */ |
745 | gtk_tree_selection_set_mode (gtk_tree_view_get_selection (main_context.md_treeview), | 745 | gtk_tree_selection_set_mode (gtk_tree_view_get_selection (main_context.md_treeview), |
@@ -762,7 +762,7 @@ run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
762 | 762 | ||
763 | /* initialize file-sharing */ | 763 | /* initialize file-sharing */ |
764 | fs = GNUNET_FS_start (main_context.cfg, "gnunet-fs-gtk", | 764 | fs = GNUNET_FS_start (main_context.cfg, "gnunet-fs-gtk", |
765 | &GNUNET_GTK_fs_event_handler, NULL, | 765 | &GNUNET_GTK_fs_event_handler, NULL, |
766 | GNUNET_FS_FLAGS_PERSISTENCE | GNUNET_FS_FLAGS_DO_PROBES, | 766 | GNUNET_FS_FLAGS_PERSISTENCE | GNUNET_FS_FLAGS_DO_PROBES, |
767 | GNUNET_FS_OPTIONS_DOWNLOAD_PARALLELISM, | 767 | GNUNET_FS_OPTIONS_DOWNLOAD_PARALLELISM, |
768 | (unsigned int) dl_parallel, | 768 | (unsigned int) dl_parallel, |
@@ -793,12 +793,12 @@ run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
793 | gtk_widget_show (main_context.main_window); | 793 | gtk_widget_show (main_context.main_window); |
794 | gtk_window_present (GTK_WINDOW (main_context.main_window)); | 794 | gtk_window_present (GTK_WINDOW (main_context.main_window)); |
795 | } | 795 | } |
796 | 796 | ||
797 | { | 797 | { |
798 | char *const *argv; | 798 | char *const *argv; |
799 | int argc; | 799 | int argc; |
800 | int i; | 800 | int i; |
801 | 801 | ||
802 | GNUNET_GTK_main_loop_get_args (ml, &argc, &argv); | 802 | GNUNET_GTK_main_loop_get_args (ml, &argc, &argv); |
803 | 803 | ||
804 | for (i = 0; i < argc; i++) | 804 | for (i = 0; i < argc; i++) |
@@ -826,7 +826,7 @@ main (int argc, char **argv) | |||
826 | gettext_noop ("start in tray mode"), 0, | 826 | gettext_noop ("start in tray mode"), 0, |
827 | &GNUNET_GETOPT_set_one, &tray_only}, | 827 | &GNUNET_GETOPT_set_one, &tray_only}, |
828 | GNUNET_GETOPT_OPTION_END | 828 | GNUNET_GETOPT_OPTION_END |
829 | }; | 829 | }; |
830 | #if HAVE_LIBUNIQUE | 830 | #if HAVE_LIBUNIQUE |
831 | int arge; | 831 | int arge; |
832 | 832 | ||
@@ -845,7 +845,7 @@ main (int argc, char **argv) | |||
845 | UniqueMessageData *msg; | 845 | UniqueMessageData *msg; |
846 | 846 | ||
847 | msg = unique_message_data_new (); | 847 | msg = unique_message_data_new (); |
848 | unique_message_data_set_text (msg, argv[arge], strlen (argv[arge])+1); | 848 | unique_message_data_set_text (msg, argv[arge], strlen (argv[arge])+1); |
849 | if (UNIQUE_RESPONSE_OK == response) | 849 | if (UNIQUE_RESPONSE_OK == response) |
850 | response = unique_app_send_message (unique_app, | 850 | response = unique_app_send_message (unique_app, |
851 | UNIQUE_OPEN, | 851 | UNIQUE_OPEN, |
@@ -857,14 +857,14 @@ main (int argc, char **argv) | |||
857 | 857 | ||
858 | return (UNIQUE_RESPONSE_OK == response) ? 0 : 1; | 858 | return (UNIQUE_RESPONSE_OK == response) ? 0 : 1; |
859 | } | 859 | } |
860 | 860 | ||
861 | #endif | 861 | #endif |
862 | if (GNUNET_OK != | 862 | if (GNUNET_OK != |
863 | GNUNET_GTK_main_loop_start ("gnunet-fs-gtk", | 863 | GNUNET_GTK_main_loop_start ("gnunet-fs-gtk", |
864 | "GTK GUI for GNUnet", | 864 | "GTK GUI for GNUnet", |
865 | argc, argv, | 865 | argc, argv, |
866 | options, | 866 | options, |
867 | "gnunet_fs_gtk_main_window.glade", | 867 | "gnunet_fs_gtk_main_window.glade", |
868 | &run)) | 868 | &run)) |
869 | { | 869 | { |
870 | #if HAVE_LIBUNIQUE | 870 | #if HAVE_LIBUNIQUE |
diff --git a/src/fs/gnunet-fs-gtk.h b/src/fs/gnunet-fs-gtk.h index fd0c8419..295a513e 100644 --- a/src/fs/gnunet-fs-gtk.h +++ b/src/fs/gnunet-fs-gtk.h | |||
@@ -78,7 +78,7 @@ struct SearchLookup | |||
78 | */ | 78 | */ |
79 | struct PseuLookupContext | 79 | struct PseuLookupContext |
80 | { | 80 | { |
81 | 81 | ||
82 | /** | 82 | /** |
83 | * Kept in a DLL. | 83 | * Kept in a DLL. |
84 | */ | 84 | */ |
@@ -97,7 +97,7 @@ struct PseuLookupContext | |||
97 | /** | 97 | /** |
98 | * Lookup request with GNS. | 98 | * Lookup request with GNS. |
99 | */ | 99 | */ |
100 | struct GNUNET_GNS_LookupRequest *lr; | 100 | struct GNUNET_GNS_LookupRequest *lr; |
101 | 101 | ||
102 | /** | 102 | /** |
103 | * Builder for the progress dialog that is displayed. | 103 | * Builder for the progress dialog that is displayed. |
@@ -132,7 +132,7 @@ struct PseuLookupContext | |||
132 | /** | 132 | /** |
133 | * Public key of the namespace we are trying to save. | 133 | * Public key of the namespace we are trying to save. |
134 | */ | 134 | */ |
135 | struct GNUNET_CRYPTO_EccPublicSignKey pkey; | 135 | struct GNUNET_CRYPTO_EccPublicSignKey pkey; |
136 | 136 | ||
137 | /** | 137 | /** |
138 | * Nickname we're saving under. | 138 | * Nickname we're saving under. |
@@ -272,12 +272,12 @@ enum GNUNET_GTK_FS_MAIN_WINDOW_SearchNamespaceModelColumns | |||
272 | * A gpointer. | 272 | * A gpointer. |
273 | */ | 273 | */ |
274 | GNUNET_GTK_FS_MAIN_WINDOW_SEARCH_NAMESPACE_MC_KEY = 1, | 274 | GNUNET_GTK_FS_MAIN_WINDOW_SEARCH_NAMESPACE_MC_KEY = 1, |
275 | 275 | ||
276 | /** | 276 | /** |
277 | * A gchararray. | 277 | * A gchararray. |
278 | */ | 278 | */ |
279 | GNUNET_GTK_FS_MAIN_WINDOW_SEARCH_NAMESPACE_MC_ROOT = 2, | 279 | GNUNET_GTK_FS_MAIN_WINDOW_SEARCH_NAMESPACE_MC_ROOT = 2, |
280 | 280 | ||
281 | /** | 281 | /** |
282 | * A gchararray. | 282 | * A gchararray. |
283 | */ | 283 | */ |
@@ -299,12 +299,12 @@ enum GNUNET_GTK_FS_MAIN_WINDOW_MetaDataModelColumns | |||
299 | * A guint. | 299 | * A guint. |
300 | */ | 300 | */ |
301 | GNUNET_GTK_FS_MAIN_WINDOW_META_DATA_MC_META_FORMAT = 1, | 301 | GNUNET_GTK_FS_MAIN_WINDOW_META_DATA_MC_META_FORMAT = 1, |
302 | 302 | ||
303 | /** | 303 | /** |
304 | * A gchararray. | 304 | * A gchararray. |
305 | */ | 305 | */ |
306 | GNUNET_GTK_FS_MAIN_WINDOW_META_DATA_MC_META_TYPE_STRING = 2, | 306 | GNUNET_GTK_FS_MAIN_WINDOW_META_DATA_MC_META_TYPE_STRING = 2, |
307 | 307 | ||
308 | /** | 308 | /** |
309 | * A gchararray. | 309 | * A gchararray. |
310 | */ | 310 | */ |
diff --git a/src/fs/gnunet-fs-gtk_anonymity-widgets.c b/src/fs/gnunet-fs-gtk_anonymity-widgets.c index 283899ee..14362e01 100644 --- a/src/fs/gnunet-fs-gtk_anonymity-widgets.c +++ b/src/fs/gnunet-fs-gtk_anonymity-widgets.c | |||
@@ -125,7 +125,7 @@ GNUNET_GTK_select_anonymity_combo_level (GtkComboBox *combo, guint sel_level) | |||
125 | gtk_combo_box_set_active_iter (combo, &iter); | 125 | gtk_combo_box_set_active_iter (combo, &iter); |
126 | return TRUE; | 126 | return TRUE; |
127 | } | 127 | } |
128 | } | 128 | } |
129 | while (gtk_tree_model_iter_next (model, &iter)); | 129 | while (gtk_tree_model_iter_next (model, &iter)); |
130 | return FALSE; | 130 | return FALSE; |
131 | } | 131 | } |
diff --git a/src/fs/gnunet-fs-gtk_common.c b/src/fs/gnunet-fs-gtk_common.c index dcfbfa9f..a35e3d1e 100644 --- a/src/fs/gnunet-fs-gtk_common.c +++ b/src/fs/gnunet-fs-gtk_common.c | |||
@@ -54,11 +54,11 @@ GNUNET_FS_GTK_dubious_meta_to_utf8 (enum EXTRACTOR_MetaFormat format, | |||
54 | return GNUNET_strdup (data); | 54 | return GNUNET_strdup (data); |
55 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 55 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
56 | _("Failed to validate supposedly utf-8 string `%s' of length %u, assuming it to be a C string\n"), | 56 | _("Failed to validate supposedly utf-8 string `%s' of length %u, assuming it to be a C string\n"), |
57 | data, | 57 | data, |
58 | (unsigned int) data_len); | 58 | (unsigned int) data_len); |
59 | format = EXTRACTOR_METAFORMAT_C_STRING; | 59 | format = EXTRACTOR_METAFORMAT_C_STRING; |
60 | /* fall-through */ | 60 | /* fall-through */ |
61 | case EXTRACTOR_METAFORMAT_C_STRING: | 61 | case EXTRACTOR_METAFORMAT_C_STRING: |
62 | if (data_len > 0) | 62 | if (data_len > 0) |
63 | { | 63 | { |
64 | /* There are no guarantees that data is NULL-terminated, AFAIU, | 64 | /* There are no guarantees that data is NULL-terminated, AFAIU, |
@@ -117,7 +117,7 @@ GNUNET_FS_GTK_add_meta_data_to_list_store (void *cls, const char *plugin_name, | |||
117 | GNUNET_GTK_FS_MAIN_WINDOW_META_DATA_MC_META_VALUE, | 117 | GNUNET_GTK_FS_MAIN_WINDOW_META_DATA_MC_META_VALUE, |
118 | data_to_insert, | 118 | data_to_insert, |
119 | -1); | 119 | -1); |
120 | GNUNET_free (data_to_insert); | 120 | GNUNET_free (data_to_insert); |
121 | return 0; | 121 | return 0; |
122 | } | 122 | } |
123 | 123 | ||
@@ -223,7 +223,7 @@ GNUNET_FS_GTK_mmap_and_scan (const char *filename, | |||
223 | * @return description of the result in utf-8, never NULL | 223 | * @return description of the result in utf-8, never NULL |
224 | */ | 224 | */ |
225 | char * | 225 | char * |
226 | GNUNET_FS_GTK_get_description_from_metadata (const struct GNUNET_CONTAINER_MetaData *meta, | 226 | GNUNET_FS_GTK_get_description_from_metadata (const struct GNUNET_CONTAINER_MetaData *meta, |
227 | int *is_a_dup) | 227 | int *is_a_dup) |
228 | { | 228 | { |
229 | char *desc; | 229 | char *desc; |
@@ -277,8 +277,8 @@ GNUNET_FS_GTK_handle_uri (const struct GNUNET_FS_Uri *uri, | |||
277 | GtkComboBox *ns_cb; | 277 | GtkComboBox *ns_cb; |
278 | GtkEntry *ns_entry; | 278 | GtkEntry *ns_entry; |
279 | struct GNUNET_CRYPTO_EccPublicSignKey want; | 279 | struct GNUNET_CRYPTO_EccPublicSignKey want; |
280 | 280 | ||
281 | 281 | ||
282 | if (GNUNET_FS_uri_test_chk (uri) || GNUNET_FS_uri_test_loc (uri)) | 282 | if (GNUNET_FS_uri_test_chk (uri) || GNUNET_FS_uri_test_loc (uri)) |
283 | { | 283 | { |
284 | struct DownloadEntry *de; | 284 | struct DownloadEntry *de; |
@@ -291,7 +291,7 @@ GNUNET_FS_GTK_handle_uri (const struct GNUNET_FS_Uri *uri, | |||
291 | } | 291 | } |
292 | query_entry = GTK_ENTRY (GNUNET_FS_GTK_get_main_window_object ("main_window_search_entry")); | 292 | query_entry = GTK_ENTRY (GNUNET_FS_GTK_get_main_window_object ("main_window_search_entry")); |
293 | ns_cb = GTK_COMBO_BOX (GNUNET_FS_GTK_get_main_window_object ("main_window_search_namespace_combobox")); | 293 | ns_cb = GTK_COMBO_BOX (GNUNET_FS_GTK_get_main_window_object ("main_window_search_namespace_combobox")); |
294 | ns_entry = GTK_ENTRY (gtk_bin_get_child (GTK_BIN (ns_cb))); | 294 | ns_entry = GTK_ENTRY (gtk_bin_get_child (GTK_BIN (ns_cb))); |
295 | if (GNUNET_FS_uri_test_sks (uri)) | 295 | if (GNUNET_FS_uri_test_sks (uri)) |
296 | { | 296 | { |
297 | /* select the namespace */ | 297 | /* select the namespace */ |
@@ -315,7 +315,7 @@ GNUNET_FS_GTK_handle_uri (const struct GNUNET_FS_Uri *uri, | |||
315 | query_string = GNUNET_FS_uri_sks_get_content_id (uri); | 315 | query_string = GNUNET_FS_uri_sks_get_content_id (uri); |
316 | gtk_entry_set_text (query_entry, | 316 | gtk_entry_set_text (query_entry, |
317 | query_string); | 317 | query_string); |
318 | GNUNET_free (query_string); | 318 | GNUNET_free (query_string); |
319 | } | 319 | } |
320 | return; | 320 | return; |
321 | } | 321 | } |
@@ -329,7 +329,7 @@ GNUNET_FS_GTK_handle_uri (const struct GNUNET_FS_Uri *uri, | |||
329 | 329 | ||
330 | query_string = GNUNET_FS_uri_ksk_to_string_fancy (uri); | 330 | query_string = GNUNET_FS_uri_ksk_to_string_fancy (uri); |
331 | gtk_entry_set_text (query_entry, | 331 | gtk_entry_set_text (query_entry, |
332 | query_string); | 332 | query_string); |
333 | GNUNET_free (query_string); | 333 | GNUNET_free (query_string); |
334 | } | 334 | } |
335 | return; | 335 | return; |
@@ -413,9 +413,9 @@ GNUNET_GTK_get_reference_from_iter (GtkTreeModel *model, GtkTreeIter *iter) | |||
413 | * FALSE if ran out of parents | 413 | * FALSE if ran out of parents |
414 | */ | 414 | */ |
415 | gboolean | 415 | gboolean |
416 | GNUNET_GTK_tree_model_get_next_flat_iter (GtkTreeModel *model, | 416 | GNUNET_GTK_tree_model_get_next_flat_iter (GtkTreeModel *model, |
417 | GtkTreeIter *iter, | 417 | GtkTreeIter *iter, |
418 | gboolean allow_children, | 418 | gboolean allow_children, |
419 | GtkTreeIter *next_iter) | 419 | GtkTreeIter *next_iter) |
420 | { | 420 | { |
421 | GtkTreeIter current_iter = *iter; | 421 | GtkTreeIter current_iter = *iter; |
diff --git a/src/fs/gnunet-fs-gtk_common.h b/src/fs/gnunet-fs-gtk_common.h index 9cc7ee29..bd9da77b 100644 --- a/src/fs/gnunet-fs-gtk_common.h +++ b/src/fs/gnunet-fs-gtk_common.h | |||
@@ -110,7 +110,7 @@ GNUNET_FS_GTK_dubious_meta_to_utf8 (enum EXTRACTOR_MetaFormat format, | |||
110 | * @return description of the result in utf-8, never NULL | 110 | * @return description of the result in utf-8, never NULL |
111 | */ | 111 | */ |
112 | char * | 112 | char * |
113 | GNUNET_FS_GTK_get_description_from_metadata (const struct GNUNET_CONTAINER_MetaData *meta, | 113 | GNUNET_FS_GTK_get_description_from_metadata (const struct GNUNET_CONTAINER_MetaData *meta, |
114 | int *is_a_dup); | 114 | int *is_a_dup); |
115 | 115 | ||
116 | 116 | ||
@@ -134,7 +134,7 @@ GNUNET_FS_GTK_handle_uri (const struct GNUNET_FS_Uri *uri, | |||
134 | * @return #GNUNET_OK if iter was filled, #GNUNET_SYSERR otherwise | 134 | * @return #GNUNET_OK if iter was filled, #GNUNET_SYSERR otherwise |
135 | */ | 135 | */ |
136 | int | 136 | int |
137 | GNUNET_GTK_get_iter_from_reference (GtkTreeRowReference *rr, | 137 | GNUNET_GTK_get_iter_from_reference (GtkTreeRowReference *rr, |
138 | GtkTreeIter *iter); | 138 | GtkTreeIter *iter); |
139 | 139 | ||
140 | 140 | ||
@@ -146,7 +146,7 @@ GNUNET_GTK_get_iter_from_reference (GtkTreeRowReference *rr, | |||
146 | * @return newly created reference or NULL in case of error | 146 | * @return newly created reference or NULL in case of error |
147 | */ | 147 | */ |
148 | GtkTreeRowReference * | 148 | GtkTreeRowReference * |
149 | GNUNET_GTK_get_reference_from_iter (GtkTreeModel *model, | 149 | GNUNET_GTK_get_reference_from_iter (GtkTreeModel *model, |
150 | GtkTreeIter *iter); | 150 | GtkTreeIter *iter); |
151 | 151 | ||
152 | 152 | ||
@@ -169,8 +169,8 @@ GNUNET_GTK_get_reference_from_iter (GtkTreeModel *model, | |||
169 | */ | 169 | */ |
170 | gboolean | 170 | gboolean |
171 | GNUNET_GTK_tree_model_get_next_flat_iter (GtkTreeModel *model, | 171 | GNUNET_GTK_tree_model_get_next_flat_iter (GtkTreeModel *model, |
172 | GtkTreeIter *iter, | 172 | GtkTreeIter *iter, |
173 | gboolean allow_children, | 173 | gboolean allow_children, |
174 | GtkTreeIter *next_iter); | 174 | GtkTreeIter *next_iter); |
175 | 175 | ||
176 | 176 | ||
diff --git a/src/fs/gnunet-fs-gtk_download-save-as.c b/src/fs/gnunet-fs-gtk_download-save-as.c index 5ebaed70..aa0d3604 100644 --- a/src/fs/gnunet-fs-gtk_download-save-as.c +++ b/src/fs/gnunet-fs-gtk_download-save-as.c | |||
@@ -20,7 +20,7 @@ | |||
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @file src/fs/gnunet-fs-gtk_download-save-as.c | 22 | * @file src/fs/gnunet-fs-gtk_download-save-as.c |
23 | * @brief functions for managing the 'save as' dialog | 23 | * @brief functions for managing the 'save as' dialog |
24 | * @author Christian Grothoff | 24 | * @author Christian Grothoff |
25 | */ | 25 | */ |
26 | #include "gnunet-fs-gtk_download-save-as.h" | 26 | #include "gnunet-fs-gtk_download-save-as.h" |
@@ -43,7 +43,7 @@ struct DownloadAsDialogContext | |||
43 | * Builder for the dialog. | 43 | * Builder for the dialog. |
44 | */ | 44 | */ |
45 | GtkBuilder *builder; | 45 | GtkBuilder *builder; |
46 | 46 | ||
47 | /** | 47 | /** |
48 | * Main dialog object. | 48 | * Main dialog object. |
49 | */ | 49 | */ |
@@ -97,13 +97,13 @@ GNUNET_FS_GTK_free_download_entry (struct DownloadEntry *de) | |||
97 | GNUNET_assert (NULL == de->dc); | 97 | GNUNET_assert (NULL == de->dc); |
98 | if (NULL != de->sr) | 98 | if (NULL != de->sr) |
99 | { | 99 | { |
100 | GNUNET_assert (de->sr->download == de); | 100 | GNUNET_assert (de->sr->download == de); |
101 | de->sr->download = NULL; | 101 | de->sr->download = NULL; |
102 | de->sr = NULL; | 102 | de->sr = NULL; |
103 | } | 103 | } |
104 | GNUNET_free_non_null (de->filename); | 104 | GNUNET_free_non_null (de->filename); |
105 | GNUNET_FS_uri_destroy (de->uri); | 105 | GNUNET_FS_uri_destroy (de->uri); |
106 | GNUNET_free (de); | 106 | GNUNET_free (de); |
107 | } | 107 | } |
108 | 108 | ||
109 | 109 | ||
@@ -136,7 +136,7 @@ GNUNET_GTK_save_as_dialog_delete_event_cb (GtkWidget * widget, GdkEvent * event, | |||
136 | * @param user_data the 'structDownloadAsDialogContext' of the dialog | 136 | * @param user_data the 'structDownloadAsDialogContext' of the dialog |
137 | */ | 137 | */ |
138 | void | 138 | void |
139 | GNUNET_GTK_save_as_dialog_response_cb (GtkDialog * dialog, | 139 | GNUNET_GTK_save_as_dialog_response_cb (GtkDialog * dialog, |
140 | gint response_id, | 140 | gint response_id, |
141 | gpointer user_data) | 141 | gpointer user_data) |
142 | { | 142 | { |
@@ -148,7 +148,7 @@ GNUNET_GTK_save_as_dialog_response_cb (GtkDialog * dialog, | |||
148 | if (GTK_RESPONSE_OK != response_id) | 148 | if (GTK_RESPONSE_OK != response_id) |
149 | { | 149 | { |
150 | GNUNET_FS_GTK_free_download_entry (de); | 150 | GNUNET_FS_GTK_free_download_entry (de); |
151 | gtk_widget_destroy (GTK_WIDGET (dialog)); | 151 | gtk_widget_destroy (GTK_WIDGET (dialog)); |
152 | clean_up_download_as_context (dlc); | 152 | clean_up_download_as_context (dlc); |
153 | return; | 153 | return; |
154 | } | 154 | } |
@@ -319,25 +319,25 @@ GNUNET_FS_GTK_download_context_start_download (struct DownloadEntry *de) | |||
319 | if ((NULL != de->sr) && (NULL != de->sr->result)) | 319 | if ((NULL != de->sr) && (NULL != de->sr->result)) |
320 | { | 320 | { |
321 | GNUNET_break (NULL != | 321 | GNUNET_break (NULL != |
322 | GNUNET_FS_download_start_from_search (fs, | 322 | GNUNET_FS_download_start_from_search (fs, |
323 | de->sr->result, | 323 | de->sr->result, |
324 | de->filename, | 324 | de->filename, |
325 | NULL /* tempname */ , | 325 | NULL /* tempname */ , |
326 | 0 /* offset */ , | 326 | 0 /* offset */ , |
327 | len, | 327 | len, |
328 | de->anonymity, opt, | 328 | de->anonymity, opt, |
329 | de)); | 329 | de)); |
330 | } | 330 | } |
331 | else | 331 | else |
332 | { | 332 | { |
333 | GNUNET_break (NULL != | 333 | GNUNET_break (NULL != |
334 | GNUNET_FS_download_start (fs, | 334 | GNUNET_FS_download_start (fs, |
335 | de->uri, | 335 | de->uri, |
336 | NULL /* meta data */, | 336 | NULL /* meta data */, |
337 | de->filename, NULL /* tempname */ , | 337 | de->filename, NULL /* tempname */ , |
338 | 0 /* offset */ , | 338 | 0 /* offset */ , |
339 | len, | 339 | len, |
340 | de->anonymity, opt, | 340 | de->anonymity, opt, |
341 | de, | 341 | de, |
342 | (NULL != de->pde) ? de->pde->dc : NULL)); | 342 | (NULL != de->pde) ? de->pde->dc : NULL)); |
343 | } | 343 | } |
diff --git a/src/fs/gnunet-fs-gtk_event-handler.c b/src/fs/gnunet-fs-gtk_event-handler.c index 0b96dc52..dc01c04c 100644 --- a/src/fs/gnunet-fs-gtk_event-handler.c +++ b/src/fs/gnunet-fs-gtk_event-handler.c | |||
@@ -184,7 +184,7 @@ enum PUBLISH_TAB_ModelColumns | |||
184 | /** | 184 | /** |
185 | * We have a single tab where we display publishing operations. | 185 | * We have a single tab where we display publishing operations. |
186 | * So there is only one instance of this struct. | 186 | * So there is only one instance of this struct. |
187 | */ | 187 | */ |
188 | struct PublishTab | 188 | struct PublishTab |
189 | { | 189 | { |
190 | 190 | ||
@@ -317,9 +317,9 @@ static struct GNUNET_FS_AnimationContext *animation_found_sources; | |||
317 | static struct GNUNET_FS_AnimationContext *animation_error; | 317 | static struct GNUNET_FS_AnimationContext *animation_error; |
318 | 318 | ||
319 | 319 | ||
320 | /** | 320 | /** |
321 | * Get the handle to the current search tab. | 321 | * Get the handle to the current search tab. |
322 | * | 322 | * |
323 | * @return handle to the current search tab. | 323 | * @return handle to the current search tab. |
324 | */ | 324 | */ |
325 | struct SearchTab * | 325 | struct SearchTab * |
@@ -331,9 +331,9 @@ GNUNET_FS_GTK_get_current_search_tab () | |||
331 | 331 | ||
332 | /* ***************** Search event handling ****************** */ | 332 | /* ***************** Search event handling ****************** */ |
333 | 333 | ||
334 | /** | 334 | /** |
335 | * Load an animation. | 335 | * Load an animation. |
336 | * | 336 | * |
337 | * @param basename basename of the animation file to load | 337 | * @param basename basename of the animation file to load |
338 | * @return handle to the animation. | 338 | * @return handle to the animation. |
339 | */ | 339 | */ |
@@ -371,7 +371,7 @@ clear_metadata_display () | |||
371 | * This should get the default download directory (so that GNUnet | 371 | * This should get the default download directory (so that GNUnet |
372 | * won't offer the user to download files to the 'bin' subdirectory, | 372 | * won't offer the user to download files to the 'bin' subdirectory, |
373 | * or whatever is the cwd). Returns NULL on failure (such as | 373 | * or whatever is the cwd). Returns NULL on failure (such as |
374 | * non-existing directory). | 374 | * non-existing directory). |
375 | * TODO: Should also preserve the last setting (so | 375 | * TODO: Should also preserve the last setting (so |
376 | * if the user saves files somewhere else, next time we default to | 376 | * if the user saves files somewhere else, next time we default to |
377 | * somewhere else, at least until application restart, or maybe even | 377 | * somewhere else, at least until application restart, or maybe even |
@@ -379,10 +379,10 @@ clear_metadata_display () | |||
379 | * | 379 | * |
380 | * Fills the @a buffer up to @a size bytes, returns a pointer to it. | 380 | * Fills the @a buffer up to @a size bytes, returns a pointer to it. |
381 | * Buffer will be NUL-terminated, if not NULL. | 381 | * Buffer will be NUL-terminated, if not NULL. |
382 | * | 382 | * |
383 | * @param buffer where to store the download directory name | 383 | * @param buffer where to store the download directory name |
384 | * @param size number of bytes available in @a buffer | 384 | * @param size number of bytes available in @a buffer |
385 | * @return | 385 | * @return |
386 | */ | 386 | */ |
387 | static char * | 387 | static char * |
388 | get_default_download_directory (char *buffer, size_t size) | 388 | get_default_download_directory (char *buffer, size_t size) |
@@ -416,9 +416,9 @@ get_default_download_directory (char *buffer, size_t size) | |||
416 | return buffer; | 416 | return buffer; |
417 | } | 417 | } |
418 | 418 | ||
419 | /** | 419 | /** |
420 | * | 420 | * |
421 | * | 421 | * |
422 | * @param tm which tree model are we inspecting | 422 | * @param tm which tree model are we inspecting |
423 | * @param iter location in the tree model we are getting data from | 423 | * @param iter location in the tree model we are getting data from |
424 | * @param finished_chain non-NULL for top-level call (for the item we're about to download), NULL otherwise | 424 | * @param finished_chain non-NULL for top-level call (for the item we're about to download), NULL otherwise |
@@ -430,7 +430,7 @@ get_default_download_directory (char *buffer, size_t size) | |||
430 | * @param relative_directory name of the directory in which we're about to download a file, relative to the root_directory. Whether it includes name of the file itself, depends on finished_chain; | 430 | * @param relative_directory name of the directory in which we're about to download a file, relative to the root_directory. Whether it includes name of the file itself, depends on finished_chain; |
431 | * Returned strings should be freed with GNUNET_free() if not NULL. | 431 | * Returned strings should be freed with GNUNET_free() if not NULL. |
432 | * @param anonymity anonymity level of one of the *parents. Initialize to -1. If none were downloaded, remains -1. | 432 | * @param anonymity anonymity level of one of the *parents. Initialize to -1. If none were downloaded, remains -1. |
433 | */ | 433 | */ |
434 | static void | 434 | static void |
435 | build_relative_name (GtkTreeModel *tm, | 435 | build_relative_name (GtkTreeModel *tm, |
436 | GtkTreeIter *iter, | 436 | GtkTreeIter *iter, |
@@ -444,7 +444,7 @@ build_relative_name (GtkTreeModel *tm, | |||
444 | GtkTreeIter parent; | 444 | GtkTreeIter parent; |
445 | 445 | ||
446 | gtk_tree_model_get (tm, iter, | 446 | gtk_tree_model_get (tm, iter, |
447 | SEARCH_TAB_MC_DOWNLOADED_FILENAME, &filename, | 447 | SEARCH_TAB_MC_DOWNLOADED_FILENAME, &filename, |
448 | SEARCH_TAB_MC_DOWNLOADED_ANONYMITY, &downloaded_anonymity, | 448 | SEARCH_TAB_MC_DOWNLOADED_ANONYMITY, &downloaded_anonymity, |
449 | -1); | 449 | -1); |
450 | 450 | ||
@@ -563,7 +563,7 @@ build_relative_name (GtkTreeModel *tm, | |||
563 | */ | 563 | */ |
564 | static char * | 564 | static char * |
565 | get_suggested_filename_anonymity2 (GtkTreeModel *tm, | 565 | get_suggested_filename_anonymity2 (GtkTreeModel *tm, |
566 | GtkTreeIter *iter, | 566 | GtkTreeIter *iter, |
567 | char **download_directory, | 567 | char **download_directory, |
568 | int *anonymity) | 568 | int *anonymity) |
569 | { | 569 | { |
@@ -581,9 +581,9 @@ get_suggested_filename_anonymity2 (GtkTreeModel *tm, | |||
581 | relname = NULL; | 581 | relname = NULL; |
582 | finished_chain = GNUNET_NO; | 582 | finished_chain = GNUNET_NO; |
583 | build_relative_name (tm, iter, &finished_chain, &downloaddir, &relname, &downloaded_anonymity); | 583 | build_relative_name (tm, iter, &finished_chain, &downloaddir, &relname, &downloaded_anonymity); |
584 | 584 | ||
585 | gtk_tree_model_get (tm, iter, | 585 | gtk_tree_model_get (tm, iter, |
586 | SEARCH_TAB_MC_METADATA, &meta, | 586 | SEARCH_TAB_MC_METADATA, &meta, |
587 | -1); | 587 | -1); |
588 | 588 | ||
589 | filename = GNUNET_FS_meta_data_suggest_filename (meta); | 589 | filename = GNUNET_FS_meta_data_suggest_filename (meta); |
@@ -648,7 +648,7 @@ struct SearchListPopupContext | |||
648 | * Tab where the search list popup was created. | 648 | * Tab where the search list popup was created. |
649 | */ | 649 | */ |
650 | struct SearchTab *tab; | 650 | struct SearchTab *tab; |
651 | 651 | ||
652 | /** | 652 | /** |
653 | * Row where the search list popup was created. | 653 | * Row where the search list popup was created. |
654 | */ | 654 | */ |
@@ -658,7 +658,7 @@ struct SearchListPopupContext | |||
658 | * Search result at the respective row. | 658 | * Search result at the respective row. |
659 | */ | 659 | */ |
660 | struct SearchResult *sr; | 660 | struct SearchResult *sr; |
661 | 661 | ||
662 | }; | 662 | }; |
663 | 663 | ||
664 | 664 | ||
@@ -666,7 +666,7 @@ struct SearchListPopupContext | |||
666 | * An item was selected from the context menu; destroy the menu shell. | 666 | * An item was selected from the context menu; destroy the menu shell. |
667 | * | 667 | * |
668 | * @param menushell menu to destroy | 668 | * @param menushell menu to destroy |
669 | * @param user_data the 'struct SearchListPopupContext' of the menu | 669 | * @param user_data the 'struct SearchListPopupContext' of the menu |
670 | */ | 670 | */ |
671 | static void | 671 | static void |
672 | search_list_popup_selection_done (GtkMenuShell *menushell, | 672 | search_list_popup_selection_done (GtkMenuShell *menushell, |
@@ -688,7 +688,7 @@ search_list_popup_selection_done (GtkMenuShell *menushell, | |||
688 | * @param user_data the 'struct SearchTab' that contains the tree view | 688 | * @param user_data the 'struct SearchTab' that contains the tree view |
689 | */ | 689 | */ |
690 | void | 690 | void |
691 | GNUNET_FS_GTK_search_treeview_cursor_changed (GtkTreeView *tv, | 691 | GNUNET_FS_GTK_search_treeview_cursor_changed (GtkTreeView *tv, |
692 | gpointer user_data); | 692 | gpointer user_data); |
693 | 693 | ||
694 | 694 | ||
@@ -853,7 +853,7 @@ GNUNET_GTK_search_frame_download_download_button_clicked_cb (GtkButton *button, | |||
853 | * @param user_data the main window context | 853 | * @param user_data the main window context |
854 | */ | 854 | */ |
855 | void | 855 | void |
856 | GNUNET_GTK_search_frame_download_filename_change_button_clicked_cb (GtkButton *button, | 856 | GNUNET_GTK_search_frame_download_filename_change_button_clicked_cb (GtkButton *button, |
857 | gpointer user_data) | 857 | gpointer user_data) |
858 | { | 858 | { |
859 | start_download2 (GNUNET_YES, GNUNET_NO); | 859 | start_download2 (GNUNET_YES, GNUNET_NO); |
@@ -862,9 +862,9 @@ GNUNET_GTK_search_frame_download_filename_change_button_clicked_cb (GtkButton *b | |||
862 | 862 | ||
863 | /** | 863 | /** |
864 | * "Download" was selected in the current search context menu. | 864 | * "Download" was selected in the current search context menu. |
865 | * | 865 | * |
866 | * @param item the 'download' menu item | 866 | * @param item the 'download' menu item |
867 | * @param user_data the `struct SearchListPopupContext` of the menu | 867 | * @param user_data the `struct SearchListPopupContext` of the menu |
868 | */ | 868 | */ |
869 | static void | 869 | static void |
870 | start_download_ctx_menu (GtkMenuItem *item, gpointer user_data) | 870 | start_download_ctx_menu (GtkMenuItem *item, gpointer user_data) |
@@ -904,9 +904,9 @@ handle_uri_from_ctx_menu (GtkMenuItem *item, gpointer user_data) | |||
904 | 904 | ||
905 | /** | 905 | /** |
906 | * "Download recursively" was selected in the current search context menu. | 906 | * "Download recursively" was selected in the current search context menu. |
907 | * | 907 | * |
908 | * @param item the 'download recursively' menu item | 908 | * @param item the 'download recursively' menu item |
909 | * @param user_data the 'struct SearchListPopupContext' of the menu | 909 | * @param user_data the 'struct SearchListPopupContext' of the menu |
910 | */ | 910 | */ |
911 | static void | 911 | static void |
912 | start_download_recursively_ctx_menu (GtkMenuItem *item, gpointer user_data) | 912 | start_download_recursively_ctx_menu (GtkMenuItem *item, gpointer user_data) |
@@ -919,9 +919,9 @@ start_download_recursively_ctx_menu (GtkMenuItem *item, gpointer user_data) | |||
919 | 919 | ||
920 | /** | 920 | /** |
921 | * "Download as..." was selected in the current search context menu. | 921 | * "Download as..." was selected in the current search context menu. |
922 | * | 922 | * |
923 | * @param item the 'download as...' menu item | 923 | * @param item the 'download as...' menu item |
924 | * @param user_data the 'struct SearchListPopupContext' of the menu | 924 | * @param user_data the 'struct SearchListPopupContext' of the menu |
925 | */ | 925 | */ |
926 | static void | 926 | static void |
927 | download_as_ctx_menu (GtkMenuItem *item, gpointer user_data) | 927 | download_as_ctx_menu (GtkMenuItem *item, gpointer user_data) |
@@ -933,7 +933,7 @@ download_as_ctx_menu (GtkMenuItem *item, gpointer user_data) | |||
933 | 933 | ||
934 | /** | 934 | /** |
935 | * Download "abort" was selected in the current search context menu. | 935 | * Download "abort" was selected in the current search context menu. |
936 | * | 936 | * |
937 | * @param item the 'abort' menu item | 937 | * @param item the 'abort' menu item |
938 | * @param user_data the 'struct SearchListPopupContext' with the download to abort. | 938 | * @param user_data the 'struct SearchListPopupContext' with the download to abort. |
939 | */ | 939 | */ |
@@ -953,7 +953,7 @@ abort_download_ctx_menu (GtkMenuItem *item, gpointer user_data) | |||
953 | 953 | ||
954 | /** | 954 | /** |
955 | * Copy current URI to clipboard was selected in the current context menu. | 955 | * Copy current URI to clipboard was selected in the current context menu. |
956 | * | 956 | * |
957 | * @param item the 'copy-to-clipboard' menu item | 957 | * @param item the 'copy-to-clipboard' menu item |
958 | * @param user_data the `struct SearchListPopupContext` of the menu | 958 | * @param user_data the `struct SearchListPopupContext` of the menu |
959 | */ | 959 | */ |
@@ -981,7 +981,7 @@ copy_search_uri_to_clipboard_ctx_menu (GtkMenuItem *item, gpointer user_data) | |||
981 | return; | 981 | return; |
982 | } | 982 | } |
983 | gtk_tree_model_get (tm, &iter, | 983 | gtk_tree_model_get (tm, &iter, |
984 | SEARCH_TAB_MC_URI, &uri, | 984 | SEARCH_TAB_MC_URI, &uri, |
985 | -1); | 985 | -1); |
986 | gtk_tree_path_free (path); | 986 | gtk_tree_path_free (path); |
987 | if (uri == NULL) | 987 | if (uri == NULL) |
@@ -998,11 +998,11 @@ copy_search_uri_to_clipboard_ctx_menu (GtkMenuItem *item, gpointer user_data) | |||
998 | 998 | ||
999 | 999 | ||
1000 | /** | 1000 | /** |
1001 | * Callback invoked for each embedded URIs. | 1001 | * Callback invoked for each embedded URIs. |
1002 | * | 1002 | * |
1003 | * @return 0 to continue iteration, 1 to abort | 1003 | * @return 0 to continue iteration, 1 to abort |
1004 | */ | 1004 | */ |
1005 | typedef int (*EmbeddedUriCallback) (void *cls, | 1005 | typedef int (*EmbeddedUriCallback) (void *cls, |
1006 | const struct GNUNET_FS_Uri *uri); | 1006 | const struct GNUNET_FS_Uri *uri); |
1007 | 1007 | ||
1008 | 1008 | ||
@@ -1038,8 +1038,8 @@ struct UriScannerCallbackContext | |||
1038 | * whatever the callback returned | 1038 | * whatever the callback returned |
1039 | */ | 1039 | */ |
1040 | static int | 1040 | static int |
1041 | check_for_embedded_uri (void *cls, | 1041 | check_for_embedded_uri (void *cls, |
1042 | const char *plugin_name, | 1042 | const char *plugin_name, |
1043 | enum EXTRACTOR_MetaType type, | 1043 | enum EXTRACTOR_MetaType type, |
1044 | enum EXTRACTOR_MetaFormat format, | 1044 | enum EXTRACTOR_MetaFormat format, |
1045 | const char *data_mime_type, | 1045 | const char *data_mime_type, |
@@ -1056,7 +1056,7 @@ check_for_embedded_uri (void *cls, | |||
1056 | (0 != strcmp ("text/plain", data_mime_type)) || | 1056 | (0 != strcmp ("text/plain", data_mime_type)) || |
1057 | (0 == data_size) || | 1057 | (0 == data_size) || |
1058 | ('\0' != data[data_size - 1]) ) | 1058 | ('\0' != data[data_size - 1]) ) |
1059 | return 0; | 1059 | return 0; |
1060 | emsg = NULL; | 1060 | emsg = NULL; |
1061 | uri = GNUNET_FS_uri_parse (data, &emsg); | 1061 | uri = GNUNET_FS_uri_parse (data, &emsg); |
1062 | if (NULL == uri) | 1062 | if (NULL == uri) |
@@ -1076,21 +1076,21 @@ check_for_embedded_uri (void *cls, | |||
1076 | 1076 | ||
1077 | 1077 | ||
1078 | /** | 1078 | /** |
1079 | * Search metadata for URIs, invoke the callback for each one. | 1079 | * Search metadata for URIs, invoke the callback for each one. |
1080 | * | 1080 | * |
1081 | * @param meta meta data to inspect | 1081 | * @param meta meta data to inspect |
1082 | * @param cb function to call on URIs that were found | 1082 | * @param cb function to call on URIs that were found |
1083 | * @param cls closure for @a cb | 1083 | * @param cls closure for @a cb |
1084 | */ | 1084 | */ |
1085 | static void | 1085 | static void |
1086 | find_embedded_uris (const struct GNUNET_CONTAINER_MetaData *meta, | 1086 | find_embedded_uris (const struct GNUNET_CONTAINER_MetaData *meta, |
1087 | EmbeddedUriCallback cb, void *cls) | 1087 | EmbeddedUriCallback cb, void *cls) |
1088 | { | 1088 | { |
1089 | struct UriScannerCallbackContext ctx; | 1089 | struct UriScannerCallbackContext ctx; |
1090 | 1090 | ||
1091 | ctx.cb = cb; | 1091 | ctx.cb = cb; |
1092 | ctx.cls = cls; | 1092 | ctx.cls = cls; |
1093 | GNUNET_CONTAINER_meta_data_iterate (meta, | 1093 | GNUNET_CONTAINER_meta_data_iterate (meta, |
1094 | &check_for_embedded_uri, &ctx); | 1094 | &check_for_embedded_uri, &ctx); |
1095 | } | 1095 | } |
1096 | 1096 | ||
@@ -1116,7 +1116,7 @@ struct UriPopulationContext | |||
1116 | /** | 1116 | /** |
1117 | * Called for every URI in metadata. Adds up to 3 menu items | 1117 | * Called for every URI in metadata. Adds up to 3 menu items |
1118 | * that will initiate downloads for these URIs | 1118 | * that will initiate downloads for these URIs |
1119 | * | 1119 | * |
1120 | * @param cls the `struct UriPopulationContext` | 1120 | * @param cls the `struct UriPopulationContext` |
1121 | * @param uri URI to download | 1121 | * @param uri URI to download |
1122 | * @return 0 if we might add more iterms, | 1122 | * @return 0 if we might add more iterms, |
@@ -1134,27 +1134,27 @@ populate_popup_with_uri_items (void *cls, | |||
1134 | 1134 | ||
1135 | ctx->counter++; | 1135 | ctx->counter++; |
1136 | uris = GNUNET_FS_uri_to_string (uri); | 1136 | uris = GNUNET_FS_uri_to_string (uri); |
1137 | GNUNET_asprintf (&label, | 1137 | GNUNET_asprintf (&label, |
1138 | _("URI #%d: %s"), | 1138 | _("URI #%d: %s"), |
1139 | ctx->counter, | 1139 | ctx->counter, |
1140 | uris); | 1140 | uris); |
1141 | GNUNET_free (uris); | 1141 | GNUNET_free (uris); |
1142 | child = gtk_image_menu_item_new_with_label (label); | 1142 | child = gtk_image_menu_item_new_with_label (label); |
1143 | GNUNET_free (label); | 1143 | GNUNET_free (label); |
1144 | 1144 | ||
1145 | ns_association_icon = gtk_image_new_from_icon_name ("gnunet-fs-gtk-ns-association", | 1145 | ns_association_icon = gtk_image_new_from_icon_name ("gnunet-fs-gtk-ns-association", |
1146 | GTK_ICON_SIZE_MENU); | 1146 | GTK_ICON_SIZE_MENU); |
1147 | 1147 | ||
1148 | /* Takes ownership of the icon */ | 1148 | /* Takes ownership of the icon */ |
1149 | gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (child), | 1149 | gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (child), |
1150 | ns_association_icon); | 1150 | ns_association_icon); |
1151 | 1151 | ||
1152 | g_object_set_data_full (G_OBJECT (child), | 1152 | g_object_set_data_full (G_OBJECT (child), |
1153 | "fs-uri", | 1153 | "fs-uri", |
1154 | GNUNET_FS_uri_dup (uri), | 1154 | GNUNET_FS_uri_dup (uri), |
1155 | (GDestroyNotify) &GNUNET_FS_uri_destroy); | 1155 | (GDestroyNotify) &GNUNET_FS_uri_destroy); |
1156 | g_signal_connect (child, "activate", | 1156 | g_signal_connect (child, "activate", |
1157 | G_CALLBACK (handle_uri_from_ctx_menu), | 1157 | G_CALLBACK (handle_uri_from_ctx_menu), |
1158 | NULL); | 1158 | NULL); |
1159 | gtk_widget_show (child); | 1159 | gtk_widget_show (child); |
1160 | gtk_menu_shell_append (GTK_MENU_SHELL (ctx->menu), child); | 1160 | gtk_menu_shell_append (GTK_MENU_SHELL (ctx->menu), child); |
@@ -1177,8 +1177,8 @@ populate_popup_with_uri_items (void *cls, | |||
1177 | * TRUE if there is now a pop-up menu | 1177 | * TRUE if there is now a pop-up menu |
1178 | */ | 1178 | */ |
1179 | static gboolean | 1179 | static gboolean |
1180 | search_list_popup (GtkTreeModel *tm, | 1180 | search_list_popup (GtkTreeModel *tm, |
1181 | struct SearchTab *tab, | 1181 | struct SearchTab *tab, |
1182 | gint init_button, | 1182 | gint init_button, |
1183 | guint32 event_time, | 1183 | guint32 event_time, |
1184 | GtkTreeIter *iter) | 1184 | GtkTreeIter *iter) |
@@ -1251,8 +1251,8 @@ search_list_popup (GtkTreeModel *tm, | |||
1251 | 1251 | ||
1252 | /* check for embedded URIs */ | 1252 | /* check for embedded URIs */ |
1253 | uri_pop_ctx.counter = 0; | 1253 | uri_pop_ctx.counter = 0; |
1254 | uri_pop_ctx.menu = menu; | 1254 | uri_pop_ctx.menu = menu; |
1255 | find_embedded_uris (meta, | 1255 | find_embedded_uris (meta, |
1256 | &populate_popup_with_uri_items, | 1256 | &populate_popup_with_uri_items, |
1257 | &uri_pop_ctx); | 1257 | &uri_pop_ctx); |
1258 | if (0 < uri_pop_ctx.counter) | 1258 | if (0 < uri_pop_ctx.counter) |
@@ -1301,7 +1301,7 @@ search_list_popup (GtkTreeModel *tm, | |||
1301 | * TRUE if there is now a pop-up menu | 1301 | * TRUE if there is now a pop-up menu |
1302 | */ | 1302 | */ |
1303 | gboolean | 1303 | gboolean |
1304 | GNUNET_FS_GTK_search_treeview_popup_menu (GtkWidget *widget, | 1304 | GNUNET_FS_GTK_search_treeview_popup_menu (GtkWidget *widget, |
1305 | gpointer user_data) | 1305 | gpointer user_data) |
1306 | { | 1306 | { |
1307 | GtkTreeView *tv = GTK_TREE_VIEW (widget); | 1307 | GtkTreeView *tv = GTK_TREE_VIEW (widget); |
@@ -1328,7 +1328,7 @@ GNUNET_FS_GTK_search_treeview_popup_menu (GtkWidget *widget, | |||
1328 | * TRUE to stop the propagation | 1328 | * TRUE to stop the propagation |
1329 | */ | 1329 | */ |
1330 | gboolean | 1330 | gboolean |
1331 | GNUNET_FS_GTK_search_treeview_button_press_event (GtkWidget * widget, | 1331 | GNUNET_FS_GTK_search_treeview_button_press_event (GtkWidget * widget, |
1332 | GdkEvent * event, | 1332 | GdkEvent * event, |
1333 | gpointer user_data) | 1333 | gpointer user_data) |
1334 | { | 1334 | { |
@@ -1345,12 +1345,12 @@ GNUNET_FS_GTK_search_treeview_button_press_event (GtkWidget * widget, | |||
1345 | if (! gtk_tree_view_get_path_at_pos (tv, | 1345 | if (! gtk_tree_view_get_path_at_pos (tv, |
1346 | event_button->x, event_button->y, | 1346 | event_button->x, event_button->y, |
1347 | &path, NULL, NULL, NULL)) | 1347 | &path, NULL, NULL, NULL)) |
1348 | return FALSE; /* click outside of area with values, ignore */ | 1348 | return FALSE; /* click outside of area with values, ignore */ |
1349 | tm = gtk_tree_view_get_model (tv); | 1349 | tm = gtk_tree_view_get_model (tv); |
1350 | if (! gtk_tree_model_get_iter (tm, &iter, path)) | 1350 | if (! gtk_tree_model_get_iter (tm, &iter, path)) |
1351 | return FALSE; /* not sure how we got a path but no iter... */ | 1351 | return FALSE; /* not sure how we got a path but no iter... */ |
1352 | gtk_tree_path_free (path); | 1352 | gtk_tree_path_free (path); |
1353 | search_list_popup (tm, tab, | 1353 | search_list_popup (tm, tab, |
1354 | event_button->button, | 1354 | event_button->button, |
1355 | event_button->time, | 1355 | event_button->time, |
1356 | &iter); | 1356 | &iter); |
@@ -1444,7 +1444,7 @@ close_search_tab (struct SearchTab *tab) | |||
1444 | 1444 | ||
1445 | /** | 1445 | /** |
1446 | * Close the 'uri_tab'. | 1446 | * Close the 'uri_tab'. |
1447 | */ | 1447 | */ |
1448 | void | 1448 | void |
1449 | GNUNET_FS_GTK_close_uri_tab_ () | 1449 | GNUNET_FS_GTK_close_uri_tab_ () |
1450 | { | 1450 | { |
@@ -1463,7 +1463,7 @@ GNUNET_FS_GTK_close_uri_tab_ () | |||
1463 | * to refer to the new model. | 1463 | * to refer to the new model. |
1464 | * | 1464 | * |
1465 | * @param src_model source model | 1465 | * @param src_model source model |
1466 | * @param src_iter parent of the nodes to move | 1466 | * @param src_iter parent of the nodes to move |
1467 | * @param dst_tab destination tab | 1467 | * @param dst_tab destination tab |
1468 | * @param dst_iter new parent of the entries we are moving | 1468 | * @param dst_iter new parent of the entries we are moving |
1469 | */ | 1469 | */ |
@@ -1610,10 +1610,10 @@ download_lost_parent (struct DownloadEntry *de) | |||
1610 | return; | 1610 | return; |
1611 | } | 1611 | } |
1612 | gtk_tree_path_free (path); | 1612 | gtk_tree_path_free (path); |
1613 | gtk_tree_model_get (tm_old, &iter_old, | 1613 | gtk_tree_model_get (tm_old, &iter_old, |
1614 | SEARCH_TAB_MC_METADATA, &meta, | 1614 | SEARCH_TAB_MC_METADATA, &meta, |
1615 | SEARCH_TAB_MC_URI, &uri, | 1615 | SEARCH_TAB_MC_URI, &uri, |
1616 | SEARCH_TAB_MC_PERCENT_PROGRESS, &percent_progress, | 1616 | SEARCH_TAB_MC_PERCENT_PROGRESS, &percent_progress, |
1617 | SEARCH_TAB_MC_PERCENT_AVAILABILITY, &percent_availability, | 1617 | SEARCH_TAB_MC_PERCENT_AVAILABILITY, &percent_availability, |
1618 | SEARCH_TAB_MC_UNKNOWN_AVAILABILITY, &unknown_availability, | 1618 | SEARCH_TAB_MC_UNKNOWN_AVAILABILITY, &unknown_availability, |
1619 | SEARCH_TAB_MC_FILENAME, &filename, | 1619 | SEARCH_TAB_MC_FILENAME, &filename, |
@@ -1700,9 +1700,9 @@ move_downloads_in_subtree (GtkTreeModel *tm, | |||
1700 | gtk_tree_model_get (tm, &child, | 1700 | gtk_tree_model_get (tm, &child, |
1701 | SEARCH_TAB_MC_METADATA, &meta, | 1701 | SEARCH_TAB_MC_METADATA, &meta, |
1702 | SEARCH_TAB_MC_URI, &uri, | 1702 | SEARCH_TAB_MC_URI, &uri, |
1703 | SEARCH_TAB_MC_SEARCH_RESULT, &sr, | 1703 | SEARCH_TAB_MC_SEARCH_RESULT, &sr, |
1704 | -1); | 1704 | -1); |
1705 | if (NULL != sr->download) | 1705 | if (NULL != sr->download) |
1706 | { | 1706 | { |
1707 | if (sr->download->is_done == GNUNET_YES) | 1707 | if (sr->download->is_done == GNUNET_YES) |
1708 | { | 1708 | { |
@@ -1731,7 +1731,7 @@ move_downloads_in_subtree (GtkTreeModel *tm, | |||
1731 | SEARCH_TAB_MC_SEARCH_RESULT, NULL, | 1731 | SEARCH_TAB_MC_SEARCH_RESULT, NULL, |
1732 | -1); | 1732 | -1); |
1733 | } | 1733 | } |
1734 | while (TRUE == gtk_tree_model_iter_next (tm, &child)); | 1734 | while (TRUE == gtk_tree_model_iter_next (tm, &child)); |
1735 | } | 1735 | } |
1736 | } | 1736 | } |
1737 | 1737 | ||
@@ -1754,7 +1754,7 @@ free_search_result (struct SearchResult *sr) | |||
1754 | struct GNUNET_CONTAINER_MetaData *meta; | 1754 | struct GNUNET_CONTAINER_MetaData *meta; |
1755 | 1755 | ||
1756 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1756 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1757 | "Freeing a search result SR=%p\n", | 1757 | "Freeing a search result SR=%p\n", |
1758 | sr); | 1758 | sr); |
1759 | if ( (NULL == sr) || | 1759 | if ( (NULL == sr) || |
1760 | (NULL == sr->rr) || | 1760 | (NULL == sr->rr) || |
@@ -1796,7 +1796,7 @@ free_search_result (struct SearchResult *sr) | |||
1796 | * @param user_data the 'struct SearchTab' that contains the tree view | 1796 | * @param user_data the 'struct SearchTab' that contains the tree view |
1797 | */ | 1797 | */ |
1798 | void | 1798 | void |
1799 | GNUNET_FS_GTK_search_treeview_cursor_changed (GtkTreeView *tv, | 1799 | GNUNET_FS_GTK_search_treeview_cursor_changed (GtkTreeView *tv, |
1800 | gpointer user_data) | 1800 | gpointer user_data) |
1801 | { | 1801 | { |
1802 | struct SearchTab *tab = user_data; | 1802 | struct SearchTab *tab = user_data; |
@@ -1861,7 +1861,7 @@ GNUNET_FS_GTK_search_treeview_cursor_changed (GtkTreeView *tv, | |||
1861 | 1861 | ||
1862 | gtk_entry_set_text (mctx->download_name_entry, filename != NULL ? filename : NULL); | 1862 | gtk_entry_set_text (mctx->download_name_entry, filename != NULL ? filename : NULL); |
1863 | gtk_file_chooser_set_current_folder (mctx->download_location_chooser, download_directory); | 1863 | gtk_file_chooser_set_current_folder (mctx->download_location_chooser, download_directory); |
1864 | 1864 | ||
1865 | gtk_widget_show_all (GTK_WIDGET (mctx->download_panel)); | 1865 | gtk_widget_show_all (GTK_WIDGET (mctx->download_panel)); |
1866 | GNUNET_free_non_null (filename); | 1866 | GNUNET_free_non_null (filename); |
1867 | GNUNET_free (download_directory); | 1867 | GNUNET_free (download_directory); |
@@ -1922,7 +1922,7 @@ GNUNET_GTK_main_window_notebook_switch_page_cb (GtkWidget * dummy, | |||
1922 | return; | 1922 | return; |
1923 | } | 1923 | } |
1924 | gtk_widget_hide (GTK_WIDGET (mctx->download_panel)); | 1924 | gtk_widget_hide (GTK_WIDGET (mctx->download_panel)); |
1925 | /* active tab is not a search tab (likely the 'publish' tab), | 1925 | /* active tab is not a search tab (likely the 'publish' tab), |
1926 | clear meta data and preview widgets */ | 1926 | clear meta data and preview widgets */ |
1927 | gtk_image_clear (mctx->preview_image); | 1927 | gtk_image_clear (mctx->preview_image); |
1928 | gtk_list_store_clear (mctx->md_liststore); | 1928 | gtk_list_store_clear (mctx->md_liststore); |
@@ -1995,7 +1995,7 @@ GNUNET_FS_GTK_search_result_play_button_clicked (GtkButton * button, gpointer us | |||
1995 | } | 1995 | } |
1996 | GNUNET_FS_search_continue (tab->sc); | 1996 | GNUNET_FS_search_continue (tab->sc); |
1997 | gtk_widget_show (tab->pause_button); | 1997 | gtk_widget_show (tab->pause_button); |
1998 | gtk_widget_hide (tab->play_button); | 1998 | gtk_widget_hide (tab->play_button); |
1999 | } | 1999 | } |
2000 | 2000 | ||
2001 | 2001 | ||
@@ -2036,7 +2036,7 @@ stop_downloads_in_subtree (GtkTreeModel *tm, | |||
2036 | if (GNUNET_YES != stop_downloads_in_subtree (tm, &child)) | 2036 | if (GNUNET_YES != stop_downloads_in_subtree (tm, &child)) |
2037 | ret = GNUNET_NO; | 2037 | ret = GNUNET_NO; |
2038 | } | 2038 | } |
2039 | while (TRUE == gtk_tree_model_iter_next (tm, &child)); | 2039 | while (TRUE == gtk_tree_model_iter_next (tm, &child)); |
2040 | } | 2040 | } |
2041 | return ret; | 2041 | return ret; |
2042 | } | 2042 | } |
@@ -2065,7 +2065,7 @@ GNUNET_FS_GTK_search_result_clear_button_clicked (GtkButton * button, gpointer u | |||
2065 | if (! gtk_tree_model_get_iter_first (tm, &iter)) | 2065 | if (! gtk_tree_model_get_iter_first (tm, &iter)) |
2066 | return; | 2066 | return; |
2067 | do | 2067 | do |
2068 | { | 2068 | { |
2069 | gtk_tree_model_get (tm, &iter, | 2069 | gtk_tree_model_get (tm, &iter, |
2070 | SEARCH_TAB_MC_SEARCH_RESULT, &sr, | 2070 | SEARCH_TAB_MC_SEARCH_RESULT, &sr, |
2071 | -1); | 2071 | -1); |
@@ -2080,7 +2080,7 @@ GNUNET_FS_GTK_search_result_clear_button_clicked (GtkButton * button, gpointer u | |||
2080 | (GNUNET_YES == stop_downloads_in_subtree (tm, &iter)) ) | 2080 | (GNUNET_YES == stop_downloads_in_subtree (tm, &iter)) ) |
2081 | { | 2081 | { |
2082 | /* no active download and no associated FS-API search result; | 2082 | /* no active download and no associated FS-API search result; |
2083 | so this must be some left-over entry from an opened | 2083 | so this must be some left-over entry from an opened |
2084 | directory; clean it up */ | 2084 | directory; clean it up */ |
2085 | free_search_result (sr); | 2085 | free_search_result (sr); |
2086 | /* the above call clobbered our 'iter', restart from the beginning... */ | 2086 | /* the above call clobbered our 'iter', restart from the beginning... */ |
@@ -2100,7 +2100,7 @@ GNUNET_FS_GTK_search_result_clear_button_clicked (GtkButton * button, gpointer u | |||
2100 | * @param emsg the error message | 2100 | * @param emsg the error message |
2101 | */ | 2101 | */ |
2102 | static void | 2102 | static void |
2103 | handle_search_error (struct SearchTab *tab, | 2103 | handle_search_error (struct SearchTab *tab, |
2104 | const char *emsg) | 2104 | const char *emsg) |
2105 | { | 2105 | { |
2106 | gtk_label_set_text (tab->label, _("Error!")); | 2106 | gtk_label_set_text (tab->label, _("Error!")); |
@@ -2183,7 +2183,7 @@ update_search_result (struct SearchResult *sr, | |||
2183 | percent_avail = 50 + (gint) (availability_rank * 50.0 / availability_certainty); | 2183 | percent_avail = 50 + (gint) (availability_rank * 50.0 / availability_certainty); |
2184 | else | 2184 | else |
2185 | percent_avail = 50; | 2185 | percent_avail = 50; |
2186 | gtk_tree_store_set (ts, &iter, | 2186 | gtk_tree_store_set (ts, &iter, |
2187 | SEARCH_TAB_MC_METADATA, GNUNET_CONTAINER_meta_data_duplicate (meta), | 2187 | SEARCH_TAB_MC_METADATA, GNUNET_CONTAINER_meta_data_duplicate (meta), |
2188 | SEARCH_TAB_MC_PREVIEW, pixbuf, | 2188 | SEARCH_TAB_MC_PREVIEW, pixbuf, |
2189 | SEARCH_TAB_MC_PERCENT_AVAILABILITY, (guint) percent_avail, | 2189 | SEARCH_TAB_MC_PERCENT_AVAILABILITY, (guint) percent_avail, |
@@ -2219,9 +2219,9 @@ update_search_result (struct SearchResult *sr, | |||
2219 | } | 2219 | } |
2220 | 2220 | ||
2221 | 2221 | ||
2222 | /** | 2222 | /** |
2223 | * If called, sets the `gboolean` pointer in @a cls to TRUE. | 2223 | * If called, sets the `gboolean` pointer in @a cls to TRUE. |
2224 | * | 2224 | * |
2225 | * @param cls pointer to a `gboolean` | 2225 | * @param cls pointer to a `gboolean` |
2226 | * @param sks_uri a URI | 2226 | * @param sks_uri a URI |
2227 | * @return 1 (abort iteration) | 2227 | * @return 1 (abort iteration) |
@@ -2238,14 +2238,14 @@ see_if_there_are_any_uris (void *cls, | |||
2238 | 2238 | ||
2239 | 2239 | ||
2240 | /** | 2240 | /** |
2241 | * Add a search result to the given search tab. This function is called | 2241 | * Add a search result to the given search tab. This function is called |
2242 | * not only for 'normal' search results but also for directories that | 2242 | * not only for 'normal' search results but also for directories that |
2243 | * are being opened and if the user manually enters a URI. | 2243 | * are being opened and if the user manually enters a URI. |
2244 | * | 2244 | * |
2245 | * @param tab search tab to extend, never NULL | 2245 | * @param tab search tab to extend, never NULL |
2246 | * @param anonymity anonymity level to use for probes for this result | 2246 | * @param anonymity anonymity level to use for probes for this result |
2247 | * @param parent_rr reference to parent entry in search tab, NULL for normal | 2247 | * @param parent_rr reference to parent entry in search tab, NULL for normal |
2248 | * search results, | 2248 | * search results, |
2249 | * @param uri uri to add, can be NULL for top-level entry of a directory opened from disk | 2249 | * @param uri uri to add, can be NULL for top-level entry of a directory opened from disk |
2250 | * (in this case, we don't know the URI and should probably not | 2250 | * (in this case, we don't know the URI and should probably not |
2251 | * bother to calculate it) | 2251 | * bother to calculate it) |
@@ -2257,7 +2257,7 @@ see_if_there_are_any_uris (void *cls, | |||
2257 | * model at 'iter') | 2257 | * model at 'iter') |
2258 | */ | 2258 | */ |
2259 | struct SearchResult * | 2259 | struct SearchResult * |
2260 | GNUNET_GTK_add_search_result (struct SearchTab *tab, | 2260 | GNUNET_GTK_add_search_result (struct SearchTab *tab, |
2261 | uint32_t anonymity, | 2261 | uint32_t anonymity, |
2262 | GtkTreeRowReference *parent_rr, | 2262 | GtkTreeRowReference *parent_rr, |
2263 | const struct GNUNET_FS_Uri *uri, | 2263 | const struct GNUNET_FS_Uri *uri, |
@@ -2303,14 +2303,14 @@ GNUNET_GTK_add_search_result (struct SearchTab *tab, | |||
2303 | else | 2303 | else |
2304 | { | 2304 | { |
2305 | fsize = 0; | 2305 | fsize = 0; |
2306 | mime = GNUNET_strdup ("gnunet/namespace"); | 2306 | mime = GNUNET_strdup ("gnunet/namespace"); |
2307 | status_colour = "lightgreen"; | 2307 | status_colour = "lightgreen"; |
2308 | } | 2308 | } |
2309 | uris = GNUNET_FS_uri_to_string (uri); | 2309 | uris = GNUNET_FS_uri_to_string (uri); |
2310 | } | 2310 | } |
2311 | desc = GNUNET_FS_GTK_get_description_from_metadata (meta, &desc_is_a_dup); | 2311 | desc = GNUNET_FS_GTK_get_description_from_metadata (meta, &desc_is_a_dup); |
2312 | pixbuf = GNUNET_FS_GTK_get_thumbnail_from_meta_data (meta); | 2312 | pixbuf = GNUNET_FS_GTK_get_thumbnail_from_meta_data (meta); |
2313 | find_embedded_uris (meta, | 2313 | find_embedded_uris (meta, |
2314 | &see_if_there_are_any_uris, | 2314 | &see_if_there_are_any_uris, |
2315 | &show_uri_association); | 2315 | &show_uri_association); |
2316 | 2316 | ||
@@ -2352,7 +2352,7 @@ GNUNET_GTK_add_search_result (struct SearchTab *tab, | |||
2352 | } | 2352 | } |
2353 | gtk_tree_store_insert_with_values (ts, &iter, pitr, G_MAXINT, | 2353 | gtk_tree_store_insert_with_values (ts, &iter, pitr, G_MAXINT, |
2354 | SEARCH_TAB_MC_METADATA, GNUNET_CONTAINER_meta_data_duplicate (meta), | 2354 | SEARCH_TAB_MC_METADATA, GNUNET_CONTAINER_meta_data_duplicate (meta), |
2355 | SEARCH_TAB_MC_URI, (uri == NULL) ? NULL : GNUNET_FS_uri_dup (uri), | 2355 | SEARCH_TAB_MC_URI, (uri == NULL) ? NULL : GNUNET_FS_uri_dup (uri), |
2356 | SEARCH_TAB_MC_FILESIZE, fsize, | 2356 | SEARCH_TAB_MC_FILESIZE, fsize, |
2357 | SEARCH_TAB_MC_PREVIEW, pixbuf, | 2357 | SEARCH_TAB_MC_PREVIEW, pixbuf, |
2358 | SEARCH_TAB_MC_PERCENT_PROGRESS, 0, | 2358 | SEARCH_TAB_MC_PERCENT_PROGRESS, 0, |
@@ -2387,7 +2387,7 @@ GNUNET_GTK_add_search_result (struct SearchTab *tab, | |||
2387 | while (NULL != tab->parent) | 2387 | while (NULL != tab->parent) |
2388 | tab = tab->parent->tab; | 2388 | tab = tab->parent->tab; |
2389 | tab->num_results++; | 2389 | tab->num_results++; |
2390 | 2390 | ||
2391 | return sr; | 2391 | return sr; |
2392 | } | 2392 | } |
2393 | 2393 | ||
@@ -2427,7 +2427,7 @@ GNUNET_FS_GTK_set_item_downloaded_name (GtkTreeStore *ts, GtkTreeRowReference *r | |||
2427 | char *suggested_filename; | 2427 | char *suggested_filename; |
2428 | int anonymity = -1; | 2428 | int anonymity = -1; |
2429 | 2429 | ||
2430 | gtk_tree_store_set (ts, &iter, | 2430 | gtk_tree_store_set (ts, &iter, |
2431 | SEARCH_TAB_MC_DOWNLOADED_FILENAME, filename, | 2431 | SEARCH_TAB_MC_DOWNLOADED_FILENAME, filename, |
2432 | -1); | 2432 | -1); |
2433 | 2433 | ||
@@ -2492,7 +2492,7 @@ GNUNET_FS_GTK_set_item_downloaded_name (GtkTreeStore *ts, GtkTreeRowReference *r | |||
2492 | * model at 'iter') | 2492 | * model at 'iter') |
2493 | */ | 2493 | */ |
2494 | static struct SearchResult * | 2494 | static struct SearchResult * |
2495 | process_search_result (struct SearchTab *tab, | 2495 | process_search_result (struct SearchTab *tab, |
2496 | uint32_t anonymity, | 2496 | uint32_t anonymity, |
2497 | struct SearchResult *parent, | 2497 | struct SearchResult *parent, |
2498 | const struct GNUNET_FS_Uri *uri, | 2498 | const struct GNUNET_FS_Uri *uri, |
@@ -2696,18 +2696,18 @@ GNUNET_GTK_add_to_uri_tab (uint32_t anonymity, | |||
2696 | /** | 2696 | /** |
2697 | * Change the (background) color of the given download entry. | 2697 | * Change the (background) color of the given download entry. |
2698 | * | 2698 | * |
2699 | * @param de entry to change | 2699 | * @param de entry to change |
2700 | * @param color name of the color to use | 2700 | * @param color name of the color to use |
2701 | */ | 2701 | */ |
2702 | static void | 2702 | static void |
2703 | change_download_color (struct DownloadEntry *de, | 2703 | change_download_color (struct DownloadEntry *de, |
2704 | const char *color) | 2704 | const char *color) |
2705 | { | 2705 | { |
2706 | GtkTreeIter iter; | 2706 | GtkTreeIter iter; |
2707 | GtkTreePath *path; | 2707 | GtkTreePath *path; |
2708 | 2708 | ||
2709 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 2709 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
2710 | "Changing download DE=%p color to %s\n", | 2710 | "Changing download DE=%p color to %s\n", |
2711 | de, color); | 2711 | de, color); |
2712 | path = gtk_tree_row_reference_get_path (de->sr->rr); | 2712 | path = gtk_tree_row_reference_get_path (de->sr->rr); |
2713 | if (! gtk_tree_model_get_iter (GTK_TREE_MODEL (de->sr->tab->ts), &iter, path)) | 2713 | if (! gtk_tree_model_get_iter (GTK_TREE_MODEL (de->sr->tab->ts), &iter, path)) |
@@ -2786,7 +2786,7 @@ struct AddDirectoryEntryContext | |||
2786 | * Anonymity level to use for probes in this directory. | 2786 | * Anonymity level to use for probes in this directory. |
2787 | */ | 2787 | */ |
2788 | uint32_t anonymity; | 2788 | uint32_t anonymity; |
2789 | 2789 | ||
2790 | /** | 2790 | /** |
2791 | * Do we need to check if the given entry already exists to | 2791 | * Do we need to check if the given entry already exists to |
2792 | * avoid adding it twice? Set to #GNUNET_YES if #add_directory_entry | 2792 | * avoid adding it twice? Set to #GNUNET_YES if #add_directory_entry |
@@ -2835,8 +2835,8 @@ add_directory_entry (void *cls, const char *filename, | |||
2835 | GtkTreeModel *tm; | 2835 | GtkTreeModel *tm; |
2836 | struct GNUNET_FS_Uri *xuri; | 2836 | struct GNUNET_FS_Uri *xuri; |
2837 | 2837 | ||
2838 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 2838 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
2839 | "Adding directory entry `%s'\n", | 2839 | "Adding directory entry `%s'\n", |
2840 | filename); | 2840 | filename); |
2841 | if (NULL == uri) | 2841 | if (NULL == uri) |
2842 | { | 2842 | { |
@@ -2849,7 +2849,7 @@ add_directory_entry (void *cls, const char *filename, | |||
2849 | { | 2849 | { |
2850 | tm = gtk_tree_row_reference_get_model (ade->prr); | 2850 | tm = gtk_tree_row_reference_get_model (ade->prr); |
2851 | path = gtk_tree_row_reference_get_path (ade->prr); | 2851 | path = gtk_tree_row_reference_get_path (ade->prr); |
2852 | if (! gtk_tree_model_get_iter (tm, &piter, path)) | 2852 | if (! gtk_tree_model_get_iter (tm, &piter, path)) |
2853 | { | 2853 | { |
2854 | GNUNET_break (0); | 2854 | GNUNET_break (0); |
2855 | gtk_tree_path_free (path); | 2855 | gtk_tree_path_free (path); |
@@ -2860,8 +2860,8 @@ add_directory_entry (void *cls, const char *filename, | |||
2860 | { | 2860 | { |
2861 | do | 2861 | do |
2862 | { | 2862 | { |
2863 | gtk_tree_model_get (tm, &iter, | 2863 | gtk_tree_model_get (tm, &iter, |
2864 | SEARCH_TAB_MC_URI, &xuri, | 2864 | SEARCH_TAB_MC_URI, &xuri, |
2865 | -1); | 2865 | -1); |
2866 | if (GNUNET_YES == GNUNET_FS_uri_test_equal (xuri, uri)) | 2866 | if (GNUNET_YES == GNUNET_FS_uri_test_equal (xuri, uri)) |
2867 | return; /* already present */ | 2867 | return; /* already present */ |
@@ -2869,9 +2869,9 @@ add_directory_entry (void *cls, const char *filename, | |||
2869 | while (TRUE == gtk_tree_model_iter_next (tm, &iter)); | 2869 | while (TRUE == gtk_tree_model_iter_next (tm, &iter)); |
2870 | } | 2870 | } |
2871 | } | 2871 | } |
2872 | GNUNET_GTK_add_search_result (ade->tab, | 2872 | GNUNET_GTK_add_search_result (ade->tab, |
2873 | ade->anonymity, | 2873 | ade->anonymity, |
2874 | ade->prr, | 2874 | ade->prr, |
2875 | uri, meta, NULL, | 2875 | uri, meta, NULL, |
2876 | 0); | 2876 | 0); |
2877 | } | 2877 | } |
@@ -2892,7 +2892,7 @@ add_directory_entry (void *cls, const char *filename, | |||
2892 | * @param depth depth of the block in the ECRS tree | 2892 | * @param depth depth of the block in the ECRS tree |
2893 | */ | 2893 | */ |
2894 | static void | 2894 | static void |
2895 | mark_download_progress (struct DownloadEntry *de, | 2895 | mark_download_progress (struct DownloadEntry *de, |
2896 | const char *filename, | 2896 | const char *filename, |
2897 | uint64_t size, | 2897 | uint64_t size, |
2898 | uint64_t completed, const void *block_data, | 2898 | uint64_t completed, const void *block_data, |
@@ -2931,19 +2931,19 @@ mark_download_progress (struct DownloadEntry *de, | |||
2931 | { | 2931 | { |
2932 | /* got a data block of a directory, list its contents */ | 2932 | /* got a data block of a directory, list its contents */ |
2933 | struct AddDirectoryEntryContext ade; | 2933 | struct AddDirectoryEntryContext ade; |
2934 | 2934 | ||
2935 | ade.tab = de->sr->tab; | 2935 | ade.tab = de->sr->tab; |
2936 | ade.prr = de->sr->rr; | 2936 | ade.prr = de->sr->rr; |
2937 | ade.check_duplicates = GNUNET_NO; | 2937 | ade.check_duplicates = GNUNET_NO; |
2938 | ade.anonymity = de->anonymity; | 2938 | ade.anonymity = de->anonymity; |
2939 | if (GNUNET_SYSERR == | 2939 | if (GNUNET_SYSERR == |
2940 | GNUNET_FS_directory_list_contents ((size_t) block_size, block_data, | 2940 | GNUNET_FS_directory_list_contents ((size_t) block_size, block_data, |
2941 | offset, &add_directory_entry, &ade)) | 2941 | offset, &add_directory_entry, &ade)) |
2942 | { | 2942 | { |
2943 | /* Mime type was wrong, this is not a directory, update model! */ | 2943 | /* Mime type was wrong, this is not a directory, update model! */ |
2944 | de->is_directory = GNUNET_SYSERR; | 2944 | de->is_directory = GNUNET_SYSERR; |
2945 | gtk_tree_store_set (de->sr->tab->ts, &iter, | 2945 | gtk_tree_store_set (de->sr->tab->ts, &iter, |
2946 | SEARCH_TAB_MC_MIMETYPE, "", | 2946 | SEARCH_TAB_MC_MIMETYPE, "", |
2947 | -1); | 2947 | -1); |
2948 | } | 2948 | } |
2949 | } | 2949 | } |
@@ -2955,7 +2955,7 @@ mark_download_progress (struct DownloadEntry *de, | |||
2955 | (filename != NULL) ) | 2955 | (filename != NULL) ) |
2956 | { | 2956 | { |
2957 | struct AddDirectoryEntryContext ade; | 2957 | struct AddDirectoryEntryContext ade; |
2958 | 2958 | ||
2959 | /* download was for a directory (and we have a temp file for scanning); | 2959 | /* download was for a directory (and we have a temp file for scanning); |
2960 | add contents of the directory to the view */ | 2960 | add contents of the directory to the view */ |
2961 | ade.tab = de->sr->tab; | 2961 | ade.tab = de->sr->tab; |
@@ -3026,7 +3026,7 @@ mark_download_completed (struct DownloadEntry *de, uint64_t size) | |||
3026 | return; | 3026 | return; |
3027 | } | 3027 | } |
3028 | gtk_tree_path_free (path); | 3028 | gtk_tree_path_free (path); |
3029 | gtk_tree_store_set (de->sr->tab->ts, &iter, | 3029 | gtk_tree_store_set (de->sr->tab->ts, &iter, |
3030 | SEARCH_TAB_MC_PERCENT_PROGRESS, (guint) 100, | 3030 | SEARCH_TAB_MC_PERCENT_PROGRESS, (guint) 100, |
3031 | SEARCH_TAB_MC_PERCENT_AVAILABILITY, (guint) 100, | 3031 | SEARCH_TAB_MC_PERCENT_AVAILABILITY, (guint) 100, |
3032 | SEARCH_TAB_MC_UNKNOWN_AVAILABILITY, -1, | 3032 | SEARCH_TAB_MC_UNKNOWN_AVAILABILITY, -1, |
@@ -3052,7 +3052,7 @@ mark_download_completed (struct DownloadEntry *de, uint64_t size) | |||
3052 | */ | 3052 | */ |
3053 | static struct DownloadEntry * | 3053 | static struct DownloadEntry * |
3054 | setup_download (struct DownloadEntry *de, struct DownloadEntry *pde, | 3054 | setup_download (struct DownloadEntry *de, struct DownloadEntry *pde, |
3055 | struct SearchResult *sr, | 3055 | struct SearchResult *sr, |
3056 | uint32_t anonymity, | 3056 | uint32_t anonymity, |
3057 | struct GNUNET_FS_DownloadContext *dc, | 3057 | struct GNUNET_FS_DownloadContext *dc, |
3058 | const struct GNUNET_FS_Uri *uri, const char *filename, | 3058 | const struct GNUNET_FS_Uri *uri, const char *filename, |
@@ -3078,7 +3078,7 @@ setup_download (struct DownloadEntry *de, struct DownloadEntry *pde, | |||
3078 | } | 3078 | } |
3079 | de->dc = dc; | 3079 | de->dc = dc; |
3080 | de->pde = pde; | 3080 | de->pde = pde; |
3081 | if (NULL != sr) | 3081 | if (NULL != sr) |
3082 | { | 3082 | { |
3083 | /* have a search result, establish mapping de <--> sr */ | 3083 | /* have a search result, establish mapping de <--> sr */ |
3084 | if (NULL == de->sr) | 3084 | if (NULL == de->sr) |
@@ -3086,7 +3086,7 @@ setup_download (struct DownloadEntry *de, struct DownloadEntry *pde, | |||
3086 | GNUNET_assert (sr->download == NULL); | 3086 | GNUNET_assert (sr->download == NULL); |
3087 | de->sr = sr; | 3087 | de->sr = sr; |
3088 | sr->download = de; | 3088 | sr->download = de; |
3089 | } | 3089 | } |
3090 | else | 3090 | else |
3091 | { | 3091 | { |
3092 | GNUNET_assert (sr == de->sr); | 3092 | GNUNET_assert (sr == de->sr); |
@@ -3101,7 +3101,7 @@ setup_download (struct DownloadEntry *de, struct DownloadEntry *pde, | |||
3101 | GtkTreeIter iter; | 3101 | GtkTreeIter iter; |
3102 | GtkTreeIter child; | 3102 | GtkTreeIter child; |
3103 | struct GNUNET_FS_Uri *uri; | 3103 | struct GNUNET_FS_Uri *uri; |
3104 | 3104 | ||
3105 | tm = GTK_TREE_MODEL (pde->sr->tab->ts); | 3105 | tm = GTK_TREE_MODEL (pde->sr->tab->ts); |
3106 | path = gtk_tree_row_reference_get_path (pde->sr->rr); | 3106 | path = gtk_tree_row_reference_get_path (pde->sr->rr); |
3107 | if ( (! gtk_tree_model_get_iter (tm, &iter, path)) || | 3107 | if ( (! gtk_tree_model_get_iter (tm, &iter, path)) || |
@@ -3121,7 +3121,7 @@ setup_download (struct DownloadEntry *de, struct DownloadEntry *pde, | |||
3121 | uri)) | 3121 | uri)) |
3122 | break; | 3122 | break; |
3123 | de->sr = NULL; | 3123 | de->sr = NULL; |
3124 | } | 3124 | } |
3125 | while (gtk_tree_model_iter_next (tm, &child)); | 3125 | while (gtk_tree_model_iter_next (tm, &child)); |
3126 | if (NULL == de->sr) | 3126 | if (NULL == de->sr) |
3127 | { | 3127 | { |
@@ -3154,7 +3154,7 @@ setup_download (struct DownloadEntry *de, struct DownloadEntry *pde, | |||
3154 | else | 3154 | else |
3155 | { | 3155 | { |
3156 | struct GNUNET_CONTAINER_MetaData *meta; | 3156 | struct GNUNET_CONTAINER_MetaData *meta; |
3157 | 3157 | ||
3158 | /* get metadata from existing tab, might have a mime type */ | 3158 | /* get metadata from existing tab, might have a mime type */ |
3159 | path = gtk_tree_row_reference_get_path (de->sr->rr); | 3159 | path = gtk_tree_row_reference_get_path (de->sr->rr); |
3160 | if (! gtk_tree_model_get_iter (GTK_TREE_MODEL (de->sr->tab->ts), &iter, path)) | 3160 | if (! gtk_tree_model_get_iter (GTK_TREE_MODEL (de->sr->tab->ts), &iter, path)) |
@@ -3169,11 +3169,11 @@ setup_download (struct DownloadEntry *de, struct DownloadEntry *pde, | |||
3169 | de->is_directory = GNUNET_FS_meta_data_test_for_directory (meta); | 3169 | de->is_directory = GNUNET_FS_meta_data_test_for_directory (meta); |
3170 | } | 3170 | } |
3171 | gtk_tree_path_free (path); | 3171 | gtk_tree_path_free (path); |
3172 | gtk_tree_store_set (de->sr->tab->ts, &iter, | 3172 | gtk_tree_store_set (de->sr->tab->ts, &iter, |
3173 | SEARCH_TAB_MC_PERCENT_PROGRESS, (guint) ((size > 0) ? (100 * completed / size) : 100), | 3173 | SEARCH_TAB_MC_PERCENT_PROGRESS, (guint) ((size > 0) ? (100 * completed / size) : 100), |
3174 | SEARCH_TAB_MC_FILENAME, filename, | 3174 | SEARCH_TAB_MC_FILENAME, filename, |
3175 | SEARCH_TAB_MC_STATUS_COLOUR, "blue", | 3175 | SEARCH_TAB_MC_STATUS_COLOUR, "blue", |
3176 | SEARCH_TAB_MC_SEARCH_RESULT, de->sr, | 3176 | SEARCH_TAB_MC_SEARCH_RESULT, de->sr, |
3177 | SEARCH_TAB_MC_COMPLETED, (guint64) completed, | 3177 | SEARCH_TAB_MC_COMPLETED, (guint64) completed, |
3178 | SEARCH_TAB_MC_DOWNLOADED_FILENAME, de->filename, | 3178 | SEARCH_TAB_MC_DOWNLOADED_FILENAME, de->filename, |
3179 | SEARCH_TAB_MC_DOWNLOADED_ANONYMITY, de->anonymity, | 3179 | SEARCH_TAB_MC_DOWNLOADED_ANONYMITY, de->anonymity, |
@@ -3191,7 +3191,7 @@ setup_download (struct DownloadEntry *de, struct DownloadEntry *pde, | |||
3191 | /** | 3191 | /** |
3192 | * Change the (background) color of the given publish entry. | 3192 | * Change the (background) color of the given publish entry. |
3193 | * | 3193 | * |
3194 | * @param pe entry to change | 3194 | * @param pe entry to change |
3195 | * @param color name of the color to use | 3195 | * @param color name of the color to use |
3196 | */ | 3196 | */ |
3197 | static void | 3197 | static void |
@@ -3201,8 +3201,8 @@ change_publish_color (struct PublishEntry *pe, | |||
3201 | GtkTreeIter iter; | 3201 | GtkTreeIter iter; |
3202 | GtkTreePath *path; | 3202 | GtkTreePath *path; |
3203 | 3203 | ||
3204 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 3204 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
3205 | "Changing publish PE=%p color to %s\n", | 3205 | "Changing publish PE=%p color to %s\n", |
3206 | pe, color); | 3206 | pe, color); |
3207 | path = gtk_tree_row_reference_get_path (pe->rr); | 3207 | path = gtk_tree_row_reference_get_path (pe->rr); |
3208 | if (! gtk_tree_model_get_iter (GTK_TREE_MODEL (pe->tab->ts), &iter, path)) | 3208 | if (! gtk_tree_model_get_iter (GTK_TREE_MODEL (pe->tab->ts), &iter, path)) |
@@ -3212,8 +3212,8 @@ change_publish_color (struct PublishEntry *pe, | |||
3212 | return; | 3212 | return; |
3213 | } | 3213 | } |
3214 | gtk_tree_path_free (path); | 3214 | gtk_tree_path_free (path); |
3215 | gtk_tree_store_set (pe->tab->ts, &iter, | 3215 | gtk_tree_store_set (pe->tab->ts, &iter, |
3216 | PUBLISH_TAB_MC_BGCOLOUR, color, | 3216 | PUBLISH_TAB_MC_BGCOLOUR, color, |
3217 | -1); | 3217 | -1); |
3218 | } | 3218 | } |
3219 | 3219 | ||
@@ -3272,7 +3272,7 @@ handle_publish_completed (struct PublishEntry *pe, | |||
3272 | gtk_tree_path_free (path); | 3272 | gtk_tree_path_free (path); |
3273 | pe->uri = GNUNET_FS_uri_dup (uri); | 3273 | pe->uri = GNUNET_FS_uri_dup (uri); |
3274 | uris = GNUNET_FS_uri_to_string (uri); | 3274 | uris = GNUNET_FS_uri_to_string (uri); |
3275 | gtk_tree_store_set (pe->tab->ts, &iter, | 3275 | gtk_tree_store_set (pe->tab->ts, &iter, |
3276 | PUBLISH_TAB_MC_RESULT_STRING, uris, | 3276 | PUBLISH_TAB_MC_RESULT_STRING, uris, |
3277 | PUBLISH_TAB_MC_PROGRESS, 100, | 3277 | PUBLISH_TAB_MC_PROGRESS, 100, |
3278 | PUBLISH_TAB_MC_STATUS_ICON, GNUNET_GTK_animation_context_get_pixbuf (animation_published), | 3278 | PUBLISH_TAB_MC_STATUS_ICON, GNUNET_GTK_animation_context_get_pixbuf (animation_published), |
@@ -3286,7 +3286,7 @@ handle_publish_completed (struct PublishEntry *pe, | |||
3286 | * We received a publish error message from the FS library. | 3286 | * We received a publish error message from the FS library. |
3287 | * Present it to the user in an appropriate form. | 3287 | * Present it to the user in an appropriate form. |
3288 | * | 3288 | * |
3289 | * @param pe publishing operation affected by the error | 3289 | * @param pe publishing operation affected by the error |
3290 | * @param emsg the error message | 3290 | * @param emsg the error message |
3291 | */ | 3291 | */ |
3292 | static void | 3292 | static void |
@@ -3306,7 +3306,7 @@ handle_publish_error (struct PublishEntry *pe, | |||
3306 | gtk_tree_path_free (path); | 3306 | gtk_tree_path_free (path); |
3307 | if (NULL == animation_error) | 3307 | if (NULL == animation_error) |
3308 | animation_error = load_animation ("error"); | 3308 | animation_error = load_animation ("error"); |
3309 | gtk_tree_store_set (pe->tab->ts, &iter, | 3309 | gtk_tree_store_set (pe->tab->ts, &iter, |
3310 | PUBLISH_TAB_MC_RESULT_STRING, emsg, | 3310 | PUBLISH_TAB_MC_RESULT_STRING, emsg, |
3311 | PUBLISH_TAB_MC_PROGRESS, 100, | 3311 | PUBLISH_TAB_MC_PROGRESS, 100, |
3312 | PUBLISH_TAB_MC_STATUS_ICON, GNUNET_GTK_animation_context_get_pixbuf (animation_error), | 3312 | PUBLISH_TAB_MC_STATUS_ICON, GNUNET_GTK_animation_context_get_pixbuf (animation_error), |
@@ -3316,7 +3316,7 @@ handle_publish_error (struct PublishEntry *pe, | |||
3316 | 3316 | ||
3317 | 3317 | ||
3318 | /** | 3318 | /** |
3319 | * Remove publish tab from notebook | 3319 | * Remove publish tab from notebook |
3320 | */ | 3320 | */ |
3321 | static void | 3321 | static void |
3322 | delete_publish_tab () | 3322 | delete_publish_tab () |
@@ -3325,7 +3325,7 @@ delete_publish_tab () | |||
3325 | int index; | 3325 | int index; |
3326 | int i; | 3326 | int i; |
3327 | struct GNUNET_GTK_MainWindowContext *mctx = GNUNET_FS_GTK_get_main_context (); | 3327 | struct GNUNET_GTK_MainWindowContext *mctx = GNUNET_FS_GTK_get_main_context (); |
3328 | 3328 | ||
3329 | if (NULL == publish_tab) | 3329 | if (NULL == publish_tab) |
3330 | return; | 3330 | return; |
3331 | pt = publish_tab; | 3331 | pt = publish_tab; |
@@ -3391,7 +3391,7 @@ handle_publish_stop (struct PublishEntry *pe) | |||
3391 | * @param user_data the 'struct PublishTab' that is being closed | 3391 | * @param user_data the 'struct PublishTab' that is being closed |
3392 | */ | 3392 | */ |
3393 | void | 3393 | void |
3394 | GNUNET_FS_GTK_publish_label_close_button_clicked (GtkButton * button, | 3394 | GNUNET_FS_GTK_publish_label_close_button_clicked (GtkButton * button, |
3395 | gpointer user_data) | 3395 | gpointer user_data) |
3396 | { | 3396 | { |
3397 | struct PublishTab *tab = user_data; | 3397 | struct PublishTab *tab = user_data; |
@@ -3404,8 +3404,8 @@ GNUNET_FS_GTK_publish_label_close_button_clicked (GtkButton * button, | |||
3404 | tm = GTK_TREE_MODEL (publish_tab->ts); | 3404 | tm = GTK_TREE_MODEL (publish_tab->ts); |
3405 | while (gtk_tree_model_iter_children (tm, &iter, NULL)) | 3405 | while (gtk_tree_model_iter_children (tm, &iter, NULL)) |
3406 | { | 3406 | { |
3407 | gtk_tree_model_get (tm, &iter, | 3407 | gtk_tree_model_get (tm, &iter, |
3408 | PUBLISH_TAB_MC_ENT, &pe, | 3408 | PUBLISH_TAB_MC_ENT, &pe, |
3409 | -1); | 3409 | -1); |
3410 | GNUNET_FS_publish_stop (pe->pc); | 3410 | GNUNET_FS_publish_stop (pe->pc); |
3411 | } | 3411 | } |
@@ -3439,7 +3439,7 @@ setup_publish (struct GNUNET_FS_PublishContext *pc, const char *fn, | |||
3439 | GtkTreeView *tv; | 3439 | GtkTreeView *tv; |
3440 | GtkTreeViewColumn *anim_col; | 3440 | GtkTreeViewColumn *anim_col; |
3441 | struct GNUNET_GTK_MainWindowContext *mctx = GNUNET_FS_GTK_get_main_context (); | 3441 | struct GNUNET_GTK_MainWindowContext *mctx = GNUNET_FS_GTK_get_main_context (); |
3442 | 3442 | ||
3443 | if (NULL == publish_tab) | 3443 | if (NULL == publish_tab) |
3444 | { | 3444 | { |
3445 | /* create new tab */ | 3445 | /* create new tab */ |
@@ -3453,7 +3453,7 @@ setup_publish (struct GNUNET_FS_PublishContext *pc, const char *fn, | |||
3453 | g_object_ref (publish_tab->frame); | 3453 | g_object_ref (publish_tab->frame); |
3454 | gtk_container_remove (GTK_CONTAINER (df), publish_tab->frame); | 3454 | gtk_container_remove (GTK_CONTAINER (df), publish_tab->frame); |
3455 | gtk_widget_destroy (GTK_WIDGET (df)); | 3455 | gtk_widget_destroy (GTK_WIDGET (df)); |
3456 | 3456 | ||
3457 | /* load tab_label */ | 3457 | /* load tab_label */ |
3458 | df = GTK_WINDOW (gtk_builder_get_object | 3458 | df = GTK_WINDOW (gtk_builder_get_object |
3459 | (publish_tab->builder, "_publish_label_window")); | 3459 | (publish_tab->builder, "_publish_label_window")); |
@@ -3534,7 +3534,7 @@ struct PublishListPopupContext | |||
3534 | * Tab where the publish list popup was created. | 3534 | * Tab where the publish list popup was created. |
3535 | */ | 3535 | */ |
3536 | struct PublishTab *tab; | 3536 | struct PublishTab *tab; |
3537 | 3537 | ||
3538 | /** | 3538 | /** |
3539 | * Row where the publish list popup was created. | 3539 | * Row where the publish list popup was created. |
3540 | */ | 3540 | */ |
@@ -3545,7 +3545,7 @@ struct PublishListPopupContext | |||
3545 | * Publishing entry at the respective row. | 3545 | * Publishing entry at the respective row. |
3546 | */ | 3546 | */ |
3547 | struct PublishEntry *pe; | 3547 | struct PublishEntry *pe; |
3548 | 3548 | ||
3549 | }; | 3549 | }; |
3550 | 3550 | ||
3551 | 3551 | ||
@@ -3553,7 +3553,7 @@ struct PublishListPopupContext | |||
3553 | * An item was selected from the context menu; destroy the menu shell. | 3553 | * An item was selected from the context menu; destroy the menu shell. |
3554 | * | 3554 | * |
3555 | * @param menushell menu to destroy | 3555 | * @param menushell menu to destroy |
3556 | * @param user_data the 'struct PublishListPopupContext' of the menu | 3556 | * @param user_data the 'struct PublishListPopupContext' of the menu |
3557 | */ | 3557 | */ |
3558 | static void | 3558 | static void |
3559 | publish_list_popup_selection_done (GtkMenuShell *menushell, | 3559 | publish_list_popup_selection_done (GtkMenuShell *menushell, |
@@ -3569,7 +3569,7 @@ publish_list_popup_selection_done (GtkMenuShell *menushell, | |||
3569 | 3569 | ||
3570 | /** | 3570 | /** |
3571 | * Publish "abort" was selected in the current publish context menu. | 3571 | * Publish "abort" was selected in the current publish context menu. |
3572 | * | 3572 | * |
3573 | * @param item the 'abort' menu item | 3573 | * @param item the 'abort' menu item |
3574 | * @param user_data the 'struct PublishListPopupContext' with the operation to abort. | 3574 | * @param user_data the 'struct PublishListPopupContext' with the operation to abort. |
3575 | */ | 3575 | */ |
@@ -3578,7 +3578,7 @@ abort_publish_ctx_menu (GtkMenuItem *item, gpointer user_data) | |||
3578 | { | 3578 | { |
3579 | struct PublishListPopupContext *ppc = user_data; | 3579 | struct PublishListPopupContext *ppc = user_data; |
3580 | struct PublishEntry *pe = ppc->pe; | 3580 | struct PublishEntry *pe = ppc->pe; |
3581 | 3581 | ||
3582 | if (NULL != pe->pc) | 3582 | if (NULL != pe->pc) |
3583 | GNUNET_FS_publish_stop (pe->pc); | 3583 | GNUNET_FS_publish_stop (pe->pc); |
3584 | } | 3584 | } |
@@ -3586,7 +3586,7 @@ abort_publish_ctx_menu (GtkMenuItem *item, gpointer user_data) | |||
3586 | 3586 | ||
3587 | /** | 3587 | /** |
3588 | * Copy current URI to clipboard was selected in the current context menu. | 3588 | * Copy current URI to clipboard was selected in the current context menu. |
3589 | * | 3589 | * |
3590 | * @param item the 'copy-to-clipboard' menu item | 3590 | * @param item the 'copy-to-clipboard' menu item |
3591 | * @param user_data the 'struct DownloadListPopupContext' of the menu | 3591 | * @param user_data the 'struct DownloadListPopupContext' of the menu |
3592 | */ | 3592 | */ |
@@ -3626,8 +3626,8 @@ copy_publish_uri_to_clipboard_ctx_menu (GtkMenuItem *item, gpointer user_data) | |||
3626 | * TRUE if there is now a pop-up menu | 3626 | * TRUE if there is now a pop-up menu |
3627 | */ | 3627 | */ |
3628 | static gboolean | 3628 | static gboolean |
3629 | publish_list_popup (GtkTreeModel *tm, | 3629 | publish_list_popup (GtkTreeModel *tm, |
3630 | struct PublishTab *tab, | 3630 | struct PublishTab *tab, |
3631 | gint init_button, | 3631 | gint init_button, |
3632 | guint32 event_time, | 3632 | guint32 event_time, |
3633 | GtkTreeIter *iter) | 3633 | GtkTreeIter *iter) |
@@ -3638,8 +3638,8 @@ publish_list_popup (GtkTreeModel *tm, | |||
3638 | struct PublishEntry *pe; | 3638 | struct PublishEntry *pe; |
3639 | struct PublishListPopupContext *ppc; | 3639 | struct PublishListPopupContext *ppc; |
3640 | 3640 | ||
3641 | gtk_tree_model_get (tm, iter, | 3641 | gtk_tree_model_get (tm, iter, |
3642 | PUBLISH_TAB_MC_ENT, &pe, | 3642 | PUBLISH_TAB_MC_ENT, &pe, |
3643 | -1); | 3643 | -1); |
3644 | if ( (NULL == pe->uri) && | 3644 | if ( (NULL == pe->uri) && |
3645 | ( (NULL == pe->pc) || | 3645 | ( (NULL == pe->pc) || |
@@ -3676,7 +3676,7 @@ publish_list_popup (GtkTreeModel *tm, | |||
3676 | TRUE); | 3676 | TRUE); |
3677 | gtk_widget_show (child); | 3677 | gtk_widget_show (child); |
3678 | gtk_menu_shell_append (GTK_MENU_SHELL (menu), child); | 3678 | gtk_menu_shell_append (GTK_MENU_SHELL (menu), child); |
3679 | } | 3679 | } |
3680 | g_signal_connect (menu, "selection-done", | 3680 | g_signal_connect (menu, "selection-done", |
3681 | G_CALLBACK (publish_list_popup_selection_done), ppc); | 3681 | G_CALLBACK (publish_list_popup_selection_done), ppc); |
3682 | gtk_menu_popup (menu, NULL, NULL, NULL, NULL, init_button, event_time); | 3682 | gtk_menu_popup (menu, NULL, NULL, NULL, NULL, init_button, event_time); |
@@ -3693,7 +3693,7 @@ publish_list_popup (GtkTreeModel *tm, | |||
3693 | * TRUE if there is now a pop-up menu | 3693 | * TRUE if there is now a pop-up menu |
3694 | */ | 3694 | */ |
3695 | gboolean | 3695 | gboolean |
3696 | GNUNET_FS_GTK_publish_treeview_popup_menu (GtkWidget *widget, | 3696 | GNUNET_FS_GTK_publish_treeview_popup_menu (GtkWidget *widget, |
3697 | gpointer user_data) | 3697 | gpointer user_data) |
3698 | { | 3698 | { |
3699 | GtkTreeView *tv = GTK_TREE_VIEW (widget); | 3699 | GtkTreeView *tv = GTK_TREE_VIEW (widget); |
@@ -3720,7 +3720,7 @@ GNUNET_FS_GTK_publish_treeview_popup_menu (GtkWidget *widget, | |||
3720 | * TRUE to stop the event propagation. | 3720 | * TRUE to stop the event propagation. |
3721 | */ | 3721 | */ |
3722 | gboolean | 3722 | gboolean |
3723 | GNUNET_FS_GTK_publish_treeview_button_press_event (GtkWidget * widget, | 3723 | GNUNET_FS_GTK_publish_treeview_button_press_event (GtkWidget * widget, |
3724 | GdkEvent * event, | 3724 | GdkEvent * event, |
3725 | gpointer user_data) | 3725 | gpointer user_data) |
3726 | { | 3726 | { |
@@ -3737,12 +3737,12 @@ GNUNET_FS_GTK_publish_treeview_button_press_event (GtkWidget * widget, | |||
3737 | if (! gtk_tree_view_get_path_at_pos (tv, | 3737 | if (! gtk_tree_view_get_path_at_pos (tv, |
3738 | event_button->x, event_button->y, | 3738 | event_button->x, event_button->y, |
3739 | &path, NULL, NULL, NULL)) | 3739 | &path, NULL, NULL, NULL)) |
3740 | return FALSE; /* click outside of area with values, ignore */ | 3740 | return FALSE; /* click outside of area with values, ignore */ |
3741 | tm = gtk_tree_view_get_model (tv); | 3741 | tm = gtk_tree_view_get_model (tv); |
3742 | if (! gtk_tree_model_get_iter (tm, &iter, path)) | 3742 | if (! gtk_tree_model_get_iter (tm, &iter, path)) |
3743 | return FALSE; /* not sure how we got a path but no iter... */ | 3743 | return FALSE; /* not sure how we got a path but no iter... */ |
3744 | gtk_tree_path_free (path); | 3744 | gtk_tree_path_free (path); |
3745 | publish_list_popup (tm, tab, | 3745 | publish_list_popup (tm, tab, |
3746 | event_button->button, | 3746 | event_button->button, |
3747 | event_button->time, | 3747 | event_button->time, |
3748 | &iter); | 3748 | &iter); |
@@ -3775,7 +3775,7 @@ GNUNET_GTK_fs_event_handler (void *cls, | |||
3775 | const struct GNUNET_FS_ProgressInfo *info) | 3775 | const struct GNUNET_FS_ProgressInfo *info) |
3776 | { | 3776 | { |
3777 | void *ret; | 3777 | void *ret; |
3778 | 3778 | ||
3779 | GNUNET_FS_GTK_set_fs_handle (info->fsh); | 3779 | GNUNET_FS_GTK_set_fs_handle (info->fsh); |
3780 | switch (info->status) | 3780 | switch (info->status) |
3781 | { | 3781 | { |
@@ -3820,7 +3820,7 @@ GNUNET_GTK_fs_event_handler (void *cls, | |||
3820 | return NULL; | 3820 | return NULL; |
3821 | case GNUNET_FS_STATUS_DOWNLOAD_START: | 3821 | case GNUNET_FS_STATUS_DOWNLOAD_START: |
3822 | return setup_download (info->value.download.cctx, info->value.download.pctx, | 3822 | return setup_download (info->value.download.cctx, info->value.download.pctx, |
3823 | info->value.download.sctx, | 3823 | info->value.download.sctx, |
3824 | info->value.download.anonymity, | 3824 | info->value.download.anonymity, |
3825 | info->value.download.dc, | 3825 | info->value.download.dc, |
3826 | info->value.download.uri, | 3826 | info->value.download.uri, |
@@ -3831,7 +3831,7 @@ GNUNET_GTK_fs_event_handler (void *cls, | |||
3831 | case GNUNET_FS_STATUS_DOWNLOAD_RESUME: | 3831 | case GNUNET_FS_STATUS_DOWNLOAD_RESUME: |
3832 | ret = | 3832 | ret = |
3833 | setup_download (info->value.download.cctx, info->value.download.pctx, | 3833 | setup_download (info->value.download.cctx, info->value.download.pctx, |
3834 | info->value.download.sctx, | 3834 | info->value.download.sctx, |
3835 | info->value.download.anonymity, | 3835 | info->value.download.anonymity, |
3836 | info->value.download.dc, | 3836 | info->value.download.dc, |
3837 | info->value.download.uri, info->value.download.filename, | 3837 | info->value.download.uri, info->value.download.filename, |
@@ -3840,7 +3840,7 @@ GNUNET_GTK_fs_event_handler (void *cls, | |||
3840 | info->value.download.completed); | 3840 | info->value.download.completed); |
3841 | if (NULL != info->value.download.specifics.resume.message) | 3841 | if (NULL != info->value.download.specifics.resume.message) |
3842 | mark_download_error (ret, | 3842 | mark_download_error (ret, |
3843 | info->value.download.specifics.resume.message); | 3843 | info->value.download.specifics.resume.message); |
3844 | return ret; | 3844 | return ret; |
3845 | case GNUNET_FS_STATUS_DOWNLOAD_SUSPEND: | 3845 | case GNUNET_FS_STATUS_DOWNLOAD_SUSPEND: |
3846 | stop_download (info->value.download.cctx); | 3846 | stop_download (info->value.download.cctx); |
@@ -3871,12 +3871,12 @@ GNUNET_GTK_fs_event_handler (void *cls, | |||
3871 | return NULL; | 3871 | return NULL; |
3872 | case GNUNET_FS_STATUS_DOWNLOAD_ACTIVE: | 3872 | case GNUNET_FS_STATUS_DOWNLOAD_ACTIVE: |
3873 | change_download_color (info->value.download.cctx, "yellow"); | 3873 | change_download_color (info->value.download.cctx, "yellow"); |
3874 | change_download_status_icon (info->value.download.cctx, | 3874 | change_download_status_icon (info->value.download.cctx, |
3875 | GNUNET_GTK_animation_context_get_pixbuf (animation_downloading)); | 3875 | GNUNET_GTK_animation_context_get_pixbuf (animation_downloading)); |
3876 | return info->value.download.cctx; | 3876 | return info->value.download.cctx; |
3877 | case GNUNET_FS_STATUS_DOWNLOAD_INACTIVE: | 3877 | case GNUNET_FS_STATUS_DOWNLOAD_INACTIVE: |
3878 | change_download_color (info->value.download.cctx, "blue"); | 3878 | change_download_color (info->value.download.cctx, "blue"); |
3879 | change_download_status_icon (info->value.download.cctx, | 3879 | change_download_status_icon (info->value.download.cctx, |
3880 | GNUNET_GTK_animation_context_get_pixbuf (animation_download_stalled)); | 3880 | GNUNET_GTK_animation_context_get_pixbuf (animation_download_stalled)); |
3881 | return info->value.download.cctx; | 3881 | return info->value.download.cctx; |
3882 | case GNUNET_FS_STATUS_DOWNLOAD_LOST_PARENT: | 3882 | case GNUNET_FS_STATUS_DOWNLOAD_LOST_PARENT: |
@@ -3895,7 +3895,7 @@ GNUNET_GTK_fs_event_handler (void *cls, | |||
3895 | return ret; | 3895 | return ret; |
3896 | case GNUNET_FS_STATUS_SEARCH_RESUME_RESULT: | 3896 | case GNUNET_FS_STATUS_SEARCH_RESUME_RESULT: |
3897 | ret = | 3897 | ret = |
3898 | process_search_result (info->value.search.cctx, | 3898 | process_search_result (info->value.search.cctx, |
3899 | info->value.search.anonymity, | 3899 | info->value.search.anonymity, |
3900 | info->value.search.pctx, | 3900 | info->value.search.pctx, |
3901 | info->value.search.specifics.resume_result.uri, | 3901 | info->value.search.specifics.resume_result.uri, |
diff --git a/src/fs/gnunet-fs-gtk_event-handler.h b/src/fs/gnunet-fs-gtk_event-handler.h index ae7bde2c..e0f5d8ed 100644 --- a/src/fs/gnunet-fs-gtk_event-handler.h +++ b/src/fs/gnunet-fs-gtk_event-handler.h | |||
@@ -68,7 +68,7 @@ struct SearchTab | |||
68 | 68 | ||
69 | /** | 69 | /** |
70 | * GtkBuilder object for the search tab. | 70 | * GtkBuilder object for the search tab. |
71 | */ | 71 | */ |
72 | GtkBuilder *builder; | 72 | GtkBuilder *builder; |
73 | 73 | ||
74 | /** | 74 | /** |
@@ -238,7 +238,7 @@ GNUNET_GTK_add_to_uri_tab (uint32_t anonymity, | |||
238 | * @param tab search tab to extend, never NULL | 238 | * @param tab search tab to extend, never NULL |
239 | * @param anonymity anonymity level to use for probes for this result | 239 | * @param anonymity anonymity level to use for probes for this result |
240 | * @param parent_rr reference to parent entry in search tab, NULL for normal | 240 | * @param parent_rr reference to parent entry in search tab, NULL for normal |
241 | * search results, | 241 | * search results, |
242 | * @param uri uri to add, can be NULL for top-level entry of a directory opened from disk | 242 | * @param uri uri to add, can be NULL for top-level entry of a directory opened from disk |
243 | * (in this case, we don't know the URI and should probably not | 243 | * (in this case, we don't know the URI and should probably not |
244 | * bother to calculate it) | 244 | * bother to calculate it) |
@@ -250,7 +250,7 @@ GNUNET_GTK_add_to_uri_tab (uint32_t anonymity, | |||
250 | * model at 'iter') | 250 | * model at 'iter') |
251 | */ | 251 | */ |
252 | struct SearchResult * | 252 | struct SearchResult * |
253 | GNUNET_GTK_add_search_result (struct SearchTab *tab, | 253 | GNUNET_GTK_add_search_result (struct SearchTab *tab, |
254 | uint32_t anonymity, | 254 | uint32_t anonymity, |
255 | GtkTreeRowReference *parent_rr, | 255 | GtkTreeRowReference *parent_rr, |
256 | const struct GNUNET_FS_Uri *uri, | 256 | const struct GNUNET_FS_Uri *uri, |
@@ -284,7 +284,7 @@ GNUNET_GTK_fs_event_handler (void *cls, | |||
284 | 284 | ||
285 | /** | 285 | /** |
286 | * Close the 'uri_tab'. | 286 | * Close the 'uri_tab'. |
287 | */ | 287 | */ |
288 | void | 288 | void |
289 | GNUNET_FS_GTK_close_uri_tab_ (); | 289 | GNUNET_FS_GTK_close_uri_tab_ (); |
290 | 290 | ||
diff --git a/src/fs/gnunet-fs-gtk_main-window-meta-data-context-menu.c b/src/fs/gnunet-fs-gtk_main-window-meta-data-context-menu.c index 308b2582..9777b892 100644 --- a/src/fs/gnunet-fs-gtk_main-window-meta-data-context-menu.c +++ b/src/fs/gnunet-fs-gtk_main-window-meta-data-context-menu.c | |||
@@ -39,7 +39,7 @@ | |||
39 | * @param path unused | 39 | * @param path unused |
40 | * @param iter position in the model to access | 40 | * @param iter position in the model to access |
41 | * @param user_data 'GList**' where we should store the types and values found | 41 | * @param user_data 'GList**' where we should store the types and values found |
42 | */ | 42 | */ |
43 | static void | 43 | static void |
44 | copy_metadata_to_clipboard (GtkTreeModel * model, GtkTreePath * path, | 44 | copy_metadata_to_clipboard (GtkTreeModel * model, GtkTreePath * path, |
45 | GtkTreeIter * iter, gpointer user_data) | 45 | GtkTreeIter * iter, gpointer user_data) |
@@ -66,7 +66,7 @@ copy_metadata_to_clipboard (GtkTreeModel * model, GtkTreePath * path, | |||
66 | * @param user_data the GtkBuilder of the main window | 66 | * @param user_data the GtkBuilder of the main window |
67 | */ | 67 | */ |
68 | void | 68 | void |
69 | GNUNET_GTK_FS_metadata_copy_selection_activated (GtkMenuItem * menuitem, | 69 | GNUNET_GTK_FS_metadata_copy_selection_activated (GtkMenuItem * menuitem, |
70 | gpointer user_data) | 70 | gpointer user_data) |
71 | { | 71 | { |
72 | struct GNUNET_GTK_MainWindowContext *main_ctx = user_data; | 72 | struct GNUNET_GTK_MainWindowContext *main_ctx = user_data; |
@@ -115,14 +115,14 @@ GNUNET_GTK_FS_metadata_copy_selection_activated (GtkMenuItem * menuitem, | |||
115 | p = g_stpcpy (p, ": "); | 115 | p = g_stpcpy (p, ": "); |
116 | p = g_stpcpy (p, (gchar *) value->data); | 116 | p = g_stpcpy (p, (gchar *) value->data); |
117 | if (NULL != value->next) | 117 | if (NULL != value->next) |
118 | p = g_stpcpy (p, "\n"); | 118 | p = g_stpcpy (p, "\n"); |
119 | } | 119 | } |
120 | g_list_foreach (pairs, (GFunc) &g_free, NULL); | 120 | g_list_foreach (pairs, (GFunc) &g_free, NULL); |
121 | g_list_free (pairs); | 121 | g_list_free (pairs); |
122 | cb = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD); | 122 | cb = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD); |
123 | gtk_clipboard_set_text (cb, s, -1); | 123 | gtk_clipboard_set_text (cb, s, -1); |
124 | gtk_clipboard_store (cb); | 124 | gtk_clipboard_store (cb); |
125 | g_free (s); | 125 | g_free (s); |
126 | } | 126 | } |
127 | 127 | ||
128 | 128 | ||
diff --git a/src/fs/gnunet-fs-gtk_main-window-search.c b/src/fs/gnunet-fs-gtk_main-window-search.c index 45aaf590..11bacee2 100644 --- a/src/fs/gnunet-fs-gtk_main-window-search.c +++ b/src/fs/gnunet-fs-gtk_main-window-search.c | |||
@@ -43,7 +43,7 @@ static void | |||
43 | search_for_uri (struct GNUNET_FS_Uri *uri, | 43 | search_for_uri (struct GNUNET_FS_Uri *uri, |
44 | guint anonymity_level) | 44 | guint anonymity_level) |
45 | { | 45 | { |
46 | GNUNET_FS_search_start (GNUNET_FS_GTK_get_fs_handle (), | 46 | GNUNET_FS_search_start (GNUNET_FS_GTK_get_fs_handle (), |
47 | uri, anonymity_level, | 47 | uri, anonymity_level, |
48 | GNUNET_FS_SEARCH_OPTION_NONE, NULL); | 48 | GNUNET_FS_SEARCH_OPTION_NONE, NULL); |
49 | GNUNET_FS_uri_destroy (uri); | 49 | GNUNET_FS_uri_destroy (uri); |
@@ -74,7 +74,7 @@ abort_search_lookup (struct SearchLookup *sl) | |||
74 | sl->gns = NULL; | 74 | sl->gns = NULL; |
75 | } | 75 | } |
76 | g_free (sl->keywords); | 76 | g_free (sl->keywords); |
77 | GNUNET_free (sl); | 77 | GNUNET_free (sl); |
78 | } | 78 | } |
79 | 79 | ||
80 | 80 | ||
@@ -92,7 +92,7 @@ timeout_search_lookup (void *cls, | |||
92 | struct SearchLookup *sl = cls; | 92 | struct SearchLookup *sl = cls; |
93 | 93 | ||
94 | sl->timeout_task = GNUNET_SCHEDULER_NO_TASK; | 94 | sl->timeout_task = GNUNET_SCHEDULER_NO_TASK; |
95 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 95 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
96 | _("Failed to resolve namespace in time\n")); | 96 | _("Failed to resolve namespace in time\n")); |
97 | abort_search_lookup (sl); | 97 | abort_search_lookup (sl); |
98 | } | 98 | } |
@@ -128,9 +128,9 @@ handle_gns_result (void *cls, | |||
128 | uri = GNUNET_FS_uri_sks_create (rd[i].data, sl->keywords); | 128 | uri = GNUNET_FS_uri_sks_create (rd[i].data, sl->keywords); |
129 | search_for_uri (uri, sl->anonymity_level); | 129 | search_for_uri (uri, sl->anonymity_level); |
130 | abort_search_lookup (sl); | 130 | abort_search_lookup (sl); |
131 | return; | 131 | return; |
132 | } | 132 | } |
133 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 133 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
134 | _("Failed to resolve namespace in time\n")); | 134 | _("Failed to resolve namespace in time\n")); |
135 | abort_search_lookup (sl); | 135 | abort_search_lookup (sl); |
136 | } | 136 | } |
@@ -171,7 +171,7 @@ start_search (struct GNUNET_GTK_MainWindowContext *main_ctx) | |||
171 | ("main_window_search_mime_combobox")); | 171 | ("main_window_search_mime_combobox")); |
172 | mime_model = gtk_combo_box_get_model (mime_combo); | 172 | mime_model = gtk_combo_box_get_model (mime_combo); |
173 | mime_keyword = NULL; | 173 | mime_keyword = NULL; |
174 | if ( (NULL != mime_model) && | 174 | if ( (NULL != mime_model) && |
175 | gtk_combo_box_get_active_iter (mime_combo, &iter)) | 175 | gtk_combo_box_get_active_iter (mime_combo, &iter)) |
176 | gtk_tree_model_get (mime_model, &iter, | 176 | gtk_tree_model_get (mime_model, &iter, |
177 | GNUNET_GTK_FS_MAIN_WINDOW_SEARCH_MIME_MC_MIME, | 177 | GNUNET_GTK_FS_MAIN_WINDOW_SEARCH_MIME_MC_MIME, |
@@ -186,7 +186,7 @@ start_search (struct GNUNET_GTK_MainWindowContext *main_ctx) | |||
186 | } | 186 | } |
187 | { | 187 | { |
188 | GtkComboBox *namespace_box; | 188 | GtkComboBox *namespace_box; |
189 | 189 | ||
190 | namespace_box = GTK_COMBO_BOX (GNUNET_FS_GTK_get_main_window_object ("main_window_search_namespace_combobox")); | 190 | namespace_box = GTK_COMBO_BOX (GNUNET_FS_GTK_get_main_window_object ("main_window_search_namespace_combobox")); |
191 | nsid = gtk_entry_get_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (namespace_box)))); | 191 | nsid = gtk_entry_get_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (namespace_box)))); |
192 | if ( (NULL != nsid) && | 192 | if ( (NULL != nsid) && |
@@ -196,16 +196,16 @@ start_search (struct GNUNET_GTK_MainWindowContext *main_ctx) | |||
196 | _("<none>"))) ) ) | 196 | _("<none>"))) ) ) |
197 | nsid = NULL; | 197 | nsid = NULL; |
198 | } | 198 | } |
199 | 199 | ||
200 | /* get keywords and compose keyword string */ | 200 | /* get keywords and compose keyword string */ |
201 | { | 201 | { |
202 | const char *entry_keywords; | 202 | const char *entry_keywords; |
203 | 203 | ||
204 | entry_keywords = gtk_entry_get_text (main_ctx->search_entry); | 204 | entry_keywords = gtk_entry_get_text (main_ctx->search_entry); |
205 | if (NULL != mime_keyword) | 205 | if (NULL != mime_keyword) |
206 | { | 206 | { |
207 | keywords = g_strdup_printf ("%s +%s", | 207 | keywords = g_strdup_printf ("%s +%s", |
208 | entry_keywords, | 208 | entry_keywords, |
209 | mime_keyword); | 209 | mime_keyword); |
210 | g_free (mime_keyword); | 210 | g_free (mime_keyword); |
211 | } | 211 | } |
@@ -218,7 +218,7 @@ start_search (struct GNUNET_GTK_MainWindowContext *main_ctx) | |||
218 | /* build KSK/SKS URI */ | 218 | /* build KSK/SKS URI */ |
219 | if ( (NULL != nsid) && | 219 | if ( (NULL != nsid) && |
220 | (0 < strlen (nsid)) ) | 220 | (0 < strlen (nsid)) ) |
221 | { | 221 | { |
222 | sl = GNUNET_new (struct SearchLookup); | 222 | sl = GNUNET_new (struct SearchLookup); |
223 | sl->keywords = keywords; | 223 | sl->keywords = keywords; |
224 | sl->anonymity_level = anonymity_level; | 224 | sl->anonymity_level = anonymity_level; |
@@ -244,13 +244,13 @@ start_search (struct GNUNET_GTK_MainWindowContext *main_ctx) | |||
244 | uri = GNUNET_FS_uri_ksk_create (keywords, &emsg); | 244 | uri = GNUNET_FS_uri_ksk_create (keywords, &emsg); |
245 | if (NULL == uri) | 245 | if (NULL == uri) |
246 | { | 246 | { |
247 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 247 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
248 | _("Invalid keyword string `%s': %s"), | 248 | _("Invalid keyword string `%s': %s"), |
249 | keywords, emsg); | 249 | keywords, emsg); |
250 | g_free (keywords); | 250 | g_free (keywords); |
251 | GNUNET_free_non_null (emsg); | 251 | GNUNET_free_non_null (emsg); |
252 | return; | 252 | return; |
253 | } | 253 | } |
254 | g_free (keywords); | 254 | g_free (keywords); |
255 | search_for_uri (uri, anonymity_level); | 255 | search_for_uri (uri, anonymity_level); |
256 | } | 256 | } |
@@ -263,7 +263,7 @@ start_search (struct GNUNET_GTK_MainWindowContext *main_ctx) | |||
263 | * @param user_data the main window context builder | 263 | * @param user_data the main window context builder |
264 | */ | 264 | */ |
265 | void | 265 | void |
266 | main_window_search_button_clicked_cb (GtkButton * button, | 266 | main_window_search_button_clicked_cb (GtkButton * button, |
267 | gpointer user_data) | 267 | gpointer user_data) |
268 | { | 268 | { |
269 | struct GNUNET_GTK_MainWindowContext *main_ctx = user_data; | 269 | struct GNUNET_GTK_MainWindowContext *main_ctx = user_data; |
@@ -312,13 +312,13 @@ end_pseu_lookup (void *cls, | |||
312 | if (NULL != lctx->progress_dialog_builder) | 312 | if (NULL != lctx->progress_dialog_builder) |
313 | { | 313 | { |
314 | gtk_widget_destroy (lctx->progress_dialog); | 314 | gtk_widget_destroy (lctx->progress_dialog); |
315 | g_object_unref (G_OBJECT (lctx->progress_dialog_builder)); | 315 | g_object_unref (G_OBJECT (lctx->progress_dialog_builder)); |
316 | lctx->progress_dialog_builder = NULL; | 316 | lctx->progress_dialog_builder = NULL; |
317 | } | 317 | } |
318 | if (NULL != lctx->nick_dialog_builder) | 318 | if (NULL != lctx->nick_dialog_builder) |
319 | { | 319 | { |
320 | gtk_widget_destroy (lctx->nick_dialog); | 320 | gtk_widget_destroy (lctx->nick_dialog); |
321 | g_object_unref (G_OBJECT (lctx->nick_dialog_builder)); | 321 | g_object_unref (G_OBJECT (lctx->nick_dialog_builder)); |
322 | lctx->nick_dialog_builder = NULL; | 322 | lctx->nick_dialog_builder = NULL; |
323 | } | 323 | } |
324 | 324 | ||
@@ -406,11 +406,11 @@ save_pseudonym_with_nick (struct PseuLookupContext *lctx, | |||
406 | lctx->nick = GNUNET_strdup (nick); | 406 | lctx->nick = GNUNET_strdup (nick); |
407 | /* again, show progress indicator, this should be fast though... */ | 407 | /* again, show progress indicator, this should be fast though... */ |
408 | lctx->progress_dialog_builder | 408 | lctx->progress_dialog_builder |
409 | = GNUNET_GTK_get_new_builder | 409 | = GNUNET_GTK_get_new_builder |
410 | ("gnunet_fs_gtk_pseu_progress_dialog.glade", | 410 | ("gnunet_fs_gtk_pseu_progress_dialog.glade", |
411 | lctx); | 411 | lctx); |
412 | lctx->progress_dialog | 412 | lctx->progress_dialog |
413 | = GTK_WIDGET (gtk_builder_get_object | 413 | = GTK_WIDGET (gtk_builder_get_object |
414 | (lctx->progress_dialog_builder, | 414 | (lctx->progress_dialog_builder, |
415 | "GNUNET_FS_GTK_pseu_progress_dialog")); | 415 | "GNUNET_FS_GTK_pseu_progress_dialog")); |
416 | /* show the window */ | 416 | /* show the window */ |
@@ -441,14 +441,14 @@ save_pseudonym_with_nick (struct PseuLookupContext *lctx, | |||
441 | * @param user_data the `struct PseuLookupContext` | 441 | * @param user_data the `struct PseuLookupContext` |
442 | */ | 442 | */ |
443 | void | 443 | void |
444 | GNUNET_GTK_enter_nick_window_execute_button_clicked_cb (GtkButton * button, | 444 | GNUNET_GTK_enter_nick_window_execute_button_clicked_cb (GtkButton * button, |
445 | gpointer user_data) | 445 | gpointer user_data) |
446 | { | 446 | { |
447 | struct PseuLookupContext *lctx = user_data; | 447 | struct PseuLookupContext *lctx = user_data; |
448 | GtkEntry *entry; | 448 | GtkEntry *entry; |
449 | const char *nick; | 449 | const char *nick; |
450 | 450 | ||
451 | entry = GTK_ENTRY (gtk_builder_get_object | 451 | entry = GTK_ENTRY (gtk_builder_get_object |
452 | (lctx->nick_dialog_builder, | 452 | (lctx->nick_dialog_builder, |
453 | "GNUNET_GTK_enter_nick_window_nick_entry")); | 453 | "GNUNET_GTK_enter_nick_window_nick_entry")); |
454 | nick = gtk_entry_get_text (entry); | 454 | nick = gtk_entry_get_text (entry); |
@@ -461,8 +461,8 @@ GNUNET_GTK_enter_nick_window_execute_button_clicked_cb (GtkButton * button, | |||
461 | } | 461 | } |
462 | save_pseudonym_with_nick (lctx, nick); | 462 | save_pseudonym_with_nick (lctx, nick); |
463 | gtk_widget_destroy (lctx->nick_dialog); | 463 | gtk_widget_destroy (lctx->nick_dialog); |
464 | g_object_unref (G_OBJECT (lctx->nick_dialog_builder)); | 464 | g_object_unref (G_OBJECT (lctx->nick_dialog_builder)); |
465 | lctx->nick_dialog_builder = NULL; | 465 | lctx->nick_dialog_builder = NULL; |
466 | lctx->nick_dialog = NULL; | 466 | lctx->nick_dialog = NULL; |
467 | } | 467 | } |
468 | 468 | ||
@@ -474,7 +474,7 @@ GNUNET_GTK_enter_nick_window_execute_button_clicked_cb (GtkButton * button, | |||
474 | * @param user_data the `struct PseuLookupContext` | 474 | * @param user_data the `struct PseuLookupContext` |
475 | */ | 475 | */ |
476 | void | 476 | void |
477 | GNUNET_GTK_enter_nick_window_nick_entry_changed_cb (GtkWidget *widget, | 477 | GNUNET_GTK_enter_nick_window_nick_entry_changed_cb (GtkWidget *widget, |
478 | gpointer user_data) | 478 | gpointer user_data) |
479 | { | 479 | { |
480 | struct PseuLookupContext *lctx = user_data; | 480 | struct PseuLookupContext *lctx = user_data; |
@@ -497,7 +497,7 @@ GNUNET_GTK_enter_nick_window_nick_entry_changed_cb (GtkWidget *widget, | |||
497 | * @param user_data the `struct PseuLookupContext` | 497 | * @param user_data the `struct PseuLookupContext` |
498 | */ | 498 | */ |
499 | void | 499 | void |
500 | GNUNET_GTK_enter_nick_window_cancel_button_clicked_cb (GtkButton * button, | 500 | GNUNET_GTK_enter_nick_window_cancel_button_clicked_cb (GtkButton * button, |
501 | gpointer user_data) | 501 | gpointer user_data) |
502 | { | 502 | { |
503 | struct PseuLookupContext *lctx = user_data; | 503 | struct PseuLookupContext *lctx = user_data; |
@@ -521,7 +521,7 @@ ask_for_nickname (struct PseuLookupContext *lctx) | |||
521 | lctx->nick_dialog = GTK_WIDGET (gtk_builder_get_object (lctx->nick_dialog_builder, | 521 | lctx->nick_dialog = GTK_WIDGET (gtk_builder_get_object (lctx->nick_dialog_builder, |
522 | "GNUNET_GTK_enter_nick_window")); | 522 | "GNUNET_GTK_enter_nick_window")); |
523 | /* show the window */ | 523 | /* show the window */ |
524 | gtk_window_present (GTK_WINDOW (lctx->nick_dialog)); | 524 | gtk_window_present (GTK_WINDOW (lctx->nick_dialog)); |
525 | } | 525 | } |
526 | 526 | ||
527 | 527 | ||
@@ -548,7 +548,7 @@ lookup_finished (void *cls, | |||
548 | if (NULL != lctx->progress_dialog_builder) | 548 | if (NULL != lctx->progress_dialog_builder) |
549 | { | 549 | { |
550 | gtk_widget_destroy (lctx->progress_dialog); | 550 | gtk_widget_destroy (lctx->progress_dialog); |
551 | g_object_unref (G_OBJECT (lctx->progress_dialog_builder)); | 551 | g_object_unref (G_OBJECT (lctx->progress_dialog_builder)); |
552 | lctx->progress_dialog_builder = NULL; | 552 | lctx->progress_dialog_builder = NULL; |
553 | lctx->progress_dialog = NULL; | 553 | lctx->progress_dialog = NULL; |
554 | } | 554 | } |
@@ -588,7 +588,7 @@ GNUNET_FS_GTK_pseu_progress_dialog_cancel_button_clicked_cb (GtkButton *button, | |||
588 | if (NULL != lctx->progress_dialog_builder) | 588 | if (NULL != lctx->progress_dialog_builder) |
589 | { | 589 | { |
590 | gtk_widget_destroy (lctx->progress_dialog); | 590 | gtk_widget_destroy (lctx->progress_dialog); |
591 | g_object_unref (G_OBJECT (lctx->progress_dialog_builder)); | 591 | g_object_unref (G_OBJECT (lctx->progress_dialog_builder)); |
592 | lctx->progress_dialog_builder = NULL; | 592 | lctx->progress_dialog_builder = NULL; |
593 | lctx->progress_dialog = NULL; | 593 | lctx->progress_dialog = NULL; |
594 | } | 594 | } |
@@ -645,7 +645,7 @@ GNUNET_FS_GTK_pseu_progress_dialog_delete_event_cb (GtkWidget *widget, | |||
645 | * @param user_data the main window context builder | 645 | * @param user_data the main window context builder |
646 | */ | 646 | */ |
647 | void | 647 | void |
648 | GNUNET_FS_GTK_save_button_clicked_cb (GtkButton * button, | 648 | GNUNET_FS_GTK_save_button_clicked_cb (GtkButton * button, |
649 | gpointer user_data) | 649 | gpointer user_data) |
650 | { | 650 | { |
651 | struct GNUNET_GTK_MainWindowContext *main_ctx = user_data; | 651 | struct GNUNET_GTK_MainWindowContext *main_ctx = user_data; |
@@ -687,7 +687,7 @@ GNUNET_FS_GTK_save_button_clicked_cb (GtkButton * button, | |||
687 | if (0 == anonymity_level) | 687 | if (0 == anonymity_level) |
688 | { | 688 | { |
689 | /* setup the dialog and get the widgets we need most */ | 689 | /* setup the dialog and get the widgets we need most */ |
690 | lctx->progress_dialog_builder = GNUNET_GTK_get_new_builder ("gnunet_fs_gtk_pseu_progress_dialog.glade", | 690 | lctx->progress_dialog_builder = GNUNET_GTK_get_new_builder ("gnunet_fs_gtk_pseu_progress_dialog.glade", |
691 | lctx); | 691 | lctx); |
692 | lctx->progress_dialog = GTK_WIDGET (gtk_builder_get_object (lctx->progress_dialog_builder, | 692 | lctx->progress_dialog = GTK_WIDGET (gtk_builder_get_object (lctx->progress_dialog_builder, |
693 | "GNUNET_FS_GTK_pseu_progress_dialog")); | 693 | "GNUNET_FS_GTK_pseu_progress_dialog")); |
@@ -729,7 +729,7 @@ main_window_search_namespace_combobox_changed_cb (GtkComboBox *widget, | |||
729 | const gchar *text; | 729 | const gchar *text; |
730 | struct GNUNET_CRYPTO_EccPublicSignKey pkey; | 730 | struct GNUNET_CRYPTO_EccPublicSignKey pkey; |
731 | int ret; | 731 | int ret; |
732 | 732 | ||
733 | text = gtk_entry_get_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (widget)))); | 733 | text = gtk_entry_get_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (widget)))); |
734 | ret = GNUNET_NAMESTORE_zkey_to_pkey (text, &pkey); | 734 | ret = GNUNET_NAMESTORE_zkey_to_pkey (text, &pkey); |
735 | button = GTK_BUTTON (GNUNET_FS_GTK_get_main_window_object | 735 | button = GTK_BUTTON (GNUNET_FS_GTK_get_main_window_object |
diff --git a/src/fs/gnunet-fs-gtk_main-window-view-toggles.c b/src/fs/gnunet-fs-gtk_main-window-view-toggles.c index 25749be6..f8e1b9c3 100644 --- a/src/fs/gnunet-fs-gtk_main-window-view-toggles.c +++ b/src/fs/gnunet-fs-gtk_main-window-view-toggles.c | |||
@@ -35,7 +35,7 @@ | |||
35 | * @param toggle_menu name of menu entry | 35 | * @param toggle_menu name of menu entry |
36 | */ | 36 | */ |
37 | static void | 37 | static void |
38 | toggle_view (const char *toggled_widget, | 38 | toggle_view (const char *toggled_widget, |
39 | const char *toggle_menu) | 39 | const char *toggle_menu) |
40 | { | 40 | { |
41 | GtkCheckMenuItem *mi; | 41 | GtkCheckMenuItem *mi; |
@@ -79,7 +79,7 @@ check_extras () | |||
79 | * @param data main window builder (unused) | 79 | * @param data main window builder (unused) |
80 | */ | 80 | */ |
81 | void | 81 | void |
82 | GNUNET_GTK_main_menu_view_preview_toggled_cb (GtkWidget * dummy, | 82 | GNUNET_GTK_main_menu_view_preview_toggled_cb (GtkWidget * dummy, |
83 | gpointer data) | 83 | gpointer data) |
84 | { | 84 | { |
85 | toggle_view ("GNUNET_GTK_main_window_preview_image", | 85 | toggle_view ("GNUNET_GTK_main_window_preview_image", |
@@ -95,7 +95,7 @@ GNUNET_GTK_main_menu_view_preview_toggled_cb (GtkWidget * dummy, | |||
95 | * @param data main window builder (unused) | 95 | * @param data main window builder (unused) |
96 | */ | 96 | */ |
97 | void | 97 | void |
98 | GNUNET_GTK_main_menu_view_metadata_toggled_cb (GtkWidget * dummy, | 98 | GNUNET_GTK_main_menu_view_metadata_toggled_cb (GtkWidget * dummy, |
99 | gpointer data) | 99 | gpointer data) |
100 | { | 100 | { |
101 | toggle_view ("GNUNET_GTK_main_window_metadata_treeview", | 101 | toggle_view ("GNUNET_GTK_main_window_metadata_treeview", |
@@ -112,7 +112,7 @@ GNUNET_GTK_main_menu_view_metadata_toggled_cb (GtkWidget * dummy, | |||
112 | * @param data main window builder (unused) | 112 | * @param data main window builder (unused) |
113 | */ | 113 | */ |
114 | void | 114 | void |
115 | GNUNET_GTK_main_menu_view_search_toggled_cb (GtkWidget * dummy, | 115 | GNUNET_GTK_main_menu_view_search_toggled_cb (GtkWidget * dummy, |
116 | gpointer data) | 116 | gpointer data) |
117 | { | 117 | { |
118 | toggle_view ("main_window_search_hbox", | 118 | toggle_view ("main_window_search_hbox", |
diff --git a/src/fs/gnunet-fs-gtk_open-directory.c b/src/fs/gnunet-fs-gtk_open-directory.c index ae05b2e2..8e255106 100644 --- a/src/fs/gnunet-fs-gtk_open-directory.c +++ b/src/fs/gnunet-fs-gtk_open-directory.c | |||
@@ -40,7 +40,7 @@ struct AddChildContext | |||
40 | * Reference to the directorie's search result. | 40 | * Reference to the directorie's search result. |
41 | */ | 41 | */ |
42 | struct SearchResult *sr; | 42 | struct SearchResult *sr; |
43 | 43 | ||
44 | /** | 44 | /** |
45 | * Anonymity level to use for probes in the directory. | 45 | * Anonymity level to use for probes in the directory. |
46 | */ | 46 | */ |
@@ -94,9 +94,9 @@ add_child (void *cls, const char *filename, const struct GNUNET_FS_Uri *uri, | |||
94 | return; | 94 | return; |
95 | } | 95 | } |
96 | GNUNET_assert (NULL != | 96 | GNUNET_assert (NULL != |
97 | GNUNET_GTK_add_search_result (acc->sr->tab, | 97 | GNUNET_GTK_add_search_result (acc->sr->tab, |
98 | acc->anonymity, | 98 | acc->anonymity, |
99 | acc->sr->rr, | 99 | acc->sr->rr, |
100 | uri, | 100 | uri, |
101 | meta, NULL, 0)); | 101 | meta, NULL, 0)); |
102 | } | 102 | } |
diff --git a/src/fs/gnunet-fs-gtk_open-uri.c b/src/fs/gnunet-fs-gtk_open-uri.c index c272083d..86e7778c 100644 --- a/src/fs/gnunet-fs-gtk_open-uri.c +++ b/src/fs/gnunet-fs-gtk_open-uri.c | |||
@@ -61,7 +61,7 @@ GNUNET_FS_GTK_handle_uri_string (const char *uris, | |||
61 | 61 | ||
62 | /** | 62 | /** |
63 | * User selected "execute" in the open-URI dialog. | 63 | * User selected "execute" in the open-URI dialog. |
64 | * | 64 | * |
65 | * @param button the execute button | 65 | * @param button the execute button |
66 | * @param user_data the `GtkBuilder` of the URI dialog | 66 | * @param user_data the `GtkBuilder` of the URI dialog |
67 | */ | 67 | */ |
@@ -92,20 +92,20 @@ GNUNET_GTK_open_url_dialog_execute_button_clicked_cb (GtkButton * button, | |||
92 | { | 92 | { |
93 | GNUNET_break (0); | 93 | GNUNET_break (0); |
94 | gtk_widget_destroy (dialog); | 94 | gtk_widget_destroy (dialog); |
95 | g_object_unref (G_OBJECT (builder)); | 95 | g_object_unref (G_OBJECT (builder)); |
96 | return; | 96 | return; |
97 | } | 97 | } |
98 | GNUNET_break (GNUNET_OK == | 98 | GNUNET_break (GNUNET_OK == |
99 | GNUNET_FS_GTK_handle_uri_string (uris, anonymity_level)); | 99 | GNUNET_FS_GTK_handle_uri_string (uris, anonymity_level)); |
100 | g_free (uris); | 100 | g_free (uris); |
101 | gtk_widget_destroy (dialog); | 101 | gtk_widget_destroy (dialog); |
102 | g_object_unref (G_OBJECT (builder)); | 102 | g_object_unref (G_OBJECT (builder)); |
103 | } | 103 | } |
104 | 104 | ||
105 | 105 | ||
106 | /** | 106 | /** |
107 | * User selected "cancel" in the open-URI dialog. | 107 | * User selected "cancel" in the open-URI dialog. |
108 | * | 108 | * |
109 | * @param button the cancel button | 109 | * @param button the cancel button |
110 | * @param user_data the 'GtkBuilder' of the URI dialog | 110 | * @param user_data the 'GtkBuilder' of the URI dialog |
111 | */ | 111 | */ |
@@ -117,7 +117,7 @@ GNUNET_GTK_open_url_dialog_cancel_button_clicked_cb (GtkButton * button, | |||
117 | GtkWidget *dialog; | 117 | GtkWidget *dialog; |
118 | 118 | ||
119 | dialog = GTK_WIDGET (gtk_builder_get_object | 119 | dialog = GTK_WIDGET (gtk_builder_get_object |
120 | (builder, | 120 | (builder, |
121 | "GNUNET_GTK_open_url_window")); | 121 | "GNUNET_GTK_open_url_window")); |
122 | gtk_widget_destroy (GTK_WIDGET (dialog)); | 122 | gtk_widget_destroy (GTK_WIDGET (dialog)); |
123 | g_object_unref (G_OBJECT (builder)); | 123 | g_object_unref (G_OBJECT (builder)); |
@@ -126,7 +126,7 @@ GNUNET_GTK_open_url_dialog_cancel_button_clicked_cb (GtkButton * button, | |||
126 | 126 | ||
127 | /** | 127 | /** |
128 | * User closed the window of the open-URI dialog. | 128 | * User closed the window of the open-URI dialog. |
129 | * | 129 | * |
130 | * @param widget the window | 130 | * @param widget the window |
131 | * @param event the deletion event | 131 | * @param event the deletion event |
132 | * @param user_data the 'GtkBuilder' of the URI dialog | 132 | * @param user_data the 'GtkBuilder' of the URI dialog |
@@ -147,7 +147,7 @@ GNUNET_GTK_open_url_window_delete_event_cb (GtkWidget * widget, | |||
147 | /** | 147 | /** |
148 | * User pushed a key in the open-URI dialog, check if we currently | 148 | * User pushed a key in the open-URI dialog, check if we currently |
149 | * have valid URI and if the key was 'RETURN', run the action. | 149 | * have valid URI and if the key was 'RETURN', run the action. |
150 | * | 150 | * |
151 | * @param widget the window | 151 | * @param widget the window |
152 | * @param event the deletion event | 152 | * @param event the deletion event |
153 | * @param user_data the 'GtkBuilder' of the URI dialog | 153 | * @param user_data the 'GtkBuilder' of the URI dialog |
@@ -163,7 +163,7 @@ GNUNET_GTK_open_url_dialog_url_textview_key_press_event_cb (GtkWidget * widget, | |||
163 | if (event->keyval != GDK_KEY_Return) | 163 | if (event->keyval != GDK_KEY_Return) |
164 | return FALSE; | 164 | return FALSE; |
165 | execute = GTK_WIDGET (gtk_builder_get_object (builder, | 165 | execute = GTK_WIDGET (gtk_builder_get_object (builder, |
166 | "GNUNET_GTK_open_url_dialog_execute_button")); | 166 | "GNUNET_GTK_open_url_dialog_execute_button")); |
167 | if (gtk_widget_get_sensitive (execute)) | 167 | if (gtk_widget_get_sensitive (execute)) |
168 | GNUNET_GTK_open_url_dialog_execute_button_clicked_cb (GTK_BUTTON (execute), | 168 | GNUNET_GTK_open_url_dialog_execute_button_clicked_cb (GTK_BUTTON (execute), |
169 | user_data); | 169 | user_data); |
@@ -174,7 +174,7 @@ GNUNET_GTK_open_url_dialog_url_textview_key_press_event_cb (GtkWidget * widget, | |||
174 | /** | 174 | /** |
175 | * User edited the URI of the open-URI dialog, check if it is currently | 175 | * User edited the URI of the open-URI dialog, check if it is currently |
176 | * a valid URI and update the sensitivity of the 'execute' button accordingly. | 176 | * a valid URI and update the sensitivity of the 'execute' button accordingly. |
177 | * | 177 | * |
178 | * @param textbuffer the updated buffer | 178 | * @param textbuffer the updated buffer |
179 | * @param user_data the 'GtkBuilder' of the URI dialog | 179 | * @param user_data the 'GtkBuilder' of the URI dialog |
180 | */ | 180 | */ |
@@ -240,7 +240,7 @@ GNUNET_GTK_main_menu_file_download_uri_activate_cb (GtkWidget * dummy, | |||
240 | return; | 240 | return; |
241 | } | 241 | } |
242 | dialog = GTK_WIDGET (gtk_builder_get_object | 242 | dialog = GTK_WIDGET (gtk_builder_get_object |
243 | (builder, | 243 | (builder, |
244 | "GNUNET_GTK_open_url_window")); | 244 | "GNUNET_GTK_open_url_window")); |
245 | tb = GTK_TEXT_BUFFER (gtk_builder_get_object | 245 | tb = GTK_TEXT_BUFFER (gtk_builder_get_object |
246 | (builder, | 246 | (builder, |
@@ -251,7 +251,7 @@ GNUNET_GTK_main_menu_file_download_uri_activate_cb (GtkWidget * dummy, | |||
251 | 251 | ||
252 | /* FIXME-FEATURE: query the clipboard, maybe there's valid URI in there? | 252 | /* FIXME-FEATURE: query the clipboard, maybe there's valid URI in there? |
253 | * If so, get it. */ | 253 | * If so, get it. */ |
254 | combo = GTK_COMBO_BOX (gtk_builder_get_object | 254 | combo = GTK_COMBO_BOX (gtk_builder_get_object |
255 | (builder, | 255 | (builder, |
256 | "GNUNET_GTK_open_url_dialog_anonymity_combobox")); | 256 | "GNUNET_GTK_open_url_dialog_anonymity_combobox")); |
257 | gtk_combo_box_set_model (combo, GNUNET_FS_GTK_get_anonymity_level_list_store ()); | 257 | gtk_combo_box_set_model (combo, GNUNET_FS_GTK_get_anonymity_level_list_store ()); |
diff --git a/src/fs/gnunet-fs-gtk_open-uri.h b/src/fs/gnunet-fs-gtk_open-uri.h index e41de56a..cc85754c 100644 --- a/src/fs/gnunet-fs-gtk_open-uri.h +++ b/src/fs/gnunet-fs-gtk_open-uri.h | |||
@@ -31,8 +31,8 @@ | |||
31 | * | 31 | * |
32 | * @param uris string we got | 32 | * @param uris string we got |
33 | * @param anonymity_level anonymity level to use | 33 | * @param anonymity_level anonymity level to use |
34 | * @return #GNUNET_OK on success, | 34 | * @return #GNUNET_OK on success, |
35 | * #GNUNET_NO if the URI type is not supported, | 35 | * #GNUNET_NO if the URI type is not supported, |
36 | * #GNUNET_SYSERR if we failed to parse the URI | 36 | * #GNUNET_SYSERR if we failed to parse the URI |
37 | */ | 37 | */ |
38 | int | 38 | int |
diff --git a/src/fs/gnunet-fs-gtk_publish-dialog.c b/src/fs/gnunet-fs-gtk_publish-dialog.c index d97ddb4e..f9994a1b 100644 --- a/src/fs/gnunet-fs-gtk_publish-dialog.c +++ b/src/fs/gnunet-fs-gtk_publish-dialog.c | |||
@@ -124,9 +124,9 @@ enum IDENTIFIERS_ModelColumns | |||
124 | enum EGO_ModelColumns | 124 | enum EGO_ModelColumns |
125 | { | 125 | { |
126 | 126 | ||
127 | /** | 127 | /** |
128 | * A gchararray. | 128 | * A gchararray. |
129 | */ | 129 | */ |
130 | EGO_MC_NAME = 0, | 130 | EGO_MC_NAME = 0, |
131 | 131 | ||
132 | /** | 132 | /** |
@@ -156,9 +156,9 @@ struct MainPublishingDialogContext | |||
156 | 156 | ||
157 | /** | 157 | /** |
158 | * Connection to the identity service. | 158 | * Connection to the identity service. |
159 | */ | 159 | */ |
160 | struct GNUNET_IDENTITY_Handle *identity; | 160 | struct GNUNET_IDENTITY_Handle *identity; |
161 | 161 | ||
162 | /** | 162 | /** |
163 | * Handle to the main window of the publishing dialog. | 163 | * Handle to the main window of the publishing dialog. |
164 | */ | 164 | */ |
@@ -177,7 +177,7 @@ struct MainPublishingDialogContext | |||
177 | /** | 177 | /** |
178 | * Model with the list of files to be shared. | 178 | * Model with the list of files to be shared. |
179 | */ | 179 | */ |
180 | GtkTreeModel *file_info_treemodel; | 180 | GtkTreeModel *file_info_treemodel; |
181 | 181 | ||
182 | /** | 182 | /** |
183 | * Button to move selected file upwards | 183 | * Button to move selected file upwards |
@@ -411,7 +411,7 @@ struct AddDirClientContext | |||
411 | }; | 411 | }; |
412 | 412 | ||
413 | 413 | ||
414 | static void | 414 | static void |
415 | clear_keywords_from_tm (struct MainPublishingDialogContext *ctx); | 415 | clear_keywords_from_tm (struct MainPublishingDialogContext *ctx); |
416 | 416 | ||
417 | 417 | ||
@@ -428,7 +428,7 @@ clear_keywords_from_tm (struct MainPublishingDialogContext *ctx); | |||
428 | */ | 428 | */ |
429 | static int | 429 | static int |
430 | gtk_tree_iter_equals (GtkTreeModel *tm, | 430 | gtk_tree_iter_equals (GtkTreeModel *tm, |
431 | GtkTreeIter *i1, | 431 | GtkTreeIter *i1, |
432 | GtkTreeIter *i2) | 432 | GtkTreeIter *i2) |
433 | { | 433 | { |
434 | GtkTreePath *p1; | 434 | GtkTreePath *p1; |
@@ -468,9 +468,9 @@ update_selectivity_execute_cancel (struct MainPublishingDialogContext *ctx) | |||
468 | 468 | ||
469 | /* Don't let the user close the dialog until all scanners are finished and | 469 | /* Don't let the user close the dialog until all scanners are finished and |
470 | their windows are closed */ | 470 | their windows are closed */ |
471 | if ( (gtk_tree_model_get_iter_first (ctx->file_info_treemodel, &iter)) && | 471 | if ( (gtk_tree_model_get_iter_first (ctx->file_info_treemodel, &iter)) && |
472 | (pub_in_global || pub_in_own) && | 472 | (pub_in_global || pub_in_own) && |
473 | ((!pub_in_own) || ( (NULL != ctx->ns) && | 473 | ((!pub_in_own) || ( (NULL != ctx->ns) && |
474 | (NULL != ns_id) && | 474 | (NULL != ns_id) && |
475 | ('\0' != ns_id[0])) ) && | 475 | ('\0' != ns_id[0])) ) && |
476 | (NULL == ctx->adddir_head) ) | 476 | (NULL == ctx->adddir_head) ) |
@@ -515,9 +515,9 @@ update_selectivity_edit (struct MainPublishingDialogContext *ctx) | |||
515 | 515 | ||
516 | /* figure out which move operations are currently legal */ | 516 | /* figure out which move operations are currently legal */ |
517 | GNUNET_assert (gtk_tree_selection_get_selected (ctx->file_info_selection, NULL, &iter)); | 517 | GNUNET_assert (gtk_tree_selection_get_selected (ctx->file_info_selection, NULL, &iter)); |
518 | if (gtk_tree_model_iter_next (ctx->file_info_treemodel, &iter)) | 518 | if (gtk_tree_model_iter_next (ctx->file_info_treemodel, &iter)) |
519 | gtk_widget_set_sensitive (ctx->down_button, TRUE); | 519 | gtk_widget_set_sensitive (ctx->down_button, TRUE); |
520 | else | 520 | else |
521 | gtk_widget_set_sensitive (ctx->down_button, FALSE); | 521 | gtk_widget_set_sensitive (ctx->down_button, FALSE); |
522 | GNUNET_assert (gtk_tree_selection_get_selected (ctx->file_info_selection, NULL, &iter)); | 522 | GNUNET_assert (gtk_tree_selection_get_selected (ctx->file_info_selection, NULL, &iter)); |
523 | if (gtk_tree_model_iter_parent (ctx->file_info_treemodel, &parent, &iter)) | 523 | if (gtk_tree_model_iter_parent (ctx->file_info_treemodel, &parent, &iter)) |
@@ -540,14 +540,14 @@ update_selectivity_edit (struct MainPublishingDialogContext *ctx) | |||
540 | is_dir = GNUNET_FS_file_information_is_directory (fip); | 540 | is_dir = GNUNET_FS_file_information_is_directory (fip); |
541 | GNUNET_assert (gtk_tree_model_iter_next (ctx->file_info_treemodel, &pred)); | 541 | GNUNET_assert (gtk_tree_model_iter_next (ctx->file_info_treemodel, &pred)); |
542 | } | 542 | } |
543 | if (GNUNET_YES == is_dir) | 543 | if (GNUNET_YES == is_dir) |
544 | gtk_widget_set_sensitive (ctx->right_button, TRUE); | 544 | gtk_widget_set_sensitive (ctx->right_button, TRUE); |
545 | else | 545 | else |
546 | gtk_widget_set_sensitive (ctx->right_button, FALSE); | 546 | gtk_widget_set_sensitive (ctx->right_button, FALSE); |
547 | if (GNUNET_SYSERR != is_dir) | 547 | if (GNUNET_SYSERR != is_dir) |
548 | gtk_widget_set_sensitive (ctx->up_button, TRUE); | 548 | gtk_widget_set_sensitive (ctx->up_button, TRUE); |
549 | else | 549 | else |
550 | gtk_widget_set_sensitive (ctx->up_button, FALSE); | 550 | gtk_widget_set_sensitive (ctx->up_button, FALSE); |
551 | } | 551 | } |
552 | 552 | ||
553 | 553 | ||
@@ -558,7 +558,7 @@ update_selectivity_edit (struct MainPublishingDialogContext *ctx) | |||
558 | * @param user_data master publishing dialog context of our window | 558 | * @param user_data master publishing dialog context of our window |
559 | */ | 559 | */ |
560 | static void | 560 | static void |
561 | selection_changed_cb (GtkTreeSelection * ts, | 561 | selection_changed_cb (GtkTreeSelection * ts, |
562 | gpointer user_data) | 562 | gpointer user_data) |
563 | { | 563 | { |
564 | struct MainPublishingDialogContext *ctx = user_data; | 564 | struct MainPublishingDialogContext *ctx = user_data; |
@@ -577,9 +577,9 @@ selection_changed_cb (GtkTreeSelection * ts, | |||
577 | * @param pos iterator to set to the location of the new element | 577 | * @param pos iterator to set to the location of the new element |
578 | */ | 578 | */ |
579 | static void | 579 | static void |
580 | create_dir_at_iter (struct MainPublishingDialogContext *ctx, | 580 | create_dir_at_iter (struct MainPublishingDialogContext *ctx, |
581 | const char *name, | 581 | const char *name, |
582 | const struct GNUNET_FS_BlockOptions *bo, | 582 | const struct GNUNET_FS_BlockOptions *bo, |
583 | GtkTreeIter * iter, | 583 | GtkTreeIter * iter, |
584 | GtkTreeIter * pos) | 584 | GtkTreeIter * pos) |
585 | { | 585 | { |
@@ -601,12 +601,12 @@ create_dir_at_iter (struct MainPublishingDialogContext *ctx, | |||
601 | fi = GNUNET_FS_file_information_create_empty_directory | 601 | fi = GNUNET_FS_file_information_create_empty_directory |
602 | (GNUNET_FS_GTK_get_fs_handle (), row_reference, NULL, meta, bo, name); | 602 | (GNUNET_FS_GTK_get_fs_handle (), row_reference, NULL, meta, bo, name); |
603 | GNUNET_CONTAINER_meta_data_destroy (meta); | 603 | GNUNET_CONTAINER_meta_data_destroy (meta); |
604 | gtk_tree_store_set (GTK_TREE_STORE (ctx->file_info_treemodel), pos, | 604 | gtk_tree_store_set (GTK_TREE_STORE (ctx->file_info_treemodel), pos, |
605 | PUBLISH_MC_FILESIZE, MARKER_DIR_FILE_SIZE, | 605 | PUBLISH_MC_FILESIZE, MARKER_DIR_FILE_SIZE, |
606 | PUBLISH_MC_DO_INDEX, (gboolean) GNUNET_NO, | 606 | PUBLISH_MC_DO_INDEX, (gboolean) GNUNET_NO, |
607 | PUBLISH_MC_FILENAME, name, | 607 | PUBLISH_MC_FILENAME, name, |
608 | PUBLISH_MC_ANONYMITY_LEVEL, (guint) bo->anonymity_level, | 608 | PUBLISH_MC_ANONYMITY_LEVEL, (guint) bo->anonymity_level, |
609 | PUBLISH_MC_PRIORITY, (guint) bo->content_priority, | 609 | PUBLISH_MC_PRIORITY, (guint) bo->content_priority, |
610 | PUBLISH_MC_FILE_INFORMATION_STRUCT, fi, | 610 | PUBLISH_MC_FILE_INFORMATION_STRUCT, fi, |
611 | PUBLISH_MC_EXPIRATION_TIME_ABSOLUTE, | 611 | PUBLISH_MC_EXPIRATION_TIME_ABSOLUTE, |
612 | (guint64) bo->expiration_time.abs_value_us, | 612 | (guint64) bo->expiration_time.abs_value_us, |
@@ -653,7 +653,7 @@ copy_entry (struct MainPublishingDialogContext *ctx, GtkTreeModel * tm, GtkTreeI | |||
653 | char *fsf; | 653 | char *fsf; |
654 | 654 | ||
655 | gtk_tree_model_get (tm, old, | 655 | gtk_tree_model_get (tm, old, |
656 | PUBLISH_MC_FILESIZE, &fsf, | 656 | PUBLISH_MC_FILESIZE, &fsf, |
657 | PUBLISH_MC_DO_INDEX, &do_index, | 657 | PUBLISH_MC_DO_INDEX, &do_index, |
658 | PUBLISH_MC_FILENAME, &short_fn, | 658 | PUBLISH_MC_FILENAME, &short_fn, |
659 | PUBLISH_MC_ANONYMITY_LEVEL, &anonymity_level, | 659 | PUBLISH_MC_ANONYMITY_LEVEL, &anonymity_level, |
@@ -820,7 +820,7 @@ generate_update_id (const gchar *new_text) | |||
820 | * FALSE otherwise | 820 | * FALSE otherwise |
821 | */ | 821 | */ |
822 | static gboolean | 822 | static gboolean |
823 | update_id_is_autofilled (const gchar *existing_update_id, | 823 | update_id_is_autofilled (const gchar *existing_update_id, |
824 | const gchar *previous_id) | 824 | const gchar *previous_id) |
825 | { | 825 | { |
826 | gboolean result; | 826 | gboolean result; |
@@ -852,10 +852,10 @@ maybe_change_update_id (struct MainPublishingDialogContext *ctx, | |||
852 | new_update_id = NULL; | 852 | new_update_id = NULL; |
853 | existing_update_id = gtk_entry_get_text (GTK_ENTRY (ctx->update_id_entry)); | 853 | existing_update_id = gtk_entry_get_text (GTK_ENTRY (ctx->update_id_entry)); |
854 | 854 | ||
855 | if ( ( (NULL == ctx->previous_id) && | 855 | if ( ( (NULL == ctx->previous_id) && |
856 | ('\0' == existing_update_id[0]) ) || | 856 | ('\0' == existing_update_id[0]) ) || |
857 | ( (NULL != ctx->previous_id) && | 857 | ( (NULL != ctx->previous_id) && |
858 | update_id_is_autofilled (existing_update_id, | 858 | update_id_is_autofilled (existing_update_id, |
859 | ctx->previous_id) ) ) | 859 | ctx->previous_id) ) ) |
860 | new_update_id = generate_update_id (new_text); | 860 | new_update_id = generate_update_id (new_text); |
861 | if (NULL != new_update_id) | 861 | if (NULL != new_update_id) |
@@ -877,7 +877,7 @@ maybe_change_update_id (struct MainPublishingDialogContext *ctx, | |||
877 | * @param user_data our `struct MainPublishingDialogContext` | 877 | * @param user_data our `struct MainPublishingDialogContext` |
878 | */ | 878 | */ |
879 | void | 879 | void |
880 | GNUNET_GTK_master_publish_dialog_identifier_entry_changed_cb (GtkWidget *widget, | 880 | GNUNET_GTK_master_publish_dialog_identifier_entry_changed_cb (GtkWidget *widget, |
881 | gpointer user_data) | 881 | gpointer user_data) |
882 | { | 882 | { |
883 | struct MainPublishingDialogContext *ctx = user_data; | 883 | struct MainPublishingDialogContext *ctx = user_data; |
@@ -1042,12 +1042,12 @@ GNUNET_GTK_master_publish_dialog_up_button_clicked_cb (GtkWidget * dummy, | |||
1042 | GNUNET_assert (TRUE == gtk_tree_model_iter_children (ctx->file_info_treemodel, &pred, &parent)); | 1042 | GNUNET_assert (TRUE == gtk_tree_model_iter_children (ctx->file_info_treemodel, &pred, &parent)); |
1043 | pprev = &parent; | 1043 | pprev = &parent; |
1044 | } | 1044 | } |
1045 | else if (! gtk_tree_model_get_iter_first (ctx->file_info_treemodel, &pred)) | 1045 | else if (! gtk_tree_model_get_iter_first (ctx->file_info_treemodel, &pred)) |
1046 | { | 1046 | { |
1047 | GNUNET_break (0); | 1047 | GNUNET_break (0); |
1048 | return; | 1048 | return; |
1049 | } | 1049 | } |
1050 | pprev = NULL; | 1050 | pprev = NULL; |
1051 | /* iterate over 'next' of pred to find out who our predecessor is! */ | 1051 | /* iterate over 'next' of pred to find out who our predecessor is! */ |
1052 | while (GNUNET_YES != gtk_tree_iter_equals (ctx->file_info_treemodel, &pred, &iter)) | 1052 | while (GNUNET_YES != gtk_tree_iter_equals (ctx->file_info_treemodel, &pred, &iter)) |
1053 | { | 1053 | { |
@@ -1147,7 +1147,7 @@ GNUNET_GTK_master_publish_dialog_new_button_clicked_cb (GtkWidget * dummy, | |||
1147 | * @param bo publishing options, unused | 1147 | * @param bo publishing options, unused |
1148 | * @param do_index indexing option, unused | 1148 | * @param do_index indexing option, unused |
1149 | * @param client_info pointer to the GtkTreeRowReference, freed | 1149 | * @param client_info pointer to the GtkTreeRowReference, freed |
1150 | * @return GNUNET_OK to traverse entire subtree | 1150 | * @return GNUNET_OK to traverse entire subtree |
1151 | */ | 1151 | */ |
1152 | static int | 1152 | static int |
1153 | free_fi_row_reference (void *cls, struct GNUNET_FS_FileInformation *fi, | 1153 | free_fi_row_reference (void *cls, struct GNUNET_FS_FileInformation *fi, |
@@ -1216,7 +1216,7 @@ GNUNET_GTK_master_publish_dialog_delete_button_clicked_cb (GtkWidget * dummy, | |||
1216 | { | 1216 | { |
1217 | rr = gtk_tree_row_reference_new (ctx->file_info_treemodel, path); | 1217 | rr = gtk_tree_row_reference_new (ctx->file_info_treemodel, path); |
1218 | gtk_tree_path_free (path); | 1218 | gtk_tree_path_free (path); |
1219 | } | 1219 | } |
1220 | 1220 | ||
1221 | /* 'iter' might have again been clobbered, get it one more time... */ | 1221 | /* 'iter' might have again been clobbered, get it one more time... */ |
1222 | GNUNET_assert (gtk_tree_selection_get_selected (ctx->file_info_selection, NULL, &iter)); | 1222 | GNUNET_assert (gtk_tree_selection_get_selected (ctx->file_info_selection, NULL, &iter)); |
@@ -1225,7 +1225,7 @@ GNUNET_GTK_master_publish_dialog_delete_button_clicked_cb (GtkWidget * dummy, | |||
1225 | gtk_tree_model_get (ctx->file_info_treemodel, &iter, | 1225 | gtk_tree_model_get (ctx->file_info_treemodel, &iter, |
1226 | PUBLISH_MC_FILE_INFORMATION_STRUCT, &fip, -1); | 1226 | PUBLISH_MC_FILE_INFORMATION_STRUCT, &fip, -1); |
1227 | GNUNET_FS_file_information_destroy (fip, &free_fi_row_reference, NULL); | 1227 | GNUNET_FS_file_information_destroy (fip, &free_fi_row_reference, NULL); |
1228 | GNUNET_FS_GTK_remove_treestore_subtree (GTK_TREE_STORE (ctx->file_info_treemodel), | 1228 | GNUNET_FS_GTK_remove_treestore_subtree (GTK_TREE_STORE (ctx->file_info_treemodel), |
1229 | &iter); | 1229 | &iter); |
1230 | 1230 | ||
1231 | /* finally, select the item from 'rr' (if any) */ | 1231 | /* finally, select the item from 'rr' (if any) */ |
@@ -1263,9 +1263,9 @@ destroy_progress_dialog (struct AddDirClientContext *adcc) | |||
1263 | adcc->kill_task = GNUNET_SCHEDULER_NO_TASK; | 1263 | adcc->kill_task = GNUNET_SCHEDULER_NO_TASK; |
1264 | } | 1264 | } |
1265 | gtk_widget_destroy (adcc->progress_dialog); | 1265 | gtk_widget_destroy (adcc->progress_dialog); |
1266 | g_object_unref (G_OBJECT (adcc->progress_dialog_builder)); | 1266 | g_object_unref (G_OBJECT (adcc->progress_dialog_builder)); |
1267 | GNUNET_CONTAINER_DLL_remove (adcc->ctx->adddir_head, | 1267 | GNUNET_CONTAINER_DLL_remove (adcc->ctx->adddir_head, |
1268 | adcc->ctx->adddir_tail, | 1268 | adcc->ctx->adddir_tail, |
1269 | adcc); | 1269 | adcc); |
1270 | update_selectivity_execute_cancel (adcc->ctx); | 1270 | update_selectivity_execute_cancel (adcc->ctx); |
1271 | update_selectivity_edit (adcc->ctx); | 1271 | update_selectivity_edit (adcc->ctx); |
@@ -1315,7 +1315,7 @@ GNUNET_FS_GTK_progress_dialog_delete_event_cb (GtkWidget *widget, | |||
1315 | 1315 | ||
1316 | 1316 | ||
1317 | /** | 1317 | /** |
1318 | * Display some additional information in the text area of the | 1318 | * Display some additional information in the text area of the |
1319 | * progress dialog. | 1319 | * progress dialog. |
1320 | * | 1320 | * |
1321 | * @param adcc progress dialog context of our window | 1321 | * @param adcc progress dialog context of our window |
@@ -1344,10 +1344,10 @@ insert_progress_dialog_text (struct AddDirClientContext *adcc, | |||
1344 | * @param item_iter entry to set to the added item (OUT) | 1344 | * @param item_iter entry to set to the added item (OUT) |
1345 | */ | 1345 | */ |
1346 | static void | 1346 | static void |
1347 | add_item (struct AddDirClientContext *adcc, | 1347 | add_item (struct AddDirClientContext *adcc, |
1348 | GtkTreeStore *ts, | 1348 | GtkTreeStore *ts, |
1349 | struct GNUNET_FS_ShareTreeItem *item, | 1349 | struct GNUNET_FS_ShareTreeItem *item, |
1350 | GtkTreeIter *parent, | 1350 | GtkTreeIter *parent, |
1351 | GtkTreeIter *sibling, | 1351 | GtkTreeIter *sibling, |
1352 | GtkTreeIter *item_iter) | 1352 | GtkTreeIter *item_iter) |
1353 | { | 1353 | { |
@@ -1357,7 +1357,7 @@ add_item (struct AddDirClientContext *adcc, | |||
1357 | GtkTreePath *path; | 1357 | GtkTreePath *path; |
1358 | struct stat sbuf; | 1358 | struct stat sbuf; |
1359 | uint64_t fsize; | 1359 | uint64_t fsize; |
1360 | 1360 | ||
1361 | if (0 != STAT (item->filename, | 1361 | if (0 != STAT (item->filename, |
1362 | &sbuf)) | 1362 | &sbuf)) |
1363 | { | 1363 | { |
@@ -1382,26 +1382,26 @@ add_item (struct AddDirClientContext *adcc, | |||
1382 | item->meta = GNUNET_CONTAINER_meta_data_create (); | 1382 | item->meta = GNUNET_CONTAINER_meta_data_create (); |
1383 | GNUNET_FS_meta_data_make_directory (item->meta); | 1383 | GNUNET_FS_meta_data_make_directory (item->meta); |
1384 | 1384 | ||
1385 | fi = GNUNET_FS_file_information_create_empty_directory (GNUNET_FS_GTK_get_fs_handle (), | 1385 | fi = GNUNET_FS_file_information_create_empty_directory (GNUNET_FS_GTK_get_fs_handle (), |
1386 | row_reference, | 1386 | row_reference, |
1387 | item->ksk_uri, | 1387 | item->ksk_uri, |
1388 | item->meta, | 1388 | item->meta, |
1389 | &adcc->directory_scan_bo, | 1389 | &adcc->directory_scan_bo, |
1390 | item->filename); | 1390 | item->filename); |
1391 | file_size_fancy = GNUNET_strdup (MARKER_DIR_FILE_SIZE); | 1391 | file_size_fancy = GNUNET_strdup (MARKER_DIR_FILE_SIZE); |
1392 | } | 1392 | } |
1393 | else | 1393 | else |
1394 | { | 1394 | { |
1395 | fi = GNUNET_FS_file_information_create_from_file (GNUNET_FS_GTK_get_fs_handle (), | 1395 | fi = GNUNET_FS_file_information_create_from_file (GNUNET_FS_GTK_get_fs_handle (), |
1396 | row_reference, | 1396 | row_reference, |
1397 | item->filename, | 1397 | item->filename, |
1398 | item->ksk_uri, | 1398 | item->ksk_uri, |
1399 | item->meta, | 1399 | item->meta, |
1400 | adcc->directory_scan_do_index, | 1400 | adcc->directory_scan_do_index, |
1401 | &adcc->directory_scan_bo); | 1401 | &adcc->directory_scan_bo); |
1402 | file_size_fancy = GNUNET_STRINGS_byte_size_fancy (fsize); | 1402 | file_size_fancy = GNUNET_STRINGS_byte_size_fancy (fsize); |
1403 | } | 1403 | } |
1404 | gtk_tree_store_set (ts, item_iter, | 1404 | gtk_tree_store_set (ts, item_iter, |
1405 | PUBLISH_MC_FILESIZE, file_size_fancy, | 1405 | PUBLISH_MC_FILESIZE, file_size_fancy, |
1406 | PUBLISH_MC_DO_INDEX, | 1406 | PUBLISH_MC_DO_INDEX, |
1407 | (gboolean) adcc->directory_scan_do_index, | 1407 | (gboolean) adcc->directory_scan_do_index, |
@@ -1437,12 +1437,12 @@ add_share_items_to_treestore (struct AddDirClientContext *adcc, | |||
1437 | GtkTreeIter last_added; | 1437 | GtkTreeIter last_added; |
1438 | struct GNUNET_FS_ShareTreeItem *item; | 1438 | struct GNUNET_FS_ShareTreeItem *item; |
1439 | 1439 | ||
1440 | sibling_iter = NULL; | 1440 | sibling_iter = NULL; |
1441 | for (item = toplevel; NULL != item; item = item->next) | 1441 | for (item = toplevel; NULL != item; item = item->next) |
1442 | { | 1442 | { |
1443 | add_item (adcc, ts, item, parent_iter, sibling_iter, &last_added); | 1443 | add_item (adcc, ts, item, parent_iter, sibling_iter, &last_added); |
1444 | sibling_iter = &last_added; | 1444 | sibling_iter = &last_added; |
1445 | if (item->is_directory == GNUNET_YES) | 1445 | if (item->is_directory == GNUNET_YES) |
1446 | add_share_items_to_treestore (adcc, | 1446 | add_share_items_to_treestore (adcc, |
1447 | item->children_head, | 1447 | item->children_head, |
1448 | sibling_iter); | 1448 | sibling_iter); |
@@ -1452,7 +1452,7 @@ add_share_items_to_treestore (struct AddDirClientContext *adcc, | |||
1452 | 1452 | ||
1453 | /** | 1453 | /** |
1454 | * Function called when the scanner had some trouble and we | 1454 | * Function called when the scanner had some trouble and we |
1455 | * need to abort the scanning process (which we need to do | 1455 | * need to abort the scanning process (which we need to do |
1456 | * in a separate task). | 1456 | * in a separate task). |
1457 | * | 1457 | * |
1458 | * @param cls progress dialog context of our window | 1458 | * @param cls progress dialog context of our window |
@@ -1463,7 +1463,7 @@ stop_scanner_task (void *cls, | |||
1463 | const struct GNUNET_SCHEDULER_TaskContext *tc) | 1463 | const struct GNUNET_SCHEDULER_TaskContext *tc) |
1464 | { | 1464 | { |
1465 | struct AddDirClientContext *adcc = cls; | 1465 | struct AddDirClientContext *adcc = cls; |
1466 | 1466 | ||
1467 | adcc->kill_task = GNUNET_SCHEDULER_NO_TASK; | 1467 | adcc->kill_task = GNUNET_SCHEDULER_NO_TASK; |
1468 | if (NULL != adcc->ds) | 1468 | if (NULL != adcc->ds) |
1469 | { | 1469 | { |
@@ -1483,7 +1483,7 @@ stop_scanner_task (void *cls, | |||
1483 | * @param reason kind of progress that was made | 1483 | * @param reason kind of progress that was made |
1484 | */ | 1484 | */ |
1485 | static void | 1485 | static void |
1486 | directory_scan_cb (void *cls, | 1486 | directory_scan_cb (void *cls, |
1487 | const char *filename, int is_directory, | 1487 | const char *filename, int is_directory, |
1488 | enum GNUNET_FS_DirScannerProgressUpdateReason reason) | 1488 | enum GNUNET_FS_DirScannerProgressUpdateReason reason) |
1489 | { | 1489 | { |
@@ -1525,16 +1525,16 @@ directory_scan_cb (void *cls, | |||
1525 | "GNUNET_FS_GTK_progress_dialog_scrolled_window"))); | 1525 | "GNUNET_FS_GTK_progress_dialog_scrolled_window"))); |
1526 | #endif | 1526 | #endif |
1527 | insert_progress_dialog_text (adcc, s); | 1527 | insert_progress_dialog_text (adcc, s); |
1528 | GNUNET_free (s); | 1528 | GNUNET_free (s); |
1529 | break; | 1529 | break; |
1530 | case GNUNET_FS_DIRSCANNER_ALL_COUNTED: | 1530 | case GNUNET_FS_DIRSCANNER_ALL_COUNTED: |
1531 | fraction = (adcc->total == 0) ? 1.0 : (1.0 * adcc->done) / adcc->total; | 1531 | fraction = (adcc->total == 0) ? 1.0 : (1.0 * adcc->done) / adcc->total; |
1532 | GNUNET_asprintf (&s, "%u/%u (%3f%%)", | 1532 | GNUNET_asprintf (&s, "%u/%u (%3f%%)", |
1533 | adcc->done, | 1533 | adcc->done, |
1534 | adcc->total, | 1534 | adcc->total, |
1535 | 100.0 * fraction); | 1535 | 100.0 * fraction); |
1536 | gtk_progress_bar_set_text (adcc->progress_dialog_bar, | 1536 | gtk_progress_bar_set_text (adcc->progress_dialog_bar, |
1537 | s); | 1537 | s); |
1538 | GNUNET_free (s); | 1538 | GNUNET_free (s); |
1539 | gtk_progress_bar_set_fraction (adcc->progress_dialog_bar, | 1539 | gtk_progress_bar_set_fraction (adcc->progress_dialog_bar, |
1540 | fraction); | 1540 | fraction); |
@@ -1549,12 +1549,12 @@ directory_scan_cb (void *cls, | |||
1549 | adcc->done++; | 1549 | adcc->done++; |
1550 | GNUNET_assert (adcc->done <= adcc->total); | 1550 | GNUNET_assert (adcc->done <= adcc->total); |
1551 | fraction = (adcc->total == 0) ? 1.0 : (1.0 * adcc->done) / adcc->total; | 1551 | fraction = (adcc->total == 0) ? 1.0 : (1.0 * adcc->done) / adcc->total; |
1552 | GNUNET_asprintf (&s, "%u/%u (%3f%%)", | 1552 | GNUNET_asprintf (&s, "%u/%u (%3f%%)", |
1553 | adcc->done, | 1553 | adcc->done, |
1554 | adcc->total, | 1554 | adcc->total, |
1555 | 100.0 * fraction); | 1555 | 100.0 * fraction); |
1556 | gtk_progress_bar_set_text (adcc->progress_dialog_bar, | 1556 | gtk_progress_bar_set_text (adcc->progress_dialog_bar, |
1557 | s); | 1557 | s); |
1558 | GNUNET_free (s); | 1558 | GNUNET_free (s); |
1559 | gtk_progress_bar_set_fraction (adcc->progress_dialog_bar, | 1559 | gtk_progress_bar_set_fraction (adcc->progress_dialog_bar, |
1560 | fraction); | 1560 | fraction); |
@@ -1575,7 +1575,7 @@ directory_scan_cb (void *cls, | |||
1575 | directory_scan_result = GNUNET_FS_directory_scan_get_result (adcc->ds); | 1575 | directory_scan_result = GNUNET_FS_directory_scan_get_result (adcc->ds); |
1576 | adcc->ds = NULL; | 1576 | adcc->ds = NULL; |
1577 | GNUNET_FS_share_tree_trim (directory_scan_result); | 1577 | GNUNET_FS_share_tree_trim (directory_scan_result); |
1578 | add_share_items_to_treestore (adcc, | 1578 | add_share_items_to_treestore (adcc, |
1579 | directory_scan_result, | 1579 | directory_scan_result, |
1580 | NULL); | 1580 | NULL); |
1581 | GNUNET_FS_share_tree_free (directory_scan_result); | 1581 | GNUNET_FS_share_tree_free (directory_scan_result); |
@@ -1600,9 +1600,9 @@ directory_scan_cb (void *cls, | |||
1600 | * @param do_index should we index or insert files (by default) | 1600 | * @param do_index should we index or insert files (by default) |
1601 | */ | 1601 | */ |
1602 | static void | 1602 | static void |
1603 | scan_file_or_directory (struct MainPublishingDialogContext *ctx, | 1603 | scan_file_or_directory (struct MainPublishingDialogContext *ctx, |
1604 | gchar *filename, | 1604 | gchar *filename, |
1605 | struct GNUNET_FS_BlockOptions *bo, | 1605 | struct GNUNET_FS_BlockOptions *bo, |
1606 | int do_index) | 1606 | int do_index) |
1607 | { | 1607 | { |
1608 | struct AddDirClientContext *adcc; | 1608 | struct AddDirClientContext *adcc; |
@@ -1633,7 +1633,7 @@ scan_file_or_directory (struct MainPublishingDialogContext *ctx, | |||
1633 | 1633 | ||
1634 | /* actually start the scan */ | 1634 | /* actually start the scan */ |
1635 | adcc->ds = GNUNET_FS_directory_scan_start (filename, | 1635 | adcc->ds = GNUNET_FS_directory_scan_start (filename, |
1636 | GNUNET_NO, NULL, | 1636 | GNUNET_NO, NULL, |
1637 | &directory_scan_cb, adcc); | 1637 | &directory_scan_cb, adcc); |
1638 | 1638 | ||
1639 | /* disables 'cancel' button of the master dialog */ | 1639 | /* disables 'cancel' button of the master dialog */ |
@@ -1663,7 +1663,7 @@ GNUNET_GTK_publish_directory_dialog_response_cb (GtkDialog * dialog, | |||
1663 | 1663 | ||
1664 | filename = GNUNET_GTK_filechooser_get_filename_utf8 (GTK_FILE_CHOOSER (dialog)); | 1664 | filename = GNUNET_GTK_filechooser_get_filename_utf8 (GTK_FILE_CHOOSER (dialog)); |
1665 | if (! GNUNET_GTK_get_selected_anonymity_level | 1665 | if (! GNUNET_GTK_get_selected_anonymity_level |
1666 | (ctx->open_directory_builder, | 1666 | (ctx->open_directory_builder, |
1667 | "GNUNET_GTK_publish_directory_dialog_anonymity_combobox", | 1667 | "GNUNET_GTK_publish_directory_dialog_anonymity_combobox", |
1668 | &bo.anonymity_level)) | 1668 | &bo.anonymity_level)) |
1669 | { | 1669 | { |
@@ -1675,7 +1675,7 @@ GNUNET_GTK_publish_directory_dialog_response_cb (GtkDialog * dialog, | |||
1675 | (gtk_builder_get_object | 1675 | (gtk_builder_get_object |
1676 | (ctx->open_directory_builder, | 1676 | (ctx->open_directory_builder, |
1677 | "GNUNET_GTK_publish_directory_dialog_priority_spin_button"))); | 1677 | "GNUNET_GTK_publish_directory_dialog_priority_spin_button"))); |
1678 | bo.replication_level = | 1678 | bo.replication_level = |
1679 | gtk_spin_button_get_value (GTK_SPIN_BUTTON | 1679 | gtk_spin_button_get_value (GTK_SPIN_BUTTON |
1680 | (gtk_builder_get_object | 1680 | (gtk_builder_get_object |
1681 | (ctx->open_directory_builder, | 1681 | (ctx->open_directory_builder, |
@@ -1740,7 +1740,7 @@ GNUNET_GTK_publish_file_dialog_response_cb (GtkDialog * dialog, | |||
1740 | 1740 | ||
1741 | sb = GTK_SPIN_BUTTON (gtk_builder_get_object | 1741 | sb = GTK_SPIN_BUTTON (gtk_builder_get_object |
1742 | (ctx->open_file_builder, | 1742 | (ctx->open_file_builder, |
1743 | "GNUNET_GTK_publish_file_dialog_expiration_year_spin_button")); | 1743 | "GNUNET_GTK_publish_file_dialog_expiration_year_spin_button")); |
1744 | bo.expiration_time = GNUNET_GTK_get_expiration_time (sb); | 1744 | bo.expiration_time = GNUNET_GTK_get_expiration_time (sb); |
1745 | } | 1745 | } |
1746 | bo.replication_level = | 1746 | bo.replication_level = |
@@ -1766,7 +1766,7 @@ GNUNET_GTK_publish_file_dialog_response_cb (GtkDialog * dialog, | |||
1766 | /** | 1766 | /** |
1767 | * User clicked on the 'add' button in the master publish dialog. | 1767 | * User clicked on the 'add' button in the master publish dialog. |
1768 | * Create the dialog to allow the user to select a file to add. | 1768 | * Create the dialog to allow the user to select a file to add. |
1769 | * | 1769 | * |
1770 | * FIXME-UGLY: lots of code duplication between files & directories here... | 1770 | * FIXME-UGLY: lots of code duplication between files & directories here... |
1771 | * | 1771 | * |
1772 | * @param dummy the button that was pressed | 1772 | * @param dummy the button that was pressed |
@@ -1791,10 +1791,10 @@ GNUNET_GTK_master_publish_dialog_add_button_clicked_cb (GtkWidget * dummy, | |||
1791 | 1791 | ||
1792 | { | 1792 | { |
1793 | GtkComboBox *combo; | 1793 | GtkComboBox *combo; |
1794 | 1794 | ||
1795 | combo = GTK_COMBO_BOX (gtk_builder_get_object (ctx->open_file_builder, | 1795 | combo = GTK_COMBO_BOX (gtk_builder_get_object (ctx->open_file_builder, |
1796 | "GNUNET_GTK_publish_file_dialog_anonymity_combobox")); | 1796 | "GNUNET_GTK_publish_file_dialog_anonymity_combobox")); |
1797 | gtk_combo_box_set_model (combo, | 1797 | gtk_combo_box_set_model (combo, |
1798 | GNUNET_FS_GTK_get_anonymity_level_list_store ()); | 1798 | GNUNET_FS_GTK_get_anonymity_level_list_store ()); |
1799 | } | 1799 | } |
1800 | 1800 | ||
@@ -1908,12 +1908,12 @@ update_treeview_after_edit (void *cls, struct GNUNET_FS_FileInformation *fi, | |||
1908 | { | 1908 | { |
1909 | struct EditPublishContext *epc = cls; | 1909 | struct EditPublishContext *epc = cls; |
1910 | char *name; | 1910 | char *name; |
1911 | 1911 | ||
1912 | name = GNUNET_CONTAINER_meta_data_get_by_type (meta, | 1912 | name = GNUNET_CONTAINER_meta_data_get_by_type (meta, |
1913 | EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME); | 1913 | EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME); |
1914 | gtk_tree_store_set (GTK_TREE_STORE (epc->tm), &epc->iter, | 1914 | gtk_tree_store_set (GTK_TREE_STORE (epc->tm), &epc->iter, |
1915 | PUBLISH_MC_DO_INDEX, *do_index, | 1915 | PUBLISH_MC_DO_INDEX, *do_index, |
1916 | PUBLISH_MC_FILENAME, name, | 1916 | PUBLISH_MC_FILENAME, name, |
1917 | PUBLISH_MC_ANONYMITY_LEVEL, (guint) bo->anonymity_level, | 1917 | PUBLISH_MC_ANONYMITY_LEVEL, (guint) bo->anonymity_level, |
1918 | PUBLISH_MC_PRIORITY, (guint) bo->content_priority, | 1918 | PUBLISH_MC_PRIORITY, (guint) bo->content_priority, |
1919 | PUBLISH_MC_EXPIRATION_TIME_ABSOLUTE, | 1919 | PUBLISH_MC_EXPIRATION_TIME_ABSOLUTE, |
@@ -1972,9 +1972,9 @@ GNUNET_GTK_master_publish_dialog_edit_button_clicked_cb (GtkWidget * dummy, | |||
1972 | &epc->iter, | 1972 | &epc->iter, |
1973 | PUBLISH_MC_FILE_INFORMATION_STRUCT, &epc->fip, | 1973 | PUBLISH_MC_FILE_INFORMATION_STRUCT, &epc->fip, |
1974 | -1); | 1974 | -1); |
1975 | GNUNET_FS_GTK_edit_publish_dialog (ctx->master_pubdialog, | 1975 | GNUNET_FS_GTK_edit_publish_dialog (ctx->master_pubdialog, |
1976 | epc->fip, | 1976 | epc->fip, |
1977 | GNUNET_NO, | 1977 | GNUNET_NO, |
1978 | &master_publish_edit_publish_dialog_cb, | 1978 | &master_publish_edit_publish_dialog_cb, |
1979 | epc); | 1979 | epc); |
1980 | } | 1980 | } |
@@ -2100,10 +2100,10 @@ close_master_publish_dialog (struct MainPublishingDialogContext *ctx) | |||
2100 | */ | 2100 | */ |
2101 | static int | 2101 | static int |
2102 | insert_advertisement (void *cls, struct GNUNET_FS_FileInformation *fi, | 2102 | insert_advertisement (void *cls, struct GNUNET_FS_FileInformation *fi, |
2103 | uint64_t length, | 2103 | uint64_t length, |
2104 | struct GNUNET_CONTAINER_MetaData *meta, | 2104 | struct GNUNET_CONTAINER_MetaData *meta, |
2105 | struct GNUNET_FS_Uri **uri, | 2105 | struct GNUNET_FS_Uri **uri, |
2106 | struct GNUNET_FS_BlockOptions *bo, | 2106 | struct GNUNET_FS_BlockOptions *bo, |
2107 | int *do_index, | 2107 | int *do_index, |
2108 | void **client_info) | 2108 | void **client_info) |
2109 | { | 2109 | { |
@@ -2123,7 +2123,7 @@ insert_advertisement (void *cls, struct GNUNET_FS_FileInformation *fi, | |||
2123 | 2123 | ||
2124 | GNUNET_CONTAINER_meta_data_insert (meta, "<gnunet>", | 2124 | GNUNET_CONTAINER_meta_data_insert (meta, "<gnunet>", |
2125 | EXTRACTOR_METATYPE_URI, EXTRACTOR_METAFORMAT_UTF8, | 2125 | EXTRACTOR_METATYPE_URI, EXTRACTOR_METAFORMAT_UTF8, |
2126 | "text/plain", | 2126 | "text/plain", |
2127 | sks_uri_string, | 2127 | sks_uri_string, |
2128 | strlen (sks_uri_string) + 1); | 2128 | strlen (sks_uri_string) + 1); |
2129 | GNUNET_free (sks_uri_string); | 2129 | GNUNET_free (sks_uri_string); |
@@ -2178,7 +2178,7 @@ GNUNET_GTK_master_publish_dialog_execute_button_clicked_cb (GtkButton * button, | |||
2178 | if (NULL != (id_entry_text = gtk_entry_get_text (GTK_ENTRY (ctx->identifier_entry)))) | 2178 | if (NULL != (id_entry_text = gtk_entry_get_text (GTK_ENTRY (ctx->identifier_entry)))) |
2179 | namespace_id = g_strdup (id_entry_text); | 2179 | namespace_id = g_strdup (id_entry_text); |
2180 | else if (!do_global) | 2180 | else if (!do_global) |
2181 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 2181 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
2182 | "Global publication is disabled, but namespace_id is not available\n"); | 2182 | "Global publication is disabled, but namespace_id is not available\n"); |
2183 | if ((NULL != namespace_id) && ('\0' == namespace_id[0])) | 2183 | if ((NULL != namespace_id) && ('\0' == namespace_id[0])) |
2184 | { | 2184 | { |
@@ -2214,10 +2214,10 @@ GNUNET_GTK_master_publish_dialog_execute_button_clicked_cb (GtkButton * button, | |||
2214 | fi = get_file_information (ctx->file_info_treemodel, &iter); | 2214 | fi = get_file_information (ctx->file_info_treemodel, &iter); |
2215 | if (do_global && do_own && !disable_ads_insertion) | 2215 | if (do_global && do_own && !disable_ads_insertion) |
2216 | GNUNET_FS_file_information_inspect (fi, insert_advertisement, ctx); | 2216 | GNUNET_FS_file_information_inspect (fi, insert_advertisement, ctx); |
2217 | GNUNET_FS_publish_start (GNUNET_FS_GTK_get_fs_handle (), | 2217 | GNUNET_FS_publish_start (GNUNET_FS_GTK_get_fs_handle (), |
2218 | fi, | 2218 | fi, |
2219 | (NULL == ns) | 2219 | (NULL == ns) |
2220 | ? NULL | 2220 | ? NULL |
2221 | : GNUNET_IDENTITY_ego_get_private_key (ns), | 2221 | : GNUNET_IDENTITY_ego_get_private_key (ns), |
2222 | namespace_id, namespace_uid, | 2222 | namespace_id, namespace_uid, |
2223 | GNUNET_FS_PUBLISH_OPTION_NONE); | 2223 | GNUNET_FS_PUBLISH_OPTION_NONE); |
@@ -2278,7 +2278,7 @@ clear_keywords_from_file_information_in_tree_store (GtkTreeModel * tm, | |||
2278 | { | 2278 | { |
2279 | GtkTreeIter child; | 2279 | GtkTreeIter child; |
2280 | struct GNUNET_FS_FileInformation *fip; | 2280 | struct GNUNET_FS_FileInformation *fip; |
2281 | 2281 | ||
2282 | gtk_tree_model_get (tm, iter, PUBLISH_MC_FILE_INFORMATION_STRUCT, &fip, -1); | 2282 | gtk_tree_model_get (tm, iter, PUBLISH_MC_FILE_INFORMATION_STRUCT, &fip, -1); |
2283 | if (NULL != fip) | 2283 | if (NULL != fip) |
2284 | { | 2284 | { |
@@ -2398,7 +2398,7 @@ expander_callback (GObject *object, | |||
2398 | g_value_init (&gv, G_TYPE_BOOLEAN); | 2398 | g_value_init (&gv, G_TYPE_BOOLEAN); |
2399 | g_value_set_boolean (&gv, expanded); | 2399 | g_value_set_boolean (&gv, expanded); |
2400 | gtk_container_child_set_property (GTK_CONTAINER (ctx->vpaned), | 2400 | gtk_container_child_set_property (GTK_CONTAINER (ctx->vpaned), |
2401 | ctx->bottom_frame, | 2401 | ctx->bottom_frame, |
2402 | "resize", &gv); | 2402 | "resize", &gv); |
2403 | paned_pos = gtk_paned_get_position (GTK_PANED (ctx->vpaned)); | 2403 | paned_pos = gtk_paned_get_position (GTK_PANED (ctx->vpaned)); |
2404 | paned_pos = paned_pos + (scrolled_allocation.height * (expanded ? -1 : 1)); | 2404 | paned_pos = paned_pos + (scrolled_allocation.height * (expanded ? -1 : 1)); |
@@ -2492,7 +2492,7 @@ add_updateable_to_ts (void *cls, const char *last_id, | |||
2492 | urilen = 0; | 2492 | urilen = 0; |
2493 | 2493 | ||
2494 | mdbuf = NULL; | 2494 | mdbuf = NULL; |
2495 | mdsize = GNUNET_CONTAINER_meta_data_serialize (last_meta, | 2495 | mdsize = GNUNET_CONTAINER_meta_data_serialize (last_meta, |
2496 | &mdbuf, 64*1024, | 2496 | &mdbuf, 64*1024, |
2497 | GNUNET_CONTAINER_META_DATA_SERIALIZE_FULL); | 2497 | GNUNET_CONTAINER_META_DATA_SERIALIZE_FULL); |
2498 | if (0 > mdsize) | 2498 | if (0 > mdsize) |
@@ -2575,12 +2575,12 @@ add_updateable_to_ts (void *cls, const char *last_id, | |||
2575 | sc.ns = uc->ns; | 2575 | sc.ns = uc->ns; |
2576 | sc.seen = uc->seen; | 2576 | sc.seen = uc->seen; |
2577 | sc.update_called = GNUNET_NO; | 2577 | sc.update_called = GNUNET_NO; |
2578 | GNUNET_FS_namespace_list_updateable (GNUNET_FS_GTK_get_fs_handle (), | 2578 | GNUNET_FS_namespace_list_updateable (GNUNET_FS_GTK_get_fs_handle (), |
2579 | GNUNET_IDENTITY_ego_get_private_key (uc->ns), | 2579 | GNUNET_IDENTITY_ego_get_private_key (uc->ns), |
2580 | next_id, | 2580 | next_id, |
2581 | &add_updateable_to_ts, | 2581 | &add_updateable_to_ts, |
2582 | &sc); | 2582 | &sc); |
2583 | if ((sc.update_called == GNUNET_NO) && | 2583 | if ((sc.update_called == GNUNET_NO) && |
2584 | (NULL != next_id) && | 2584 | (NULL != next_id) && |
2585 | (strlen (next_id) > 0)) | 2585 | (strlen (next_id) > 0)) |
2586 | { | 2586 | { |
@@ -2608,8 +2608,8 @@ add_updateable_to_ts (void *cls, const char *last_id, | |||
2608 | * @return #GNUNET_YES, always. | 2608 | * @return #GNUNET_YES, always. |
2609 | */ | 2609 | */ |
2610 | static int | 2610 | static int |
2611 | free_seen_paths (void *cls, | 2611 | free_seen_paths (void *cls, |
2612 | const struct GNUNET_HashCode *key, | 2612 | const struct GNUNET_HashCode *key, |
2613 | void *value) | 2613 | void *value) |
2614 | { | 2614 | { |
2615 | GNUNET_free_non_null (value); | 2615 | GNUNET_free_non_null (value); |
@@ -2669,7 +2669,7 @@ GNUNET_GTK_master_publish_dialog_ego_combobox_changed_cb (GtkComboBox *combo, | |||
2669 | uc.update_called = GNUNET_NO; | 2669 | uc.update_called = GNUNET_NO; |
2670 | uc.seen = GNUNET_CONTAINER_multihashmap_create (128, GNUNET_NO); | 2670 | uc.seen = GNUNET_CONTAINER_multihashmap_create (128, GNUNET_NO); |
2671 | 2671 | ||
2672 | GNUNET_FS_namespace_list_updateable (GNUNET_FS_GTK_get_fs_handle (), | 2672 | GNUNET_FS_namespace_list_updateable (GNUNET_FS_GTK_get_fs_handle (), |
2673 | GNUNET_IDENTITY_ego_get_private_key (ego), | 2673 | GNUNET_IDENTITY_ego_get_private_key (ego), |
2674 | NULL, | 2674 | NULL, |
2675 | &add_updateable_to_ts, | 2675 | &add_updateable_to_ts, |
@@ -2689,7 +2689,7 @@ GNUNET_GTK_master_publish_dialog_ego_combobox_changed_cb (GtkComboBox *combo, | |||
2689 | * | 2689 | * |
2690 | * @param cls our `struct MainPublishingDialogContext` | 2690 | * @param cls our `struct MainPublishingDialogContext` |
2691 | * @param ego identity of the namespace to add | 2691 | * @param ego identity of the namespace to add |
2692 | * @param ego_ctx where to store context data | 2692 | * @param ego_ctx where to store context data |
2693 | * @param name name of the namespace to add | 2693 | * @param name name of the namespace to add |
2694 | */ | 2694 | */ |
2695 | static void | 2695 | static void |
@@ -2714,14 +2714,14 @@ add_namespace_to_ts (void *cls, | |||
2714 | { | 2714 | { |
2715 | /* insert operation */ | 2715 | /* insert operation */ |
2716 | GNUNET_assert (NULL != name); | 2716 | GNUNET_assert (NULL != name); |
2717 | gtk_list_store_insert_with_values (ls, | 2717 | gtk_list_store_insert_with_values (ls, |
2718 | &iter, G_MAXINT, | 2718 | &iter, G_MAXINT, |
2719 | EGO_MC_NAME, name, | 2719 | EGO_MC_NAME, name, |
2720 | EGO_MC_EGO, ego, | 2720 | EGO_MC_EGO, ego, |
2721 | -1); | 2721 | -1); |
2722 | path = gtk_tree_model_get_path (GTK_TREE_MODEL (ls), | 2722 | path = gtk_tree_model_get_path (GTK_TREE_MODEL (ls), |
2723 | &iter); | 2723 | &iter); |
2724 | rr = gtk_tree_row_reference_new (GTK_TREE_MODEL (ls), | 2724 | rr = gtk_tree_row_reference_new (GTK_TREE_MODEL (ls), |
2725 | path); | 2725 | path); |
2726 | gtk_tree_path_free (path); | 2726 | gtk_tree_path_free (path); |
2727 | *ego_ctx = rr; | 2727 | *ego_ctx = rr; |
@@ -2741,13 +2741,13 @@ add_namespace_to_ts (void *cls, | |||
2741 | { | 2741 | { |
2742 | /* rename operation */ | 2742 | /* rename operation */ |
2743 | path = gtk_tree_row_reference_get_path (rr); | 2743 | path = gtk_tree_row_reference_get_path (rr); |
2744 | GNUNET_assert (gtk_tree_model_get_iter (GTK_TREE_MODEL (ls), | 2744 | GNUNET_assert (gtk_tree_model_get_iter (GTK_TREE_MODEL (ls), |
2745 | &iter, path)); | 2745 | &iter, path)); |
2746 | gtk_list_store_set (ls, | 2746 | gtk_list_store_set (ls, |
2747 | &iter, G_MAXINT, | 2747 | &iter, G_MAXINT, |
2748 | EGO_MC_NAME, name, | 2748 | EGO_MC_NAME, name, |
2749 | -1); | 2749 | -1); |
2750 | gtk_tree_path_free (path); | 2750 | gtk_tree_path_free (path); |
2751 | } | 2751 | } |
2752 | have_ns = gtk_tree_model_get_iter_first (GTK_TREE_MODEL (ls), &iter); | 2752 | have_ns = gtk_tree_model_get_iter_first (GTK_TREE_MODEL (ls), &iter); |
2753 | gtk_widget_set_sensitive (ctx->own_checkbox, have_ns); | 2753 | gtk_widget_set_sensitive (ctx->own_checkbox, have_ns); |
@@ -2759,12 +2759,12 @@ add_namespace_to_ts (void *cls, | |||
2759 | 2759 | ||
2760 | /** | 2760 | /** |
2761 | * Run the file-publishing operation (by opening the master publishing dialog). | 2761 | * Run the file-publishing operation (by opening the master publishing dialog). |
2762 | * | 2762 | * |
2763 | * @param dummy widget that triggered the action | 2763 | * @param dummy widget that triggered the action |
2764 | * @param user_data builder of the main window | 2764 | * @param user_data builder of the main window |
2765 | */ | 2765 | */ |
2766 | void | 2766 | void |
2767 | GNUNET_GTK_main_menu_file_publish_activate_cb (GtkWidget * dummy, | 2767 | GNUNET_GTK_main_menu_file_publish_activate_cb (GtkWidget * dummy, |
2768 | gpointer user_data) | 2768 | gpointer user_data) |
2769 | { | 2769 | { |
2770 | struct MainPublishingDialogContext *ctx; | 2770 | struct MainPublishingDialogContext *ctx; |
@@ -2873,7 +2873,7 @@ GNUNET_GTK_main_menu_file_publish_activate_cb (GtkWidget * dummy, | |||
2873 | /* show dialog */ | 2873 | /* show dialog */ |
2874 | toplevel = gtk_widget_get_toplevel (dummy); | 2874 | toplevel = gtk_widget_get_toplevel (dummy); |
2875 | if (GTK_IS_WINDOW (toplevel)) | 2875 | if (GTK_IS_WINDOW (toplevel)) |
2876 | gtk_window_set_transient_for (GTK_WINDOW (ctx->master_pubdialog), | 2876 | gtk_window_set_transient_for (GTK_WINDOW (ctx->master_pubdialog), |
2877 | GTK_WINDOW (toplevel)); | 2877 | GTK_WINDOW (toplevel)); |
2878 | gtk_window_present (GTK_WINDOW (ctx->master_pubdialog)); | 2878 | gtk_window_present (GTK_WINDOW (ctx->master_pubdialog)); |
2879 | } | 2879 | } |
diff --git a/src/fs/gnunet-fs-gtk_publish-edit-dialog.c b/src/fs/gnunet-fs-gtk_publish-edit-dialog.c index 71260209..196726a1 100644 --- a/src/fs/gnunet-fs-gtk_publish-edit-dialog.c +++ b/src/fs/gnunet-fs-gtk_publish-edit-dialog.c | |||
@@ -300,26 +300,26 @@ change_metatypes (struct EditPublicationDialogContext *ctx, gint code) | |||
300 | /* double-check that 'code' is valid */ | 300 | /* double-check that 'code' is valid */ |
301 | for (pubtype_count = 0; NULL != types[pubtype_count]; pubtype_count++) ; | 301 | for (pubtype_count = 0; NULL != types[pubtype_count]; pubtype_count++) ; |
302 | GNUNET_assert (code < pubtype_count); | 302 | GNUNET_assert (code < pubtype_count); |
303 | 303 | ||
304 | /* clear existing selection of metatypes */ | 304 | /* clear existing selection of metatypes */ |
305 | gtk_list_store_clear (ctx->metatypes_liststore); | 305 | gtk_list_store_clear (ctx->metatypes_liststore); |
306 | max_type = EXTRACTOR_metatype_get_max (); | 306 | max_type = EXTRACTOR_metatype_get_max (); |
307 | /* add new types based on selection */ | 307 | /* add new types based on selection */ |
308 | for (i = 0; types[code][i] != EXTRACTOR_METATYPE_RESERVED; i++) | 308 | for (i = 0; types[code][i] != EXTRACTOR_METATYPE_RESERVED; i++) |
309 | if ( (types[code][i] < max_type) && (types[code][i] > 0) ) | 309 | if ( (types[code][i] < max_type) && (types[code][i] > 0) ) |
310 | gtk_list_store_insert_with_values (ctx->metatypes_liststore, | 310 | gtk_list_store_insert_with_values (ctx->metatypes_liststore, |
311 | &iter, G_MAXINT, | 311 | &iter, G_MAXINT, |
312 | PUBLISH_METADATA_TYPES_MC_TYPE, | 312 | PUBLISH_METADATA_TYPES_MC_TYPE, |
313 | types[code][i], | 313 | types[code][i], |
314 | PUBLISH_METADATA_TYPES_MC_FORMAT, | 314 | PUBLISH_METADATA_TYPES_MC_FORMAT, |
315 | EXTRACTOR_METAFORMAT_UTF8, | 315 | EXTRACTOR_METAFORMAT_UTF8, |
316 | PUBLISH_METADATA_TYPES_MC_TYPE_NAME, | 316 | PUBLISH_METADATA_TYPES_MC_TYPE_NAME, |
317 | EXTRACTOR_metatype_to_string | 317 | EXTRACTOR_metatype_to_string |
318 | (types [code][i]), | 318 | (types [code][i]), |
319 | PUBLISH_METADATA_TYPES_MC_DESCRIPTION, | 319 | PUBLISH_METADATA_TYPES_MC_DESCRIPTION, |
320 | EXTRACTOR_metatype_to_description | 320 | EXTRACTOR_metatype_to_description |
321 | (types[code][i]), | 321 | (types[code][i]), |
322 | -1); | 322 | -1); |
323 | } | 323 | } |
324 | 324 | ||
325 | 325 | ||
@@ -361,7 +361,7 @@ metadata_selection_changed_cb (GtkTreeSelection *ts, | |||
361 | struct EditPublicationDialogContext *ctx = user_data; | 361 | struct EditPublicationDialogContext *ctx = user_data; |
362 | 362 | ||
363 | gtk_widget_set_sensitive (GTK_WIDGET (gtk_builder_get_object | 363 | gtk_widget_set_sensitive (GTK_WIDGET (gtk_builder_get_object |
364 | (ctx->builder, | 364 | (ctx->builder, |
365 | "GNUNET_GTK_edit_publication_delete_button")), | 365 | "GNUNET_GTK_edit_publication_delete_button")), |
366 | gtk_tree_selection_get_selected (ts, NULL, NULL)); | 366 | gtk_tree_selection_get_selected (ts, NULL, NULL)); |
367 | } | 367 | } |
@@ -377,9 +377,9 @@ metadata_selection_changed_cb (GtkTreeSelection *ts, | |||
377 | * @param new_text new value for the item | 377 | * @param new_text new value for the item |
378 | * @param user_data the 'struct EditPublicationDialogContext' | 378 | * @param user_data the 'struct EditPublicationDialogContext' |
379 | */ | 379 | */ |
380 | void | 380 | void |
381 | GNUNET_GTK_edit_publication_metadata_tree_view_type_renderer_edited_cb (GtkCellRendererText *renderer, | 381 | GNUNET_GTK_edit_publication_metadata_tree_view_type_renderer_edited_cb (GtkCellRendererText *renderer, |
382 | gchar * path, | 382 | gchar * path, |
383 | gchar * new_text, | 383 | gchar * new_text, |
384 | gpointer user_data) | 384 | gpointer user_data) |
385 | { | 385 | { |
@@ -387,8 +387,8 @@ GNUNET_GTK_edit_publication_metadata_tree_view_type_renderer_edited_cb (GtkCellR | |||
387 | GtkTreeIter iter; | 387 | GtkTreeIter iter; |
388 | gint type_id; | 388 | gint type_id; |
389 | 389 | ||
390 | if (! gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL (ctx->meta_liststore), | 390 | if (! gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL (ctx->meta_liststore), |
391 | &iter, | 391 | &iter, |
392 | path)) | 392 | path)) |
393 | { | 393 | { |
394 | GNUNET_break (0); | 394 | GNUNET_break (0); |
@@ -421,10 +421,10 @@ GNUNET_GTK_edit_publication_metadata_tree_view_type_renderer_edited_cb (GtkCellR | |||
421 | * @param combo combo box that was dropped down | 421 | * @param combo combo box that was dropped down |
422 | * @param path_string which item was changed in the tree view | 422 | * @param path_string which item was changed in the tree view |
423 | * @param new_iter item that is now selected in the drop-down combo box | 423 | * @param new_iter item that is now selected in the drop-down combo box |
424 | * @param user_data the 'struct EditPublicationDialogContext' | 424 | * @param user_data the 'struct EditPublicationDialogContext' |
425 | */ | 425 | */ |
426 | void | 426 | void |
427 | GNUNET_GTK_edit_publication_metadata_tree_view_type_renderer_changed_cb (GtkCellRendererCombo * combo, | 427 | GNUNET_GTK_edit_publication_metadata_tree_view_type_renderer_changed_cb (GtkCellRendererCombo * combo, |
428 | gchar * path_string, | 428 | gchar * path_string, |
429 | GtkTreeIter * new_iter, | 429 | GtkTreeIter * new_iter, |
430 | gpointer user_data) | 430 | gpointer user_data) |
@@ -452,7 +452,7 @@ GNUNET_GTK_edit_publication_metadata_tree_view_type_renderer_changed_cb (GtkCell | |||
452 | * @param new_text new value for the item | 452 | * @param new_text new value for the item |
453 | * @param user_data the 'struct EditPublicationDialogContext' | 453 | * @param user_data the 'struct EditPublicationDialogContext' |
454 | */ | 454 | */ |
455 | void | 455 | void |
456 | GNUNET_GTK_edit_publication_metadata_tree_view_value_renderer_edited_cb (GtkCellRendererText * renderer, | 456 | GNUNET_GTK_edit_publication_metadata_tree_view_value_renderer_edited_cb (GtkCellRendererText * renderer, |
457 | gchar * path, | 457 | gchar * path, |
458 | gchar * new_text, | 458 | gchar * new_text, |
@@ -467,16 +467,16 @@ GNUNET_GTK_edit_publication_metadata_tree_view_value_renderer_edited_cb (GtkCell | |||
467 | char *pos; | 467 | char *pos; |
468 | 468 | ||
469 | if (! gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL (ctx->meta_liststore), | 469 | if (! gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL (ctx->meta_liststore), |
470 | &iter, | 470 | &iter, |
471 | path)) | 471 | path)) |
472 | { | 472 | { |
473 | GNUNET_break (0); | 473 | GNUNET_break (0); |
474 | return; | 474 | return; |
475 | } | 475 | } |
476 | 476 | ||
477 | gtk_tree_model_get (GTK_TREE_MODEL (ctx->meta_liststore), &iter, | 477 | gtk_tree_model_get (GTK_TREE_MODEL (ctx->meta_liststore), &iter, |
478 | PUBLISH_METADATA_MC_TYPE, &metatype, -1); | 478 | PUBLISH_METADATA_MC_TYPE, &metatype, -1); |
479 | if (metatype == EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME) | 479 | if (metatype == EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME) |
480 | { | 480 | { |
481 | /* apply filename rules */ | 481 | /* apply filename rules */ |
482 | /* First, use UNIX-style separators */ | 482 | /* First, use UNIX-style separators */ |
@@ -493,16 +493,16 @@ GNUNET_GTK_edit_publication_metadata_tree_view_value_renderer_edited_cb (GtkCell | |||
493 | } | 493 | } |
494 | 494 | ||
495 | /* However, directories must end with '/', so add it */ | 495 | /* However, directories must end with '/', so add it */ |
496 | if ( (new_text[strlen (new_text) - 1] != '/') && | 496 | if ( (new_text[strlen (new_text) - 1] != '/') && |
497 | ctx->is_directory == GNUNET_YES) | 497 | ctx->is_directory == GNUNET_YES) |
498 | { | 498 | { |
499 | char * tmp; | 499 | char * tmp; |
500 | 500 | ||
501 | GNUNET_asprintf (&tmp, "%s/", avalue); | 501 | GNUNET_asprintf (&tmp, "%s/", avalue); |
502 | GNUNET_free (avalue); | 502 | GNUNET_free (avalue); |
503 | avalue = tmp; | 503 | avalue = tmp; |
504 | } | 504 | } |
505 | 505 | ||
506 | /* Also, replace '../' everywhere with "___" */ | 506 | /* Also, replace '../' everywhere with "___" */ |
507 | while (NULL != (pos = strstr (avalue, "../"))) | 507 | while (NULL != (pos = strstr (avalue, "../"))) |
508 | memset (pos, '_', 3); | 508 | memset (pos, '_', 3); |
@@ -514,8 +514,8 @@ GNUNET_GTK_edit_publication_metadata_tree_view_value_renderer_edited_cb (GtkCell | |||
514 | ivalue = new_text; | 514 | ivalue = new_text; |
515 | avalue = NULL; | 515 | avalue = NULL; |
516 | } | 516 | } |
517 | gtk_list_store_set (ctx->meta_liststore, &iter, | 517 | gtk_list_store_set (ctx->meta_liststore, &iter, |
518 | PUBLISH_METADATA_MC_VALUE, ivalue, | 518 | PUBLISH_METADATA_MC_VALUE, ivalue, |
519 | -1); | 519 | -1); |
520 | GNUNET_free_non_null (avalue); | 520 | GNUNET_free_non_null (avalue); |
521 | } | 521 | } |
@@ -583,7 +583,7 @@ GNUNET_GTK_edit_publication_delete_button_clicked_cb (GtkButton * button, | |||
583 | * @param user_data the 'struct EditPublicationDialogContext' | 583 | * @param user_data the 'struct EditPublicationDialogContext' |
584 | */ | 584 | */ |
585 | void | 585 | void |
586 | GNUNET_GTK_edit_publication_metadata_preview_file_chooser_button_file_set_cb (GtkFileChooserButton * widget, | 586 | GNUNET_GTK_edit_publication_metadata_preview_file_chooser_button_file_set_cb (GtkFileChooserButton * widget, |
587 | gpointer user_data) | 587 | gpointer user_data) |
588 | { | 588 | { |
589 | struct EditPublicationDialogContext *ctx = user_data; | 589 | struct EditPublicationDialogContext *ctx = user_data; |
@@ -637,14 +637,14 @@ GNUNET_GTK_edit_publication_keyword_entry_changed_cb (GtkEditable * editable, | |||
637 | 637 | ||
638 | keyword = gtk_entry_get_text (ctx->keyword_entry); | 638 | keyword = gtk_entry_get_text (ctx->keyword_entry); |
639 | gtk_widget_set_sensitive (GTK_WIDGET (gtk_builder_get_object (ctx->builder, | 639 | gtk_widget_set_sensitive (GTK_WIDGET (gtk_builder_get_object (ctx->builder, |
640 | "GNUNET_GTK_edit_publication_keyword_list_add_button")), | 640 | "GNUNET_GTK_edit_publication_keyword_list_add_button")), |
641 | (strlen (keyword) > 0) ? TRUE : FALSE); | 641 | (strlen (keyword) > 0) ? TRUE : FALSE); |
642 | } | 642 | } |
643 | 643 | ||
644 | 644 | ||
645 | /** | 645 | /** |
646 | * Update the sensitivity of the 'confirm' button based on | 646 | * Update the sensitivity of the 'confirm' button based on |
647 | * the availability of keywords and whether they are required or | 647 | * the availability of keywords and whether they are required or |
648 | * not. | 648 | * not. |
649 | * | 649 | * |
650 | * @param ctx the 'struct EditPublicationDialogContext' | 650 | * @param ctx the 'struct EditPublicationDialogContext' |
@@ -654,7 +654,7 @@ update_confirm_sensitivity (struct EditPublicationDialogContext *ctx) | |||
654 | { | 654 | { |
655 | GtkTreeIter iter; | 655 | GtkTreeIter iter; |
656 | 656 | ||
657 | if ( (! ctx->allow_no_keywords) && | 657 | if ( (! ctx->allow_no_keywords) && |
658 | (! gtk_tree_model_get_iter_first (GTK_TREE_MODEL (ctx->keywords_liststore), | 658 | (! gtk_tree_model_get_iter_first (GTK_TREE_MODEL (ctx->keywords_liststore), |
659 | &iter)) ) | 659 | &iter)) ) |
660 | gtk_widget_set_sensitive (ctx->confirm_button, FALSE); | 660 | gtk_widget_set_sensitive (ctx->confirm_button, FALSE); |
@@ -674,7 +674,7 @@ void | |||
674 | GNUNET_GTK_edit_publication_keyword_list_del_button_clicked_cb (GtkButton * | 674 | GNUNET_GTK_edit_publication_keyword_list_del_button_clicked_cb (GtkButton * |
675 | button, | 675 | button, |
676 | gpointer user_data) | 676 | gpointer user_data) |
677 | { | 677 | { |
678 | struct EditPublicationDialogContext *ctx = user_data; | 678 | struct EditPublicationDialogContext *ctx = user_data; |
679 | GtkTreeIter iter; | 679 | GtkTreeIter iter; |
680 | GtkTreeSelection *keywords_selection; | 680 | GtkTreeSelection *keywords_selection; |
@@ -712,7 +712,7 @@ GNUNET_GTK_edit_publication_keyword_list_add_button_clicked_cb (GtkButton * | |||
712 | keyword = gtk_entry_get_text (ctx->keyword_entry); | 712 | keyword = gtk_entry_get_text (ctx->keyword_entry); |
713 | if (strlen (keyword) == 0) | 713 | if (strlen (keyword) == 0) |
714 | return; | 714 | return; |
715 | gtk_list_store_insert_with_values (ctx->keywords_liststore, | 715 | gtk_list_store_insert_with_values (ctx->keywords_liststore, |
716 | &iter, G_MAXINT, | 716 | &iter, G_MAXINT, |
717 | PUBLISH_TYPES_MC_KEYWORD, keyword, | 717 | PUBLISH_TYPES_MC_KEYWORD, keyword, |
718 | PUBLISH_TYPES_MC_ADDED, TRUE, | 718 | PUBLISH_TYPES_MC_ADDED, TRUE, |
@@ -884,13 +884,13 @@ preserve_meta_items (void *cls, const char *plugin_name, | |||
884 | * used in the main libextractor library and yielding | 884 | * used in the main libextractor library and yielding |
885 | * meta data). | 885 | * meta data). |
886 | * @param type libextractor-type describing the meta data | 886 | * @param type libextractor-type describing the meta data |
887 | * @param format basic format information about data | 887 | * @param format basic format information about data |
888 | * @param data_mime_type mime-type of data (not of the original file); | 888 | * @param data_mime_type mime-type of data (not of the original file); |
889 | * can be NULL (if mime-type is not known) | 889 | * can be NULL (if mime-type is not known) |
890 | * @param data actual meta-data found | 890 | * @param data actual meta-data found |
891 | * @param data_len number of bytes in data | 891 | * @param data_len number of bytes in data |
892 | * @return 0 to continue extracting, 1 to abort | 892 | * @return 0 to continue extracting, 1 to abort |
893 | */ | 893 | */ |
894 | static int | 894 | static int |
895 | le_callback (void *cls, | 895 | le_callback (void *cls, |
896 | const char *plugin_name, | 896 | const char *plugin_name, |
@@ -930,7 +930,7 @@ get_mime_type (const void *data, | |||
930 | return NULL; | 930 | return NULL; |
931 | ret = NULL; | 931 | ret = NULL; |
932 | EXTRACTOR_extract (pl, NULL, data, data_size, &le_callback, &ret); | 932 | EXTRACTOR_extract (pl, NULL, data, data_size, &le_callback, &ret); |
933 | EXTRACTOR_plugin_remove_all (pl); | 933 | EXTRACTOR_plugin_remove_all (pl); |
934 | return ret; | 934 | return ret; |
935 | } | 935 | } |
936 | 936 | ||
@@ -994,8 +994,8 @@ file_information_update (void *cls, struct GNUNET_FS_FileInformation *fi, | |||
994 | 994 | ||
995 | /* update meta data; first, we copy the unchanged values from the original meta data */ | 995 | /* update meta data; first, we copy the unchanged values from the original meta data */ |
996 | ctx->md = GNUNET_CONTAINER_meta_data_create (); | 996 | ctx->md = GNUNET_CONTAINER_meta_data_create (); |
997 | GNUNET_CONTAINER_meta_data_iterate (meta, | 997 | GNUNET_CONTAINER_meta_data_iterate (meta, |
998 | &preserve_meta_items, | 998 | &preserve_meta_items, |
999 | ctx); | 999 | ctx); |
1000 | /* clear original meta data */ | 1000 | /* clear original meta data */ |
1001 | GNUNET_CONTAINER_meta_data_clear (meta); | 1001 | GNUNET_CONTAINER_meta_data_clear (meta); |
@@ -1003,7 +1003,7 @@ file_information_update (void *cls, struct GNUNET_FS_FileInformation *fi, | |||
1003 | GNUNET_CONTAINER_meta_data_merge (meta, ctx->md); | 1003 | GNUNET_CONTAINER_meta_data_merge (meta, ctx->md); |
1004 | GNUNET_CONTAINER_meta_data_destroy (ctx->md); | 1004 | GNUNET_CONTAINER_meta_data_destroy (ctx->md); |
1005 | ctx->md = NULL; | 1005 | ctx->md = NULL; |
1006 | /* now add all of the values from the model; adding will simply do | 1006 | /* now add all of the values from the model; adding will simply do |
1007 | nothing for values that are already in the set because they were preserved */ | 1007 | nothing for values that are already in the set because they were preserved */ |
1008 | if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (ctx->meta_liststore), &iter)) | 1008 | if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (ctx->meta_liststore), &iter)) |
1009 | { | 1009 | { |
@@ -1028,7 +1028,7 @@ file_information_update (void *cls, struct GNUNET_FS_FileInformation *fi, | |||
1028 | } | 1028 | } |
1029 | while (gtk_tree_model_iter_next (GTK_TREE_MODEL (ctx->meta_liststore), &iter)); | 1029 | while (gtk_tree_model_iter_next (GTK_TREE_MODEL (ctx->meta_liststore), &iter)); |
1030 | } | 1030 | } |
1031 | 1031 | ||
1032 | /* finally, if we got a new preview, add it as well */ | 1032 | /* finally, if we got a new preview, add it as well */ |
1033 | if (ctx->preview_changed == GNUNET_YES) | 1033 | if (ctx->preview_changed == GNUNET_YES) |
1034 | { | 1034 | { |
@@ -1058,7 +1058,7 @@ file_information_update (void *cls, struct GNUNET_FS_FileInformation *fi, | |||
1058 | GFileInfo *finfo; | 1058 | GFileInfo *finfo; |
1059 | const char *gmime; | 1059 | const char *gmime; |
1060 | 1060 | ||
1061 | finfo = g_file_query_info (f, G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE, | 1061 | finfo = g_file_query_info (f, G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE, |
1062 | 0, NULL, NULL); | 1062 | 0, NULL, NULL); |
1063 | gmime = g_file_info_get_attribute_string (finfo, | 1063 | gmime = g_file_info_get_attribute_string (finfo, |
1064 | G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE); | 1064 | G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE); |
@@ -1082,7 +1082,7 @@ file_information_update (void *cls, struct GNUNET_FS_FileInformation *fi, | |||
1082 | 1082 | ||
1083 | /** | 1083 | /** |
1084 | * The user clicked the 'confirm' button. Push the edits back into the | 1084 | * The user clicked the 'confirm' button. Push the edits back into the |
1085 | * FileInformation structure and given it and the options back to the | 1085 | * FileInformation structure and given it and the options back to the |
1086 | * callback. Then clean up the dialog. | 1086 | * callback. Then clean up the dialog. |
1087 | * | 1087 | * |
1088 | * @param button the cancel button | 1088 | * @param button the cancel button |
@@ -1095,11 +1095,11 @@ GNUNET_GTK_edit_publication_confirm_button_clicked_cb (GtkButton * button, | |||
1095 | struct EditPublicationDialogContext *ctx = user_data; | 1095 | struct EditPublicationDialogContext *ctx = user_data; |
1096 | 1096 | ||
1097 | /* push back changes to file-information */ | 1097 | /* push back changes to file-information */ |
1098 | GNUNET_FS_file_information_inspect (ctx->fip, | 1098 | GNUNET_FS_file_information_inspect (ctx->fip, |
1099 | &file_information_update, | 1099 | &file_information_update, |
1100 | ctx); | 1100 | ctx); |
1101 | /* call our continuation */ | 1101 | /* call our continuation */ |
1102 | ctx->cb (ctx->cb_cls, | 1102 | ctx->cb (ctx->cb_cls, |
1103 | GTK_RESPONSE_OK, | 1103 | GTK_RESPONSE_OK, |
1104 | gtk_entry_get_text (ctx->root_entry)); | 1104 | gtk_entry_get_text (ctx->root_entry)); |
1105 | /* free resources from the edit dialog */ | 1105 | /* free resources from the edit dialog */ |
@@ -1144,13 +1144,13 @@ add_keyword (void *cls, const char *keyword, int is_mandatory) | |||
1144 | * used in the main libextractor library and yielding | 1144 | * used in the main libextractor library and yielding |
1145 | * meta data). | 1145 | * meta data). |
1146 | * @param type libextractor-type describing the meta data | 1146 | * @param type libextractor-type describing the meta data |
1147 | * @param format basic format information about data | 1147 | * @param format basic format information about data |
1148 | * @param data_mime_type mime-type of data (not of the original file); | 1148 | * @param data_mime_type mime-type of data (not of the original file); |
1149 | * can be NULL (if mime-type is not known) | 1149 | * can be NULL (if mime-type is not known) |
1150 | * @param data actual meta-data found | 1150 | * @param data actual meta-data found |
1151 | * @param data_len number of bytes in data | 1151 | * @param data_len number of bytes in data |
1152 | * @return 0 to continue extracting, 1 to abort | 1152 | * @return 0 to continue extracting, 1 to abort |
1153 | */ | 1153 | */ |
1154 | static int | 1154 | static int |
1155 | set_window_title_to_filename (void *cls, | 1155 | set_window_title_to_filename (void *cls, |
1156 | const char *plugin_name, | 1156 | const char *plugin_name, |
@@ -1188,7 +1188,7 @@ set_window_title_to_filename (void *cls, | |||
1188 | * @return GNUNET_SYSERR (aborts after first call) | 1188 | * @return GNUNET_SYSERR (aborts after first call) |
1189 | */ | 1189 | */ |
1190 | static int | 1190 | static int |
1191 | file_information_import (void *cls, | 1191 | file_information_import (void *cls, |
1192 | struct GNUNET_FS_FileInformation *fi, | 1192 | struct GNUNET_FS_FileInformation *fi, |
1193 | uint64_t length, | 1193 | uint64_t length, |
1194 | struct GNUNET_CONTAINER_MetaData *meta, | 1194 | struct GNUNET_CONTAINER_MetaData *meta, |
@@ -1226,7 +1226,7 @@ file_information_import (void *cls, | |||
1226 | gtk_image_set_from_pixbuf (ctx->preview_image, pixbuf); | 1226 | gtk_image_set_from_pixbuf (ctx->preview_image, pixbuf); |
1227 | } | 1227 | } |
1228 | } | 1228 | } |
1229 | 1229 | ||
1230 | /* Also update window title based on filename */ | 1230 | /* Also update window title based on filename */ |
1231 | gtk_window_set_title (ctx->edit_publication_window, _("<unnamed>")); | 1231 | gtk_window_set_title (ctx->edit_publication_window, _("<unnamed>")); |
1232 | GNUNET_CONTAINER_meta_data_iterate (meta, | 1232 | GNUNET_CONTAINER_meta_data_iterate (meta, |
@@ -1294,7 +1294,7 @@ GNUNET_FS_GTK_edit_publish_dialog (GtkWindow * parent, | |||
1294 | (ctx->builder, | 1294 | (ctx->builder, |
1295 | "GNUNET_GTK_edit_publication_keyword_list_tree_view")); | 1295 | "GNUNET_GTK_edit_publication_keyword_list_tree_view")); |
1296 | ctx->edit_publication_window = | 1296 | ctx->edit_publication_window = |
1297 | GTK_WINDOW (gtk_builder_get_object (ctx->builder, | 1297 | GTK_WINDOW (gtk_builder_get_object (ctx->builder, |
1298 | "GNUNET_GTK_edit_publication_window")); | 1298 | "GNUNET_GTK_edit_publication_window")); |
1299 | ctx->keywords_liststore = GTK_LIST_STORE (gtk_builder_get_object | 1299 | ctx->keywords_liststore = GTK_LIST_STORE (gtk_builder_get_object |
1300 | (ctx->builder, "GNUNET_GTK_publication_keywords_liststore")); | 1300 | (ctx->builder, "GNUNET_GTK_publication_keywords_liststore")); |
@@ -1332,7 +1332,7 @@ GNUNET_FS_GTK_edit_publish_dialog (GtkWindow * parent, | |||
1332 | "GNUNET_GTK_edit_publication_anonymity_combobox")); | 1332 | "GNUNET_GTK_edit_publication_anonymity_combobox")); |
1333 | 1333 | ||
1334 | /* Basic initialization of widgets models and visibility */ | 1334 | /* Basic initialization of widgets models and visibility */ |
1335 | gtk_combo_box_set_model (ctx->anonymity_combo, | 1335 | gtk_combo_box_set_model (ctx->anonymity_combo, |
1336 | GNUNET_FS_GTK_get_anonymity_level_list_store ()); | 1336 | GNUNET_FS_GTK_get_anonymity_level_list_store ()); |
1337 | GNUNET_GTK_setup_expiration_year_adjustment (ctx->builder); | 1337 | GNUNET_GTK_setup_expiration_year_adjustment (ctx->builder); |
1338 | 1338 | ||
diff --git a/src/fs/gnunet-fs-gtk_unindex.c b/src/fs/gnunet-fs-gtk_unindex.c index a4fc4c61..d7efdf8e 100644 --- a/src/fs/gnunet-fs-gtk_unindex.c +++ b/src/fs/gnunet-fs-gtk_unindex.c | |||
@@ -43,7 +43,7 @@ enum UNINDEX_ModelColumns | |||
43 | * A guint64. | 43 | * A guint64. |
44 | */ | 44 | */ |
45 | UNINDEX_MC_FILESIZE = 1, | 45 | UNINDEX_MC_FILESIZE = 1, |
46 | 46 | ||
47 | /** | 47 | /** |
48 | * A gchararray representing a color. | 48 | * A gchararray representing a color. |
49 | */ | 49 | */ |
@@ -180,7 +180,7 @@ static struct UnindexEntry *ue_tail; | |||
180 | 180 | ||
181 | 181 | ||
182 | /** | 182 | /** |
183 | * User has clicked on the 'delete/unindex' button for the dialog. | 183 | * User has clicked on the 'delete/unindex' button for the dialog. |
184 | * Unindex the selected file. | 184 | * Unindex the selected file. |
185 | * | 185 | * |
186 | * @param dummy the button | 186 | * @param dummy the button |
@@ -203,17 +203,17 @@ GNUNET_FS_GTK_unindex_button_clicked_cb (GtkWidget * dummy, | |||
203 | GNUNET_break (0); | 203 | GNUNET_break (0); |
204 | return; | 204 | return; |
205 | } | 205 | } |
206 | gtk_tree_model_get (udc->model, &iter, | 206 | gtk_tree_model_get (udc->model, &iter, |
207 | UNINDEX_MC_FILENAME, &filename, | 207 | UNINDEX_MC_FILENAME, &filename, |
208 | UNINDEX_MC_FILESIZE, &filesize, | 208 | UNINDEX_MC_FILESIZE, &filesize, |
209 | UNINDEX_MC_UNINDEX_CONTEXT, &ue, | 209 | UNINDEX_MC_UNINDEX_CONTEXT, &ue, |
210 | -1); | 210 | -1); |
211 | if (NULL != ue) | 211 | if (NULL != ue) |
212 | { | 212 | { |
213 | GNUNET_break (0); | 213 | GNUNET_break (0); |
214 | g_free (filename); | 214 | g_free (filename); |
215 | return; | 215 | return; |
216 | } | 216 | } |
217 | ue = GNUNET_malloc (sizeof (struct UnindexEntry)); | 217 | ue = GNUNET_malloc (sizeof (struct UnindexEntry)); |
218 | ue->filesize = filesize; | 218 | ue->filesize = filesize; |
219 | GNUNET_CONTAINER_DLL_insert (ue_head, ue_tail, ue); | 219 | GNUNET_CONTAINER_DLL_insert (ue_head, ue_tail, ue); |
@@ -223,8 +223,8 @@ GNUNET_FS_GTK_unindex_button_clicked_cb (GtkWidget * dummy, | |||
223 | gtk_tree_path_free (path); | 223 | gtk_tree_path_free (path); |
224 | ue->uc = GNUNET_FS_unindex_start (GNUNET_FS_GTK_get_fs_handle (), | 224 | ue->uc = GNUNET_FS_unindex_start (GNUNET_FS_GTK_get_fs_handle (), |
225 | filename, ue); | 225 | filename, ue); |
226 | gtk_list_store_set (GTK_LIST_STORE (udc->model), | 226 | gtk_list_store_set (GTK_LIST_STORE (udc->model), |
227 | &iter, | 227 | &iter, |
228 | UNINDEX_MC_BACKGROUND_COLOR, "yellow", | 228 | UNINDEX_MC_BACKGROUND_COLOR, "yellow", |
229 | UNINDEX_MC_UNINDEX_CONTEXT, ue, | 229 | UNINDEX_MC_UNINDEX_CONTEXT, ue, |
230 | UNINDEX_MC_UNINDEX_PROGRESS, 0, | 230 | UNINDEX_MC_UNINDEX_PROGRESS, 0, |
@@ -253,10 +253,10 @@ GNUNET_FS_GTK_unindex_close_button_clicked_cb (GtkWidget * dummy, | |||
253 | GNUNET_FS_get_indexed_files_cancel (udc->gic); | 253 | GNUNET_FS_get_indexed_files_cancel (udc->gic); |
254 | udc->gic = NULL; | 254 | udc->gic = NULL; |
255 | } | 255 | } |
256 | if (gtk_tree_model_get_iter_first (udc->model, &iter)) | 256 | if (gtk_tree_model_get_iter_first (udc->model, &iter)) |
257 | do | 257 | do |
258 | { | 258 | { |
259 | gtk_tree_model_get (udc->model, &iter, | 259 | gtk_tree_model_get (udc->model, &iter, |
260 | UNINDEX_MC_UNINDEX_CONTEXT, &ue, | 260 | UNINDEX_MC_UNINDEX_CONTEXT, &ue, |
261 | -1); | 261 | -1); |
262 | if (NULL != ue) | 262 | if (NULL != ue) |
@@ -264,10 +264,10 @@ GNUNET_FS_GTK_unindex_close_button_clicked_cb (GtkWidget * dummy, | |||
264 | gtk_tree_row_reference_free (ue->rr); | 264 | gtk_tree_row_reference_free (ue->rr); |
265 | ue->rr = NULL; | 265 | ue->rr = NULL; |
266 | } | 266 | } |
267 | } | 267 | } |
268 | while (TRUE == gtk_tree_model_iter_next (udc->model, &iter)); | 268 | while (TRUE == gtk_tree_model_iter_next (udc->model, &iter)); |
269 | gtk_widget_destroy (udc->dialog); | 269 | gtk_widget_destroy (udc->dialog); |
270 | g_object_unref (G_OBJECT (udc->builder)); | 270 | g_object_unref (G_OBJECT (udc->builder)); |
271 | GNUNET_free (udc); | 271 | GNUNET_free (udc); |
272 | master_udc = NULL; | 272 | master_udc = NULL; |
273 | } | 273 | } |
@@ -280,7 +280,7 @@ GNUNET_FS_GTK_unindex_close_button_clicked_cb (GtkWidget * dummy, | |||
280 | * @param user_data our unindex context | 280 | * @param user_data our unindex context |
281 | */ | 281 | */ |
282 | static void | 282 | static void |
283 | selection_changed_cb (GtkTreeSelection * ts, | 283 | selection_changed_cb (GtkTreeSelection * ts, |
284 | gpointer user_data) | 284 | gpointer user_data) |
285 | { | 285 | { |
286 | struct UnindexDialogContext *udc = user_data; | 286 | struct UnindexDialogContext *udc = user_data; |
@@ -290,8 +290,8 @@ selection_changed_cb (GtkTreeSelection * ts, | |||
290 | /* find out if a file is selected */ | 290 | /* find out if a file is selected */ |
291 | if (gtk_tree_selection_get_selected (udc->selection, NULL, &iter)) | 291 | if (gtk_tree_selection_get_selected (udc->selection, NULL, &iter)) |
292 | { | 292 | { |
293 | gtk_tree_model_get (udc->model, &iter, | 293 | gtk_tree_model_get (udc->model, &iter, |
294 | UNINDEX_MC_UNINDEX_CONTEXT, &ue, | 294 | UNINDEX_MC_UNINDEX_CONTEXT, &ue, |
295 | -1); | 295 | -1); |
296 | if (NULL == ue) | 296 | if (NULL == ue) |
297 | { | 297 | { |
@@ -312,7 +312,7 @@ selection_changed_cb (GtkTreeSelection * ts, | |||
312 | * @param file_id hash of the contents of the indexed file | 312 | * @param file_id hash of the contents of the indexed file |
313 | * @return GNUNET_OK to continue iteration, GNUNET_SYSERR to abort | 313 | * @return GNUNET_OK to continue iteration, GNUNET_SYSERR to abort |
314 | */ | 314 | */ |
315 | static int | 315 | static int |
316 | add_indexed_file (void *cls, const char *filename, | 316 | add_indexed_file (void *cls, const char *filename, |
317 | const struct GNUNET_HashCode * file_id) | 317 | const struct GNUNET_HashCode * file_id) |
318 | { | 318 | { |
@@ -387,7 +387,7 @@ GNUNET_GTK_main_menu_unindex_activate_cb (GtkWidget * dummy, | |||
387 | { | 387 | { |
388 | GtkWidget *toplevel; | 388 | GtkWidget *toplevel; |
389 | struct UnindexDialogContext *udc; | 389 | struct UnindexDialogContext *udc; |
390 | 390 | ||
391 | if (NULL != master_udc) | 391 | if (NULL != master_udc) |
392 | { | 392 | { |
393 | /* window already exists, raise focus */ | 393 | /* window already exists, raise focus */ |
@@ -417,7 +417,7 @@ GNUNET_GTK_main_menu_unindex_activate_cb (GtkWidget * dummy, | |||
417 | udc); | 417 | udc); |
418 | toplevel = gtk_widget_get_toplevel (dummy); | 418 | toplevel = gtk_widget_get_toplevel (dummy); |
419 | if (GTK_IS_WINDOW (toplevel)) | 419 | if (GTK_IS_WINDOW (toplevel)) |
420 | gtk_window_set_transient_for (GTK_WINDOW (udc->dialog), GTK_WINDOW (toplevel)); | 420 | gtk_window_set_transient_for (GTK_WINDOW (udc->dialog), GTK_WINDOW (toplevel)); |
421 | /* connect signals; FIXME-GTK3: these could be connected with (modern) Glade */ | 421 | /* connect signals; FIXME-GTK3: these could be connected with (modern) Glade */ |
422 | g_signal_connect (G_OBJECT (udc->selection), "changed", | 422 | g_signal_connect (G_OBJECT (udc->selection), "changed", |
423 | G_CALLBACK (selection_changed_cb), udc); | 423 | G_CALLBACK (selection_changed_cb), udc); |
@@ -471,19 +471,19 @@ GNUNET_FS_GTK_unindex_handle_stop_ (struct UnindexEntry *ue) | |||
471 | GtkTreePath *path; | 471 | GtkTreePath *path; |
472 | GtkTreeIter iter; | 472 | GtkTreeIter iter; |
473 | GtkTreeModel *model; | 473 | GtkTreeModel *model; |
474 | 474 | ||
475 | if (NULL != ue->rr) | 475 | if (NULL != ue->rr) |
476 | { | 476 | { |
477 | path = gtk_tree_row_reference_get_path (ue->rr); | 477 | path = gtk_tree_row_reference_get_path (ue->rr); |
478 | model = gtk_tree_row_reference_get_model (ue->rr); | 478 | model = gtk_tree_row_reference_get_model (ue->rr); |
479 | gtk_tree_row_reference_free (ue->rr); | 479 | gtk_tree_row_reference_free (ue->rr); |
480 | ue->rr = NULL; | 480 | ue->rr = NULL; |
481 | GNUNET_assert (TRUE == gtk_tree_model_get_iter (model, | 481 | GNUNET_assert (TRUE == gtk_tree_model_get_iter (model, |
482 | &iter, | 482 | &iter, |
483 | path)); | 483 | path)); |
484 | gtk_tree_path_free (path); | 484 | gtk_tree_path_free (path); |
485 | gtk_list_store_set (GTK_LIST_STORE (model), | 485 | gtk_list_store_set (GTK_LIST_STORE (model), |
486 | &iter, | 486 | &iter, |
487 | UNINDEX_MC_UNINDEX_CONTEXT, NULL, | 487 | UNINDEX_MC_UNINDEX_CONTEXT, NULL, |
488 | -1); | 488 | -1); |
489 | } | 489 | } |
@@ -515,12 +515,12 @@ GNUNET_FS_GTK_unindex_handle_error_ (struct UnindexEntry *ue, | |||
515 | return; | 515 | return; |
516 | path = gtk_tree_row_reference_get_path (ue->rr); | 516 | path = gtk_tree_row_reference_get_path (ue->rr); |
517 | model = gtk_tree_row_reference_get_model (ue->rr); | 517 | model = gtk_tree_row_reference_get_model (ue->rr); |
518 | GNUNET_assert (TRUE == gtk_tree_model_get_iter (model, | 518 | GNUNET_assert (TRUE == gtk_tree_model_get_iter (model, |
519 | &iter, | 519 | &iter, |
520 | path)); | 520 | path)); |
521 | gtk_tree_path_free (path); | 521 | gtk_tree_path_free (path); |
522 | gtk_list_store_set (GTK_LIST_STORE (model), | 522 | gtk_list_store_set (GTK_LIST_STORE (model), |
523 | &iter, | 523 | &iter, |
524 | UNINDEX_MC_BACKGROUND_COLOR, "red", | 524 | UNINDEX_MC_BACKGROUND_COLOR, "red", |
525 | UNINDEX_MC_ERROR, emsg, | 525 | UNINDEX_MC_ERROR, emsg, |
526 | -1); | 526 | -1); |
@@ -546,12 +546,12 @@ GNUNET_FS_GTK_unindex_handle_progress_ (struct UnindexEntry *ue, | |||
546 | return; | 546 | return; |
547 | path = gtk_tree_row_reference_get_path (ue->rr); | 547 | path = gtk_tree_row_reference_get_path (ue->rr); |
548 | model = gtk_tree_row_reference_get_model (ue->rr); | 548 | model = gtk_tree_row_reference_get_model (ue->rr); |
549 | GNUNET_assert (TRUE == gtk_tree_model_get_iter (model, | 549 | GNUNET_assert (TRUE == gtk_tree_model_get_iter (model, |
550 | &iter, | 550 | &iter, |
551 | path)); | 551 | path)); |
552 | gtk_tree_path_free (path); | 552 | gtk_tree_path_free (path); |
553 | gtk_list_store_set (GTK_LIST_STORE (model), | 553 | gtk_list_store_set (GTK_LIST_STORE (model), |
554 | &iter, | 554 | &iter, |
555 | UNINDEX_MC_UNINDEX_PROGRESS, ue->progress, | 555 | UNINDEX_MC_UNINDEX_PROGRESS, ue->progress, |
556 | -1); | 556 | -1); |
557 | } | 557 | } |
@@ -573,11 +573,11 @@ GNUNET_FS_GTK_unindex_handle_completed_ (struct UnindexEntry *ue) | |||
573 | { | 573 | { |
574 | path = gtk_tree_row_reference_get_path (ue->rr); | 574 | path = gtk_tree_row_reference_get_path (ue->rr); |
575 | model = gtk_tree_row_reference_get_model (ue->rr); | 575 | model = gtk_tree_row_reference_get_model (ue->rr); |
576 | GNUNET_assert (TRUE == gtk_tree_model_get_iter (model, | 576 | GNUNET_assert (TRUE == gtk_tree_model_get_iter (model, |
577 | &iter, | 577 | &iter, |
578 | path)); | 578 | path)); |
579 | gtk_tree_path_free (path); | 579 | gtk_tree_path_free (path); |
580 | gtk_list_store_remove (GTK_LIST_STORE (model), | 580 | gtk_list_store_remove (GTK_LIST_STORE (model), |
581 | &iter); | 581 | &iter); |
582 | gtk_tree_row_reference_free (ue->rr); | 582 | gtk_tree_row_reference_free (ue->rr); |
583 | ue->rr = NULL; | 583 | ue->rr = NULL; |
diff --git a/src/fs/metatypes.c b/src/fs/metatypes.c index 5e9cba98..c722aef2 100644 --- a/src/fs/metatypes.c +++ b/src/fs/metatypes.c | |||
@@ -1,44 +1,44 @@ | |||
1 | /* *INDENT-OFF* */ | 1 | /* *INDENT-OFF* */ |
2 | 2 | ||
3 | gint types_generic[] = { | 3 | gint types_generic[] = { |
4 | EXTRACTOR_METATYPE_MIMETYPE, | 4 | EXTRACTOR_METATYPE_MIMETYPE, |
5 | EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME, | 5 | EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME, |
6 | EXTRACTOR_METATYPE_TITLE, | 6 | EXTRACTOR_METATYPE_TITLE, |
7 | EXTRACTOR_METATYPE_KEYWORDS, | 7 | EXTRACTOR_METATYPE_KEYWORDS, |
8 | EXTRACTOR_METATYPE_SUBJECT, | 8 | EXTRACTOR_METATYPE_SUBJECT, |
9 | EXTRACTOR_METATYPE_DESCRIPTION, | 9 | EXTRACTOR_METATYPE_DESCRIPTION, |
10 | EXTRACTOR_METATYPE_COMMENT, | 10 | EXTRACTOR_METATYPE_COMMENT, |
11 | EXTRACTOR_METATYPE_COPYRIGHT, | 11 | EXTRACTOR_METATYPE_COPYRIGHT, |
12 | EXTRACTOR_METATYPE_URI, | 12 | EXTRACTOR_METATYPE_URI, |
13 | EXTRACTOR_METATYPE_CREATOR, | 13 | EXTRACTOR_METATYPE_CREATOR, |
14 | EXTRACTOR_METATYPE_CREATION_DATE, | 14 | EXTRACTOR_METATYPE_CREATION_DATE, |
15 | EXTRACTOR_METATYPE_RESERVED | 15 | EXTRACTOR_METATYPE_RESERVED |
16 | }; | 16 | }; |
17 | 17 | ||
18 | 18 | ||
19 | gint types_text[] = | 19 | gint types_text[] = |
20 | { | 20 | { |
21 | EXTRACTOR_METATYPE_MIMETYPE, | 21 | EXTRACTOR_METATYPE_MIMETYPE, |
22 | EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME, | 22 | EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME, |
23 | EXTRACTOR_METATYPE_TITLE, | 23 | EXTRACTOR_METATYPE_TITLE, |
24 | EXTRACTOR_METATYPE_KEYWORDS, | 24 | EXTRACTOR_METATYPE_KEYWORDS, |
25 | EXTRACTOR_METATYPE_ABSTRACT, | 25 | EXTRACTOR_METATYPE_ABSTRACT, |
26 | EXTRACTOR_METATYPE_SUMMARY, | 26 | EXTRACTOR_METATYPE_SUMMARY, |
27 | EXTRACTOR_METATYPE_SUBJECT, | 27 | EXTRACTOR_METATYPE_SUBJECT, |
28 | EXTRACTOR_METATYPE_AUTHOR_NAME, | 28 | EXTRACTOR_METATYPE_AUTHOR_NAME, |
29 | EXTRACTOR_METATYPE_AUTHOR_EMAIL, | 29 | EXTRACTOR_METATYPE_AUTHOR_EMAIL, |
30 | EXTRACTOR_METATYPE_AUTHOR_INSTITUTION, | 30 | EXTRACTOR_METATYPE_AUTHOR_INSTITUTION, |
31 | EXTRACTOR_METATYPE_DESCRIPTION, | 31 | EXTRACTOR_METATYPE_DESCRIPTION, |
32 | EXTRACTOR_METATYPE_LANGUAGE, | 32 | EXTRACTOR_METATYPE_LANGUAGE, |
33 | EXTRACTOR_METATYPE_COPYRIGHT, | 33 | EXTRACTOR_METATYPE_COPYRIGHT, |
34 | EXTRACTOR_METATYPE_COMMENT, | 34 | EXTRACTOR_METATYPE_COMMENT, |
35 | EXTRACTOR_METATYPE_BOOK_TITLE, | 35 | EXTRACTOR_METATYPE_BOOK_TITLE, |
36 | EXTRACTOR_METATYPE_BOOK_EDITION, | 36 | EXTRACTOR_METATYPE_BOOK_EDITION, |
37 | EXTRACTOR_METATYPE_BOOK_CHAPTER_NUMBER, | 37 | EXTRACTOR_METATYPE_BOOK_CHAPTER_NUMBER, |
38 | EXTRACTOR_METATYPE_JOURNAL_NAME, | 38 | EXTRACTOR_METATYPE_JOURNAL_NAME, |
39 | EXTRACTOR_METATYPE_JOURNAL_VOLUME, | 39 | EXTRACTOR_METATYPE_JOURNAL_VOLUME, |
40 | EXTRACTOR_METATYPE_JOURNAL_NUMBER, | 40 | EXTRACTOR_METATYPE_JOURNAL_NUMBER, |
41 | EXTRACTOR_METATYPE_PAGE_COUNT, | 41 | EXTRACTOR_METATYPE_PAGE_COUNT, |
42 | EXTRACTOR_METATYPE_PAGE_RANGE, | 42 | EXTRACTOR_METATYPE_PAGE_RANGE, |
43 | EXTRACTOR_METATYPE_PUBLISHER, | 43 | EXTRACTOR_METATYPE_PUBLISHER, |
44 | EXTRACTOR_METATYPE_PUBLISHER_ADDRESS, | 44 | EXTRACTOR_METATYPE_PUBLISHER_ADDRESS, |
@@ -46,11 +46,11 @@ gint types_text[] = | |||
46 | EXTRACTOR_METATYPE_PUBLISHER_SERIES, | 46 | EXTRACTOR_METATYPE_PUBLISHER_SERIES, |
47 | EXTRACTOR_METATYPE_PUBLICATION_TYPE, | 47 | EXTRACTOR_METATYPE_PUBLICATION_TYPE, |
48 | EXTRACTOR_METATYPE_PUBLICATION_DATE, | 48 | EXTRACTOR_METATYPE_PUBLICATION_DATE, |
49 | EXTRACTOR_METATYPE_URL, | 49 | EXTRACTOR_METATYPE_URL, |
50 | EXTRACTOR_METATYPE_CREATOR, | 50 | EXTRACTOR_METATYPE_CREATOR, |
51 | EXTRACTOR_METATYPE_CREATION_DATE, | 51 | EXTRACTOR_METATYPE_CREATION_DATE, |
52 | EXTRACTOR_METATYPE_MODIFICATION_DATE, | 52 | EXTRACTOR_METATYPE_MODIFICATION_DATE, |
53 | EXTRACTOR_METATYPE_CHARACTER_SET, | 53 | EXTRACTOR_METATYPE_CHARACTER_SET, |
54 | EXTRACTOR_METATYPE_LINE_COUNT, | 54 | EXTRACTOR_METATYPE_LINE_COUNT, |
55 | EXTRACTOR_METATYPE_WORD_COUNT, | 55 | EXTRACTOR_METATYPE_WORD_COUNT, |
56 | EXTRACTOR_METATYPE_PAGE_ORIENTATION, | 56 | EXTRACTOR_METATYPE_PAGE_ORIENTATION, |
@@ -62,14 +62,14 @@ gint types_text[] = | |||
62 | }; | 62 | }; |
63 | 63 | ||
64 | 64 | ||
65 | gint types_music[] = | 65 | gint types_music[] = |
66 | { | 66 | { |
67 | EXTRACTOR_METATYPE_MIMETYPE, | 67 | EXTRACTOR_METATYPE_MIMETYPE, |
68 | EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME, | 68 | EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME, |
69 | EXTRACTOR_METATYPE_TITLE, | 69 | EXTRACTOR_METATYPE_TITLE, |
70 | EXTRACTOR_METATYPE_ARTIST, | 70 | EXTRACTOR_METATYPE_ARTIST, |
71 | EXTRACTOR_METATYPE_COMPOSER, | 71 | EXTRACTOR_METATYPE_COMPOSER, |
72 | EXTRACTOR_METATYPE_CONDUCTOR, | 72 | EXTRACTOR_METATYPE_CONDUCTOR, |
73 | EXTRACTOR_METATYPE_ALBUM, | 73 | EXTRACTOR_METATYPE_ALBUM, |
74 | EXTRACTOR_METATYPE_DURATION, | 74 | EXTRACTOR_METATYPE_DURATION, |
75 | EXTRACTOR_METATYPE_KEYWORDS, | 75 | EXTRACTOR_METATYPE_KEYWORDS, |
@@ -81,15 +81,15 @@ gint types_music[] = | |||
81 | EXTRACTOR_METATYPE_COMMENT, | 81 | EXTRACTOR_METATYPE_COMMENT, |
82 | EXTRACTOR_METATYPE_ISRC, | 82 | EXTRACTOR_METATYPE_ISRC, |
83 | EXTRACTOR_METATYPE_LYRICS, | 83 | EXTRACTOR_METATYPE_LYRICS, |
84 | EXTRACTOR_METATYPE_COPYRIGHT, | 84 | EXTRACTOR_METATYPE_COPYRIGHT, |
85 | EXTRACTOR_METATYPE_PUBLISHER, | 85 | EXTRACTOR_METATYPE_PUBLISHER, |
86 | EXTRACTOR_METATYPE_PERFORMER, | 86 | EXTRACTOR_METATYPE_PERFORMER, |
87 | EXTRACTOR_METATYPE_PRODUCER, | 87 | EXTRACTOR_METATYPE_PRODUCER, |
88 | EXTRACTOR_METATYPE_SONG_VERSION, | 88 | EXTRACTOR_METATYPE_SONG_VERSION, |
89 | EXTRACTOR_METATYPE_URI, | 89 | EXTRACTOR_METATYPE_URI, |
90 | EXTRACTOR_METATYPE_CREATION_DATE, | 90 | EXTRACTOR_METATYPE_CREATION_DATE, |
91 | EXTRACTOR_METATYPE_DISCLAIMER, | 91 | EXTRACTOR_METATYPE_DISCLAIMER, |
92 | EXTRACTOR_METATYPE_WRITER, | 92 | EXTRACTOR_METATYPE_WRITER, |
93 | EXTRACTOR_METATYPE_CONTRIBUTOR_NAME, | 93 | EXTRACTOR_METATYPE_CONTRIBUTOR_NAME, |
94 | EXTRACTOR_METATYPE_SONG_COUNT, | 94 | EXTRACTOR_METATYPE_SONG_COUNT, |
95 | EXTRACTOR_METATYPE_STARTING_SONG, | 95 | EXTRACTOR_METATYPE_STARTING_SONG, |
@@ -98,35 +98,35 @@ gint types_music[] = | |||
98 | EXTRACTOR_METATYPE_ORIGINAL_ARTIST, | 98 | EXTRACTOR_METATYPE_ORIGINAL_ARTIST, |
99 | EXTRACTOR_METATYPE_ORIGINAL_WRITER, | 99 | EXTRACTOR_METATYPE_ORIGINAL_WRITER, |
100 | EXTRACTOR_METATYPE_ORIGINAL_RELEASE_YEAR, | 100 | EXTRACTOR_METATYPE_ORIGINAL_RELEASE_YEAR, |
101 | EXTRACTOR_METATYPE_ORIGINAL_PERFORMER, | 101 | EXTRACTOR_METATYPE_ORIGINAL_PERFORMER, |
102 | EXTRACTOR_METATYPE_MUSICIAN_CREDITS_LIST, | 102 | EXTRACTOR_METATYPE_MUSICIAN_CREDITS_LIST, |
103 | EXTRACTOR_METATYPE_SUBTITLE, | 103 | EXTRACTOR_METATYPE_SUBTITLE, |
104 | EXTRACTOR_METATYPE_RESERVED | 104 | EXTRACTOR_METATYPE_RESERVED |
105 | }; | 105 | }; |
106 | 106 | ||
107 | 107 | ||
108 | gint types_video[] = | 108 | gint types_video[] = |
109 | { | 109 | { |
110 | EXTRACTOR_METATYPE_MIMETYPE, | 110 | EXTRACTOR_METATYPE_MIMETYPE, |
111 | EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME, | 111 | EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME, |
112 | EXTRACTOR_METATYPE_TITLE, | 112 | EXTRACTOR_METATYPE_TITLE, |
113 | EXTRACTOR_METATYPE_GENRE, | 113 | EXTRACTOR_METATYPE_GENRE, |
114 | EXTRACTOR_METATYPE_KEYWORDS, | 114 | EXTRACTOR_METATYPE_KEYWORDS, |
115 | EXTRACTOR_METATYPE_SUMMARY, | 115 | EXTRACTOR_METATYPE_SUMMARY, |
116 | EXTRACTOR_METATYPE_DESCRIPTION, | 116 | EXTRACTOR_METATYPE_DESCRIPTION, |
117 | EXTRACTOR_METATYPE_DURATION, | 117 | EXTRACTOR_METATYPE_DURATION, |
118 | EXTRACTOR_METATYPE_IMAGE_DIMENSIONS, | 118 | EXTRACTOR_METATYPE_IMAGE_DIMENSIONS, |
119 | EXTRACTOR_METATYPE_COMMENT, | 119 | EXTRACTOR_METATYPE_COMMENT, |
120 | EXTRACTOR_METATYPE_CREATOR, | 120 | EXTRACTOR_METATYPE_CREATOR, |
121 | EXTRACTOR_METATYPE_WRITER, | 121 | EXTRACTOR_METATYPE_WRITER, |
122 | EXTRACTOR_METATYPE_MOVIE_DIRECTOR, | 122 | EXTRACTOR_METATYPE_MOVIE_DIRECTOR, |
123 | EXTRACTOR_METATYPE_PRODUCER, | 123 | EXTRACTOR_METATYPE_PRODUCER, |
124 | EXTRACTOR_METATYPE_PUBLISHER, | 124 | EXTRACTOR_METATYPE_PUBLISHER, |
125 | EXTRACTOR_METATYPE_NETWORK_NAME, | 125 | EXTRACTOR_METATYPE_NETWORK_NAME, |
126 | EXTRACTOR_METATYPE_SHOW_NAME, | 126 | EXTRACTOR_METATYPE_SHOW_NAME, |
127 | EXTRACTOR_METATYPE_CHAPTER_NAME, | 127 | EXTRACTOR_METATYPE_CHAPTER_NAME, |
128 | EXTRACTOR_METATYPE_MUSICIAN_CREDITS_LIST, | 128 | EXTRACTOR_METATYPE_MUSICIAN_CREDITS_LIST, |
129 | EXTRACTOR_METATYPE_COPYRIGHT, | 129 | EXTRACTOR_METATYPE_COPYRIGHT, |
130 | EXTRACTOR_METATYPE_URI, | 130 | EXTRACTOR_METATYPE_URI, |
131 | EXTRACTOR_METATYPE_LOCATION_CITY, | 131 | EXTRACTOR_METATYPE_LOCATION_CITY, |
132 | EXTRACTOR_METATYPE_LOCATION_COUNTRY, | 132 | EXTRACTOR_METATYPE_LOCATION_COUNTRY, |
@@ -137,15 +137,15 @@ gint types_video[] = | |||
137 | }; | 137 | }; |
138 | 138 | ||
139 | 139 | ||
140 | gint types_image[] = | 140 | gint types_image[] = |
141 | { | 141 | { |
142 | EXTRACTOR_METATYPE_MIMETYPE, | 142 | EXTRACTOR_METATYPE_MIMETYPE, |
143 | EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME, | 143 | EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME, |
144 | EXTRACTOR_METATYPE_TITLE, | 144 | EXTRACTOR_METATYPE_TITLE, |
145 | EXTRACTOR_METATYPE_KEYWORDS, | 145 | EXTRACTOR_METATYPE_KEYWORDS, |
146 | EXTRACTOR_METATYPE_DESCRIPTION, | 146 | EXTRACTOR_METATYPE_DESCRIPTION, |
147 | EXTRACTOR_METATYPE_IMAGE_DIMENSIONS, | 147 | EXTRACTOR_METATYPE_IMAGE_DIMENSIONS, |
148 | EXTRACTOR_METATYPE_IMAGE_RESOLUTION, | 148 | EXTRACTOR_METATYPE_IMAGE_RESOLUTION, |
149 | EXTRACTOR_METATYPE_COMMENT, | 149 | EXTRACTOR_METATYPE_COMMENT, |
150 | EXTRACTOR_METATYPE_COPYRIGHT, | 150 | EXTRACTOR_METATYPE_COPYRIGHT, |
151 | EXTRACTOR_METATYPE_SUBJECT, | 151 | EXTRACTOR_METATYPE_SUBJECT, |
@@ -155,7 +155,7 @@ gint types_image[] = | |||
155 | EXTRACTOR_METATYPE_LOCATION_CITY, | 155 | EXTRACTOR_METATYPE_LOCATION_CITY, |
156 | EXTRACTOR_METATYPE_LOCATION_COUNTRY, | 156 | EXTRACTOR_METATYPE_LOCATION_COUNTRY, |
157 | EXTRACTOR_METATYPE_LOCATION_COUNTRY_CODE, | 157 | EXTRACTOR_METATYPE_LOCATION_COUNTRY_CODE, |
158 | EXTRACTOR_METATYPE_ORGANIZATION, | 158 | EXTRACTOR_METATYPE_ORGANIZATION, |
159 | EXTRACTOR_METATYPE_RESERVED | 159 | EXTRACTOR_METATYPE_RESERVED |
160 | }; | 160 | }; |
161 | 161 | ||
@@ -171,7 +171,7 @@ gint types_namespace[] = | |||
171 | EXTRACTOR_METATYPE_RIGHTS, | 171 | EXTRACTOR_METATYPE_RIGHTS, |
172 | EXTRACTOR_METATYPE_KEYWORDS, | 172 | EXTRACTOR_METATYPE_KEYWORDS, |
173 | EXTRACTOR_METATYPE_ABSTRACT, | 173 | EXTRACTOR_METATYPE_ABSTRACT, |
174 | EXTRACTOR_METATYPE_SUMMARY, | 174 | EXTRACTOR_METATYPE_SUMMARY, |
175 | EXTRACTOR_METATYPE_SUBJECT, | 175 | EXTRACTOR_METATYPE_SUBJECT, |
176 | EXTRACTOR_METATYPE_CREATOR, | 176 | EXTRACTOR_METATYPE_CREATOR, |
177 | EXTRACTOR_METATYPE_RATING, | 177 | EXTRACTOR_METATYPE_RATING, |
@@ -183,17 +183,17 @@ gint types_namespace[] = | |||
183 | }; | 183 | }; |
184 | 184 | ||
185 | 185 | ||
186 | gint types_software[] = | 186 | gint types_software[] = |
187 | { | 187 | { |
188 | EXTRACTOR_METATYPE_MIMETYPE, | 188 | EXTRACTOR_METATYPE_MIMETYPE, |
189 | EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME, | 189 | EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME, |
190 | EXTRACTOR_METATYPE_PACKAGE_NAME, | 190 | EXTRACTOR_METATYPE_PACKAGE_NAME, |
191 | EXTRACTOR_METATYPE_PACKAGE_VERSION, | 191 | EXTRACTOR_METATYPE_PACKAGE_VERSION, |
192 | EXTRACTOR_METATYPE_TARGET_ARCHITECTURE, | 192 | EXTRACTOR_METATYPE_TARGET_ARCHITECTURE, |
193 | EXTRACTOR_METATYPE_LICENSE, | 193 | EXTRACTOR_METATYPE_LICENSE, |
194 | EXTRACTOR_METATYPE_TARGET_OS, | 194 | EXTRACTOR_METATYPE_TARGET_OS, |
195 | EXTRACTOR_METATYPE_COMMENT, | 195 | EXTRACTOR_METATYPE_COMMENT, |
196 | EXTRACTOR_METATYPE_SECTION, | 196 | EXTRACTOR_METATYPE_SECTION, |
197 | EXTRACTOR_METATYPE_PACKAGE_DEPENDENCY, | 197 | EXTRACTOR_METATYPE_PACKAGE_DEPENDENCY, |
198 | EXTRACTOR_METATYPE_PACKAGE_CONFLICTS, | 198 | EXTRACTOR_METATYPE_PACKAGE_CONFLICTS, |
199 | EXTRACTOR_METATYPE_PACKAGE_REPLACES, | 199 | EXTRACTOR_METATYPE_PACKAGE_REPLACES, |
@@ -205,11 +205,11 @@ gint types_software[] = | |||
205 | EXTRACTOR_METATYPE_PACKAGE_SOURCE, | 205 | EXTRACTOR_METATYPE_PACKAGE_SOURCE, |
206 | EXTRACTOR_METATYPE_PACKAGE_ESSENTIAL, | 206 | EXTRACTOR_METATYPE_PACKAGE_ESSENTIAL, |
207 | EXTRACTOR_METATYPE_PACKAGE_PRE_DEPENDENCY, | 207 | EXTRACTOR_METATYPE_PACKAGE_PRE_DEPENDENCY, |
208 | EXTRACTOR_METATYPE_PACKAGE_DISTRIBUTION, | 208 | EXTRACTOR_METATYPE_PACKAGE_DISTRIBUTION, |
209 | EXTRACTOR_METATYPE_BUILDHOST, | 209 | EXTRACTOR_METATYPE_BUILDHOST, |
210 | EXTRACTOR_METATYPE_VENDOR, | 210 | EXTRACTOR_METATYPE_VENDOR, |
211 | EXTRACTOR_METATYPE_SOFTWARE_VERSION, | 211 | EXTRACTOR_METATYPE_SOFTWARE_VERSION, |
212 | EXTRACTOR_METATYPE_TARGET_PLATFORM, | 212 | EXTRACTOR_METATYPE_TARGET_PLATFORM, |
213 | EXTRACTOR_METATYPE_RESOURCE_TYPE, | 213 | EXTRACTOR_METATYPE_RESOURCE_TYPE, |
214 | EXTRACTOR_METATYPE_LIBRARY_SEARCH_PATH, | 214 | EXTRACTOR_METATYPE_LIBRARY_SEARCH_PATH, |
215 | EXTRACTOR_METATYPE_LIBRARY_DEPENDENCY, | 215 | EXTRACTOR_METATYPE_LIBRARY_DEPENDENCY, |
@@ -225,12 +225,12 @@ gint types_software[] = | |||
225 | */ | 225 | */ |
226 | gint *types[] = { | 226 | gint *types[] = { |
227 | types_generic, | 227 | types_generic, |
228 | types_text, | 228 | types_text, |
229 | types_music, | 229 | types_music, |
230 | types_video, | 230 | types_video, |
231 | types_image, | 231 | types_image, |
232 | types_software, | 232 | types_software, |
233 | types_namespace, | 233 | types_namespace, |
234 | NULL | 234 | NULL |
235 | }; | 235 | }; |
236 | 236 | ||
diff --git a/src/identity/gnunet-identity-gtk.c b/src/identity/gnunet-identity-gtk.c index 5d3ba622..f201c596 100644 --- a/src/identity/gnunet-identity-gtk.c +++ b/src/identity/gnunet-identity-gtk.c | |||
@@ -34,7 +34,7 @@ | |||
34 | enum IDENTITY_ModelColumns | 34 | enum IDENTITY_ModelColumns |
35 | { | 35 | { |
36 | /** | 36 | /** |
37 | * A gchararray | 37 | * A gchararray |
38 | */ | 38 | */ |
39 | IDENTITY_MC_NAME = 0, | 39 | IDENTITY_MC_NAME = 0, |
40 | 40 | ||
@@ -80,17 +80,17 @@ struct OperationContext | |||
80 | 80 | ||
81 | /** | 81 | /** |
82 | * Kept in a DLL. | 82 | * Kept in a DLL. |
83 | */ | 83 | */ |
84 | struct OperationContext *next; | 84 | struct OperationContext *next; |
85 | 85 | ||
86 | /** | 86 | /** |
87 | * Kept in a DLL. | 87 | * Kept in a DLL. |
88 | */ | 88 | */ |
89 | struct OperationContext *prev; | 89 | struct OperationContext *prev; |
90 | 90 | ||
91 | /** | 91 | /** |
92 | * Operation handle with the identity service. | 92 | * Operation handle with the identity service. |
93 | */ | 93 | */ |
94 | struct GNUNET_IDENTITY_Operation *op; | 94 | struct GNUNET_IDENTITY_Operation *op; |
95 | 95 | ||
96 | }; | 96 | }; |
@@ -98,12 +98,12 @@ struct OperationContext | |||
98 | 98 | ||
99 | /** | 99 | /** |
100 | * Head of operations. | 100 | * Head of operations. |
101 | */ | 101 | */ |
102 | static struct OperationContext *oc_head; | 102 | static struct OperationContext *oc_head; |
103 | 103 | ||
104 | /** | 104 | /** |
105 | * Tail of operations. | 105 | * Tail of operations. |
106 | */ | 106 | */ |
107 | static struct OperationContext *oc_tail; | 107 | static struct OperationContext *oc_tail; |
108 | 108 | ||
109 | 109 | ||
@@ -134,7 +134,7 @@ get_object (const char *name) | |||
134 | 134 | ||
135 | /** | 135 | /** |
136 | * Identity operation was finished, clean up. | 136 | * Identity operation was finished, clean up. |
137 | * | 137 | * |
138 | * @param cls the 'struct OperationContext' | 138 | * @param cls the 'struct OperationContext' |
139 | * @param emsg error message (NULL on success) | 139 | * @param emsg error message (NULL on success) |
140 | */ | 140 | */ |
@@ -144,7 +144,7 @@ operation_finished (void *cls, | |||
144 | { | 144 | { |
145 | struct OperationContext *oc = cls; | 145 | struct OperationContext *oc = cls; |
146 | 146 | ||
147 | GNUNET_CONTAINER_DLL_remove (oc_head, | 147 | GNUNET_CONTAINER_DLL_remove (oc_head, |
148 | oc_tail, | 148 | oc_tail, |
149 | oc); | 149 | oc); |
150 | gtk_widget_set_sensitive (GTK_WIDGET (get_object ("GNUNET_GTK_identity_treeview")), | 150 | gtk_widget_set_sensitive (GTK_WIDGET (get_object ("GNUNET_GTK_identity_treeview")), |
@@ -168,19 +168,19 @@ struct AdvertisePopupContext | |||
168 | 168 | ||
169 | /** | 169 | /** |
170 | * "Advertise" was selected in the current context menu. | 170 | * "Advertise" was selected in the current context menu. |
171 | * | 171 | * |
172 | * @param item the 'advertise' menu item | 172 | * @param item the 'advertise' menu item |
173 | * @param user_data the 'struct AdvertisePopupContext' of the menu | 173 | * @param user_data the 'struct AdvertisePopupContext' of the menu |
174 | */ | 174 | */ |
175 | static void | 175 | static void |
176 | advertise_ctx_menu (GtkMenuItem *item, | 176 | advertise_ctx_menu (GtkMenuItem *item, |
177 | gpointer user_data) | 177 | gpointer user_data) |
178 | { | 178 | { |
179 | struct AdvertisePopupContext *apc = user_data; | 179 | struct AdvertisePopupContext *apc = user_data; |
180 | const struct GNUNET_CRYPTO_EccPrivateKey *priv; | 180 | const struct GNUNET_CRYPTO_EccPrivateKey *priv; |
181 | 181 | ||
182 | priv = GNUNET_IDENTITY_ego_get_private_key (apc->ego); | 182 | priv = GNUNET_IDENTITY_ego_get_private_key (apc->ego); |
183 | GIG_advertise_dialog_start_ (priv); | 183 | GIG_advertise_dialog_start_ (priv); |
184 | } | 184 | } |
185 | 185 | ||
186 | 186 | ||
@@ -188,7 +188,7 @@ advertise_ctx_menu (GtkMenuItem *item, | |||
188 | * An item was selected from the context menu; destroy the menu shell. | 188 | * An item was selected from the context menu; destroy the menu shell. |
189 | * | 189 | * |
190 | * @param menushell menu to destroy | 190 | * @param menushell menu to destroy |
191 | * @param user_data the 'struct AdvertisePopupContext' of the menu | 191 | * @param user_data the 'struct AdvertisePopupContext' of the menu |
192 | */ | 192 | */ |
193 | static void | 193 | static void |
194 | advertise_popup_selection_done (GtkMenuShell *menushell, | 194 | advertise_popup_selection_done (GtkMenuShell *menushell, |
@@ -212,7 +212,7 @@ advertise_popup_selection_done (GtkMenuShell *menushell, | |||
212 | * TRUE if there is now a pop-up menu | 212 | * TRUE if there is now a pop-up menu |
213 | */ | 213 | */ |
214 | gboolean | 214 | gboolean |
215 | GNUNET_GTK_identity_treeview_button_press_event_cb (GtkWidget *widget, | 215 | GNUNET_GTK_identity_treeview_button_press_event_cb (GtkWidget *widget, |
216 | GdkEvent *event, | 216 | GdkEvent *event, |
217 | gpointer user_data) | 217 | gpointer user_data) |
218 | { | 218 | { |
@@ -232,12 +232,12 @@ GNUNET_GTK_identity_treeview_button_press_event_cb (GtkWidget *widget, | |||
232 | if (! gtk_tree_view_get_path_at_pos (tv, | 232 | if (! gtk_tree_view_get_path_at_pos (tv, |
233 | event_button->x, event_button->y, | 233 | event_button->x, event_button->y, |
234 | &path, NULL, NULL, NULL)) | 234 | &path, NULL, NULL, NULL)) |
235 | return FALSE; /* click outside of area with values, ignore */ | 235 | return FALSE; /* click outside of area with values, ignore */ |
236 | tm = gtk_tree_view_get_model (tv); | 236 | tm = gtk_tree_view_get_model (tv); |
237 | if (! gtk_tree_model_get_iter (tm, &iter, path)) | 237 | if (! gtk_tree_model_get_iter (tm, &iter, path)) |
238 | { | 238 | { |
239 | gtk_tree_path_free (path); | 239 | gtk_tree_path_free (path); |
240 | return FALSE; /* not sure how we got a path but no iter... */ | 240 | return FALSE; /* not sure how we got a path but no iter... */ |
241 | } | 241 | } |
242 | gtk_tree_path_free (path); | 242 | gtk_tree_path_free (path); |
243 | gtk_tree_model_get (GTK_TREE_MODEL (ls), &iter, | 243 | gtk_tree_model_get (GTK_TREE_MODEL (ls), &iter, |
@@ -258,8 +258,8 @@ GNUNET_GTK_identity_treeview_button_press_event_cb (GtkWidget *widget, | |||
258 | gtk_menu_shell_append (GTK_MENU_SHELL (menu), child); | 258 | gtk_menu_shell_append (GTK_MENU_SHELL (menu), child); |
259 | g_signal_connect (menu, "selection-done", | 259 | g_signal_connect (menu, "selection-done", |
260 | G_CALLBACK (advertise_popup_selection_done), apc); | 260 | G_CALLBACK (advertise_popup_selection_done), apc); |
261 | gtk_menu_popup (menu, NULL, NULL, NULL, NULL, | 261 | gtk_menu_popup (menu, NULL, NULL, NULL, NULL, |
262 | event_button->button, | 262 | event_button->button, |
263 | event_button->time); | 263 | event_button->time); |
264 | return FALSE; | 264 | return FALSE; |
265 | } | 265 | } |
@@ -289,16 +289,16 @@ GNUNET_GTK_identity_treeview_key_press_event_cb (GtkWidget * widget, | |||
289 | sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (get_object ("GNUNET_GTK_identity_treeview"))); | 289 | sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (get_object ("GNUNET_GTK_identity_treeview"))); |
290 | if (! gtk_tree_selection_get_selected (sel, NULL, &iter)) | 290 | if (! gtk_tree_selection_get_selected (sel, NULL, &iter)) |
291 | return FALSE; | 291 | return FALSE; |
292 | gtk_tree_model_get (GTK_TREE_MODEL (ls), | 292 | gtk_tree_model_get (GTK_TREE_MODEL (ls), |
293 | &iter, | 293 | &iter, |
294 | IDENTITY_MC_NAME, &old, | 294 | IDENTITY_MC_NAME, &old, |
295 | -1); | 295 | -1); |
296 | oc = GNUNET_new (struct OperationContext); | 296 | oc = GNUNET_new (struct OperationContext); |
297 | GNUNET_CONTAINER_DLL_insert (oc_head, | 297 | GNUNET_CONTAINER_DLL_insert (oc_head, |
298 | oc_tail, | 298 | oc_tail, |
299 | oc); | 299 | oc); |
300 | oc->op = GNUNET_IDENTITY_delete (identity, | 300 | oc->op = GNUNET_IDENTITY_delete (identity, |
301 | old, | 301 | old, |
302 | &operation_finished, | 302 | &operation_finished, |
303 | oc); | 303 | oc); |
304 | return TRUE; | 304 | return TRUE; |
@@ -314,12 +314,12 @@ GNUNET_GTK_identity_treeview_key_press_event_cb (GtkWidget * widget, | |||
314 | * @param new_text updated text | 314 | * @param new_text updated text |
315 | * @param user_data internal context (not used) | 315 | * @param user_data internal context (not used) |
316 | */ | 316 | */ |
317 | void | 317 | void |
318 | GNUNET_GTK_namespace_organizer_namespaces_treeview_column_name_text_edited_cb | 318 | GNUNET_GTK_namespace_organizer_namespaces_treeview_column_name_text_edited_cb |
319 | (GtkCellRendererText *renderer, | 319 | (GtkCellRendererText *renderer, |
320 | gchar *path, | 320 | gchar *path, |
321 | gchar *new_text, | 321 | gchar *new_text, |
322 | gpointer user_data) | 322 | gpointer user_data) |
323 | { | 323 | { |
324 | GtkTreePath *treepath; | 324 | GtkTreePath *treepath; |
325 | GtkTreeIter iter; | 325 | GtkTreeIter iter; |
@@ -337,15 +337,15 @@ GNUNET_GTK_namespace_organizer_namespaces_treeview_column_name_text_edited_cb | |||
337 | return; | 337 | return; |
338 | } | 338 | } |
339 | gtk_tree_path_free (treepath); | 339 | gtk_tree_path_free (treepath); |
340 | gtk_tree_model_get (GTK_TREE_MODEL (ls), | 340 | gtk_tree_model_get (GTK_TREE_MODEL (ls), |
341 | &iter, | 341 | &iter, |
342 | IDENTITY_MC_NAME, &old, | 342 | IDENTITY_MC_NAME, &old, |
343 | IDENTITY_MC_EGO, &ego, | 343 | IDENTITY_MC_EGO, &ego, |
344 | -1); | 344 | -1); |
345 | gtk_widget_set_sensitive (GTK_WIDGET (get_object ("GNUNET_GTK_identity_treeview")), | 345 | gtk_widget_set_sensitive (GTK_WIDGET (get_object ("GNUNET_GTK_identity_treeview")), |
346 | FALSE); | 346 | FALSE); |
347 | oc = GNUNET_new (struct OperationContext); | 347 | oc = GNUNET_new (struct OperationContext); |
348 | GNUNET_CONTAINER_DLL_insert (oc_head, | 348 | GNUNET_CONTAINER_DLL_insert (oc_head, |
349 | oc_tail, | 349 | oc_tail, |
350 | oc); | 350 | oc); |
351 | if (NULL == ego) | 351 | if (NULL == ego) |
@@ -368,11 +368,11 @@ GNUNET_GTK_namespace_organizer_namespaces_treeview_column_name_text_edited_cb | |||
368 | { | 368 | { |
369 | /* delete operation */ | 369 | /* delete operation */ |
370 | oc->op = GNUNET_IDENTITY_delete (identity, | 370 | oc->op = GNUNET_IDENTITY_delete (identity, |
371 | old, | 371 | old, |
372 | &operation_finished, | 372 | &operation_finished, |
373 | oc); | 373 | oc); |
374 | } | 374 | } |
375 | } | 375 | } |
376 | 376 | ||
377 | 377 | ||
378 | /** | 378 | /** |
@@ -411,7 +411,7 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
411 | /** | 411 | /** |
412 | * Callback invoked if the application is supposed to exit. | 412 | * Callback invoked if the application is supposed to exit. |
413 | * | 413 | * |
414 | * @param object | 414 | * @param object |
415 | * @param user_data unused | 415 | * @param user_data unused |
416 | */ | 416 | */ |
417 | void | 417 | void |
@@ -427,7 +427,7 @@ GNUNET_GTK_identity_quit_cb (GObject * object, gpointer user_data) | |||
427 | * | 427 | * |
428 | * @param cls our 'struct MainPublishingDialogContext' | 428 | * @param cls our 'struct MainPublishingDialogContext' |
429 | * @param ego identity of the namespace to add | 429 | * @param ego identity of the namespace to add |
430 | * @param ego_ctx where to store context data | 430 | * @param ego_ctx where to store context data |
431 | * @param name name of the namespace to add | 431 | * @param name name of the namespace to add |
432 | */ | 432 | */ |
433 | static void | 433 | static void |
@@ -451,7 +451,7 @@ add_ego (void *cls, | |||
451 | GNUNET_assert (NULL != name); | 451 | GNUNET_assert (NULL != name); |
452 | GNUNET_IDENTITY_ego_get_public_key (ego, &pub); | 452 | GNUNET_IDENTITY_ego_get_public_key (ego, &pub); |
453 | id = GNUNET_CRYPTO_ecc_public_sign_key_to_string (&pub); | 453 | id = GNUNET_CRYPTO_ecc_public_sign_key_to_string (&pub); |
454 | gtk_list_store_insert_with_values (ls, | 454 | gtk_list_store_insert_with_values (ls, |
455 | &iter, G_MAXINT, | 455 | &iter, G_MAXINT, |
456 | IDENTITY_MC_NAME, name, | 456 | IDENTITY_MC_NAME, name, |
457 | IDENTITY_MC_IDENTIFIER, id, | 457 | IDENTITY_MC_IDENTIFIER, id, |
@@ -460,7 +460,7 @@ add_ego (void *cls, | |||
460 | GNUNET_free (id); | 460 | GNUNET_free (id); |
461 | path = gtk_tree_model_get_path (GTK_TREE_MODEL (ls), | 461 | path = gtk_tree_model_get_path (GTK_TREE_MODEL (ls), |
462 | &iter); | 462 | &iter); |
463 | rr = gtk_tree_row_reference_new (GTK_TREE_MODEL (ls), | 463 | rr = gtk_tree_row_reference_new (GTK_TREE_MODEL (ls), |
464 | path); | 464 | path); |
465 | gtk_tree_path_free (path); | 465 | gtk_tree_path_free (path); |
466 | *ego_ctx = rr; | 466 | *ego_ctx = rr; |
@@ -480,13 +480,13 @@ add_ego (void *cls, | |||
480 | { | 480 | { |
481 | /* rename operation */ | 481 | /* rename operation */ |
482 | path = gtk_tree_row_reference_get_path (rr); | 482 | path = gtk_tree_row_reference_get_path (rr); |
483 | GNUNET_assert (gtk_tree_model_get_iter (GTK_TREE_MODEL (ls), | 483 | GNUNET_assert (gtk_tree_model_get_iter (GTK_TREE_MODEL (ls), |
484 | &iter, path)); | 484 | &iter, path)); |
485 | gtk_list_store_set (ls, | 485 | gtk_list_store_set (ls, |
486 | &iter, | 486 | &iter, |
487 | IDENTITY_MC_NAME, name, | 487 | IDENTITY_MC_NAME, name, |
488 | -1); | 488 | -1); |
489 | gtk_tree_path_free (path); | 489 | gtk_tree_path_free (path); |
490 | } | 490 | } |
491 | } | 491 | } |
492 | 492 | ||
@@ -513,7 +513,7 @@ run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
513 | main_window = GTK_WIDGET (get_object ("GNUNET_GTK_identity_window")); | 513 | main_window = GTK_WIDGET (get_object ("GNUNET_GTK_identity_window")); |
514 | ls = GTK_LIST_STORE (get_object ("GNUNET_GTK_identity_liststore")); | 514 | ls = GTK_LIST_STORE (get_object ("GNUNET_GTK_identity_liststore")); |
515 | GNUNET_assert (NULL != ls); | 515 | GNUNET_assert (NULL != ls); |
516 | gtk_list_store_insert_with_values (ls, | 516 | gtk_list_store_insert_with_values (ls, |
517 | &iter, G_MAXINT, | 517 | &iter, G_MAXINT, |
518 | IDENTITY_MC_NAME, "<create>", | 518 | IDENTITY_MC_NAME, "<create>", |
519 | -1); | 519 | -1); |
diff --git a/src/identity/gnunet-identity-gtk.h b/src/identity/gnunet-identity-gtk.h index c3d30b7b..26943ec0 100644 --- a/src/identity/gnunet-identity-gtk.h +++ b/src/identity/gnunet-identity-gtk.h | |||
@@ -37,4 +37,4 @@ const struct GNUNET_CONFIGURATION_Handle * | |||
37 | GIG_get_configuration (void); | 37 | GIG_get_configuration (void); |
38 | 38 | ||
39 | 39 | ||
40 | #endif | 40 | #endif |
diff --git a/src/identity/gnunet-identity-gtk_advertise.c b/src/identity/gnunet-identity-gtk_advertise.c index 07ce5a01..60f8e8ea 100644 --- a/src/identity/gnunet-identity-gtk_advertise.c +++ b/src/identity/gnunet-identity-gtk_advertise.c | |||
@@ -34,16 +34,16 @@ | |||
34 | /** | 34 | /** |
35 | * Types of metadata we offer for namespaces. | 35 | * Types of metadata we offer for namespaces. |
36 | */ | 36 | */ |
37 | static gint types[] = | 37 | static gint types[] = |
38 | { | 38 | { |
39 | EXTRACTOR_METATYPE_TITLE, | 39 | EXTRACTOR_METATYPE_TITLE, |
40 | EXTRACTOR_METATYPE_KEYWORDS, | 40 | EXTRACTOR_METATYPE_KEYWORDS, |
41 | EXTRACTOR_METATYPE_SUBJECT, | 41 | EXTRACTOR_METATYPE_SUBJECT, |
42 | EXTRACTOR_METATYPE_DESCRIPTION, | 42 | EXTRACTOR_METATYPE_DESCRIPTION, |
43 | EXTRACTOR_METATYPE_COMMENT, | 43 | EXTRACTOR_METATYPE_COMMENT, |
44 | EXTRACTOR_METATYPE_COPYRIGHT, | 44 | EXTRACTOR_METATYPE_COPYRIGHT, |
45 | EXTRACTOR_METATYPE_URI, | 45 | EXTRACTOR_METATYPE_URI, |
46 | EXTRACTOR_METATYPE_CREATOR, | 46 | EXTRACTOR_METATYPE_CREATOR, |
47 | EXTRACTOR_METATYPE_CREATION_DATE, | 47 | EXTRACTOR_METATYPE_CREATION_DATE, |
48 | EXTRACTOR_METATYPE_RESERVED | 48 | EXTRACTOR_METATYPE_RESERVED |
49 | }; | 49 | }; |
@@ -59,17 +59,17 @@ enum METADATA_ModelColumns | |||
59 | * A guint | 59 | * A guint |
60 | */ | 60 | */ |
61 | METADATA_MC_TYPE_AS_ENUM = 0, | 61 | METADATA_MC_TYPE_AS_ENUM = 0, |
62 | 62 | ||
63 | /** | 63 | /** |
64 | * A gchararray | 64 | * A gchararray |
65 | */ | 65 | */ |
66 | METADATA_MC_TYPE_AS_STRING = 1, | 66 | METADATA_MC_TYPE_AS_STRING = 1, |
67 | 67 | ||
68 | /** | 68 | /** |
69 | * A gchararray | 69 | * A gchararray |
70 | */ | 70 | */ |
71 | METADATA_MC_VALUE = 2 | 71 | METADATA_MC_VALUE = 2 |
72 | 72 | ||
73 | }; | 73 | }; |
74 | 74 | ||
75 | 75 | ||
@@ -80,7 +80,7 @@ enum KEYWORDS_ModelColumns | |||
80 | { | 80 | { |
81 | 81 | ||
82 | /** | 82 | /** |
83 | * A gchararray | 83 | * A gchararray |
84 | */ | 84 | */ |
85 | KEYWORDS_MC_KEYWORD = 0 | 85 | KEYWORDS_MC_KEYWORD = 0 |
86 | 86 | ||
@@ -94,15 +94,15 @@ enum METATYPES_ModelColumns | |||
94 | { | 94 | { |
95 | 95 | ||
96 | /** | 96 | /** |
97 | * A gchararray | 97 | * A gchararray |
98 | */ | 98 | */ |
99 | METATYPES_MC_TYPE_AS_STRING = 0, | 99 | METATYPES_MC_TYPE_AS_STRING = 0, |
100 | 100 | ||
101 | /** | 101 | /** |
102 | * A guint | 102 | * A guint |
103 | */ | 103 | */ |
104 | METATYPES_MC_TYPE_AS_ENUM = 1 | 104 | METATYPES_MC_TYPE_AS_ENUM = 1 |
105 | 105 | ||
106 | }; | 106 | }; |
107 | 107 | ||
108 | 108 | ||
@@ -115,8 +115,8 @@ struct AdvertiseContext | |||
115 | * Builder for accessing objects in the dialog. | 115 | * Builder for accessing objects in the dialog. |
116 | */ | 116 | */ |
117 | GtkBuilder *builder; | 117 | GtkBuilder *builder; |
118 | 118 | ||
119 | /** | 119 | /** |
120 | * Private key of the namespace we will be advertising. | 120 | * Private key of the namespace we will be advertising. |
121 | */ | 121 | */ |
122 | struct GNUNET_CRYPTO_EccPrivateKey priv; | 122 | struct GNUNET_CRYPTO_EccPrivateKey priv; |
@@ -125,7 +125,7 @@ struct AdvertiseContext | |||
125 | * Main dialog object. | 125 | * Main dialog object. |
126 | */ | 126 | */ |
127 | GtkWidget *dialog; | 127 | GtkWidget *dialog; |
128 | 128 | ||
129 | /** | 129 | /** |
130 | * List of keywords to advertise under. | 130 | * List of keywords to advertise under. |
131 | */ | 131 | */ |
@@ -224,7 +224,7 @@ publish_continuation (void *cls, | |||
224 | const char *emsg) | 224 | const char *emsg) |
225 | { | 225 | { |
226 | struct PublishContext *pc = cls; | 226 | struct PublishContext *pc = cls; |
227 | 227 | ||
228 | pc->pub = NULL; | 228 | pc->pub = NULL; |
229 | if (NULL == uri) | 229 | if (NULL == uri) |
230 | { | 230 | { |
@@ -291,15 +291,15 @@ GNUNET_GTK_identity_advertise_dialog_response_cb (GtkDialog *dialog, | |||
291 | const char *id; | 291 | const char *id; |
292 | 292 | ||
293 | if (GTK_RESPONSE_OK != response_id) | 293 | if (GTK_RESPONSE_OK != response_id) |
294 | goto cleanup; | 294 | goto cleanup; |
295 | ksk_uri = NULL; | 295 | ksk_uri = NULL; |
296 | if (! gtk_tree_model_get_iter_first (GTK_TREE_MODEL (ac->keywords), &iter)) | 296 | if (! gtk_tree_model_get_iter_first (GTK_TREE_MODEL (ac->keywords), &iter)) |
297 | { | 297 | { |
298 | GNUNET_break (0); | 298 | GNUNET_break (0); |
299 | goto cleanup; | 299 | goto cleanup; |
300 | } | 300 | } |
301 | do | 301 | do |
302 | { | 302 | { |
303 | gtk_tree_model_get (GTK_TREE_MODEL (ac->keywords), &iter, | 303 | gtk_tree_model_get (GTK_TREE_MODEL (ac->keywords), &iter, |
304 | KEYWORDS_MC_KEYWORD, &keyword, | 304 | KEYWORDS_MC_KEYWORD, &keyword, |
305 | -1); | 305 | -1); |
@@ -310,7 +310,7 @@ GNUNET_GTK_identity_advertise_dialog_response_cb (GtkDialog *dialog, | |||
310 | g_free (keyword); | 310 | g_free (keyword); |
311 | } | 311 | } |
312 | while (gtk_tree_model_iter_next (GTK_TREE_MODEL (ac->keywords), &iter)); | 312 | while (gtk_tree_model_iter_next (GTK_TREE_MODEL (ac->keywords), &iter)); |
313 | 313 | ||
314 | meta = GNUNET_CONTAINER_meta_data_create (); | 314 | meta = GNUNET_CONTAINER_meta_data_create (); |
315 | if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (ac->metadata), | 315 | if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (ac->metadata), |
316 | &iter)) | 316 | &iter)) |
@@ -323,7 +323,7 @@ GNUNET_GTK_identity_advertise_dialog_response_cb (GtkDialog *dialog, | |||
323 | -1); | 323 | -1); |
324 | if (ntype > 0) | 324 | if (ntype > 0) |
325 | { | 325 | { |
326 | GNUNET_CONTAINER_meta_data_insert (meta, "<user>", | 326 | GNUNET_CONTAINER_meta_data_insert (meta, "<user>", |
327 | ntype, | 327 | ntype, |
328 | EXTRACTOR_METAFORMAT_UTF8, | 328 | EXTRACTOR_METAFORMAT_UTF8, |
329 | "text/plain", value, | 329 | "text/plain", value, |
@@ -335,8 +335,8 @@ GNUNET_GTK_identity_advertise_dialog_response_cb (GtkDialog *dialog, | |||
335 | } | 335 | } |
336 | 336 | ||
337 | bo.expiration_time = GNUNET_GTK_get_expiration_time | 337 | bo.expiration_time = GNUNET_GTK_get_expiration_time |
338 | (GTK_SPIN_BUTTON | 338 | (GTK_SPIN_BUTTON |
339 | (gtk_builder_get_object | 339 | (gtk_builder_get_object |
340 | (ac->builder, | 340 | (ac->builder, |
341 | "GNUNET_GTK_identity_advertise_expiration_year_spin_button"))); | 341 | "GNUNET_GTK_identity_advertise_expiration_year_spin_button"))); |
342 | anonymity = 1; | 342 | anonymity = 1; |
@@ -346,21 +346,21 @@ GNUNET_GTK_identity_advertise_dialog_response_cb (GtkDialog *dialog, | |||
346 | bo.anonymity_level = anonymity; | 346 | bo.anonymity_level = anonymity; |
347 | bo.content_priority | 347 | bo.content_priority |
348 | = (unsigned int) gtk_spin_button_get_value | 348 | = (unsigned int) gtk_spin_button_get_value |
349 | (GTK_SPIN_BUTTON | 349 | (GTK_SPIN_BUTTON |
350 | (gtk_builder_get_object | 350 | (gtk_builder_get_object |
351 | (ac->builder, | 351 | (ac->builder, |
352 | "GNUNET_GTK_identity_advertise_priority_spin_button"))); | 352 | "GNUNET_GTK_identity_advertise_priority_spin_button"))); |
353 | bo.replication_level | 353 | bo.replication_level |
354 | = (unsigned int) gtk_spin_button_get_value | 354 | = (unsigned int) gtk_spin_button_get_value |
355 | (GTK_SPIN_BUTTON | 355 | (GTK_SPIN_BUTTON |
356 | (gtk_builder_get_object | 356 | (gtk_builder_get_object |
357 | (ac->builder, | 357 | (ac->builder, |
358 | "GNUNET_GTK_identity_advertise_replication_spin_button"))); | 358 | "GNUNET_GTK_identity_advertise_replication_spin_button"))); |
359 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (&ac->priv, | 359 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (&ac->priv, |
360 | &pk); | 360 | &pk); |
361 | id = gtk_entry_get_text | 361 | id = gtk_entry_get_text |
362 | (GTK_ENTRY | 362 | (GTK_ENTRY |
363 | (gtk_builder_get_object | 363 | (gtk_builder_get_object |
364 | (ac->builder, | 364 | (ac->builder, |
365 | "GNUNET_GTK_identity_advertise_root_entry"))); | 365 | "GNUNET_GTK_identity_advertise_root_entry"))); |
366 | uri = GNUNET_FS_uri_sks_create (&pk, id); | 366 | uri = GNUNET_FS_uri_sks_create (&pk, id); |
@@ -389,7 +389,7 @@ GNUNET_GTK_identity_advertise_dialog_response_cb (GtkDialog *dialog, | |||
389 | GNUNET_free (ac); | 389 | GNUNET_free (ac); |
390 | } | 390 | } |
391 | 391 | ||
392 | 392 | ||
393 | /** | 393 | /** |
394 | * User edited keywords in the keyword tree view. Update | 394 | * User edited keywords in the keyword tree view. Update |
395 | * the model accordingly. | 395 | * the model accordingly. |
@@ -398,7 +398,7 @@ GNUNET_GTK_identity_advertise_dialog_response_cb (GtkDialog *dialog, | |||
398 | * @param path the path identifying the edited cell | 398 | * @param path the path identifying the edited cell |
399 | * @param new_text the new text | 399 | * @param new_text the new text |
400 | * @param user_data the 'struct AdvertiseContext' | 400 | * @param user_data the 'struct AdvertiseContext' |
401 | */ | 401 | */ |
402 | void | 402 | void |
403 | GNUNET_GTK_identity_advertise_keywords_text_edited_cb (GtkCellRendererText *renderer, | 403 | GNUNET_GTK_identity_advertise_keywords_text_edited_cb (GtkCellRendererText *renderer, |
404 | gchar *path, | 404 | gchar *path, |
@@ -454,7 +454,7 @@ GNUNET_GTK_identity_advertise_keywords_text_edited_cb (GtkCellRendererText *rend | |||
454 | } | 454 | } |
455 | } | 455 | } |
456 | g_free (old_text); | 456 | g_free (old_text); |
457 | gtk_widget_set_sensitive (GTK_WIDGET (gtk_builder_get_object | 457 | gtk_widget_set_sensitive (GTK_WIDGET (gtk_builder_get_object |
458 | (ac->builder, | 458 | (ac->builder, |
459 | "GNUNET_GTK_identity_advertise_ok_button")), | 459 | "GNUNET_GTK_identity_advertise_ok_button")), |
460 | 0 != ac->num_keywords); | 460 | 0 != ac->num_keywords); |
@@ -482,7 +482,7 @@ GNUNET_GTK_identity_advertise_metadata_treeview_key_press_event_cb (GtkWidget *w | |||
482 | 482 | ||
483 | if (event->keyval != GDK_KEY_Delete) | 483 | if (event->keyval != GDK_KEY_Delete) |
484 | return FALSE; | 484 | return FALSE; |
485 | sel = gtk_tree_view_get_selection (GTK_TREE_VIEW | 485 | sel = gtk_tree_view_get_selection (GTK_TREE_VIEW |
486 | (gtk_builder_get_object | 486 | (gtk_builder_get_object |
487 | (ac->builder, | 487 | (ac->builder, |
488 | "GNUNET_GTK_identity_advertise_metadata_treeview"))); | 488 | "GNUNET_GTK_identity_advertise_metadata_treeview"))); |
@@ -559,8 +559,8 @@ GNUNET_GTK_identity_advertise_metadata_value_entry_changed_cb (GtkEditable *edit | |||
559 | 559 | ||
560 | value_entry = GTK_ENTRY (gtk_builder_get_object (ac->builder, | 560 | value_entry = GTK_ENTRY (gtk_builder_get_object (ac->builder, |
561 | "GNUNET_GTK_identity_advertise_metadata_value_entry")); | 561 | "GNUNET_GTK_identity_advertise_metadata_value_entry")); |
562 | value = gtk_entry_get_text (value_entry); | 562 | value = gtk_entry_get_text (value_entry); |
563 | add_button = GTK_WIDGET (gtk_builder_get_object (ac->builder, | 563 | add_button = GTK_WIDGET (gtk_builder_get_object (ac->builder, |
564 | "GNUNET_GTK_identity_advertise_metadata_add_button")); | 564 | "GNUNET_GTK_identity_advertise_metadata_add_button")); |
565 | if ( (NULL == value) || | 565 | if ( (NULL == value) || |
566 | (0 == strlen (value)) ) | 566 | (0 == strlen (value)) ) |
@@ -608,7 +608,7 @@ GNUNET_GTK_identity_advertise_metadata_add_button_clicked_cb (GtkButton * button | |||
608 | type_as_string = EXTRACTOR_metatype_to_string (type); | 608 | type_as_string = EXTRACTOR_metatype_to_string (type); |
609 | value_entry = GTK_ENTRY (gtk_builder_get_object (ac->builder, | 609 | value_entry = GTK_ENTRY (gtk_builder_get_object (ac->builder, |
610 | "GNUNET_GTK_identity_advertise_metadata_value_entry")); | 610 | "GNUNET_GTK_identity_advertise_metadata_value_entry")); |
611 | value = gtk_entry_get_text (value_entry); | 611 | value = gtk_entry_get_text (value_entry); |
612 | if ( (NULL == value) || | 612 | if ( (NULL == value) || |
613 | (0 == strlen (value)) ) | 613 | (0 == strlen (value)) ) |
614 | { | 614 | { |
@@ -657,10 +657,10 @@ GIG_advertise_dialog_start_ (const struct GNUNET_CRYPTO_EccPrivateKey *priv) | |||
657 | (ac->builder, "GNUNET_GTK_identity_advertise_metadata_liststore")); | 657 | (ac->builder, "GNUNET_GTK_identity_advertise_metadata_liststore")); |
658 | ac->meta_types = GTK_LIST_STORE (gtk_builder_get_object | 658 | ac->meta_types = GTK_LIST_STORE (gtk_builder_get_object |
659 | (ac->builder, "GNUNET_GTK_identity_metadata_types_liststore")); | 659 | (ac->builder, "GNUNET_GTK_identity_metadata_types_liststore")); |
660 | for (i = 0; EXTRACTOR_METATYPE_RESERVED != types[i]; i++) | 660 | for (i = 0; EXTRACTOR_METATYPE_RESERVED != types[i]; i++) |
661 | { | 661 | { |
662 | gtk_list_store_insert_with_values (ac->meta_types, | 662 | gtk_list_store_insert_with_values (ac->meta_types, |
663 | &iter, G_MAXINT, | 663 | &iter, G_MAXINT, |
664 | METATYPES_MC_TYPE_AS_STRING, | 664 | METATYPES_MC_TYPE_AS_STRING, |
665 | EXTRACTOR_metatype_to_string (types[i]), | 665 | EXTRACTOR_metatype_to_string (types[i]), |
666 | METATYPES_MC_TYPE_AS_ENUM, | 666 | METATYPES_MC_TYPE_AS_ENUM, |
diff --git a/src/identity/gnunet-identity-gtk_advertise.h b/src/identity/gnunet-identity-gtk_advertise.h index 11e44163..5a9dd794 100644 --- a/src/identity/gnunet-identity-gtk_advertise.h +++ b/src/identity/gnunet-identity-gtk_advertise.h | |||
@@ -45,7 +45,7 @@ GIG_advertise_shutdown_ (void); | |||
45 | void | 45 | void |
46 | GIG_advertise_dialog_start_ (const struct GNUNET_CRYPTO_EccPrivateKey *priv); | 46 | GIG_advertise_dialog_start_ (const struct GNUNET_CRYPTO_EccPrivateKey *priv); |
47 | 47 | ||
48 | #endif | 48 | #endif |
49 | /* GNUNET_FS_GTK_NAMESPACE_MANAGER_H */ | 49 | /* GNUNET_FS_GTK_NAMESPACE_MANAGER_H */ |
50 | 50 | ||
51 | /* end of gnunet-identity-gtk_advertise.h */ | 51 | /* end of gnunet-identity-gtk_advertise.h */ |
diff --git a/src/include/gnunet_gtk.h b/src/include/gnunet_gtk.h index 98685110..730aacd0 100644 --- a/src/include/gnunet_gtk.h +++ b/src/include/gnunet_gtk.h | |||
@@ -130,7 +130,7 @@ GNUNET_GTK_display_about (const char *dialogfile); | |||
130 | * @return TRUE on success, FALSE on errors | 130 | * @return TRUE on success, FALSE on errors |
131 | */ | 131 | */ |
132 | gboolean | 132 | gboolean |
133 | GNUNET_GTK_get_tree_string (GtkTreeView *treeview, | 133 | GNUNET_GTK_get_tree_string (GtkTreeView *treeview, |
134 | GtkTreePath *treepath, | 134 | GtkTreePath *treepath, |
135 | guint column, gchar ** value); | 135 | guint column, gchar ** value); |
136 | 136 | ||
@@ -249,7 +249,7 @@ GNUNET_GTK_main_loop_get_args (struct GNUNET_GTK_MainLoop * ml, | |||
249 | * FIXME! | 249 | * FIXME! |
250 | * | 250 | * |
251 | * @param ml FIXME | 251 | * @param ml FIXME |
252 | * @param data FIXME | 252 | * @param data FIXME |
253 | * @return FIXME | 253 | * @return FIXME |
254 | */ | 254 | */ |
255 | int | 255 | int |
@@ -380,7 +380,7 @@ enum GNUNET_GTK_FS_MAIN_WINDOW_AnonymityLevelModelColumns | |||
380 | * A guint. | 380 | * A guint. |
381 | */ | 381 | */ |
382 | GNUNET_GTK_ANONYMITY_LEVEL_MC_LEVEL = 1, | 382 | GNUNET_GTK_ANONYMITY_LEVEL_MC_LEVEL = 1, |
383 | 383 | ||
384 | /** | 384 | /** |
385 | * A gchararray. | 385 | * A gchararray. |
386 | */ | 386 | */ |
diff --git a/src/lib/animations.c b/src/lib/animations.c index ff87f670..7944870a 100644 --- a/src/lib/animations.c +++ b/src/lib/animations.c | |||
@@ -44,7 +44,7 @@ struct GNUNET_FS_AnimationContext | |||
44 | * This is a doublye-linked list. | 44 | * This is a doublye-linked list. |
45 | */ | 45 | */ |
46 | struct GNUNET_FS_AnimationContext *next; | 46 | struct GNUNET_FS_AnimationContext *next; |
47 | 47 | ||
48 | /** | 48 | /** |
49 | * This is a doublye-linked list. | 49 | * This is a doublye-linked list. |
50 | */ | 50 | */ |
@@ -169,7 +169,7 @@ GNUNET_GTK_animation_context_destroy (struct GNUNET_FS_AnimationContext *ac) | |||
169 | if (NULL == ac) | 169 | if (NULL == ac) |
170 | return; | 170 | return; |
171 | g_object_unref (ac->pixbuf); | 171 | g_object_unref (ac->pixbuf); |
172 | g_object_unref (ac->iter); | 172 | g_object_unref (ac->iter); |
173 | g_object_unref (ac->ani); | 173 | g_object_unref (ac->ani); |
174 | GNUNET_CONTAINER_DLL_remove (animation_head, | 174 | GNUNET_CONTAINER_DLL_remove (animation_head, |
175 | animation_tail, | 175 | animation_tail, |
@@ -210,7 +210,7 @@ tick_animation (struct GNUNET_FS_AnimationContext *ac) | |||
210 | gint height; | 210 | gint height; |
211 | 211 | ||
212 | if (!gdk_pixbuf_animation_iter_advance (ac->iter, NULL)) | 212 | if (!gdk_pixbuf_animation_iter_advance (ac->iter, NULL)) |
213 | return 0; | 213 | return 0; |
214 | pixbuf = gdk_pixbuf_animation_iter_get_pixbuf (ac->iter); | 214 | pixbuf = gdk_pixbuf_animation_iter_get_pixbuf (ac->iter); |
215 | width = gdk_pixbuf_get_width (pixbuf); | 215 | width = gdk_pixbuf_get_width (pixbuf); |
216 | height = gdk_pixbuf_get_height (pixbuf); | 216 | height = gdk_pixbuf_get_height (pixbuf); |
@@ -227,13 +227,13 @@ tick_animation (struct GNUNET_FS_AnimationContext *ac) | |||
227 | */ | 227 | */ |
228 | static void | 228 | static void |
229 | redraw_tree_view (struct GNUNET_FS_AnimationTreeViewHandle *atv) | 229 | redraw_tree_view (struct GNUNET_FS_AnimationTreeViewHandle *atv) |
230 | { | 230 | { |
231 | GdkWindow *gw; | 231 | GdkWindow *gw; |
232 | GdkRectangle r; | 232 | GdkRectangle r; |
233 | GdkRectangle tr; | 233 | GdkRectangle tr; |
234 | gint x; | 234 | gint x; |
235 | gint width; | 235 | gint width; |
236 | 236 | ||
237 | gw = gtk_widget_get_window (GTK_WIDGET (atv->tv)); | 237 | gw = gtk_widget_get_window (GTK_WIDGET (atv->tv)); |
238 | if (! gtk_widget_get_realized (GTK_WIDGET (atv->tv))) | 238 | if (! gtk_widget_get_realized (GTK_WIDGET (atv->tv))) |
239 | return; | 239 | return; |
@@ -244,14 +244,14 @@ redraw_tree_view (struct GNUNET_FS_AnimationTreeViewHandle *atv) | |||
244 | width = r.width; | 244 | width = r.width; |
245 | gtk_tree_view_convert_bin_window_to_widget_coords (atv->tv, x, 0, &r.x, NULL); | 245 | gtk_tree_view_convert_bin_window_to_widget_coords (atv->tv, x, 0, &r.x, NULL); |
246 | gtk_tree_view_convert_bin_window_to_widget_coords (atv->tv, x + width, 0, &r.width, NULL); | 246 | gtk_tree_view_convert_bin_window_to_widget_coords (atv->tv, x + width, 0, &r.width, NULL); |
247 | 247 | ||
248 | /* Get visible area of the treeview, in tree coordinates */ | 248 | /* Get visible area of the treeview, in tree coordinates */ |
249 | gtk_tree_view_get_visible_rect (atv->tv, &tr); | 249 | gtk_tree_view_get_visible_rect (atv->tv, &tr); |
250 | 250 | ||
251 | /* Convert y and height of the visible area to widget coordinates */ | 251 | /* Convert y and height of the visible area to widget coordinates */ |
252 | gtk_tree_view_convert_tree_to_widget_coords (atv->tv, 0, tr.y, NULL, &r.y); | 252 | gtk_tree_view_convert_tree_to_widget_coords (atv->tv, 0, tr.y, NULL, &r.y); |
253 | gtk_tree_view_convert_tree_to_widget_coords (atv->tv, 0, tr.y + tr.height, NULL, &r.height); | 253 | gtk_tree_view_convert_tree_to_widget_coords (atv->tv, 0, tr.y + tr.height, NULL, &r.height); |
254 | 254 | ||
255 | /* r now encloses only column image_col, redraw it */ | 255 | /* r now encloses only column image_col, redraw it */ |
256 | gdk_window_invalidate_rect (gw, &r, TRUE); | 256 | gdk_window_invalidate_rect (gw, &r, TRUE); |
257 | } | 257 | } |
diff --git a/src/lib/eventloop.c b/src/lib/eventloop.c index 3e3972fa..8433a8dc 100644 --- a/src/lib/eventloop.c +++ b/src/lib/eventloop.c | |||
@@ -214,7 +214,7 @@ GNUNET_GTK_main_loop_get_builder (struct GNUNET_GTK_MainLoop *ml) | |||
214 | 214 | ||
215 | 215 | ||
216 | int | 216 | int |
217 | GNUNET_GTK_main_loop_build_window (struct GNUNET_GTK_MainLoop *ml, | 217 | GNUNET_GTK_main_loop_build_window (struct GNUNET_GTK_MainLoop *ml, |
218 | gpointer data) | 218 | gpointer data) |
219 | { | 219 | { |
220 | ml->builder = GNUNET_GTK_get_new_builder (ml->main_window_file, data); | 220 | ml->builder = GNUNET_GTK_get_new_builder (ml->main_window_file, data); |
diff --git a/src/lib/glade.c b/src/lib/glade.c index 5d646ef6..407e23f0 100644 --- a/src/lib/glade.c +++ b/src/lib/glade.c | |||
@@ -138,7 +138,7 @@ GNUNET_FS_GTK_remove_treestore_subtree (GtkTreeStore * ts, | |||
138 | GtkTreeIter * root) | 138 | GtkTreeIter * root) |
139 | { | 139 | { |
140 | GtkTreeIter child; | 140 | GtkTreeIter child; |
141 | 141 | ||
142 | while (gtk_tree_model_iter_children (GTK_TREE_MODEL (ts), &child, root)) | 142 | while (gtk_tree_model_iter_children (GTK_TREE_MODEL (ts), &child, root)) |
143 | GNUNET_FS_GTK_remove_treestore_subtree (ts, &child); | 143 | GNUNET_FS_GTK_remove_treestore_subtree (ts, &child); |
144 | gtk_tree_store_remove (ts, root); | 144 | gtk_tree_store_remove (ts, root); |
diff --git a/src/lib/misc.c b/src/lib/misc.c index d52058a3..72d16382 100644 --- a/src/lib/misc.c +++ b/src/lib/misc.c | |||
@@ -20,7 +20,7 @@ | |||
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @file src/lib/misc.c | 22 | * @file src/lib/misc.c |
23 | * @brief misc functions | 23 | * @brief misc functions |
24 | * @author Christian Grothoff | 24 | * @author Christian Grothoff |
25 | */ | 25 | */ |
26 | #include "gnunet_gtk.h" | 26 | #include "gnunet_gtk.h" |
diff --git a/src/peerinfo/gnunet-peerinfo-gtk-flags.c b/src/peerinfo/gnunet-peerinfo-gtk-flags.c index 2bdc054b..215e8a6a 100644 --- a/src/peerinfo/gnunet-peerinfo-gtk-flags.c +++ b/src/peerinfo/gnunet-peerinfo-gtk-flags.c | |||
@@ -100,7 +100,7 @@ GNUNET_PEERINFO_GTK_get_flag (const char *cc) | |||
100 | for (i = 0; i < strlen (mcc); i++) | 100 | for (i = 0; i < strlen (mcc); i++) |
101 | mcc[i] = tolower (mcc[i]); | 101 | mcc[i] = tolower (mcc[i]); |
102 | dir = GNUNET_GTK_installation_get_path (GNUNET_OS_IPK_DATADIR); | 102 | dir = GNUNET_GTK_installation_get_path (GNUNET_OS_IPK_DATADIR); |
103 | GNUNET_asprintf (&fn, "%sflags%s%s.png", dir, | 103 | GNUNET_asprintf (&fn, "%sflags%s%s.png", dir, |
104 | DIR_SEPARATOR_STR, mcc); | 104 | DIR_SEPARATOR_STR, mcc); |
105 | GNUNET_free (dir); | 105 | GNUNET_free (dir); |
106 | flagBuf = gdk_pixbuf_new_from_file (fn, NULL); | 106 | flagBuf = gdk_pixbuf_new_from_file (fn, NULL); |
diff --git a/src/peerinfo/gnunet-peerinfo-gtk.c b/src/peerinfo/gnunet-peerinfo-gtk.c index d4fd1db0..eb068aa0 100644 --- a/src/peerinfo/gnunet-peerinfo-gtk.c +++ b/src/peerinfo/gnunet-peerinfo-gtk.c | |||
@@ -36,7 +36,7 @@ | |||
36 | enum PEERINFO_ModelColumns | 36 | enum PEERINFO_ModelColumns |
37 | { | 37 | { |
38 | /** | 38 | /** |
39 | * A gchararray | 39 | * A gchararray |
40 | */ | 40 | */ |
41 | PEERINFO_MC_PEER_IDENTITY_STRING = 0, | 41 | PEERINFO_MC_PEER_IDENTITY_STRING = 0, |
42 | 42 | ||
@@ -258,11 +258,11 @@ peer_address_string_cb (void *cls, const char *address) | |||
258 | { | 258 | { |
259 | /* error */ | 259 | /* error */ |
260 | if (GNUNET_NO == info->got_address) | 260 | if (GNUNET_NO == info->got_address) |
261 | gtk_list_store_set (ls, &iter, | 261 | gtk_list_store_set (ls, &iter, |
262 | PEERINFO_MC_NUMBER_OF_ADDRESSES, (guint) 1, | 262 | PEERINFO_MC_NUMBER_OF_ADDRESSES, (guint) 1, |
263 | PEERINFO_MC_COUNTRY_NAME, NULL, | 263 | PEERINFO_MC_COUNTRY_NAME, NULL, |
264 | PEERINFO_MC_COUNTRY_FLAG, NULL, | 264 | PEERINFO_MC_COUNTRY_FLAG, NULL, |
265 | PEERINFO_MC_ADDRESS_AS_STRING, "<no address>", | 265 | PEERINFO_MC_ADDRESS_AS_STRING, "<no address>", |
266 | PEERINFO_MC_CONNECTIVITY_LED, led_green, | 266 | PEERINFO_MC_CONNECTIVITY_LED, led_green, |
267 | PEERINFO_MC_CONNECTED_STATUS, TRUE, | 267 | PEERINFO_MC_CONNECTED_STATUS, TRUE, |
268 | -1); | 268 | -1); |
@@ -280,11 +280,11 @@ peer_address_string_cb (void *cls, const char *address) | |||
280 | if ('.' == *dot) | 280 | if ('.' == *dot) |
281 | country = GNUNET_strndup (&dot[1], (colon - dot) - 1); | 281 | country = GNUNET_strndup (&dot[1], (colon - dot) - 1); |
282 | } | 282 | } |
283 | gtk_list_store_set (ls, &iter, | 283 | gtk_list_store_set (ls, &iter, |
284 | PEERINFO_MC_NUMBER_OF_ADDRESSES, 1, | 284 | PEERINFO_MC_NUMBER_OF_ADDRESSES, 1, |
285 | PEERINFO_MC_COUNTRY_NAME, country, | 285 | PEERINFO_MC_COUNTRY_NAME, country, |
286 | PEERINFO_MC_COUNTRY_FLAG, GNUNET_PEERINFO_GTK_get_flag (country), | 286 | PEERINFO_MC_COUNTRY_FLAG, GNUNET_PEERINFO_GTK_get_flag (country), |
287 | PEERINFO_MC_ADDRESS_AS_STRING, address, | 287 | PEERINFO_MC_ADDRESS_AS_STRING, address, |
288 | PEERINFO_MC_CONNECTIVITY_LED, led_green, | 288 | PEERINFO_MC_CONNECTIVITY_LED, led_green, |
289 | PEERINFO_MC_CONNECTED_STATUS, TRUE, | 289 | PEERINFO_MC_CONNECTED_STATUS, TRUE, |
290 | -1); | 290 | -1); |
@@ -315,14 +315,14 @@ peer_address_cb (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
315 | if (NULL == address) | 315 | if (NULL == address) |
316 | { | 316 | { |
317 | /* disconnect */ | 317 | /* disconnect */ |
318 | gtk_list_store_set (ls, &iter, | 318 | gtk_list_store_set (ls, &iter, |
319 | PEERINFO_MC_NUMBER_OF_ADDRESSES, (guint) 0, | 319 | PEERINFO_MC_NUMBER_OF_ADDRESSES, (guint) 0, |
320 | PEERINFO_MC_CONNECTIVITY_LED, led_red, | 320 | PEERINFO_MC_CONNECTIVITY_LED, led_red, |
321 | PEERINFO_MC_CONNECTED_STATUS, FALSE, | 321 | PEERINFO_MC_CONNECTED_STATUS, FALSE, |
322 | -1); | 322 | -1); |
323 | return; | 323 | return; |
324 | } | 324 | } |
325 | gtk_list_store_set (ls, &iter, | 325 | gtk_list_store_set (ls, &iter, |
326 | PEERINFO_MC_NUMBER_OF_ADDRESSES, 1, | 326 | PEERINFO_MC_NUMBER_OF_ADDRESSES, 1, |
327 | PEERINFO_MC_CONNECTIVITY_LED, led_green, | 327 | PEERINFO_MC_CONNECTIVITY_LED, led_green, |
328 | PEERINFO_MC_CONNECTED_STATUS, TRUE, | 328 | PEERINFO_MC_CONNECTED_STATUS, TRUE, |
@@ -364,8 +364,8 @@ peerinfo_processor (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
364 | npid = (char *) &enc; | 364 | npid = (char *) &enc; |
365 | npid[4] = '\0'; | 365 | npid[4] = '\0'; |
366 | gtk_list_store_append (ls, &iter); | 366 | gtk_list_store_append (ls, &iter); |
367 | gtk_list_store_set (ls, &iter, | 367 | gtk_list_store_set (ls, &iter, |
368 | PEERINFO_MC_PEER_IDENTITY_STRING, npid, | 368 | PEERINFO_MC_PEER_IDENTITY_STRING, npid, |
369 | PEERINFO_MC_NUMBER_OF_ADDRESSES, (guint) 0, | 369 | PEERINFO_MC_NUMBER_OF_ADDRESSES, (guint) 0, |
370 | PEERINFO_MC_COUNTRY_NAME, "", | 370 | PEERINFO_MC_COUNTRY_NAME, "", |
371 | PEERINFO_MC_COUNTRY_FLAG, NULL, | 371 | PEERINFO_MC_COUNTRY_FLAG, NULL, |
@@ -407,7 +407,7 @@ peerinfo_processor (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
407 | * @param ats_count number of performance records in 'ats' | 407 | * @param ats_count number of performance records in 'ats' |
408 | */ | 408 | */ |
409 | static void | 409 | static void |
410 | status_cb (void *cls, | 410 | status_cb (void *cls, |
411 | const struct GNUNET_HELLO_Address *address, | 411 | const struct GNUNET_HELLO_Address *address, |
412 | int address_active, | 412 | int address_active, |
413 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, | 413 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, |
@@ -438,7 +438,7 @@ status_cb (void *cls, | |||
438 | /** | 438 | /** |
439 | * Callback invoked if the application is supposed to exit. | 439 | * Callback invoked if the application is supposed to exit. |
440 | * | 440 | * |
441 | * @param object | 441 | * @param object |
442 | * @param user_data unused | 442 | * @param user_data unused |
443 | */ | 443 | */ |
444 | void | 444 | void |
@@ -462,7 +462,7 @@ load_led (const char *color) | |||
462 | char *fn; | 462 | char *fn; |
463 | 463 | ||
464 | dir = GNUNET_GTK_installation_get_path (GNUNET_OS_IPK_DATADIR); | 464 | dir = GNUNET_GTK_installation_get_path (GNUNET_OS_IPK_DATADIR); |
465 | GNUNET_asprintf (&fn, "%s%s.png", dir, | 465 | GNUNET_asprintf (&fn, "%s%s.png", dir, |
466 | color); | 466 | color); |
467 | GNUNET_free (dir); | 467 | GNUNET_free (dir); |
468 | pixbuf = gdk_pixbuf_new_from_file (fn, NULL); | 468 | pixbuf = gdk_pixbuf_new_from_file (fn, NULL); |
@@ -495,7 +495,7 @@ run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
495 | GNUNET_GTK_setup_nls (); | 495 | GNUNET_GTK_setup_nls (); |
496 | peer2info = GNUNET_CONTAINER_multihashmap_create (256, GNUNET_NO); | 496 | peer2info = GNUNET_CONTAINER_multihashmap_create (256, GNUNET_NO); |
497 | pnc = | 497 | pnc = |
498 | GNUNET_PEERINFO_notify (get_configuration (), | 498 | GNUNET_PEERINFO_notify (get_configuration (), |
499 | GNUNET_NO, | 499 | GNUNET_NO, |
500 | &peerinfo_processor, NULL); | 500 | &peerinfo_processor, NULL); |
501 | if (NULL == pnc) | 501 | if (NULL == pnc) |
diff --git a/src/setup/gnunet-setup-gns-edit.c b/src/setup/gnunet-setup-gns-edit.c index eb7f821b..d79f650f 100644 --- a/src/setup/gnunet-setup-gns-edit.c +++ b/src/setup/gnunet-setup-gns-edit.c | |||
@@ -35,9 +35,9 @@ enum ZoneListColumn | |||
35 | * A gchararray with the name of the zone for users. | 35 | * A gchararray with the name of the zone for users. |
36 | */ | 36 | */ |
37 | ZONELIST_COL_NAME = 0, | 37 | ZONELIST_COL_NAME = 0, |
38 | 38 | ||
39 | /** | 39 | /** |
40 | * A gchararray with the name of the configuration file option with | 40 | * A gchararray with the name of the configuration file option with |
41 | * the zone key. | 41 | * the zone key. |
42 | */ | 42 | */ |
43 | ZONELIST_COL_OPTION = 1 | 43 | ZONELIST_COL_OPTION = 1 |
@@ -51,7 +51,7 @@ enum ZoneListColumn | |||
51 | */ | 51 | */ |
52 | static void | 52 | static void |
53 | edit_dialog_disable_save (struct EditDialogContext *edc) | 53 | edit_dialog_disable_save (struct EditDialogContext *edc) |
54 | { | 54 | { |
55 | gtk_widget_set_sensitive (GTK_WIDGET (gtk_builder_get_object (edc->builder, | 55 | gtk_widget_set_sensitive (GTK_WIDGET (gtk_builder_get_object (edc->builder, |
56 | "edit_dialog_save_button")), | 56 | "edit_dialog_save_button")), |
57 | FALSE); | 57 | FALSE); |
@@ -65,7 +65,7 @@ edit_dialog_disable_save (struct EditDialogContext *edc) | |||
65 | */ | 65 | */ |
66 | static void | 66 | static void |
67 | edit_dialog_enable_save (struct EditDialogContext *edc) | 67 | edit_dialog_enable_save (struct EditDialogContext *edc) |
68 | { | 68 | { |
69 | gtk_widget_set_sensitive (GTK_WIDGET (gtk_builder_get_object (edc->builder, | 69 | gtk_widget_set_sensitive (GTK_WIDGET (gtk_builder_get_object (edc->builder, |
70 | "edit_dialog_save_button")), | 70 | "edit_dialog_save_button")), |
71 | TRUE); | 71 | TRUE); |
@@ -111,9 +111,9 @@ GNS_edit_dialog_expiration_relative_radiobutton_toggled_cb (GtkToggleButton *but | |||
111 | { | 111 | { |
112 | struct EditDialogContext *edc = user_data; | 112 | struct EditDialogContext *edc = user_data; |
113 | 113 | ||
114 | if (gtk_toggle_button_get_active (button)) | 114 | if (gtk_toggle_button_get_active (button)) |
115 | gtk_widget_show (GTK_WIDGET (gtk_builder_get_object (edc->builder, | 115 | gtk_widget_show (GTK_WIDGET (gtk_builder_get_object (edc->builder, |
116 | "edit_dialog_expiration_relative_combobox"))); | 116 | "edit_dialog_expiration_relative_combobox"))); |
117 | else | 117 | else |
118 | gtk_widget_hide (GTK_WIDGET (gtk_builder_get_object (edc->builder, | 118 | gtk_widget_hide (GTK_WIDGET (gtk_builder_get_object (edc->builder, |
119 | "edit_dialog_expiration_relative_combobox"))); | 119 | "edit_dialog_expiration_relative_combobox"))); |
@@ -146,7 +146,7 @@ GNS_edit_dialog_expiration_absolute_radiobutton_toggled_cb (GtkToggleButton *but | |||
146 | { | 146 | { |
147 | struct EditDialogContext *edc = user_data; | 147 | struct EditDialogContext *edc = user_data; |
148 | 148 | ||
149 | if (gtk_toggle_button_get_active (button)) | 149 | if (gtk_toggle_button_get_active (button)) |
150 | { | 150 | { |
151 | gtk_widget_show (GTK_WIDGET (gtk_builder_get_object (edc->builder, | 151 | gtk_widget_show (GTK_WIDGET (gtk_builder_get_object (edc->builder, |
152 | "edit_dialog_expiration_absolute_calendar"))); | 152 | "edit_dialog_expiration_absolute_calendar"))); |
@@ -235,14 +235,14 @@ edit_dialog_setup_common_elements (struct EditDialogContext *edc) | |||
235 | -1 /* position: append */, | 235 | -1 /* position: append */, |
236 | 0, GNUNET_STRINGS_relative_time_to_string (rt, GNUNET_NO), | 236 | 0, GNUNET_STRINGS_relative_time_to_string (rt, GNUNET_NO), |
237 | -1); | 237 | -1); |
238 | gtk_combo_box_set_active_iter (cb, &iter); | 238 | gtk_combo_box_set_active_iter (cb, &iter); |
239 | if ( (! edc->n_is_relative) && | 239 | if ( (! edc->n_is_relative) && |
240 | (GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us != edc->n_exp_time) ) | 240 | (GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us != edc->n_exp_time) ) |
241 | { | 241 | { |
242 | gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (edc->builder, | 242 | gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (edc->builder, |
243 | "edit_dialog_expiration_absolute_radiobutton")), | 243 | "edit_dialog_expiration_absolute_radiobutton")), |
244 | TRUE); | 244 | TRUE); |
245 | 245 | ||
246 | gtk_widget_hide (GTK_WIDGET (gtk_builder_get_object (edc->builder, | 246 | gtk_widget_hide (GTK_WIDGET (gtk_builder_get_object (edc->builder, |
247 | "edit_dialog_expiration_relative_combobox"))); | 247 | "edit_dialog_expiration_relative_combobox"))); |
248 | at.abs_value_us = edc->n_exp_time; | 248 | at.abs_value_us = edc->n_exp_time; |
@@ -258,7 +258,7 @@ edit_dialog_setup_common_elements (struct EditDialogContext *edc) | |||
258 | "edit_dialog_expiration_absolute_calendar")); | 258 | "edit_dialog_expiration_absolute_calendar")); |
259 | gtk_calendar_select_month (cal, | 259 | gtk_calendar_select_month (cal, |
260 | ymd->tm_mon, | 260 | ymd->tm_mon, |
261 | ymd->tm_year + 1900); | 261 | ymd->tm_year + 1900); |
262 | gtk_calendar_mark_day (cal, | 262 | gtk_calendar_mark_day (cal, |
263 | ymd->tm_mday); | 263 | ymd->tm_mday); |
264 | gtk_spin_button_set_value (GTK_SPIN_BUTTON (gtk_builder_get_object (edc->builder, | 264 | gtk_spin_button_set_value (GTK_SPIN_BUTTON (gtk_builder_get_object (edc->builder, |
@@ -289,7 +289,7 @@ edit_dialog_setup_common_elements (struct EditDialogContext *edc) | |||
289 | break; | 289 | break; |
290 | g_free (opt); | 290 | g_free (opt); |
291 | opt = NULL; | 291 | opt = NULL; |
292 | } while (gtk_tree_model_iter_next (tm, &iter)); | 292 | } while (gtk_tree_model_iter_next (tm, &iter)); |
293 | } | 293 | } |
294 | if (NULL != opt) | 294 | if (NULL != opt) |
295 | { | 295 | { |
@@ -302,7 +302,7 @@ edit_dialog_setup_common_elements (struct EditDialogContext *edc) | |||
302 | /** | 302 | /** |
303 | * Perform the reverse of the 'edit_dialog_setup_common_elements' function, | 303 | * Perform the reverse of the 'edit_dialog_setup_common_elements' function, |
304 | * that is, extract the values from the (common) widgets and store the | 304 | * that is, extract the values from the (common) widgets and store the |
305 | * values in 'edc'. | 305 | * values in 'edc'. |
306 | * | 306 | * |
307 | * @param edc edit dialog to extract data from | 307 | * @param edc edit dialog to extract data from |
308 | */ | 308 | */ |
@@ -313,7 +313,7 @@ edit_dialog_putes_common_elements (struct EditDialogContext *edc) | |||
313 | struct GNUNET_TIME_Relative rt; | 313 | struct GNUNET_TIME_Relative rt; |
314 | GtkComboBox *cb; | 314 | GtkComboBox *cb; |
315 | GtkTreeModel *tm; | 315 | GtkTreeModel *tm; |
316 | GtkTreeIter iter; | 316 | GtkTreeIter iter; |
317 | gchar *opt; | 317 | gchar *opt; |
318 | 318 | ||
319 | /* is public flag */ | 319 | /* is public flag */ |
@@ -322,7 +322,7 @@ edit_dialog_putes_common_elements (struct EditDialogContext *edc) | |||
322 | /* is shadow flag */ | 322 | /* is shadow flag */ |
323 | edc->n_is_shadow = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (edc->builder, | 323 | edc->n_is_shadow = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (edc->builder, |
324 | "edit_dialog_options_shadow_checkbutton"))); | 324 | "edit_dialog_options_shadow_checkbutton"))); |
325 | 325 | ||
326 | /* 'forever' expiration time */ | 326 | /* 'forever' expiration time */ |
327 | if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (edc->builder, | 327 | if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (edc->builder, |
328 | "edit_dialog_expiration_never_radiobutton")))) | 328 | "edit_dialog_expiration_never_radiobutton")))) |
@@ -330,7 +330,7 @@ edit_dialog_putes_common_elements (struct EditDialogContext *edc) | |||
330 | edc->n_exp_time = GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us; | 330 | edc->n_exp_time = GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us; |
331 | edc->n_is_relative = TRUE; /* doesn't matter, but make sure it is well-defined anyway */ | 331 | edc->n_is_relative = TRUE; /* doesn't matter, but make sure it is well-defined anyway */ |
332 | } | 332 | } |
333 | 333 | ||
334 | /* 'relative' expiration time */ | 334 | /* 'relative' expiration time */ |
335 | if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (edc->builder, | 335 | if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (edc->builder, |
336 | "edit_dialog_expiration_relative_radiobutton")))) | 336 | "edit_dialog_expiration_relative_radiobutton")))) |
@@ -343,7 +343,7 @@ edit_dialog_putes_common_elements (struct EditDialogContext *edc) | |||
343 | GNUNET_break (0); | 343 | GNUNET_break (0); |
344 | return; | 344 | return; |
345 | } | 345 | } |
346 | gtk_tree_model_get (tm, &iter, | 346 | gtk_tree_model_get (tm, &iter, |
347 | 0, &rt_s, | 347 | 0, &rt_s, |
348 | -1); | 348 | -1); |
349 | GNUNET_break (GNUNET_YES == | 349 | GNUNET_break (GNUNET_YES == |
@@ -365,7 +365,7 @@ edit_dialog_putes_common_elements (struct EditDialogContext *edc) | |||
365 | guint second; | 365 | guint second; |
366 | char fancydate[128]; | 366 | char fancydate[128]; |
367 | struct GNUNET_TIME_Absolute atime; | 367 | struct GNUNET_TIME_Absolute atime; |
368 | 368 | ||
369 | gtk_calendar_get_date (GTK_CALENDAR (gtk_builder_get_object (edc->builder, | 369 | gtk_calendar_get_date (GTK_CALENDAR (gtk_builder_get_object (edc->builder, |
370 | "edit_dialog_expiration_absolute_calendar")), | 370 | "edit_dialog_expiration_absolute_calendar")), |
371 | &year, &month, &day); | 371 | &year, &month, &day); |
@@ -378,8 +378,8 @@ edit_dialog_putes_common_elements (struct EditDialogContext *edc) | |||
378 | GNUNET_snprintf (fancydate, | 378 | GNUNET_snprintf (fancydate, |
379 | sizeof (fancydate), | 379 | sizeof (fancydate), |
380 | "%u-%u-%u %u:%u:%u", | 380 | "%u-%u-%u %u:%u:%u", |
381 | (unsigned int) year, | 381 | (unsigned int) year, |
382 | (unsigned int) month + 1, | 382 | (unsigned int) month + 1, |
383 | (unsigned int) day, | 383 | (unsigned int) day, |
384 | (unsigned int) hour, | 384 | (unsigned int) hour, |
385 | (unsigned int) minute, | 385 | (unsigned int) minute, |
@@ -476,7 +476,7 @@ GNS_edit_a_dialog_response_cb (GtkDialog *dialog, | |||
476 | struct EditDialogContext *edc = user_data; | 476 | struct EditDialogContext *edc = user_data; |
477 | GtkEntry *entry; | 477 | GtkEntry *entry; |
478 | const gchar *value; | 478 | const gchar *value; |
479 | 479 | ||
480 | if (GTK_RESPONSE_OK == response_id) | 480 | if (GTK_RESPONSE_OK == response_id) |
481 | { | 481 | { |
482 | edit_dialog_putes_common_elements (edc); | 482 | edit_dialog_putes_common_elements (edc); |
@@ -524,7 +524,7 @@ GNS_edit_dialog_a (struct EditDialogContext *edc) | |||
524 | { | 524 | { |
525 | GNUNET_break (0); | 525 | GNUNET_break (0); |
526 | edc->cont (edc, GTK_RESPONSE_CANCEL); /* treat as 'cancel' */ | 526 | edc->cont (edc, GTK_RESPONSE_CANCEL); /* treat as 'cancel' */ |
527 | return; | 527 | return; |
528 | } | 528 | } |
529 | if (GNUNET_YES == | 529 | if (GNUNET_YES == |
530 | edc->old_record_in_namestore) | 530 | edc->old_record_in_namestore) |
@@ -585,7 +585,7 @@ GNS_edit_aaaa_dialog_response_cb (GtkDialog *dialog, | |||
585 | struct EditDialogContext *edc = user_data; | 585 | struct EditDialogContext *edc = user_data; |
586 | GtkEntry *entry; | 586 | GtkEntry *entry; |
587 | const gchar *value; | 587 | const gchar *value; |
588 | 588 | ||
589 | if (GTK_RESPONSE_OK == response_id) | 589 | if (GTK_RESPONSE_OK == response_id) |
590 | { | 590 | { |
591 | edit_dialog_putes_common_elements (edc); | 591 | edit_dialog_putes_common_elements (edc); |
@@ -633,7 +633,7 @@ GNS_edit_dialog_aaaa (struct EditDialogContext *edc) | |||
633 | { | 633 | { |
634 | GNUNET_break (0); | 634 | GNUNET_break (0); |
635 | edc->cont (edc, GTK_RESPONSE_CANCEL); /* treat as 'cancel' */ | 635 | edc->cont (edc, GTK_RESPONSE_CANCEL); /* treat as 'cancel' */ |
636 | return; | 636 | return; |
637 | } | 637 | } |
638 | if (GNUNET_YES == | 638 | if (GNUNET_YES == |
639 | edc->old_record_in_namestore) | 639 | edc->old_record_in_namestore) |
@@ -693,7 +693,7 @@ GNS_edit_cname_dialog_response_cb (GtkDialog *dialog, | |||
693 | struct EditDialogContext *edc = user_data; | 693 | struct EditDialogContext *edc = user_data; |
694 | GtkEntry *entry; | 694 | GtkEntry *entry; |
695 | const gchar *value; | 695 | const gchar *value; |
696 | 696 | ||
697 | if (GTK_RESPONSE_OK == response_id) | 697 | if (GTK_RESPONSE_OK == response_id) |
698 | { | 698 | { |
699 | edit_dialog_putes_common_elements (edc); | 699 | edit_dialog_putes_common_elements (edc); |
@@ -741,7 +741,7 @@ GNS_edit_dialog_cname (struct EditDialogContext *edc) | |||
741 | { | 741 | { |
742 | GNUNET_break (0); | 742 | GNUNET_break (0); |
743 | edc->cont (edc, GTK_RESPONSE_CANCEL); /* treat as 'cancel' */ | 743 | edc->cont (edc, GTK_RESPONSE_CANCEL); /* treat as 'cancel' */ |
744 | return; | 744 | return; |
745 | } | 745 | } |
746 | if (GNUNET_YES == | 746 | if (GNUNET_YES == |
747 | edc->old_record_in_namestore) | 747 | edc->old_record_in_namestore) |
@@ -801,7 +801,7 @@ GNS_edit_leho_dialog_response_cb (GtkDialog *dialog, | |||
801 | struct EditDialogContext *edc = user_data; | 801 | struct EditDialogContext *edc = user_data; |
802 | GtkEntry *entry; | 802 | GtkEntry *entry; |
803 | const gchar *value; | 803 | const gchar *value; |
804 | 804 | ||
805 | if (GTK_RESPONSE_OK == response_id) | 805 | if (GTK_RESPONSE_OK == response_id) |
806 | { | 806 | { |
807 | edit_dialog_putes_common_elements (edc); | 807 | edit_dialog_putes_common_elements (edc); |
@@ -849,7 +849,7 @@ GNS_edit_dialog_leho (struct EditDialogContext *edc) | |||
849 | { | 849 | { |
850 | GNUNET_break (0); | 850 | GNUNET_break (0); |
851 | edc->cont (edc, GTK_RESPONSE_CANCEL); /* treat as 'cancel' */ | 851 | edc->cont (edc, GTK_RESPONSE_CANCEL); /* treat as 'cancel' */ |
852 | return; | 852 | return; |
853 | } | 853 | } |
854 | if (GNUNET_YES == | 854 | if (GNUNET_YES == |
855 | edc->old_record_in_namestore) | 855 | edc->old_record_in_namestore) |
@@ -911,7 +911,7 @@ GNS_edit_mx_dialog_response_cb (GtkDialog *dialog, | |||
911 | const gchar *value; | 911 | const gchar *value; |
912 | char *result; | 912 | char *result; |
913 | unsigned int distance; | 913 | unsigned int distance; |
914 | 914 | ||
915 | if (GTK_RESPONSE_OK == response_id) | 915 | if (GTK_RESPONSE_OK == response_id) |
916 | { | 916 | { |
917 | edit_dialog_putes_common_elements (edc); | 917 | edit_dialog_putes_common_elements (edc); |
@@ -922,8 +922,8 @@ GNS_edit_mx_dialog_response_cb (GtkDialog *dialog, | |||
922 | "edit_dialog_mx_distance_spinbutton"))); | 922 | "edit_dialog_mx_distance_spinbutton"))); |
923 | g_free (edc->n_value); | 923 | g_free (edc->n_value); |
924 | GNUNET_asprintf (&result, | 924 | GNUNET_asprintf (&result, |
925 | "%hu,%s", | 925 | "%hu,%s", |
926 | distance, | 926 | distance, |
927 | value); | 927 | value); |
928 | edc->n_value = g_strdup (result); | 928 | edc->n_value = g_strdup (result); |
929 | GNUNET_free (result); | 929 | GNUNET_free (result); |
@@ -969,12 +969,12 @@ GNS_edit_dialog_mx (struct EditDialogContext *edc) | |||
969 | { | 969 | { |
970 | GNUNET_break (0); | 970 | GNUNET_break (0); |
971 | edc->cont (edc, GTK_RESPONSE_CANCEL); /* treat as 'cancel' */ | 971 | edc->cont (edc, GTK_RESPONSE_CANCEL); /* treat as 'cancel' */ |
972 | return; | 972 | return; |
973 | } | 973 | } |
974 | if (GNUNET_YES == | 974 | if (GNUNET_YES == |
975 | edc->old_record_in_namestore) | 975 | edc->old_record_in_namestore) |
976 | { | 976 | { |
977 | if (2 != SSCANF(edc->n_value, | 977 | if (2 != SSCANF(edc->n_value, |
978 | "%hu,%253s", &mx_pref, result)) | 978 | "%hu,%253s", &mx_pref, result)) |
979 | { | 979 | { |
980 | GNUNET_break (0); | 980 | GNUNET_break (0); |
@@ -1042,7 +1042,7 @@ GNS_edit_ns_dialog_response_cb (GtkDialog *dialog, | |||
1042 | struct EditDialogContext *edc = user_data; | 1042 | struct EditDialogContext *edc = user_data; |
1043 | GtkEntry *entry; | 1043 | GtkEntry *entry; |
1044 | const gchar *value; | 1044 | const gchar *value; |
1045 | 1045 | ||
1046 | if (GTK_RESPONSE_OK == response_id) | 1046 | if (GTK_RESPONSE_OK == response_id) |
1047 | { | 1047 | { |
1048 | edit_dialog_putes_common_elements (edc); | 1048 | edit_dialog_putes_common_elements (edc); |
@@ -1090,7 +1090,7 @@ GNS_edit_dialog_ns (struct EditDialogContext *edc) | |||
1090 | { | 1090 | { |
1091 | GNUNET_break (0); | 1091 | GNUNET_break (0); |
1092 | edc->cont (edc, GTK_RESPONSE_CANCEL); /* treat as 'cancel' */ | 1092 | edc->cont (edc, GTK_RESPONSE_CANCEL); /* treat as 'cancel' */ |
1093 | return; | 1093 | return; |
1094 | } | 1094 | } |
1095 | if (GNUNET_YES == | 1095 | if (GNUNET_YES == |
1096 | edc->old_record_in_namestore) | 1096 | edc->old_record_in_namestore) |
@@ -1126,7 +1126,7 @@ edit_dialog_pkey_validity_check (struct EditDialogContext *edc) | |||
1126 | "edit_dialog_pkey_entry")), | 1126 | "edit_dialog_pkey_entry")), |
1127 | preedit = gtk_editable_get_chars (entry, 0, -1); | 1127 | preedit = gtk_editable_get_chars (entry, 0, -1); |
1128 | if ( (NULL == preedit) || | 1128 | if ( (NULL == preedit) || |
1129 | (GNUNET_OK != | 1129 | (GNUNET_OK != |
1130 | GNUNET_CRYPTO_ecc_public_sign_key_from_string (preedit, | 1130 | GNUNET_CRYPTO_ecc_public_sign_key_from_string (preedit, |
1131 | strlen (preedit), | 1131 | strlen (preedit), |
1132 | &pub)) ) | 1132 | &pub)) ) |
@@ -1154,7 +1154,7 @@ GNS_edit_pkey_dialog_response_cb (GtkDialog *dialog, | |||
1154 | struct EditDialogContext *edc = user_data; | 1154 | struct EditDialogContext *edc = user_data; |
1155 | GtkEntry *entry; | 1155 | GtkEntry *entry; |
1156 | const gchar *value; | 1156 | const gchar *value; |
1157 | 1157 | ||
1158 | if (GTK_RESPONSE_OK == response_id) | 1158 | if (GTK_RESPONSE_OK == response_id) |
1159 | { | 1159 | { |
1160 | edit_dialog_putes_common_elements (edc); | 1160 | edit_dialog_putes_common_elements (edc); |
@@ -1202,7 +1202,7 @@ GNS_edit_dialog_pkey (struct EditDialogContext *edc) | |||
1202 | { | 1202 | { |
1203 | GNUNET_break (0); | 1203 | GNUNET_break (0); |
1204 | edc->cont (edc, GTK_RESPONSE_CANCEL); /* treat as 'cancel' */ | 1204 | edc->cont (edc, GTK_RESPONSE_CANCEL); /* treat as 'cancel' */ |
1205 | return; | 1205 | return; |
1206 | } | 1206 | } |
1207 | if (GNUNET_YES == | 1207 | if (GNUNET_YES == |
1208 | edc->old_record_in_namestore) | 1208 | edc->old_record_in_namestore) |
@@ -1262,7 +1262,7 @@ GNS_edit_ptr_dialog_response_cb (GtkDialog *dialog, | |||
1262 | struct EditDialogContext *edc = user_data; | 1262 | struct EditDialogContext *edc = user_data; |
1263 | GtkEntry *entry; | 1263 | GtkEntry *entry; |
1264 | const gchar *value; | 1264 | const gchar *value; |
1265 | 1265 | ||
1266 | if (GTK_RESPONSE_OK == response_id) | 1266 | if (GTK_RESPONSE_OK == response_id) |
1267 | { | 1267 | { |
1268 | edit_dialog_putes_common_elements (edc); | 1268 | edit_dialog_putes_common_elements (edc); |
@@ -1310,7 +1310,7 @@ GNS_edit_dialog_ptr (struct EditDialogContext *edc) | |||
1310 | { | 1310 | { |
1311 | GNUNET_break (0); | 1311 | GNUNET_break (0); |
1312 | edc->cont (edc, GTK_RESPONSE_CANCEL); /* treat as 'cancel' */ | 1312 | edc->cont (edc, GTK_RESPONSE_CANCEL); /* treat as 'cancel' */ |
1313 | return; | 1313 | return; |
1314 | } | 1314 | } |
1315 | if (GNUNET_YES == | 1315 | if (GNUNET_YES == |
1316 | edc->old_record_in_namestore) | 1316 | edc->old_record_in_namestore) |
@@ -1392,7 +1392,7 @@ GNS_edit_soa_dialog_response_cb (GtkDialog *dialog, | |||
1392 | unsigned int soa_expire; | 1392 | unsigned int soa_expire; |
1393 | unsigned int soa_min; | 1393 | unsigned int soa_min; |
1394 | char *result; | 1394 | char *result; |
1395 | 1395 | ||
1396 | if (GTK_RESPONSE_OK == response_id) | 1396 | if (GTK_RESPONSE_OK == response_id) |
1397 | { | 1397 | { |
1398 | edit_dialog_putes_common_elements (edc); | 1398 | edit_dialog_putes_common_elements (edc); |
@@ -1412,12 +1412,12 @@ GNS_edit_soa_dialog_response_cb (GtkDialog *dialog, | |||
1412 | "edit_dialog_soa_expire_time_spinbutton"))); | 1412 | "edit_dialog_soa_expire_time_spinbutton"))); |
1413 | soa_min = gtk_spin_button_get_value (GTK_SPIN_BUTTON (gtk_builder_get_object (edc->builder, | 1413 | soa_min = gtk_spin_button_get_value (GTK_SPIN_BUTTON (gtk_builder_get_object (edc->builder, |
1414 | "edit_dialog_soa_minimum_ttl_spinbutton"))); | 1414 | "edit_dialog_soa_minimum_ttl_spinbutton"))); |
1415 | GNUNET_asprintf (&result, | 1415 | GNUNET_asprintf (&result, |
1416 | "rname=%s mname=%s %lu,%lu,%lu,%lu,%lu", | 1416 | "rname=%s mname=%s %lu,%lu,%lu,%lu,%lu", |
1417 | source_host, contact_email, | 1417 | source_host, contact_email, |
1418 | soa_serial, | 1418 | soa_serial, |
1419 | soa_refresh, | 1419 | soa_refresh, |
1420 | soa_retry, | 1420 | soa_retry, |
1421 | soa_expire, | 1421 | soa_expire, |
1422 | soa_min); | 1422 | soa_min); |
1423 | edc->n_value = g_strdup (result); | 1423 | edc->n_value = g_strdup (result); |
@@ -1486,12 +1486,12 @@ GNS_edit_dialog_soa (struct EditDialogContext *edc) | |||
1486 | { | 1486 | { |
1487 | GNUNET_break (0); | 1487 | GNUNET_break (0); |
1488 | edc->cont (edc, GTK_RESPONSE_CANCEL); /* treat as 'cancel' */ | 1488 | edc->cont (edc, GTK_RESPONSE_CANCEL); /* treat as 'cancel' */ |
1489 | return; | 1489 | return; |
1490 | } | 1490 | } |
1491 | if (GNUNET_YES == | 1491 | if (GNUNET_YES == |
1492 | edc->old_record_in_namestore) | 1492 | edc->old_record_in_namestore) |
1493 | { | 1493 | { |
1494 | if (7 != SSCANF (edc->n_value, | 1494 | if (7 != SSCANF (edc->n_value, |
1495 | "rname=%253s mname=%253s %u,%u,%u,%u,%u", | 1495 | "rname=%253s mname=%253s %u,%u,%u,%u,%u", |
1496 | soa_rname, soa_mname, | 1496 | soa_rname, soa_mname, |
1497 | &soa_serial, &soa_refresh, &soa_retry, &soa_expire, &soa_min)) | 1497 | &soa_serial, &soa_refresh, &soa_retry, &soa_expire, &soa_min)) |
@@ -1582,7 +1582,7 @@ GNS_edit_srv_dialog_response_cb (GtkDialog *dialog, | |||
1582 | gpointer user_data) | 1582 | gpointer user_data) |
1583 | { | 1583 | { |
1584 | struct EditDialogContext *edc = user_data; | 1584 | struct EditDialogContext *edc = user_data; |
1585 | 1585 | ||
1586 | if (GTK_RESPONSE_OK == response_id) | 1586 | if (GTK_RESPONSE_OK == response_id) |
1587 | { | 1587 | { |
1588 | edit_dialog_putes_common_elements (edc); | 1588 | edit_dialog_putes_common_elements (edc); |
@@ -1637,7 +1637,7 @@ GNS_edit_dialog_srv (struct EditDialogContext *edc) | |||
1637 | { | 1637 | { |
1638 | GNUNET_break (0); | 1638 | GNUNET_break (0); |
1639 | edc->cont (edc, GTK_RESPONSE_CANCEL); /* treat as 'cancel' */ | 1639 | edc->cont (edc, GTK_RESPONSE_CANCEL); /* treat as 'cancel' */ |
1640 | return; | 1640 | return; |
1641 | } | 1641 | } |
1642 | if (GNUNET_YES == | 1642 | if (GNUNET_YES == |
1643 | edc->old_record_in_namestore) | 1643 | edc->old_record_in_namestore) |
@@ -1688,7 +1688,7 @@ GNS_edit_txt_dialog_response_cb (GtkDialog *dialog, | |||
1688 | struct EditDialogContext *edc = user_data; | 1688 | struct EditDialogContext *edc = user_data; |
1689 | GtkEntry *entry; | 1689 | GtkEntry *entry; |
1690 | const gchar *value; | 1690 | const gchar *value; |
1691 | 1691 | ||
1692 | if (GTK_RESPONSE_OK == response_id) | 1692 | if (GTK_RESPONSE_OK == response_id) |
1693 | { | 1693 | { |
1694 | edit_dialog_putes_common_elements (edc); | 1694 | edit_dialog_putes_common_elements (edc); |
@@ -1736,7 +1736,7 @@ GNS_edit_dialog_txt (struct EditDialogContext *edc) | |||
1736 | { | 1736 | { |
1737 | GNUNET_break (0); | 1737 | GNUNET_break (0); |
1738 | edc->cont (edc, GTK_RESPONSE_CANCEL); /* treat as 'cancel' */ | 1738 | edc->cont (edc, GTK_RESPONSE_CANCEL); /* treat as 'cancel' */ |
1739 | return; | 1739 | return; |
1740 | } | 1740 | } |
1741 | if (GNUNET_YES == | 1741 | if (GNUNET_YES == |
1742 | edc->old_record_in_namestore) | 1742 | edc->old_record_in_namestore) |
@@ -1767,12 +1767,12 @@ edit_dialog_vpn_validity_check (struct EditDialogContext *edc) | |||
1767 | GtkEditable *entry; | 1767 | GtkEditable *entry; |
1768 | const gchar *preedit; | 1768 | const gchar *preedit; |
1769 | struct GNUNET_HashCode hc; | 1769 | struct GNUNET_HashCode hc; |
1770 | 1770 | ||
1771 | entry = GTK_EDITABLE (gtk_builder_get_object (edc->builder, | 1771 | entry = GTK_EDITABLE (gtk_builder_get_object (edc->builder, |
1772 | "edit_dialog_vpn_peer_entry")), | 1772 | "edit_dialog_vpn_peer_entry")), |
1773 | preedit = gtk_editable_get_chars (entry, 0, -1); | 1773 | preedit = gtk_editable_get_chars (entry, 0, -1); |
1774 | if ( (NULL == preedit) || | 1774 | if ( (NULL == preedit) || |
1775 | (GNUNET_OK != | 1775 | (GNUNET_OK != |
1776 | GNUNET_CRYPTO_hash_from_string (preedit, &hc)) ) | 1776 | GNUNET_CRYPTO_hash_from_string (preedit, &hc)) ) |
1777 | { | 1777 | { |
1778 | edit_dialog_disable_save (edc); | 1778 | edit_dialog_disable_save (edc); |
@@ -1801,7 +1801,7 @@ GNS_edit_vpn_dialog_response_cb (GtkDialog *dialog, | |||
1801 | const gchar *peer; | 1801 | const gchar *peer; |
1802 | unsigned int proto; | 1802 | unsigned int proto; |
1803 | char *result; | 1803 | char *result; |
1804 | 1804 | ||
1805 | if (GTK_RESPONSE_OK == response_id) | 1805 | if (GTK_RESPONSE_OK == response_id) |
1806 | { | 1806 | { |
1807 | edit_dialog_putes_common_elements (edc); | 1807 | edit_dialog_putes_common_elements (edc); |
@@ -1813,7 +1813,7 @@ GNS_edit_vpn_dialog_response_cb (GtkDialog *dialog, | |||
1813 | peer = gtk_entry_get_text (entry); | 1813 | peer = gtk_entry_get_text (entry); |
1814 | proto = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (edc->builder, | 1814 | proto = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (edc->builder, |
1815 | "edit_dialog_vpn_protocol_tcp_radiobutton"))) ? IPPROTO_TCP : IPPROTO_UDP; | 1815 | "edit_dialog_vpn_protocol_tcp_radiobutton"))) ? IPPROTO_TCP : IPPROTO_UDP; |
1816 | GNUNET_asprintf (&result, | 1816 | GNUNET_asprintf (&result, |
1817 | "%u %s %s", | 1817 | "%u %s %s", |
1818 | proto, | 1818 | proto, |
1819 | (const char *) peer, | 1819 | (const char *) peer, |
@@ -1857,14 +1857,14 @@ GNS_edit_dialog_vpn (struct EditDialogContext *edc) | |||
1857 | char s_peer[103 + 1]; | 1857 | char s_peer[103 + 1]; |
1858 | char s_serv[253 + 1]; | 1858 | char s_serv[253 + 1]; |
1859 | unsigned int proto; | 1859 | unsigned int proto; |
1860 | 1860 | ||
1861 | edc->builder = GNUNET_GTK_get_new_builder ("gnunet_setup_gns_edit_vpn.glade", | 1861 | edc->builder = GNUNET_GTK_get_new_builder ("gnunet_setup_gns_edit_vpn.glade", |
1862 | edc); | 1862 | edc); |
1863 | if (NULL == edc->builder) | 1863 | if (NULL == edc->builder) |
1864 | { | 1864 | { |
1865 | GNUNET_break (0); | 1865 | GNUNET_break (0); |
1866 | edc->cont (edc, GTK_RESPONSE_CANCEL); /* treat as 'cancel' */ | 1866 | edc->cont (edc, GTK_RESPONSE_CANCEL); /* treat as 'cancel' */ |
1867 | return; | 1867 | return; |
1868 | } | 1868 | } |
1869 | if (GNUNET_YES == | 1869 | if (GNUNET_YES == |
1870 | edc->old_record_in_namestore) | 1870 | edc->old_record_in_namestore) |
@@ -1885,7 +1885,7 @@ GNS_edit_dialog_vpn (struct EditDialogContext *edc) | |||
1885 | gtk_entry_set_text (GTK_ENTRY (gtk_builder_get_object (edc->builder, | 1885 | gtk_entry_set_text (GTK_ENTRY (gtk_builder_get_object (edc->builder, |
1886 | "edit_dialog_vpn_peer_entry")), | 1886 | "edit_dialog_vpn_peer_entry")), |
1887 | s_peer); | 1887 | s_peer); |
1888 | if (IPPROTO_UDP == proto) | 1888 | if (IPPROTO_UDP == proto) |
1889 | gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (edc->builder, | 1889 | gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (edc->builder, |
1890 | "edit_dialog_vpn_protocol_udp_radiobutton")), TRUE); | 1890 | "edit_dialog_vpn_protocol_udp_radiobutton")), TRUE); |
1891 | else | 1891 | else |
diff --git a/src/setup/gnunet-setup-gns.c b/src/setup/gnunet-setup-gns.c index 7d62b2a6..2185da3a 100644 --- a/src/setup/gnunet-setup-gns.c +++ b/src/setup/gnunet-setup-gns.c | |||
@@ -109,7 +109,7 @@ enum GNSTreestoreColumn | |||
109 | GNS_TREESTORE_COL_VAL_COLOR, | 109 | GNS_TREESTORE_COL_VAL_COLOR, |
110 | 110 | ||
111 | /** | 111 | /** |
112 | * A gboolean; TRUE if the 'name' column should be shown, | 112 | * A gboolean; TRUE if the 'name' column should be shown, |
113 | * FALSE for the lines with the individual records under a name. | 113 | * FALSE for the lines with the individual records under a name. |
114 | */ | 114 | */ |
115 | GNS_TREESTORE_COL_NAME_IS_VISIBLE, | 115 | GNS_TREESTORE_COL_NAME_IS_VISIBLE, |
@@ -255,7 +255,7 @@ struct MoveOperationContext | |||
255 | */ | 255 | */ |
256 | struct RecordInfo | 256 | struct RecordInfo |
257 | { | 257 | { |
258 | 258 | ||
259 | /** | 259 | /** |
260 | * Name for this record. | 260 | * Name for this record. |
261 | */ | 261 | */ |
@@ -273,7 +273,7 @@ struct RecordInfo | |||
273 | 273 | ||
274 | /** | 274 | /** |
275 | * Number of bytes in 'data'. | 275 | * Number of bytes in 'data'. |
276 | */ | 276 | */ |
277 | size_t data_size; | 277 | size_t data_size; |
278 | 278 | ||
279 | /** | 279 | /** |
@@ -340,12 +340,12 @@ static GtkTreeView *tv; | |||
340 | 340 | ||
341 | /** | 341 | /** |
342 | * Private key of the zone we are currently editing. | 342 | * Private key of the zone we are currently editing. |
343 | */ | 343 | */ |
344 | static struct GNUNET_CRYPTO_EccPrivateKey *pkey; | 344 | static struct GNUNET_CRYPTO_EccPrivateKey *pkey; |
345 | 345 | ||
346 | /** | 346 | /** |
347 | * Public key of the zone we are currently editing. | 347 | * Public key of the zone we are currently editing. |
348 | */ | 348 | */ |
349 | static struct GNUNET_CRYPTO_EccPublicSignKey pubkey; | 349 | static struct GNUNET_CRYPTO_EccPublicSignKey pubkey; |
350 | 350 | ||
351 | /** | 351 | /** |
@@ -355,7 +355,7 @@ static char *current_pseudonym; | |||
355 | 355 | ||
356 | /** | 356 | /** |
357 | * Pointer to name of the configuration option that gives the | 357 | * Pointer to name of the configuration option that gives the |
358 | * zone key for the zone we are editing right now. | 358 | * zone key for the zone we are editing right now. |
359 | */ | 359 | */ |
360 | static const char *current_zone_option; | 360 | static const char *current_zone_option; |
361 | 361 | ||
@@ -407,7 +407,7 @@ create_qrcode (unsigned int scale) | |||
407 | return NULL; | 407 | return NULL; |
408 | } | 408 | } |
409 | entry = GTK_ENTRY (GNUNET_SETUP_get_object ("GNUNET_setup_gns_pseu_entry")); | 409 | entry = GTK_ENTRY (GNUNET_SETUP_get_object ("GNUNET_setup_gns_pseu_entry")); |
410 | pseu = gtk_entry_get_text (GTK_ENTRY(entry)); | 410 | pseu = gtk_entry_get_text (GTK_ENTRY(entry)); |
411 | GNUNET_asprintf (&str, | 411 | GNUNET_asprintf (&str, |
412 | "gnunet://gns/%s/%s\n", | 412 | "gnunet://gns/%s/%s\n", |
413 | GNUNET_NAMESTORE_z2s (&pubkey), | 413 | GNUNET_NAMESTORE_z2s (&pubkey), |
@@ -467,7 +467,7 @@ create_qrcode (unsigned int scale) | |||
467 | /** | 467 | /** |
468 | * Create the QR code image for our zone. | 468 | * Create the QR code image for our zone. |
469 | */ | 469 | */ |
470 | static void | 470 | static void |
471 | setup_qrcode () | 471 | setup_qrcode () |
472 | { | 472 | { |
473 | GdkPixbuf *pb; | 473 | GdkPixbuf *pb; |
@@ -511,7 +511,7 @@ GNUNET_setup_qr_save_as_dialog_response_cb (GtkDialog *dialog, | |||
511 | 511 | ||
512 | if (GTK_RESPONSE_OK != response_id) | 512 | if (GTK_RESPONSE_OK != response_id) |
513 | { | 513 | { |
514 | gtk_widget_destroy (GTK_WIDGET (dialog)); | 514 | gtk_widget_destroy (GTK_WIDGET (dialog)); |
515 | g_object_unref (G_OBJECT (builder)); | 515 | g_object_unref (G_OBJECT (builder)); |
516 | return; | 516 | return; |
517 | } | 517 | } |
@@ -523,13 +523,13 @@ GNUNET_setup_qr_save_as_dialog_response_cb (GtkDialog *dialog, | |||
523 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, _("Failed to initialize QR-code pixbuf")); | 523 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, _("Failed to initialize QR-code pixbuf")); |
524 | return; | 524 | return; |
525 | } | 525 | } |
526 | gdk_pixbuf_save (pb, | 526 | gdk_pixbuf_save (pb, |
527 | filename, | 527 | filename, |
528 | "png", | 528 | "png", |
529 | NULL, NULL); | 529 | NULL, NULL); |
530 | g_free (filename); | 530 | g_free (filename); |
531 | g_object_unref (pb); | 531 | g_object_unref (pb); |
532 | gtk_widget_destroy (GTK_WIDGET (dialog)); | 532 | gtk_widget_destroy (GTK_WIDGET (dialog)); |
533 | g_object_unref (G_OBJECT (builder)); | 533 | g_object_unref (G_OBJECT (builder)); |
534 | #else | 534 | #else |
535 | GNUNET_break (0); | 535 | GNUNET_break (0); |
@@ -552,7 +552,7 @@ GNUNET_setup_gns_qr_saveas_button_clicked_cb (GtkButton *button, | |||
552 | char *suggestion; | 552 | char *suggestion; |
553 | 553 | ||
554 | entry = GTK_ENTRY (GNUNET_SETUP_get_object ("GNUNET_setup_gns_pseu_entry")); | 554 | entry = GTK_ENTRY (GNUNET_SETUP_get_object ("GNUNET_setup_gns_pseu_entry")); |
555 | pseu = gtk_entry_get_text (GTK_ENTRY(entry)); | 555 | pseu = gtk_entry_get_text (GTK_ENTRY(entry)); |
556 | builder = | 556 | builder = |
557 | GNUNET_GTK_get_new_builder ("gnunet_setup_qr_save_as_dialog.glade", | 557 | GNUNET_GTK_get_new_builder ("gnunet_setup_qr_save_as_dialog.glade", |
558 | NULL); | 558 | NULL); |
@@ -563,7 +563,7 @@ GNUNET_setup_gns_qr_saveas_button_clicked_cb (GtkButton *button, | |||
563 | } | 563 | } |
564 | GNUNET_asprintf (&suggestion, | 564 | GNUNET_asprintf (&suggestion, |
565 | "%s.png", | 565 | "%s.png", |
566 | pseu); | 566 | pseu); |
567 | dialog = GTK_WINDOW (gtk_builder_get_object | 567 | dialog = GTK_WINDOW (gtk_builder_get_object |
568 | (builder, "GNUNET_setup_qr_save_as_dialog")); | 568 | (builder, "GNUNET_setup_qr_save_as_dialog")); |
569 | gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (dialog), | 569 | gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (dialog), |
@@ -602,7 +602,7 @@ check_record_permitted (unsigned int rd_count, | |||
602 | return GNUNET_NO; | 602 | return GNUNET_NO; |
603 | case GNUNET_NAMESTORE_TYPE_PKEY: | 603 | case GNUNET_NAMESTORE_TYPE_PKEY: |
604 | return GNUNET_NO; | 604 | return GNUNET_NO; |
605 | default: | 605 | default: |
606 | break; | 606 | break; |
607 | } | 607 | } |
608 | } | 608 | } |
@@ -613,14 +613,14 @@ check_record_permitted (unsigned int rd_count, | |||
613 | case GNUNET_DNSPARSER_TYPE_CNAME: | 613 | case GNUNET_DNSPARSER_TYPE_CNAME: |
614 | return GNUNET_NO; | 614 | return GNUNET_NO; |
615 | case GNUNET_DNSPARSER_TYPE_NS: | 615 | case GNUNET_DNSPARSER_TYPE_NS: |
616 | for (i=0;i<rd_count;i++) | 616 | for (i=0;i<rd_count;i++) |
617 | if ( (GNUNET_DNSPARSER_TYPE_A != rd[i].record_type) && | 617 | if ( (GNUNET_DNSPARSER_TYPE_A != rd[i].record_type) && |
618 | (GNUNET_DNSPARSER_TYPE_AAAA != rd[i].record_type) ) | 618 | (GNUNET_DNSPARSER_TYPE_AAAA != rd[i].record_type) ) |
619 | return GNUNET_NO; | 619 | return GNUNET_NO; |
620 | return GNUNET_OK; | 620 | return GNUNET_OK; |
621 | case GNUNET_NAMESTORE_TYPE_PKEY: | 621 | case GNUNET_NAMESTORE_TYPE_PKEY: |
622 | return GNUNET_NO; | 622 | return GNUNET_NO; |
623 | default: | 623 | default: |
624 | break; | 624 | break; |
625 | } | 625 | } |
626 | return GNUNET_OK; | 626 | return GNUNET_OK; |
@@ -634,7 +634,7 @@ check_record_permitted (unsigned int rd_count, | |||
634 | * @param success GNUNET_OK if the operation succeeded | 634 | * @param success GNUNET_OK if the operation succeeded |
635 | * @param emsg error message if the operation failed | 635 | * @param emsg error message if the operation failed |
636 | */ | 636 | */ |
637 | static void | 637 | static void |
638 | operation_done_cont (void *cls, | 638 | operation_done_cont (void *cls, |
639 | int32_t success, | 639 | int32_t success, |
640 | const char *emsg) | 640 | const char *emsg) |
@@ -642,7 +642,7 @@ operation_done_cont (void *cls, | |||
642 | struct OperationContext *oc = cls; | 642 | struct OperationContext *oc = cls; |
643 | GtkWidget *dialog; | 643 | GtkWidget *dialog; |
644 | GtkWindow *main_window; | 644 | GtkWindow *main_window; |
645 | 645 | ||
646 | oc->qe = NULL; | 646 | oc->qe = NULL; |
647 | GNUNET_CONTAINER_DLL_remove (oc_head, | 647 | GNUNET_CONTAINER_DLL_remove (oc_head, |
648 | oc_tail, | 648 | oc_tail, |
@@ -745,7 +745,7 @@ show_error_message (const char *title, | |||
745 | title, | 745 | title, |
746 | emsg)); | 746 | emsg)); |
747 | g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL); | 747 | g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL); |
748 | gtk_widget_show_all (GTK_WIDGET(dialog)); | 748 | gtk_widget_show_all (GTK_WIDGET(dialog)); |
749 | } | 749 | } |
750 | 750 | ||
751 | 751 | ||
@@ -760,7 +760,7 @@ free_edit_dialog_context (struct EditDialogContext *edc) | |||
760 | g_free (edc->name); | 760 | g_free (edc->name); |
761 | g_free (edc->n_value); | 761 | g_free (edc->n_value); |
762 | g_free (edc->new_zone_option); | 762 | g_free (edc->new_zone_option); |
763 | GNUNET_free (edc); | 763 | GNUNET_free (edc); |
764 | } | 764 | } |
765 | 765 | ||
766 | 766 | ||
@@ -801,7 +801,7 @@ merge_with_existing_records (void *cls, | |||
801 | /* FIXME: sanity-check merge... */ | 801 | /* FIXME: sanity-check merge... */ |
802 | oc = GNUNET_new (struct OperationContext); | 802 | oc = GNUNET_new (struct OperationContext); |
803 | GNUNET_CONTAINER_DLL_insert (oc_head, oc_tail, oc); | 803 | GNUNET_CONTAINER_DLL_insert (oc_head, oc_tail, oc); |
804 | oc->qe = GNUNET_NAMESTORE_records_store (namestore, | 804 | oc->qe = GNUNET_NAMESTORE_records_store (namestore, |
805 | moc->pk, | 805 | moc->pk, |
806 | edc->name, | 806 | edc->name, |
807 | rd_count + 1, | 807 | rd_count + 1, |
@@ -849,7 +849,7 @@ decrypt_block_for_merge (void *cls, | |||
849 | 849 | ||
850 | 850 | ||
851 | /** | 851 | /** |
852 | * The edit dialog completed; update the namestore and the | 852 | * The edit dialog completed; update the namestore and the |
853 | * view based on the new values in 'edc'. | 853 | * view based on the new values in 'edc'. |
854 | * | 854 | * |
855 | * @param edc editing context information | 855 | * @param edc editing context information |
@@ -866,7 +866,7 @@ edit_dialog_continuation (struct EditDialogContext *edc, | |||
866 | void *data; | 866 | void *data; |
867 | size_t data_size; | 867 | size_t data_size; |
868 | struct OperationContext *oc; | 868 | struct OperationContext *oc; |
869 | 869 | ||
870 | if ( (NULL != ri) && | 870 | if ( (NULL != ri) && |
871 | (GNUNET_OK != | 871 | (GNUNET_OK != |
872 | GNUNET_NAMESTORE_records_deserialize (ri->data_size, | 872 | GNUNET_NAMESTORE_records_deserialize (ri->data_size, |
@@ -884,8 +884,8 @@ edit_dialog_continuation (struct EditDialogContext *edc, | |||
884 | free_edit_dialog_context (edc); | 884 | free_edit_dialog_context (edc); |
885 | return; | 885 | return; |
886 | } | 886 | } |
887 | if (GNUNET_OK != GNUNET_NAMESTORE_string_to_value (edc->record_type, edc->n_value, | 887 | if (GNUNET_OK != GNUNET_NAMESTORE_string_to_value (edc->record_type, edc->n_value, |
888 | &data, &data_size)) | 888 | &data, &data_size)) |
889 | { | 889 | { |
890 | GNUNET_break (0); | 890 | GNUNET_break (0); |
891 | free_edit_dialog_context (edc); | 891 | free_edit_dialog_context (edc); |
@@ -911,12 +911,12 @@ edit_dialog_continuation (struct EditDialogContext *edc, | |||
911 | /* remove item from tree view and namestore */ | 911 | /* remove item from tree view and namestore */ |
912 | struct GNUNET_NAMESTORE_RecordData rd_new[rd_count - 1]; | 912 | struct GNUNET_NAMESTORE_RecordData rd_new[rd_count - 1]; |
913 | 913 | ||
914 | GNUNET_assert (NULL != ri); | 914 | GNUNET_assert (NULL != ri); |
915 | memcpy (rd_new, rd_old, (rd_count - 1) * sizeof (struct GNUNET_NAMESTORE_RecordData)); | 915 | memcpy (rd_new, rd_old, (rd_count - 1) * sizeof (struct GNUNET_NAMESTORE_RecordData)); |
916 | rd_new[edc->off] = rd_old[rd_count - 1]; | 916 | rd_new[edc->off] = rd_old[rd_count - 1]; |
917 | oc = GNUNET_new (struct OperationContext); | 917 | oc = GNUNET_new (struct OperationContext); |
918 | GNUNET_CONTAINER_DLL_insert (oc_head, oc_tail, oc); | 918 | GNUNET_CONTAINER_DLL_insert (oc_head, oc_tail, oc); |
919 | oc->qe = GNUNET_NAMESTORE_records_store (namestore, | 919 | oc->qe = GNUNET_NAMESTORE_records_store (namestore, |
920 | pkey, edc->name, | 920 | pkey, edc->name, |
921 | rd_count + 1, | 921 | rd_count + 1, |
922 | rd_new, | 922 | rd_new, |
@@ -942,7 +942,7 @@ edit_dialog_continuation (struct EditDialogContext *edc, | |||
942 | rd_new[edc->off] = rd; | 942 | rd_new[edc->off] = rd; |
943 | oc = GNUNET_new (struct OperationContext); | 943 | oc = GNUNET_new (struct OperationContext); |
944 | GNUNET_CONTAINER_DLL_insert (oc_head, oc_tail, oc); | 944 | GNUNET_CONTAINER_DLL_insert (oc_head, oc_tail, oc); |
945 | oc->qe = GNUNET_NAMESTORE_records_store (namestore, | 945 | oc->qe = GNUNET_NAMESTORE_records_store (namestore, |
946 | pkey, edc->name, | 946 | pkey, edc->name, |
947 | rd_count, | 947 | rd_count, |
948 | rd_new, | 948 | rd_new, |
@@ -956,7 +956,7 @@ edit_dialog_continuation (struct EditDialogContext *edc, | |||
956 | rd_new[rd_count] = rd; | 956 | rd_new[rd_count] = rd; |
957 | oc = GNUNET_new (struct OperationContext); | 957 | oc = GNUNET_new (struct OperationContext); |
958 | GNUNET_CONTAINER_DLL_insert (oc_head, oc_tail, oc); | 958 | GNUNET_CONTAINER_DLL_insert (oc_head, oc_tail, oc); |
959 | oc->qe = GNUNET_NAMESTORE_records_store (namestore, | 959 | oc->qe = GNUNET_NAMESTORE_records_store (namestore, |
960 | pkey, edc->name, | 960 | pkey, edc->name, |
961 | rd_count + 1, | 961 | rd_count + 1, |
962 | rd_new, | 962 | rd_new, |
@@ -969,7 +969,7 @@ edit_dialog_continuation (struct EditDialogContext *edc, | |||
969 | struct GNUNET_CRYPTO_EccPrivateKey *pk; | 969 | struct GNUNET_CRYPTO_EccPrivateKey *pk; |
970 | struct MoveOperationContext *moc; | 970 | struct MoveOperationContext *moc; |
971 | struct GNUNET_HashCode query; | 971 | struct GNUNET_HashCode query; |
972 | 972 | ||
973 | /* determine target zone */ | 973 | /* determine target zone */ |
974 | if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_filename (cfg, | 974 | if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_filename (cfg, |
975 | "gns", | 975 | "gns", |
@@ -978,8 +978,8 @@ edit_dialog_continuation (struct EditDialogContext *edc, | |||
978 | { | 978 | { |
979 | char *emsg; | 979 | char *emsg; |
980 | 980 | ||
981 | GNUNET_asprintf (&emsg, | 981 | GNUNET_asprintf (&emsg, |
982 | _("Option `%s' missing in section `%s'\n"), | 982 | _("Option `%s' missing in section `%s'\n"), |
983 | edc->new_zone_option, "gns"); | 983 | edc->new_zone_option, "gns"); |
984 | show_error_message (_("Failed to access key for target zone"), | 984 | show_error_message (_("Failed to access key for target zone"), |
985 | emsg); | 985 | emsg); |
@@ -1003,10 +1003,10 @@ edit_dialog_continuation (struct EditDialogContext *edc, | |||
1003 | moc->pk = pk; | 1003 | moc->pk = pk; |
1004 | GNUNET_CONTAINER_DLL_insert (moc_head, moc_tail, moc); | 1004 | GNUNET_CONTAINER_DLL_insert (moc_head, moc_tail, moc); |
1005 | 1005 | ||
1006 | moc->qe = GNUNET_NAMESTORE_lookup_block (namestore, | 1006 | moc->qe = GNUNET_NAMESTORE_lookup_block (namestore, |
1007 | &query, | 1007 | &query, |
1008 | &decrypt_block_for_merge, | 1008 | &decrypt_block_for_merge, |
1009 | moc); | 1009 | moc); |
1010 | /* zone changed, remove record from old zone, add to new zone! */ | 1010 | /* zone changed, remove record from old zone, add to new zone! */ |
1011 | if (GNUNET_YES == edc->old_record_in_namestore) | 1011 | if (GNUNET_YES == edc->old_record_in_namestore) |
1012 | { | 1012 | { |
@@ -1018,7 +1018,7 @@ edit_dialog_continuation (struct EditDialogContext *edc, | |||
1018 | rd_new[edc->off] = rd_old[rd_count - 1]; | 1018 | rd_new[edc->off] = rd_old[rd_count - 1]; |
1019 | oc = GNUNET_new (struct OperationContext); | 1019 | oc = GNUNET_new (struct OperationContext); |
1020 | GNUNET_CONTAINER_DLL_insert (oc_head, oc_tail, oc); | 1020 | GNUNET_CONTAINER_DLL_insert (oc_head, oc_tail, oc); |
1021 | oc->qe = GNUNET_NAMESTORE_records_store (namestore, | 1021 | oc->qe = GNUNET_NAMESTORE_records_store (namestore, |
1022 | pkey, edc->name, | 1022 | pkey, edc->name, |
1023 | rd_count - 1, | 1023 | rd_count - 1, |
1024 | rd_new, | 1024 | rd_new, |
@@ -1060,7 +1060,7 @@ launch_edit_dialog (gint n_type, | |||
1060 | (off < ri->rd_count) ) | 1060 | (off < ri->rd_count) ) |
1061 | { | 1061 | { |
1062 | struct GNUNET_NAMESTORE_RecordData rd_old[ri->rd_count]; | 1062 | struct GNUNET_NAMESTORE_RecordData rd_old[ri->rd_count]; |
1063 | 1063 | ||
1064 | GNUNET_break (GNUNET_OK == | 1064 | GNUNET_break (GNUNET_OK == |
1065 | GNUNET_NAMESTORE_records_deserialize (ri->data_size, | 1065 | GNUNET_NAMESTORE_records_deserialize (ri->data_size, |
1066 | ri->data, | 1066 | ri->data, |
@@ -1127,7 +1127,7 @@ launch_edit_dialog (gint n_type, | |||
1127 | default: | 1127 | default: |
1128 | GNUNET_break (0); | 1128 | GNUNET_break (0); |
1129 | edit_dialog_continuation (edc, | 1129 | edit_dialog_continuation (edc, |
1130 | GTK_RESPONSE_CANCEL); | 1130 | GTK_RESPONSE_CANCEL); |
1131 | break; | 1131 | break; |
1132 | } | 1132 | } |
1133 | } | 1133 | } |
@@ -1146,7 +1146,7 @@ check_permissions (struct RecordInfo *ri, | |||
1146 | guint n_type) | 1146 | guint n_type) |
1147 | { | 1147 | { |
1148 | struct GNUNET_NAMESTORE_RecordData rd[ri->rd_count]; | 1148 | struct GNUNET_NAMESTORE_RecordData rd[ri->rd_count]; |
1149 | 1149 | ||
1150 | GNUNET_break (GNUNET_OK == | 1150 | GNUNET_break (GNUNET_OK == |
1151 | GNUNET_NAMESTORE_records_deserialize (ri->data_size, | 1151 | GNUNET_NAMESTORE_records_deserialize (ri->data_size, |
1152 | ri->data, | 1152 | ri->data, |
@@ -1172,7 +1172,7 @@ check_permissions (struct RecordInfo *ri, | |||
1172 | * selected row. | 1172 | * selected row. |
1173 | * | 1173 | * |
1174 | * @param widget the GtkTreeView | 1174 | * @param widget the GtkTreeView |
1175 | * @param user_data main window builder | 1175 | * @param user_data main window builder |
1176 | */ | 1176 | */ |
1177 | void | 1177 | void |
1178 | GNUNET_setup_gns_popup_edit_button_activate_cb (GtkWidget *widget, | 1178 | GNUNET_setup_gns_popup_edit_button_activate_cb (GtkWidget *widget, |
@@ -1298,8 +1298,8 @@ GNUNET_setup_gns_name_cellrenderertext_edited_cb (GtkCellRendererText *renderer, | |||
1298 | struct RecordInfo *ri; | 1298 | struct RecordInfo *ri; |
1299 | struct GNUNET_HashCode name_hash; | 1299 | struct GNUNET_HashCode name_hash; |
1300 | 1300 | ||
1301 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1301 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1302 | "New text for `%s' is `%s'\n", | 1302 | "New text for `%s' is `%s'\n", |
1303 | path, new_text); | 1303 | path, new_text); |
1304 | if ((0 == strcmp (new_text, NEW_NAME_STR)) || (0 == strcmp (new_text, ""))) | 1304 | if ((0 == strcmp (new_text, NEW_NAME_STR)) || (0 == strcmp (new_text, ""))) |
1305 | return; | 1305 | return; |
@@ -1315,13 +1315,13 @@ GNUNET_setup_gns_name_cellrenderertext_edited_cb (GtkCellRendererText *renderer, | |||
1315 | } | 1315 | } |
1316 | gtk_tree_model_get_iter_from_string (tm, &it, path); | 1316 | gtk_tree_model_get_iter_from_string (tm, &it, path); |
1317 | gtk_tree_model_get (tm, &it, | 1317 | gtk_tree_model_get (tm, &it, |
1318 | GNS_TREESTORE_COL_NOT_DUMMY_ROW, ¬_dummy, | 1318 | GNS_TREESTORE_COL_NOT_DUMMY_ROW, ¬_dummy, |
1319 | GNS_TREESTORE_COL_NAME, &name, | 1319 | GNS_TREESTORE_COL_NAME, &name, |
1320 | -1); | 1320 | -1); |
1321 | GNUNET_break (! not_dummy); | 1321 | GNUNET_break (! not_dummy); |
1322 | GNUNET_break (0 == strcmp (name, _(NEW_NAME_STR))); | 1322 | GNUNET_break (0 == strcmp (name, _(NEW_NAME_STR))); |
1323 | g_free (name); | 1323 | g_free (name); |
1324 | 1324 | ||
1325 | GNUNET_CRYPTO_hash (new_text, strlen (new_text), &name_hash); | 1325 | GNUNET_CRYPTO_hash (new_text, strlen (new_text), &name_hash); |
1326 | ri = GNUNET_CONTAINER_multihashmap_get (n2r, | 1326 | ri = GNUNET_CONTAINER_multihashmap_get (n2r, |
1327 | &name_hash); | 1327 | &name_hash); |
@@ -1364,7 +1364,7 @@ GNUNET_setup_gns_name_cellrenderertext_edited_cb (GtkCellRendererText *renderer, | |||
1364 | 1364 | ||
1365 | /** | 1365 | /** |
1366 | * Create a context (popup) menu for the zone iteration treeview | 1366 | * Create a context (popup) menu for the zone iteration treeview |
1367 | * (if applicable). | 1367 | * (if applicable). |
1368 | * | 1368 | * |
1369 | * @return TRUE if a menu was activated | 1369 | * @return TRUE if a menu was activated |
1370 | */ | 1370 | */ |
@@ -1429,14 +1429,14 @@ GNUNET_setup_gns_main_treeview_popup_menu_cb (GtkWidget *widget, | |||
1429 | * @return TRUE if a menu was activated (event was handled) | 1429 | * @return TRUE if a menu was activated (event was handled) |
1430 | */ | 1430 | */ |
1431 | gboolean | 1431 | gboolean |
1432 | GNUNET_setup_gns_main_treeview_button_press_event_cb (GtkWidget *widget, | 1432 | GNUNET_setup_gns_main_treeview_button_press_event_cb (GtkWidget *widget, |
1433 | GdkEventButton *event, | 1433 | GdkEventButton *event, |
1434 | gpointer user_data) | 1434 | gpointer user_data) |
1435 | { | 1435 | { |
1436 | /* Check for right click*/ | 1436 | /* Check for right click*/ |
1437 | if (NULL == widget) | 1437 | if (NULL == widget) |
1438 | return FALSE; | 1438 | return FALSE; |
1439 | if ( (GDK_BUTTON_PRESS == event->type) && | 1439 | if ( (GDK_BUTTON_PRESS == event->type) && |
1440 | (3 == event->button) ) | 1440 | (3 == event->button) ) |
1441 | return create_popup_menu (); | 1441 | return create_popup_menu (); |
1442 | return FALSE; | 1442 | return FALSE; |
@@ -1453,8 +1453,8 @@ GNUNET_setup_gns_main_treeview_button_press_event_cb (GtkWidget *widget, | |||
1453 | * @return TRUE if the key was processed ('del') | 1453 | * @return TRUE if the key was processed ('del') |
1454 | */ | 1454 | */ |
1455 | gboolean | 1455 | gboolean |
1456 | GNUNET_setup_gns_main_treeview_key_press_event_cb (GtkWidget *widget, | 1456 | GNUNET_setup_gns_main_treeview_key_press_event_cb (GtkWidget *widget, |
1457 | GdkEventKey *event, | 1457 | GdkEventKey *event, |
1458 | gpointer user_data) | 1458 | gpointer user_data) |
1459 | { | 1459 | { |
1460 | GtkTreeIter iter; | 1460 | GtkTreeIter iter; |
@@ -1468,13 +1468,13 @@ GNUNET_setup_gns_main_treeview_key_press_event_cb (GtkWidget *widget, | |||
1468 | 1468 | ||
1469 | /* Check for delete key */ | 1469 | /* Check for delete key */ |
1470 | if ( (GDK_KEY_PRESS != event->type) || | 1470 | if ( (GDK_KEY_PRESS != event->type) || |
1471 | (GDK_KEY_Delete != event->keyval) ) | 1471 | (GDK_KEY_Delete != event->keyval) ) |
1472 | return FALSE; | 1472 | return FALSE; |
1473 | sel = gtk_tree_view_get_selection(tv); | 1473 | sel = gtk_tree_view_get_selection(tv); |
1474 | if (! gtk_tree_selection_get_selected (sel, NULL, &iter)) | 1474 | if (! gtk_tree_selection_get_selected (sel, NULL, &iter)) |
1475 | return TRUE; /* nothing selected */ | 1475 | return TRUE; /* nothing selected */ |
1476 | gtk_tree_model_get (tm, &iter, | 1476 | gtk_tree_model_get (tm, &iter, |
1477 | GNS_TREESTORE_COL_NOT_DUMMY_ROW, ¬_dummy, | 1477 | GNS_TREESTORE_COL_NOT_DUMMY_ROW, ¬_dummy, |
1478 | GNS_TREESTORE_COL_NAME, &name, | 1478 | GNS_TREESTORE_COL_NAME, &name, |
1479 | -1); | 1479 | -1); |
1480 | if (GNUNET_NO == not_dummy) | 1480 | if (GNUNET_NO == not_dummy) |
@@ -1486,7 +1486,7 @@ GNUNET_setup_gns_main_treeview_key_press_event_cb (GtkWidget *widget, | |||
1486 | ri = GNUNET_CONTAINER_multihashmap_get (n2r, | 1486 | ri = GNUNET_CONTAINER_multihashmap_get (n2r, |
1487 | &name_hash); | 1487 | &name_hash); |
1488 | GNUNET_assert (NULL != ri); | 1488 | GNUNET_assert (NULL != ri); |
1489 | 1489 | ||
1490 | if ( (gtk_tree_model_iter_parent (tm, &parent, &iter)) && | 1490 | if ( (gtk_tree_model_iter_parent (tm, &parent, &iter)) && |
1491 | (ri->rd_count > 0) ) | 1491 | (ri->rd_count > 0) ) |
1492 | { | 1492 | { |
@@ -1503,7 +1503,7 @@ GNUNET_setup_gns_main_treeview_key_press_event_cb (GtkWidget *widget, | |||
1503 | 1503 | ||
1504 | /* Removing a single record */ | 1504 | /* Removing a single record */ |
1505 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1505 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1506 | "Removing single record for name `%s'\n", | 1506 | "Removing single record for name `%s'\n", |
1507 | name); | 1507 | name); |
1508 | GNUNET_break (GNUNET_OK == | 1508 | GNUNET_break (GNUNET_OK == |
1509 | GNUNET_NAMESTORE_records_deserialize (ri->data_size, | 1509 | GNUNET_NAMESTORE_records_deserialize (ri->data_size, |
@@ -1549,7 +1549,7 @@ GNUNET_setup_gns_main_treeview_key_press_event_cb (GtkWidget *widget, | |||
1549 | rd_new[off] = rd_old[ri->rd_count - 1]; | 1549 | rd_new[off] = rd_old[ri->rd_count - 1]; |
1550 | oc = GNUNET_new (struct OperationContext); | 1550 | oc = GNUNET_new (struct OperationContext); |
1551 | GNUNET_CONTAINER_DLL_insert (oc_head, oc_tail, oc); | 1551 | GNUNET_CONTAINER_DLL_insert (oc_head, oc_tail, oc); |
1552 | oc->qe = GNUNET_NAMESTORE_records_store (namestore, | 1552 | oc->qe = GNUNET_NAMESTORE_records_store (namestore, |
1553 | pkey, name, | 1553 | pkey, name, |
1554 | ri->rd_count - 1, | 1554 | ri->rd_count - 1, |
1555 | rd_new, | 1555 | rd_new, |
@@ -1560,7 +1560,7 @@ GNUNET_setup_gns_main_treeview_key_press_event_cb (GtkWidget *widget, | |||
1560 | { | 1560 | { |
1561 | oc = GNUNET_new (struct OperationContext); | 1561 | oc = GNUNET_new (struct OperationContext); |
1562 | GNUNET_CONTAINER_DLL_insert (oc_head, oc_tail, oc); | 1562 | GNUNET_CONTAINER_DLL_insert (oc_head, oc_tail, oc); |
1563 | oc->qe = GNUNET_NAMESTORE_records_store (namestore, | 1563 | oc->qe = GNUNET_NAMESTORE_records_store (namestore, |
1564 | pkey, name, | 1564 | pkey, name, |
1565 | 0, NULL, | 1565 | 0, NULL, |
1566 | &operation_done_cont, oc); | 1566 | &operation_done_cont, oc); |
@@ -1604,7 +1604,7 @@ GNUNET_setup_gns_pseu_entry_changed_cb (GtkEditable *editable, | |||
1604 | current_pseudonym); | 1604 | current_pseudonym); |
1605 | return; | 1605 | return; |
1606 | } | 1606 | } |
1607 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1607 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1608 | "New Pseudonym is `%s' %u\n", | 1608 | "New Pseudonym is `%s' %u\n", |
1609 | pseu); | 1609 | pseu); |
1610 | GNUNET_free_non_null (current_pseudonym); | 1610 | GNUNET_free_non_null (current_pseudonym); |
@@ -1642,11 +1642,11 @@ GNUNET_setup_gns_pseu_entry_changed_cb (GtkEditable *editable, | |||
1642 | if (off == rd_count) | 1642 | if (off == rd_count) |
1643 | total++; | 1643 | total++; |
1644 | if ( (NULL == pseu) || | 1644 | if ( (NULL == pseu) || |
1645 | (0 == strlen (pseu)) ) | 1645 | (0 == strlen (pseu)) ) |
1646 | { | 1646 | { |
1647 | rd_new[off] = rd_new[rd_count - 1]; | 1647 | rd_new[off] = rd_new[rd_count - 1]; |
1648 | total--; | 1648 | total--; |
1649 | } | 1649 | } |
1650 | else | 1650 | else |
1651 | { | 1651 | { |
1652 | rd_new[off].record_type = GNUNET_NAMESTORE_TYPE_PSEU; | 1652 | rd_new[off].record_type = GNUNET_NAMESTORE_TYPE_PSEU; |
@@ -1657,8 +1657,8 @@ GNUNET_setup_gns_pseu_entry_changed_cb (GtkEditable *editable, | |||
1657 | } | 1657 | } |
1658 | oc = GNUNET_new (struct OperationContext); | 1658 | oc = GNUNET_new (struct OperationContext); |
1659 | GNUNET_CONTAINER_DLL_insert (oc_head, oc_tail, oc); | 1659 | GNUNET_CONTAINER_DLL_insert (oc_head, oc_tail, oc); |
1660 | oc->qe = GNUNET_NAMESTORE_records_store (namestore, | 1660 | oc->qe = GNUNET_NAMESTORE_records_store (namestore, |
1661 | pkey, | 1661 | pkey, |
1662 | GNUNET_GNS_MASTERZONE_STR, | 1662 | GNUNET_GNS_MASTERZONE_STR, |
1663 | total, | 1663 | total, |
1664 | rd_new, | 1664 | rd_new, |
@@ -1686,7 +1686,7 @@ GNUNET_setup_gns_public_key_copy_button_clicked_cb (GtkButton *button, | |||
1686 | if (NULL == pkey) | 1686 | if (NULL == pkey) |
1687 | return; | 1687 | return; |
1688 | cb = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD); | 1688 | cb = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD); |
1689 | gtk_clipboard_set_text (cb, | 1689 | gtk_clipboard_set_text (cb, |
1690 | GNUNET_NAMESTORE_z2s (&pubkey), | 1690 | GNUNET_NAMESTORE_z2s (&pubkey), |
1691 | -1); | 1691 | -1); |
1692 | } | 1692 | } |
@@ -1701,8 +1701,8 @@ GNUNET_setup_gns_public_key_copy_button_clicked_cb (GtkButton *button, | |||
1701 | static void | 1701 | static void |
1702 | zone_sync_proc (void *cls) | 1702 | zone_sync_proc (void *cls) |
1703 | { | 1703 | { |
1704 | if (0 == strcmp (current_zone_option, "ZONEKEY")) | 1704 | if (0 == strcmp (current_zone_option, "ZONEKEY")) |
1705 | gtk_widget_show (GTK_WIDGET (GNUNET_SETUP_get_object ("GNUNET_setup_gns_pseu_hbox"))); | 1705 | gtk_widget_show (GTK_WIDGET (GNUNET_SETUP_get_object ("GNUNET_setup_gns_pseu_hbox"))); |
1706 | #if HAVE_QRENCODE_H | 1706 | #if HAVE_QRENCODE_H |
1707 | setup_qrcode (); | 1707 | setup_qrcode (); |
1708 | gtk_widget_show (GTK_WIDGET (GNUNET_SETUP_get_object ("GNUNET_setup_gns_qr_image"))); | 1708 | gtk_widget_show (GTK_WIDGET (GNUNET_SETUP_get_object ("GNUNET_setup_gns_qr_image"))); |
@@ -1721,7 +1721,7 @@ zone_sync_proc (void *cls) | |||
1721 | 1721 | ||
1722 | /** | 1722 | /** |
1723 | * Function called for each record in the current zone. Update the | 1723 | * Function called for each record in the current zone. Update the |
1724 | * widgets accordingly. | 1724 | * widgets accordingly. |
1725 | * | 1725 | * |
1726 | * @param cls NULL | 1726 | * @param cls NULL |
1727 | * @param zone_key private key of the zone | 1727 | * @param zone_key private key of the zone |
@@ -1769,7 +1769,7 @@ zone_iteration_proc (void *cls, | |||
1769 | name); | 1769 | name); |
1770 | return; | 1770 | return; |
1771 | } | 1771 | } |
1772 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1772 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1773 | "Zone iteration result `%s', %u records\n", | 1773 | "Zone iteration result `%s', %u records\n", |
1774 | name, rd_count); | 1774 | name, rd_count); |
1775 | GNUNET_CRYPTO_hash (name, | 1775 | GNUNET_CRYPTO_hash (name, |
@@ -1807,7 +1807,7 @@ zone_iteration_proc (void *cls, | |||
1807 | GNS_TREESTORE_COL_TYPE_IS_EDITABLE, TRUE, | 1807 | GNS_TREESTORE_COL_TYPE_IS_EDITABLE, TRUE, |
1808 | GNS_TREESTORE_COL_RECORD_OFFSET, UINT_MAX, | 1808 | GNS_TREESTORE_COL_RECORD_OFFSET, UINT_MAX, |
1809 | -1); | 1809 | -1); |
1810 | 1810 | ||
1811 | path = gtk_tree_model_get_path (tm, | 1811 | path = gtk_tree_model_get_path (tm, |
1812 | &iter_name); | 1812 | &iter_name); |
1813 | rr = gtk_tree_row_reference_new (tm, | 1813 | rr = gtk_tree_row_reference_new (tm, |
@@ -1825,7 +1825,7 @@ zone_iteration_proc (void *cls, | |||
1825 | { | 1825 | { |
1826 | /* all records removed, remove name as well */ | 1826 | /* all records removed, remove name as well */ |
1827 | gtk_tree_store_remove (ts, &iter_name); | 1827 | gtk_tree_store_remove (ts, &iter_name); |
1828 | GNUNET_assert (GNUNET_YES == | 1828 | GNUNET_assert (GNUNET_YES == |
1829 | GNUNET_CONTAINER_multihashmap_remove (n2r, &name_hash, ri)); | 1829 | GNUNET_CONTAINER_multihashmap_remove (n2r, &name_hash, ri)); |
1830 | gtk_tree_row_reference_free (rr); | 1830 | gtk_tree_row_reference_free (rr); |
1831 | GNUNET_free (ri->name); | 1831 | GNUNET_free (ri->name); |
@@ -1856,7 +1856,7 @@ zone_iteration_proc (void *cls, | |||
1856 | public = ((rd[c].flags & GNUNET_NAMESTORE_RF_PRIVATE) != GNUNET_NAMESTORE_RF_PRIVATE); | 1856 | public = ((rd[c].flags & GNUNET_NAMESTORE_RF_PRIVATE) != GNUNET_NAMESTORE_RF_PRIVATE); |
1857 | /* Expiration time */ | 1857 | /* Expiration time */ |
1858 | time_is_relative = (0 != (rd[c].flags & GNUNET_NAMESTORE_RF_RELATIVE_EXPIRATION)); | 1858 | time_is_relative = (0 != (rd[c].flags & GNUNET_NAMESTORE_RF_RELATIVE_EXPIRATION)); |
1859 | 1859 | ||
1860 | if (time_is_relative) | 1860 | if (time_is_relative) |
1861 | { | 1861 | { |
1862 | struct GNUNET_TIME_Relative rel_time; | 1862 | struct GNUNET_TIME_Relative rel_time; |
@@ -1885,7 +1885,7 @@ zone_iteration_proc (void *cls, | |||
1885 | else | 1885 | else |
1886 | GNUNET_asprintf (&type_str, "%s", EXPIRE_INVALID_STRING); | 1886 | GNUNET_asprintf (&type_str, "%s", EXPIRE_INVALID_STRING); |
1887 | 1887 | ||
1888 | if ( (0 == strcmp (name, GNUNET_GNS_MASTERZONE_STR)) && | 1888 | if ( (0 == strcmp (name, GNUNET_GNS_MASTERZONE_STR)) && |
1889 | (GNUNET_NAMESTORE_TYPE_PSEU == rd[c].record_type) && | 1889 | (GNUNET_NAMESTORE_TYPE_PSEU == rd[c].record_type) && |
1890 | (NULL == current_pseudonym) ) | 1890 | (NULL == current_pseudonym) ) |
1891 | { | 1891 | { |
@@ -1907,8 +1907,8 @@ zone_iteration_proc (void *cls, | |||
1907 | GNS_TREESTORE_COL_VAL_AS_STR, val, | 1907 | GNS_TREESTORE_COL_VAL_AS_STR, val, |
1908 | GNS_TREESTORE_COL_IS_RECORD_ROW, TRUE, | 1908 | GNS_TREESTORE_COL_IS_RECORD_ROW, TRUE, |
1909 | GNS_TREESTORE_COL_NOT_DUMMY_ROW, TRUE, | 1909 | GNS_TREESTORE_COL_NOT_DUMMY_ROW, TRUE, |
1910 | GNS_TREESTORE_COL_RECORD_OFFSET, (guint) c, | 1910 | GNS_TREESTORE_COL_RECORD_OFFSET, (guint) c, |
1911 | -1); | 1911 | -1); |
1912 | GNUNET_free (type_str); | 1912 | GNUNET_free (type_str); |
1913 | GNUNET_free (val); | 1913 | GNUNET_free (val); |
1914 | } | 1914 | } |
@@ -1921,7 +1921,7 @@ zone_iteration_proc (void *cls, | |||
1921 | } | 1921 | } |
1922 | 1922 | ||
1923 | 1923 | ||
1924 | /** | 1924 | /** |
1925 | * Method called to inform about the egos of this peer. Called | 1925 | * Method called to inform about the egos of this peer. Called |
1926 | * when we are doing a #load_zone operation and are getting the | 1926 | * when we are doing a #load_zone operation and are getting the |
1927 | * private key of the new zone to edit. | 1927 | * private key of the new zone to edit. |
@@ -1931,7 +1931,7 @@ zone_iteration_proc (void *cls, | |||
1931 | * @a ego does indicate an error (i.e. name is taken or no default | 1931 | * @a ego does indicate an error (i.e. name is taken or no default |
1932 | * value is known). If @a ego is non-NULL and if '*ctx' | 1932 | * value is known). If @a ego is non-NULL and if '*ctx' |
1933 | * is set in those callbacks, the value WILL be passed to a subsequent | 1933 | * is set in those callbacks, the value WILL be passed to a subsequent |
1934 | * call to the identity callback of #GNUNET_IDENTITY_connect (if | 1934 | * call to the identity callback of #GNUNET_IDENTITY_connect (if |
1935 | * that one was not NULL). | 1935 | * that one was not NULL). |
1936 | * | 1936 | * |
1937 | * @param cls closure with the 'const char *' zonename | 1937 | * @param cls closure with the 'const char *' zonename |
@@ -1957,8 +1957,8 @@ identity_cb (void *cls, | |||
1957 | /* setup crypto keys */ | 1957 | /* setup crypto keys */ |
1958 | if (NULL == ego) | 1958 | if (NULL == ego) |
1959 | { | 1959 | { |
1960 | GNUNET_asprintf (&emsg, | 1960 | GNUNET_asprintf (&emsg, |
1961 | _("Default zone for `%s' not set; did you run gnunet-gns-import.sh?\n"), | 1961 | _("Default zone for `%s' not set; did you run gnunet-gns-import.sh?\n"), |
1962 | zonename); | 1962 | zonename); |
1963 | show_error_message (_("Failed to load zone"), | 1963 | show_error_message (_("Failed to load zone"), |
1964 | emsg); | 1964 | emsg); |
@@ -2035,7 +2035,7 @@ load_zone (const char *zonename) | |||
2035 | * @param togglebutton button that was toggled (could be to "on" or "off", we only react to "on") | 2035 | * @param togglebutton button that was toggled (could be to "on" or "off", we only react to "on") |
2036 | * @param user_data builder, unused | 2036 | * @param user_data builder, unused |
2037 | */ | 2037 | */ |
2038 | void | 2038 | void |
2039 | GNUNET_setup_gns_shorten_zone_selection_radiobutton_toggled_cb (GtkToggleButton *togglebutton, | 2039 | GNUNET_setup_gns_shorten_zone_selection_radiobutton_toggled_cb (GtkToggleButton *togglebutton, |
2040 | gpointer user_data) | 2040 | gpointer user_data) |
2041 | { | 2041 | { |
@@ -2051,7 +2051,7 @@ GNUNET_setup_gns_shorten_zone_selection_radiobutton_toggled_cb (GtkToggleButton | |||
2051 | * @param togglebutton button that was toggled (could be to "on" or "off", we only react to "on") | 2051 | * @param togglebutton button that was toggled (could be to "on" or "off", we only react to "on") |
2052 | * @param user_data builder, unused | 2052 | * @param user_data builder, unused |
2053 | */ | 2053 | */ |
2054 | void | 2054 | void |
2055 | GNUNET_setup_gns_private_zone_selection_radiobutton_toggled_cb (GtkToggleButton *togglebutton, | 2055 | GNUNET_setup_gns_private_zone_selection_radiobutton_toggled_cb (GtkToggleButton *togglebutton, |
2056 | gpointer user_data) | 2056 | gpointer user_data) |
2057 | { | 2057 | { |
@@ -2067,7 +2067,7 @@ GNUNET_setup_gns_private_zone_selection_radiobutton_toggled_cb (GtkToggleButton | |||
2067 | * @param togglebutton button that was toggled (could be to "on" or "off", we only react to "on") | 2067 | * @param togglebutton button that was toggled (could be to "on" or "off", we only react to "on") |
2068 | * @param user_data builder, unused | 2068 | * @param user_data builder, unused |
2069 | */ | 2069 | */ |
2070 | void | 2070 | void |
2071 | GNUNET_setup_gns_master_zone_selection_radiobutton_toggled_cb (GtkToggleButton *togglebutton, | 2071 | GNUNET_setup_gns_master_zone_selection_radiobutton_toggled_cb (GtkToggleButton *togglebutton, |
2072 | gpointer user_data) | 2072 | gpointer user_data) |
2073 | { | 2073 | { |
@@ -2092,13 +2092,13 @@ GNUNET_SETUP_gns_init () | |||
2092 | status_label = GTK_LABEL (GNUNET_SETUP_get_object ("GNUNET_setup_gns_status_label")); | 2092 | status_label = GTK_LABEL (GNUNET_SETUP_get_object ("GNUNET_setup_gns_status_label")); |
2093 | label = g_markup_printf_escaped (_("<b><big>Failed to connect to namestore</b></big>")); | 2093 | label = g_markup_printf_escaped (_("<b><big>Failed to connect to namestore</b></big>")); |
2094 | gtk_label_set_markup (status_label, label); | 2094 | gtk_label_set_markup (status_label, label); |
2095 | g_free (label); | 2095 | g_free (label); |
2096 | return; | 2096 | return; |
2097 | } | 2097 | } |
2098 | identity = GNUNET_IDENTITY_connect (cfg, NULL, NULL); | 2098 | identity = GNUNET_IDENTITY_connect (cfg, NULL, NULL); |
2099 | ts = GTK_TREE_STORE (GNUNET_SETUP_get_object ("GNUNET_setup_gns_treestore")); | 2099 | ts = GTK_TREE_STORE (GNUNET_SETUP_get_object ("GNUNET_setup_gns_treestore")); |
2100 | tv = GTK_TREE_VIEW (GNUNET_SETUP_get_object ("GNUNET_setup_gns_main_treeview")); | 2100 | tv = GTK_TREE_VIEW (GNUNET_SETUP_get_object ("GNUNET_setup_gns_main_treeview")); |
2101 | tm = GTK_TREE_MODEL (ts); | 2101 | tm = GTK_TREE_MODEL (ts); |
2102 | n2r = GNUNET_CONTAINER_multihashmap_create (128, GNUNET_NO); | 2102 | n2r = GNUNET_CONTAINER_multihashmap_create (128, GNUNET_NO); |
2103 | load_zone ("gns-master"); | 2103 | load_zone ("gns-master"); |
2104 | } | 2104 | } |
diff --git a/src/setup/gnunet-setup-hostlist-server.c b/src/setup/gnunet-setup-hostlist-server.c index 122f8b7b..91411405 100644 --- a/src/setup/gnunet-setup-hostlist-server.c +++ b/src/setup/gnunet-setup-hostlist-server.c | |||
@@ -59,7 +59,7 @@ struct CommandContext | |||
59 | * Where to pass the result. | 59 | * Where to pass the result. |
60 | */ | 60 | */ |
61 | TestHostlistDaemonCallback callback; | 61 | TestHostlistDaemonCallback callback; |
62 | 62 | ||
63 | /** | 63 | /** |
64 | * Closure for the callback. | 64 | * Closure for the callback. |
65 | */ | 65 | */ |
diff --git a/src/setup/gnunet-setup-options.c b/src/setup/gnunet-setup-options.c index 4b5c52b7..45a400d6 100644 --- a/src/setup/gnunet-setup-options.c +++ b/src/setup/gnunet-setup-options.c | |||
@@ -1386,7 +1386,7 @@ const struct GNUNET_SETUP_OptionSpecification option_specifications[] = { | |||
1386 | &save_number, NULL, | 1386 | &save_number, NULL, |
1387 | NULL, NULL, | 1387 | NULL, NULL, |
1388 | NULL}, | 1388 | NULL}, |
1389 | 1389 | ||
1390 | { | 1390 | { |
1391 | "GNUNET_setup_transport_udp_advertised_port_spinbutton", | 1391 | "GNUNET_setup_transport_udp_advertised_port_spinbutton", |
1392 | "value-changed", | 1392 | "value-changed", |
diff --git a/src/setup/gnunet-setup-transport.c b/src/setup/gnunet-setup-transport.c index 40193f34..08cc39d9 100644 --- a/src/setup/gnunet-setup-transport.c +++ b/src/setup/gnunet-setup-transport.c | |||
@@ -89,7 +89,7 @@ enum AutoPhase | |||
89 | * Last phase, we're done. | 89 | * Last phase, we're done. |
90 | */ | 90 | */ |
91 | AUTO_DONE | 91 | AUTO_DONE |
92 | 92 | ||
93 | }; | 93 | }; |
94 | 94 | ||
95 | 95 | ||
@@ -108,12 +108,12 @@ struct GNUNET_SetupAutoContext | |||
108 | * Function to call when done. | 108 | * Function to call when done. |
109 | */ | 109 | */ |
110 | GNUNET_SetupAutoConfigFinished fin_cb; | 110 | GNUNET_SetupAutoConfigFinished fin_cb; |
111 | 111 | ||
112 | /** | 112 | /** |
113 | * Closure for 'fin_cb'. | 113 | * Closure for 'fin_cb'. |
114 | */ | 114 | */ |
115 | void *fin_cb_cls; | 115 | void *fin_cb_cls; |
116 | 116 | ||
117 | /** | 117 | /** |
118 | * Handle for active 'GNUNET_NAT_mini_get_external_ipv4'-operation. | 118 | * Handle for active 'GNUNET_NAT_mini_get_external_ipv4'-operation. |
119 | */ | 119 | */ |
@@ -178,12 +178,12 @@ result_callback (void *cls, int success) | |||
178 | GNUNET_NAT_test_stop (ac->tst); | 178 | GNUNET_NAT_test_stop (ac->tst); |
179 | ac->tst = NULL; | 179 | ac->tst = NULL; |
180 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 180 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
181 | success | 181 | success |
182 | ? _("NAT traversal with ICMP Server succeeded.\n") | 182 | ? _("NAT traversal with ICMP Server succeeded.\n") |
183 | : _("NAT traversal with ICMP Server failed.\n")); | 183 | : _("NAT traversal with ICMP Server failed.\n")); |
184 | update_icmp_server_enable_button (success); | 184 | update_icmp_server_enable_button (success); |
185 | if (NULL != cfg) | 185 | if (NULL != cfg) |
186 | GNUNET_CONFIGURATION_set_value_string (cfg, "nat", "ENABLE_ICMP_SERVER", | 186 | GNUNET_CONFIGURATION_set_value_string (cfg, "nat", "ENABLE_ICMP_SERVER", |
187 | success ? "YES": "NO"); | 187 | success ? "YES": "NO"); |
188 | next_phase (ac); | 188 | next_phase (ac); |
189 | } | 189 | } |
@@ -373,7 +373,7 @@ nipo (void *cls, const char *name, int isDefault, const struct sockaddr *addr, | |||
373 | 373 | ||
374 | 374 | ||
375 | /** | 375 | /** |
376 | * Determine our local IP addresses; detect internal IP & IPv6-support | 376 | * Determine our local IP addresses; detect internal IP & IPv6-support |
377 | * | 377 | * |
378 | * @param ac auto setup context | 378 | * @param ac auto setup context |
379 | */ | 379 | */ |
@@ -389,7 +389,7 @@ test_local_ip (struct GNUNET_SetupAutoContext *ac) | |||
389 | gtk_toggle_button_set_active (button, | 389 | gtk_toggle_button_set_active (button, |
390 | (GNUNET_YES == have_v6) ? FALSE : TRUE); | 390 | (GNUNET_YES == have_v6) ? FALSE : TRUE); |
391 | if (NULL != cfg) | 391 | if (NULL != cfg) |
392 | GNUNET_CONFIGURATION_set_value_string (cfg, "nat", "DISABLEV6", | 392 | GNUNET_CONFIGURATION_set_value_string (cfg, "nat", "DISABLEV6", |
393 | (GNUNET_YES == have_v6) ? "NO" : "YES"); | 393 | (GNUNET_YES == have_v6) ? "NO" : "YES"); |
394 | next_phase (ac); | 394 | next_phase (ac); |
395 | } | 395 | } |
@@ -426,7 +426,7 @@ test_upnpc (struct GNUNET_SetupAutoContext *ac) | |||
426 | /* FIXME: test if upnpc is actually working, that is, if transports | 426 | /* FIXME: test if upnpc is actually working, that is, if transports |
427 | start to work once we use UPnP */ | 427 | start to work once we use UPnP */ |
428 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 428 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
429 | (have_upnpc) | 429 | (have_upnpc) |
430 | ? _("upnpc found, enabling its use\n") | 430 | ? _("upnpc found, enabling its use\n") |
431 | : _("upnpc not found\n")); | 431 | : _("upnpc not found\n")); |
432 | gtk_toggle_button_set_active (button, | 432 | gtk_toggle_button_set_active (button, |
@@ -434,7 +434,7 @@ test_upnpc (struct GNUNET_SetupAutoContext *ac) | |||
434 | ? TRUE | 434 | ? TRUE |
435 | : FALSE); | 435 | : FALSE); |
436 | if (NULL != cfg) | 436 | if (NULL != cfg) |
437 | GNUNET_CONFIGURATION_set_value_string (cfg, "nat", "ENABLE_UPNP", | 437 | GNUNET_CONFIGURATION_set_value_string (cfg, "nat", "ENABLE_UPNP", |
438 | (GNUNET_YES == have_upnpc) ? "YES" : "NO"); | 438 | (GNUNET_YES == have_upnpc) ? "YES" : "NO"); |
439 | next_phase (ac); | 439 | next_phase (ac); |
440 | } | 440 | } |
@@ -465,7 +465,7 @@ test_icmp_server (struct GNUNET_SetupAutoContext *ac) | |||
465 | GNUNET_free_non_null (tmp); | 465 | GNUNET_free_non_null (tmp); |
466 | GNUNET_free (binary); | 466 | GNUNET_free (binary); |
467 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 467 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
468 | (hns) | 468 | (hns) |
469 | ? _("gnunet-helper-nat-server found, testing it\n") | 469 | ? _("gnunet-helper-nat-server found, testing it\n") |
470 | : _("No working gnunet-helper-nat-server found\n")); | 470 | : _("No working gnunet-helper-nat-server found\n")); |
471 | if (hns) | 471 | if (hns) |
@@ -501,7 +501,7 @@ test_icmp_client (struct GNUNET_SetupAutoContext *ac) | |||
501 | GNUNET_free_non_null (tmp); | 501 | GNUNET_free_non_null (tmp); |
502 | GNUNET_free (binary); | 502 | GNUNET_free (binary); |
503 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 503 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
504 | (hnc) | 504 | (hnc) |
505 | ? _("gnunet-helper-nat-client found, enabling it\n") | 505 | ? _("gnunet-helper-nat-client found, enabling it\n") |
506 | : _("gnunet-helper-nat-client not found or behind NAT, disabling it\n")); | 506 | : _("gnunet-helper-nat-client not found or behind NAT, disabling it\n")); |
507 | button = | 507 | button = |
@@ -517,7 +517,7 @@ test_icmp_client (struct GNUNET_SetupAutoContext *ac) | |||
517 | * | 517 | * |
518 | * @param fin_cb function to call when done | 518 | * @param fin_cb function to call when done |
519 | * @param fin_cb_cls closure for 'fin_cb' | 519 | * @param fin_cb_cls closure for 'fin_cb' |
520 | * @return handle for the operation | 520 | * @return handle for the operation |
521 | */ | 521 | */ |
522 | struct GNUNET_SetupAutoContext * | 522 | struct GNUNET_SetupAutoContext * |
523 | GNUNET_setup_transport_autoconfig_start (GNUNET_SetupAutoConfigFinished fin_cb, | 523 | GNUNET_setup_transport_autoconfig_start (GNUNET_SetupAutoConfigFinished fin_cb, |
@@ -530,8 +530,8 @@ GNUNET_setup_transport_autoconfig_start (GNUNET_SetupAutoConfigFinished fin_cb, | |||
530 | ac->fin_cb_cls = fin_cb_cls; | 530 | ac->fin_cb_cls = fin_cb_cls; |
531 | 531 | ||
532 | /* never use loopback addresses if user wanted autoconfiguration */ | 532 | /* never use loopback addresses if user wanted autoconfiguration */ |
533 | GNUNET_CONFIGURATION_set_value_string (cfg, "nat", | 533 | GNUNET_CONFIGURATION_set_value_string (cfg, "nat", |
534 | "USE_LOCALADDR", | 534 | "USE_LOCALADDR", |
535 | "NO"); | 535 | "NO"); |
536 | next_phase (ac); | 536 | next_phase (ac); |
537 | return ac; | 537 | return ac; |
@@ -608,7 +608,7 @@ GNUNET_setup_transport_autoconfig_button_clicked_cb () | |||
608 | if (NULL != ac) | 608 | if (NULL != ac) |
609 | { | 609 | { |
610 | GNUNET_break (0); | 610 | GNUNET_break (0); |
611 | return; | 611 | return; |
612 | } | 612 | } |
613 | gtk_widget_set_sensitive (GTK_WIDGET (GNUNET_SETUP_get_object ("GNUNET_setup_transport_autoconfig_button")), | 613 | gtk_widget_set_sensitive (GTK_WIDGET (GNUNET_SETUP_get_object ("GNUNET_setup_transport_autoconfig_button")), |
614 | FALSE); | 614 | FALSE); |
diff --git a/src/setup/gnunet-setup-transport.h b/src/setup/gnunet-setup-transport.h index d7cc8b90..e8b6bd37 100644 --- a/src/setup/gnunet-setup-transport.h +++ b/src/setup/gnunet-setup-transport.h | |||
@@ -48,7 +48,7 @@ typedef void (*GNUNET_SetupAutoConfigFinished)(void *cls); | |||
48 | * | 48 | * |
49 | * @param fin_cb function to call when done | 49 | * @param fin_cb function to call when done |
50 | * @param fin_cb_cls closure for 'fin_cb' | 50 | * @param fin_cb_cls closure for 'fin_cb' |
51 | * @return handle for the operation | 51 | * @return handle for the operation |
52 | */ | 52 | */ |
53 | struct GNUNET_SetupAutoContext * | 53 | struct GNUNET_SetupAutoContext * |
54 | GNUNET_setup_transport_autoconfig_start (GNUNET_SetupAutoConfigFinished fin_cb, | 54 | GNUNET_setup_transport_autoconfig_start (GNUNET_SetupAutoConfigFinished fin_cb, |
diff --git a/src/setup/gnunet-setup.c b/src/setup/gnunet-setup.c index 6a4aee80..d50cf39a 100644 --- a/src/setup/gnunet-setup.c +++ b/src/setup/gnunet-setup.c | |||
@@ -84,7 +84,7 @@ static int do_gksu; | |||
84 | * Show all configuration options, even if we are run | 84 | * Show all configuration options, even if we are run |
85 | * as a normal user and a 'gnunet' user exists and thus | 85 | * as a normal user and a 'gnunet' user exists and thus |
86 | * most options should not apply to the normal user. | 86 | * most options should not apply to the normal user. |
87 | */ | 87 | */ |
88 | static int force_full_setup; | 88 | static int force_full_setup; |
89 | #endif | 89 | #endif |
90 | 90 | ||
@@ -136,7 +136,7 @@ void | |||
136 | GNUNET_setup_notebook_switch_page_cb (GtkNotebook *notebook, | 136 | GNUNET_setup_notebook_switch_page_cb (GtkNotebook *notebook, |
137 | GtkWidget *page, | 137 | GtkWidget *page, |
138 | guint page_num, | 138 | guint page_num, |
139 | gpointer user_data) | 139 | gpointer user_data) |
140 | { | 140 | { |
141 | GtkWidget *help; | 141 | GtkWidget *help; |
142 | GtkWidget *gnu; | 142 | GtkWidget *gnu; |
@@ -146,7 +146,7 @@ GNUNET_setup_notebook_switch_page_cb (GtkNotebook *notebook, | |||
146 | if (gnu == page) | 146 | if (gnu == page) |
147 | gtk_widget_hide (help); | 147 | gtk_widget_hide (help); |
148 | else | 148 | else |
149 | gtk_widget_show (help); | 149 | gtk_widget_show (help); |
150 | } | 150 | } |
151 | 151 | ||
152 | 152 | ||
@@ -260,7 +260,7 @@ load_options () | |||
260 | GObject *widget; | 260 | GObject *widget; |
261 | char *value; | 261 | char *value; |
262 | 262 | ||
263 | #ifndef LINUX | 263 | #ifndef LINUX |
264 | gtk_widget_hide (GTK_WIDGET (GNUNET_SETUP_get_object ("GNUNET_setup_gns_hijack_checkbutton"))); | 264 | gtk_widget_hide (GTK_WIDGET (GNUNET_SETUP_get_object ("GNUNET_setup_gns_hijack_checkbutton"))); |
265 | #endif | 265 | #endif |
266 | i = 0; | 266 | i = 0; |
@@ -340,7 +340,7 @@ load_options () | |||
340 | * | 340 | * |
341 | * @return GNUNET_OK on success | 341 | * @return GNUNET_OK on success |
342 | */ | 342 | */ |
343 | static int | 343 | static int |
344 | write_configuration () | 344 | write_configuration () |
345 | { | 345 | { |
346 | struct GNUNET_CONFIGURATION_Handle *cfgDefault; | 346 | struct GNUNET_CONFIGURATION_Handle *cfgDefault; |
@@ -398,7 +398,7 @@ cleanup_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
398 | /** | 398 | /** |
399 | * Write configuration to dis, (re)start the namestore process and | 399 | * Write configuration to dis, (re)start the namestore process and |
400 | * reload the namestore models. | 400 | * reload the namestore models. |
401 | * | 401 | * |
402 | * | 402 | * |
403 | * @param cls closure (unused) | 403 | * @param cls closure (unused) |
404 | * @param tc scheduler context (unused) | 404 | * @param tc scheduler context (unused) |
@@ -540,7 +540,7 @@ try_gksu (const char *username) | |||
540 | 540 | ||
541 | /** | 541 | /** |
542 | * Called once the autoconfiguration is done. Triggers shutdown. | 542 | * Called once the autoconfiguration is done. Triggers shutdown. |
543 | * | 543 | * |
544 | * @param cls unused | 544 | * @param cls unused |
545 | */ | 545 | */ |
546 | static void | 546 | static void |
@@ -576,7 +576,7 @@ run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
576 | GNUNET_GTK_main_loop_quit (cls); | 576 | GNUNET_GTK_main_loop_quit (cls); |
577 | return; | 577 | return; |
578 | } | 578 | } |
579 | #endif | 579 | #endif |
580 | 580 | ||
581 | ml = cls; | 581 | ml = cls; |
582 | if (GNUNET_OK != GNUNET_GTK_main_loop_build_window (ml, NULL)) | 582 | if (GNUNET_OK != GNUNET_GTK_main_loop_build_window (ml, NULL)) |
@@ -584,8 +584,8 @@ run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
584 | 584 | ||
585 | cfgName = GNUNET_GTK_main_loop_get_configuration_file (ml); | 585 | cfgName = GNUNET_GTK_main_loop_get_configuration_file (ml); |
586 | cfg = GNUNET_CONFIGURATION_create (); | 586 | cfg = GNUNET_CONFIGURATION_create (); |
587 | 587 | ||
588 | #ifndef MINGW | 588 | #ifndef MINGW |
589 | if ( (0 != my_uid) && | 589 | if ( (0 != my_uid) && |
590 | (NULL != gnunet_pw) && | 590 | (NULL != gnunet_pw) && |
591 | (my_uid != gnunet_pw->pw_uid) && | 591 | (my_uid != gnunet_pw->pw_uid) && |
diff --git a/src/setup/gnunet-setup.h b/src/setup/gnunet-setup.h index cf23d474..d99f29d3 100644 --- a/src/setup/gnunet-setup.h +++ b/src/setup/gnunet-setup.h | |||
@@ -39,7 +39,7 @@ | |||
39 | enum GNUNET_GTK_SETUP_HostlistUrlModelColumns | 39 | enum GNUNET_GTK_SETUP_HostlistUrlModelColumns |
40 | { | 40 | { |
41 | /** | 41 | /** |
42 | * A gchararray | 42 | * A gchararray |
43 | */ | 43 | */ |
44 | GNUNET_GTK_SETUP_HOSTLIST_URL_MC_URL = 0, | 44 | GNUNET_GTK_SETUP_HOSTLIST_URL_MC_URL = 0, |
45 | 45 | ||
@@ -56,10 +56,10 @@ enum GNUNET_GTK_SETUP_HostlistUrlModelColumns | |||
56 | enum GNUNET_GTK_SETUP_GnsModelColumns | 56 | enum GNUNET_GTK_SETUP_GnsModelColumns |
57 | { | 57 | { |
58 | /** | 58 | /** |
59 | * A gchararray | 59 | * A gchararray |
60 | */ | 60 | */ |
61 | GNUNET_GTK_SETUP_GNS_MC_HOSTNAME = 0, | 61 | GNUNET_GTK_SETUP_GNS_MC_HOSTNAME = 0, |
62 | 62 | ||
63 | /** | 63 | /** |
64 | * A guint | 64 | * A guint |
65 | */ | 65 | */ |
@@ -71,12 +71,12 @@ enum GNUNET_GTK_SETUP_GnsModelColumns | |||
71 | GNUNET_GTK_SETUP_GNS_MC_TARGETPORT = 2, | 71 | GNUNET_GTK_SETUP_GNS_MC_TARGETPORT = 2, |
72 | 72 | ||
73 | /** | 73 | /** |
74 | * A gchararray | 74 | * A gchararray |
75 | */ | 75 | */ |
76 | GNUNET_GTK_SETUP_GNS_MC_TARGETHOSTNAME = 3, | 76 | GNUNET_GTK_SETUP_GNS_MC_TARGETHOSTNAME = 3, |
77 | 77 | ||
78 | /** | 78 | /** |
79 | * A gchararray | 79 | * A gchararray |
80 | */ | 80 | */ |
81 | GNUNET_GTK_SETUP_GNS_MC_ISUDP = 4, | 81 | GNUNET_GTK_SETUP_GNS_MC_ISUDP = 4, |
82 | }; | 82 | }; |
@@ -95,7 +95,7 @@ GNUNET_SETUP_get_object (const char *name); | |||
95 | /** | 95 | /** |
96 | * Write configuration to dis, (re)start the namestore process and | 96 | * Write configuration to dis, (re)start the namestore process and |
97 | * reload the namestore models. | 97 | * reload the namestore models. |
98 | * | 98 | * |
99 | * | 99 | * |
100 | * @param cls closure (unused) | 100 | * @param cls closure (unused) |
101 | * @param tc scheduler context (unused) | 101 | * @param tc scheduler context (unused) |