aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-12-25 21:15:59 +0000
committerChristian Grothoff <christian@grothoff.org>2011-12-25 21:15:59 +0000
commit67b441340a503a7a6219bc878c396ee02dfbe11a (patch)
treee3bccdc93016d86a7f610cbc967b1a2331c9b1fb
parent5e0aeba0b470423fd1865187a5a99e57bdc0797c (diff)
downloadgnunet-gtk-67b441340a503a7a6219bc878c396ee02dfbe11a.tar.gz
gnunet-gtk-67b441340a503a7a6219bc878c396ee02dfbe11a.zip
-remove code for keyword normalization, makes no sense in international application, normalization methods are questionable to begin with
-rw-r--r--contrib/gnunet_fs_gtk_advertise_pseudonym_dialog.glade16
-rw-r--r--contrib/gnunet_fs_gtk_main_window.glade17
-rw-r--r--contrib/gnunet_fs_gtk_publish_edit_dialog.glade16
-rw-r--r--src/fs/gnunet-fs-gtk-edit_publish_dialog.c90
4 files changed, 0 insertions, 139 deletions
diff --git a/contrib/gnunet_fs_gtk_advertise_pseudonym_dialog.glade b/contrib/gnunet_fs_gtk_advertise_pseudonym_dialog.glade
index 82cb3a2f..c1ab42fb 100644
--- a/contrib/gnunet_fs_gtk_advertise_pseudonym_dialog.glade
+++ b/contrib/gnunet_fs_gtk_advertise_pseudonym_dialog.glade
@@ -386,22 +386,6 @@
386 <property name="position">1</property> 386 <property name="position">1</property>
387 </packing> 387 </packing>
388 </child> 388 </child>
389 <child>
390 <object class="GtkButton" id="GNUNET_GTK_advertise_pseudonym_keyword_list_normalize_button">
391 <property name="label" translatable="yes">_Normalize</property>
392 <property name="sensitive">False</property>
393 <property name="can_focus">True</property>
394 <property name="receives_default">True</property>
395 <property name="use_action_appearance">False</property>
396 <property name="use_underline">True</property>
397 <signal name="clicked" handler="GNUNET_GTK_advertise_pseudonym_keyword_list_normalize_button_clicked_cb" swapped="no"/>
398 </object>
399 <packing>
400 <property name="expand">False</property>
401 <property name="fill">False</property>
402 <property name="position">2</property>
403 </packing>
404 </child>
405 </object> 389 </object>
406 <packing> 390 <packing>
407 <property name="expand">False</property> 391 <property name="expand">False</property>
diff --git a/contrib/gnunet_fs_gtk_main_window.glade b/contrib/gnunet_fs_gtk_main_window.glade
index 1c79e7cd..777784fa 100644
--- a/contrib/gnunet_fs_gtk_main_window.glade
+++ b/contrib/gnunet_fs_gtk_main_window.glade
@@ -369,23 +369,6 @@
369 <property name="position">1</property> 369 <property name="position">1</property>
370 </packing> 370 </packing>
371 </child> 371 </child>
372 <child>
373 <object class="GtkCheckButton" id="GNUNET_GTK_edit_publication_normalization_checkbox">
374 <property name="label" translatable="yes">Normalize all keywords a_utomatically after "OK" is pressed</property>
375 <property name="use_action_appearance">False</property>
376 <property name="sensitive">False</property>
377 <property name="can_focus">True</property>
378 <property name="receives_default">False</property>
379 <property name="use_underline">True</property>
380 <property name="draw_indicator">True</property>
381 <signal name="toggled" handler="GNUNET_GTK_edit_publication_normalization_checkbox_toggled_cb" swapped="no"/>
382 </object>
383 <packing>
384 <property name="expand">False</property>
385 <property name="fill">False</property>
386 <property name="position">2</property>
387 </packing>
388 </child>
389 </object> 372 </object>
390 <packing> 373 <packing>
391 <property name="expand">True</property> 374 <property name="expand">True</property>
diff --git a/contrib/gnunet_fs_gtk_publish_edit_dialog.glade b/contrib/gnunet_fs_gtk_publish_edit_dialog.glade
index 5607237f..32bf35ba 100644
--- a/contrib/gnunet_fs_gtk_publish_edit_dialog.glade
+++ b/contrib/gnunet_fs_gtk_publish_edit_dialog.glade
@@ -394,22 +394,6 @@
394 <property name="position">1</property> 394 <property name="position">1</property>
395 </packing> 395 </packing>
396 </child> 396 </child>
397 <child>
398 <object class="GtkButton" id="GNUNET_GTK_edit_file_information_keyword_list_normalize_button">
399 <property name="label" translatable="yes">_Normalize</property>
400 <property name="sensitive">False</property>
401 <property name="can_focus">True</property>
402 <property name="receives_default">True</property>
403 <property name="use_action_appearance">False</property>
404 <property name="use_underline">True</property>
405 <signal name="clicked" handler="GNUNET_GTK_edit_file_information_keyword_list_normalize_button_clicked_cb" swapped="no"/>
406 </object>
407 <packing>
408 <property name="expand">False</property>
409 <property name="fill">False</property>
410 <property name="position">2</property>
411 </packing>
412 </child>
413 </object> 397 </object>
414 <packing> 398 <packing>
415 <property name="expand">False</property> 399 <property name="expand">False</property>
diff --git a/src/fs/gnunet-fs-gtk-edit_publish_dialog.c b/src/fs/gnunet-fs-gtk-edit_publish_dialog.c
index f4ea52a4..980696b1 100644
--- a/src/fs/gnunet-fs-gtk-edit_publish_dialog.c
+++ b/src/fs/gnunet-fs-gtk-edit_publish_dialog.c
@@ -145,12 +145,6 @@ keywords_selection_changed_cb (GtkTreeSelection * ts, gpointer user_data)
145 145
146 gtk_widget_set_sensitive (button, 146 gtk_widget_set_sensitive (button,
147 gtk_tree_selection_get_selected (sel, NULL, NULL)); 147 gtk_tree_selection_get_selected (sel, NULL, NULL));
148 button =
149 GTK_WIDGET (gtk_builder_get_object
150 (builder,
151 "GNUNET_GTK_edit_publication_keyword_list_normalize_button"));
152 gtk_widget_set_sensitive (button,
153 gtk_tree_selection_get_selected (sel, NULL, NULL));
154} 148}
155 149
156 150
@@ -485,67 +479,6 @@ GNUNET_GTK_edit_publication_keyword_list_del_button_clicked_cb (
485 479
486 480
487void 481void
488GNUNET_GTK_edit_publication_keyword_list_normalize_button_clicked_cb (
489 GtkButton *button, gpointer user_data)
490{
491 GtkTreeView *tv;
492 GtkTreeSelection *sel;
493 GtkTreeModel *tm;
494 GtkTreeIter iter, inserted;
495 gchar *value;
496 struct GNUNET_FS_Uri *uri;
497 struct GNUNET_FS_Uri *nuri;
498 char *nvalue;
499 char *emsg;
500 GtkBuilder *builder;
501 builder = GTK_BUILDER (user_data);
502
503 tv = GTK_TREE_VIEW (gtk_builder_get_object
504 (builder,
505 "GNUNET_GTK_edit_publication_keyword_list_tree_view"));
506 sel = gtk_tree_view_get_selection (tv);
507 if (TRUE != gtk_tree_selection_get_selected (sel, &tm, &iter))
508 return;
509 gtk_tree_model_get (tm, &iter, 0, &value, -1);
510 emsg = NULL;
511 uri = GNUNET_FS_uri_ksk_create (value, &emsg);
512 if (uri == NULL)
513 {
514 GNUNET_break (0);
515 GNUNET_free (emsg);
516 g_free (value);
517 return;
518 }
519 nuri = GNUNET_FS_uri_ksk_canonicalize (uri);
520 nvalue = GNUNET_FS_uri_ksk_to_string_fancy (nuri);
521
522 if (strcmp (value, nvalue) != 0)
523 {
524 gtk_list_store_insert_after (GTK_LIST_STORE (tm), &inserted, &iter);
525 gtk_list_store_set (GTK_LIST_STORE (tm), &inserted, 0, nvalue, -1);
526 }
527 GNUNET_FS_uri_destroy (nuri);
528 GNUNET_FS_uri_destroy (uri);
529 GNUNET_free (nvalue);
530 g_free (value);
531}
532
533
534void
535GNUNET_GTK_edit_publication_normalization_checkbox_toggled_cb (
536 GtkToggleButton *button, gpointer user_data)
537{
538 GtkBuilder *builder;
539 GtkToggleButton *norm_button;
540 builder = GTK_BUILDER (user_data);
541 norm_button = GTK_TOGGLE_BUTTON (gtk_builder_get_object (builder,
542 "GNUNET_GTK_edit_publication_keyword_list_normalize_button"));
543 gtk_widget_set_sensitive (GTK_WIDGET (norm_button),
544 !gtk_toggle_button_get_active (norm_button));
545}
546
547
548void
549GNUNET_GTK_edit_publication_metadata_preview_file_chooser_button_file_set_cb ( 482GNUNET_GTK_edit_publication_metadata_preview_file_chooser_button_file_set_cb (
550 GtkFileChooserButton *widget, gpointer user_data) 483 GtkFileChooserButton *widget, gpointer user_data)
551{ 484{
@@ -714,7 +647,6 @@ file_information_update (void *cls, struct GNUNET_FS_FileInformation *fi,
714 const char *mime; 647 const char *mime;
715 GFile *f; 648 GFile *f;
716 GFileInfo *finfo; 649 GFileInfo *finfo;
717 gboolean auto_normalize = FALSE;
718 GObject *pubwindow; 650 GObject *pubwindow;
719 struct EditPublicationState *state = NULL; 651 struct EditPublicationState *state = NULL;
720 652
@@ -740,10 +672,6 @@ file_information_update (void *cls, struct GNUNET_FS_FileInformation *fi,
740 (gtk_builder_get_object 672 (gtk_builder_get_object
741 (builder, 673 (builder,
742 "GNUNET_GTK_edit_publication_index_checkbutton"))); 674 "GNUNET_GTK_edit_publication_index_checkbutton")));
743 auto_normalize = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON
744 (gtk_builder_get_object
745 (builder,
746 "GNUNET_GTK_edit_publication_normalization_checkbox")));
747 sb = GTK_SPIN_BUTTON (gtk_builder_get_object 675 sb = GTK_SPIN_BUTTON (gtk_builder_get_object
748 (builder, 676 (builder,
749 "GNUNET_GTK_edit_publication_expiration_year_spin_button")); 677 "GNUNET_GTK_edit_publication_expiration_year_spin_button"));
@@ -778,24 +706,6 @@ file_information_update (void *cls, struct GNUNET_FS_FileInformation *fi,
778 if (NULL != *uri) 706 if (NULL != *uri)
779 GNUNET_FS_uri_destroy (*uri); 707 GNUNET_FS_uri_destroy (*uri);
780 *uri = mrg; 708 *uri = mrg;
781 if (auto_normalize)
782 {
783 char *emsg = NULL;
784 struct GNUNET_FS_Uri *nuri;
785
786 nuri = GNUNET_FS_uri_ksk_create (value, &emsg);
787 if (nuri == NULL)
788 GNUNET_free_non_null (emsg);
789 else
790 {
791 nxt = GNUNET_FS_uri_ksk_canonicalize (nuri);
792 mrg = GNUNET_FS_uri_ksk_merge (nxt, *uri);
793 GNUNET_FS_uri_destroy (nxt);
794 if (NULL != *uri)
795 GNUNET_FS_uri_destroy (*uri);
796 *uri = mrg;
797 }
798 }
799 g_free (value); 709 g_free (value);
800 } 710 }
801 while (TRUE == gtk_tree_model_iter_next (tm, &iter)); 711 while (TRUE == gtk_tree_model_iter_next (tm, &iter));