diff options
author | Christian Grothoff <christian@grothoff.org> | 2005-08-23 08:42:03 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2005-08-23 08:42:03 +0000 |
commit | 5cd84f09d54c382b3ec4c2ead9d725666308c1ed (patch) | |
tree | 7bdf78dba68864be7a2ea89c037823c011420e09 | |
parent | a950c1b6cf061d5ff08ae4d3513903d3042a0ff7 (diff) | |
download | gnunet-gtk-5cd84f09d54c382b3ec4c2ead9d725666308c1ed.tar.gz gnunet-gtk-5cd84f09d54c382b3ec4c2ead9d725666308c1ed.zip |
fixing mantis 885
-rw-r--r-- | gnunet-gtk.glade | 22 | ||||
-rw-r--r-- | src/plugins/fs/meta.c | 3 | ||||
-rw-r--r-- | src/plugins/fs/namespace.c | 66 |
3 files changed, 32 insertions, 59 deletions
diff --git a/gnunet-gtk.glade b/gnunet-gtk.glade index 74f46be8..a915f2d7 100644 --- a/gnunet-gtk.glade +++ b/gnunet-gtk.glade | |||
@@ -1880,7 +1880,7 @@ Thank you, | |||
1880 | <property name="use_underline">True</property> | 1880 | <property name="use_underline">True</property> |
1881 | 1881 | ||
1882 | <child internal-child="image"> | 1882 | <child internal-child="image"> |
1883 | <widget class="GtkImage" id="image16"> | 1883 | <widget class="GtkImage" id="image37"> |
1884 | <property name="visible">True</property> | 1884 | <property name="visible">True</property> |
1885 | <property name="stock">gtk-new</property> | 1885 | <property name="stock">gtk-new</property> |
1886 | <property name="icon_size">1</property> | 1886 | <property name="icon_size">1</property> |
@@ -1932,7 +1932,7 @@ Thank you, | |||
1932 | <property name="use_underline">True</property> | 1932 | <property name="use_underline">True</property> |
1933 | 1933 | ||
1934 | <child internal-child="image"> | 1934 | <child internal-child="image"> |
1935 | <widget class="GtkImage" id="image17"> | 1935 | <widget class="GtkImage" id="image38"> |
1936 | <property name="visible">True</property> | 1936 | <property name="visible">True</property> |
1937 | <property name="stock">gtk-delete</property> | 1937 | <property name="stock">gtk-delete</property> |
1938 | <property name="icon_size">1</property> | 1938 | <property name="icon_size">1</property> |
@@ -3666,19 +3666,19 @@ Press ENTER to add the data.</atkproperty> | |||
3666 | <property name="spacing">0</property> | 3666 | <property name="spacing">0</property> |
3667 | 3667 | ||
3668 | <child> | 3668 | <child> |
3669 | <widget class="GtkButton" id="namespaceInsertButton"> | 3669 | <widget class="GtkButton" id="addButton"> |
3670 | <property name="visible">True</property> | 3670 | <property name="visible">True</property> |
3671 | <property name="tooltip" translatable="yes">Add additional files to this namespace.</property> | 3671 | <property name="tooltip" translatable="yes">Add content to the namespace</property> |
3672 | <property name="can_focus">True</property> | 3672 | <property name="can_focus">True</property> |
3673 | <property name="label">gtk-add</property> | 3673 | <property name="label">gtk-add</property> |
3674 | <property name="use_stock">True</property> | 3674 | <property name="use_stock">True</property> |
3675 | <property name="relief">GTK_RELIEF_NORMAL</property> | 3675 | <property name="relief">GTK_RELIEF_NORMAL</property> |
3676 | <property name="focus_on_click">True</property> | 3676 | <property name="focus_on_click">True</property> |
3677 | <signal name="clicked" handler="on_namespaceInsertButton_clicked" object="namespaceContentFrame" last_modification_time="Mon, 23 May 2005 19:00:01 GMT"/> | 3677 | <signal name="clicked" handler="on_namespaceInsertButton_clicked" last_modification_time="Tue, 23 Aug 2005 08:23:21 GMT"/> |
3678 | </widget> | 3678 | </widget> |
3679 | <packing> | 3679 | <packing> |
3680 | <property name="padding">0</property> | 3680 | <property name="padding">0</property> |
3681 | <property name="expand">True</property> | 3681 | <property name="expand">False</property> |
3682 | <property name="fill">True</property> | 3682 | <property name="fill">True</property> |
3683 | </packing> | 3683 | </packing> |
3684 | </child> | 3684 | </child> |
@@ -5466,7 +5466,7 @@ Phan Vinh Thinh <teppi82@gmail.com> | |||
5466 | <property name="right_padding">0</property> | 5466 | <property name="right_padding">0</property> |
5467 | 5467 | ||
5468 | <child> | 5468 | <child> |
5469 | <widget class="GtkComboBox" id="combobox1"> | 5469 | <widget class="GtkComboBox" id="namespaceInsertMetaTypeComboBox"> |
5470 | <property agent="glademm" name="cxx_visibility">public</property> | 5470 | <property agent="glademm" name="cxx_visibility">public</property> |
5471 | <property name="visible">True</property> | 5471 | <property name="visible">True</property> |
5472 | <property name="add_tearoffs">False</property> | 5472 | <property name="add_tearoffs">False</property> |
@@ -5530,7 +5530,7 @@ Phan Vinh Thinh <teppi82@gmail.com> | |||
5530 | </child> | 5530 | </child> |
5531 | 5531 | ||
5532 | <child> | 5532 | <child> |
5533 | <widget class="GtkButton" id="button10"> | 5533 | <widget class="GtkButton" id="namespaceInsertAddButton"> |
5534 | <property name="visible">True</property> | 5534 | <property name="visible">True</property> |
5535 | <property name="tooltip" translatable="yes">Add the given description to the meta-data describing the uploaded file.</property> | 5535 | <property name="tooltip" translatable="yes">Add the given description to the meta-data describing the uploaded file.</property> |
5536 | <property name="can_focus">True</property> | 5536 | <property name="can_focus">True</property> |
@@ -5538,7 +5538,7 @@ Phan Vinh Thinh <teppi82@gmail.com> | |||
5538 | <property name="use_stock">True</property> | 5538 | <property name="use_stock">True</property> |
5539 | <property name="relief">GTK_RELIEF_NORMAL</property> | 5539 | <property name="relief">GTK_RELIEF_NORMAL</property> |
5540 | <property name="focus_on_click">True</property> | 5540 | <property name="focus_on_click">True</property> |
5541 | <signal name="clicked" handler="on_metaDataDialogMetaDataAddButton_clicked" last_modification_time="Thu, 02 Jun 2005 12:44:47 GMT"/> | 5541 | <signal name="clicked" handler="on_namespaceUpdateMetaDataDialogMetaDataAddButton_clicked" last_modification_time="Tue, 23 Aug 2005 08:41:20 GMT"/> |
5542 | </widget> | 5542 | </widget> |
5543 | <packing> | 5543 | <packing> |
5544 | <property name="padding">0</property> | 5544 | <property name="padding">0</property> |
@@ -5575,7 +5575,7 @@ Phan Vinh Thinh <teppi82@gmail.com> | |||
5575 | <property name="visible">True</property> | 5575 | <property name="visible">True</property> |
5576 | <property name="tooltip" translatable="yes">Select entries and use the context menu (right click) in order to delete keywords.</property> | 5576 | <property name="tooltip" translatable="yes">Select entries and use the context menu (right click) in order to delete keywords.</property> |
5577 | <property name="can_focus">True</property> | 5577 | <property name="can_focus">True</property> |
5578 | <property name="headers_visible">False</property> | 5578 | <property name="headers_visible">True</property> |
5579 | <property name="rules_hint">True</property> | 5579 | <property name="rules_hint">True</property> |
5580 | <property name="reorderable">True</property> | 5580 | <property name="reorderable">True</property> |
5581 | <property name="enable_search">True</property> | 5581 | <property name="enable_search">True</property> |
@@ -5664,7 +5664,7 @@ Phan Vinh Thinh <teppi82@gmail.com> | |||
5664 | <property name="shadow_type">GTK_SHADOW_IN</property> | 5664 | <property name="shadow_type">GTK_SHADOW_IN</property> |
5665 | 5665 | ||
5666 | <child> | 5666 | <child> |
5667 | <widget class="GtkImage" id="image24"> | 5667 | <widget class="GtkImage" id="namespaceInsertPreview"> |
5668 | <property agent="glademm" name="cxx_visibility">public</property> | 5668 | <property agent="glademm" name="cxx_visibility">public</property> |
5669 | <property name="visible">True</property> | 5669 | <property name="visible">True</property> |
5670 | <property name="xalign">0.5</property> | 5670 | <property name="xalign">0.5</property> |
diff --git a/src/plugins/fs/meta.c b/src/plugins/fs/meta.c index f5361266..1848755b 100644 --- a/src/plugins/fs/meta.c +++ b/src/plugins/fs/meta.c | |||
@@ -89,7 +89,8 @@ void createMetaDataListTreeView(GladeXML * xml, | |||
89 | ECRS_getMetaData(init, | 89 | ECRS_getMetaData(init, |
90 | &publishMetaData, | 90 | &publishMetaData, |
91 | metamodel); | 91 | metamodel); |
92 | if (previewName == NULL) | 92 | if ( (previewName == NULL) || |
93 | (init == NULL) ) | ||
93 | return; | 94 | return; |
94 | preview = glade_xml_get_widget(xml, | 95 | preview = glade_xml_get_widget(xml, |
95 | previewName); | 96 | previewName); |
diff --git a/src/plugins/fs/namespace.c b/src/plugins/fs/namespace.c index 8c8ece20..a11ee771 100644 --- a/src/plugins/fs/namespace.c +++ b/src/plugins/fs/namespace.c | |||
@@ -654,6 +654,14 @@ static void initiateUpload(GtkTreeModel * model, | |||
654 | } | 654 | } |
655 | } | 655 | } |
656 | 656 | ||
657 | void on_namespaceUpdateMetaDataDialogMetaDataAddButton_clicked(GtkWidget * dummy1, | ||
658 | GtkWidget * dummy2) { | ||
659 | handleMetaDataListUpdate(metaXML, | ||
660 | "namespaceInsertMetaTypeComboBox", | ||
661 | "metaDataValueEntry", | ||
662 | "metaDataTreeView"); | ||
663 | } | ||
664 | |||
657 | void on_namespaceInsertButton_clicked(GtkWidget * dummy1, | 665 | void on_namespaceInsertButton_clicked(GtkWidget * dummy1, |
658 | GtkWidget * dummy2) { | 666 | GtkWidget * dummy2) { |
659 | const char * identifierName; | 667 | const char * identifierName; |
@@ -662,16 +670,10 @@ void on_namespaceInsertButton_clicked(GtkWidget * dummy1, | |||
662 | GtkWidget * nameLine; | 670 | GtkWidget * nameLine; |
663 | GtkWidget * page; | 671 | GtkWidget * page; |
664 | GtkWidget * notebook; | 672 | GtkWidget * notebook; |
665 | GtkWidget * metaList; | ||
666 | GtkWidget * dialog; | 673 | GtkWidget * dialog; |
667 | GtkWidget * spin; | 674 | GtkWidget * spin; |
668 | GtkWidget * update; | 675 | GtkWidget * update; |
669 | GtkListStore * metamodel; | ||
670 | GtkCellRenderer * renderer; | ||
671 | GtkTreeIter iter; | ||
672 | struct ECRS_MetaData * meta; | 676 | struct ECRS_MetaData * meta; |
673 | EXTRACTOR_KeywordType type; | ||
674 | char * mvalue; | ||
675 | HashCode512 nextId; | 677 | HashCode512 nextId; |
676 | GtkWidget * contentList; | 678 | GtkWidget * contentList; |
677 | GtkTreeSelection * selection; | 679 | GtkTreeSelection * selection; |
@@ -716,34 +718,17 @@ void on_namespaceInsertButton_clicked(GtkWidget * dummy1, | |||
716 | 718 | ||
717 | metaXML | 719 | metaXML |
718 | = glade_xml_new(getGladeFileName(), | 720 | = glade_xml_new(getGladeFileName(), |
719 | "namespaceMetaDataDialog", | 721 | "namespaceInsertDialog", |
720 | PACKAGE_NAME); | 722 | PACKAGE_NAME); |
721 | connectGladeWithPlugins(metaXML); | 723 | connectGladeWithPlugins(metaXML); |
724 | createMetaDataListTreeView(metaXML, | ||
725 | "metaDataTreeView", | ||
726 | "namespaceInsertPreview", | ||
727 | NULL); | ||
728 | createMetaTypeComboBox(metaXML, | ||
729 | "namespaceInsertMetaTypeComboBox"); | ||
722 | dialog = glade_xml_get_widget(metaXML, | 730 | dialog = glade_xml_get_widget(metaXML, |
723 | "namespaceMetaDataDialog"); | 731 | "namespaceInsertDialog"); |
724 | metamodel | ||
725 | = gtk_list_store_new(META_NUM, | ||
726 | G_TYPE_INT, | ||
727 | G_TYPE_STRING, | ||
728 | G_TYPE_STRING); | ||
729 | metaList = glade_xml_get_widget(metaXML, | ||
730 | "namespaceMetaDataDialogMetaDataList"); | ||
731 | renderer = gtk_cell_renderer_text_new(); | ||
732 | gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(metaList), | ||
733 | -1, | ||
734 | _("Category"), | ||
735 | renderer, | ||
736 | "text", META_STYPE, | ||
737 | NULL); | ||
738 | renderer = gtk_cell_renderer_text_new(); | ||
739 | gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(metaList), | ||
740 | -1, | ||
741 | _("Value"), | ||
742 | renderer, | ||
743 | "text", META_VALUE, | ||
744 | NULL); | ||
745 | gtk_tree_view_set_model(GTK_TREE_VIEW(metaList), | ||
746 | GTK_TREE_MODEL(metamodel)); | ||
747 | gtk_dialog_set_default_response(GTK_DIALOG(dialog), | 732 | gtk_dialog_set_default_response(GTK_DIALOG(dialog), |
748 | GTK_RESPONSE_OK); | 733 | GTK_RESPONSE_OK); |
749 | if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_OK) { | 734 | if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_OK) { |
@@ -772,21 +757,9 @@ void on_namespaceInsertButton_clicked(GtkWidget * dummy1, | |||
772 | return; | 757 | return; |
773 | } | 758 | } |
774 | 759 | ||
775 | meta = ECRS_createMetaData(); | 760 | meta = getMetaDataFromList(metaXML, |
776 | if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(metamodel), | 761 | "metaDataTreeView", |
777 | &iter)) { | 762 | "namespaceInsertPreview"); |
778 | do { | ||
779 | gtk_tree_model_get(GTK_TREE_MODEL(metamodel), | ||
780 | &iter, | ||
781 | META_TYPE, &type, | ||
782 | META_VALUE, &mvalue, | ||
783 | -1); | ||
784 | ECRS_addToMetaData(meta, | ||
785 | type, | ||
786 | mvalue); | ||
787 | } while (gtk_tree_model_iter_next(GTK_TREE_MODEL(metamodel), | ||
788 | &iter)); | ||
789 | } | ||
790 | spin = glade_xml_get_widget(metaXML, | 763 | spin = glade_xml_get_widget(metaXML, |
791 | "anonymitySpinButton"); | 764 | "anonymitySpinButton"); |
792 | cls.anonymityLevel | 765 | cls.anonymityLevel |
@@ -814,7 +787,6 @@ void on_namespaceInsertButton_clicked(GtkWidget * dummy1, | |||
814 | cls.nextId = &nextId; | 787 | cls.nextId = &nextId; |
815 | } | 788 | } |
816 | cls.meta = meta; | 789 | cls.meta = meta; |
817 | |||
818 | gtk_tree_selection_selected_foreach | 790 | gtk_tree_selection_selected_foreach |
819 | (selection, | 791 | (selection, |
820 | &initiateUpload, | 792 | &initiateUpload, |