diff options
Diffstat (limited to 'src/fs/gnunet-fs-gtk_main-window-search.c')
-rw-r--r-- | src/fs/gnunet-fs-gtk_main-window-search.c | 68 |
1 files changed, 34 insertions, 34 deletions
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 |