diff options
author | Christian Grothoff <christian@grothoff.org> | 2006-12-03 22:02:03 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2006-12-03 22:02:03 +0000 |
commit | 39ecb7900c0d45d8fb56e0ae62ad924421f184b4 (patch) | |
tree | f29174f924cf4d1c7f9ef1351d3ee0717fa4f551 | |
parent | 92aa5cc54ea18e67c546f375be861ba526751646 (diff) | |
download | gnunet-gtk-39ecb7900c0d45d8fb56e0ae62ad924421f184b4.tar.gz gnunet-gtk-39ecb7900c0d45d8fb56e0ae62ad924421f184b4.zip |
removing of metadata and more button enabling/disabling code
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | TODO | 7 | ||||
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | gnunet-gtk.glade | 42 | ||||
-rw-r--r-- | src/plugins/fs/meta.c | 89 | ||||
-rw-r--r-- | src/plugins/fs/meta.h | 3 | ||||
-rw-r--r-- | src/plugins/fs/upload.c | 112 |
7 files changed, 215 insertions, 46 deletions
@@ -5,7 +5,9 @@ Sun Dec 3 14:47:46 MST 2006 | |||
5 | Completed downloads are marked using a green | 5 | Completed downloads are marked using a green |
6 | background. When manually entering a path | 6 | background. When manually entering a path |
7 | for uploads, switch between recursive and | 7 | for uploads, switch between recursive and |
8 | file-only is now automatic. | 8 | file-only is now automatic. It is now possible |
9 | to remove keywords and metadata in the upload | ||
10 | dialog. | ||
9 | 11 | ||
10 | Wed Nov 15 23:17:36 MST 2006 | 12 | Wed Nov 15 23:17:36 MST 2006 |
11 | Updated to GNUnet 0.7.1pre0 APIs. Disabled | 13 | Updated to GNUnet 0.7.1pre0 APIs. Disabled |
@@ -1,6 +1,5 @@ | |||
1 | 0.7.1: | 1 | 0.7.1: |
2 | - allow deletion of keywords and metadata [pre1] | 2 | - fix addition of previews for uploads [pre2] |
3 | |||
4 | - create directory from known file IDs [ medium ] [pre2] | 3 | - create directory from known file IDs [ medium ] [pre2] |
5 | in Assemble Directory's Files Available/Selected | 4 | in Assemble Directory's Files Available/Selected |
6 | + have sortability | 5 | + have sortability |
@@ -29,6 +28,10 @@ ODD BUGS TO WATCH OUT FOR (seen, possibly fixed, hard to reproduce): | |||
29 | * clean, short namespace search URIs | 28 | * clean, short namespace search URIs |
30 | - fix custom gtk logger (via memory logger?) | 29 | - fix custom gtk logger (via memory logger?) |
31 | - show content of current collection | 30 | - show content of current collection |
31 | - color-coding of pending/completion of search results | ||
32 | should be made persistent (currently reverts to white | ||
33 | when gnunet-gtk is stopped and restarted); also need | ||
34 | to add color for results previously downloaded | ||
32 | 35 | ||
33 | 0.7.3: | 36 | 0.7.3: |
34 | - pop-up dialogs / context menus (show extra information, | 37 | - pop-up dialogs / context menus (show extra information, |
diff --git a/configure.ac b/configure.ac index be3a5223..a1a78275 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -20,8 +20,8 @@ | |||
20 | # Process this file with autoconf to produce a configure script. | 20 | # Process this file with autoconf to produce a configure script. |
21 | # | 21 | # |
22 | AC_PREREQ(2.57) | 22 | AC_PREREQ(2.57) |
23 | AC_INIT([gnunet-gtk],[0.7.1pre0],[bug-gnunet@gnu.org]) | 23 | AC_INIT([gnunet-gtk],[0.7.1pre1],[bug-gnunet@gnu.org]) |
24 | AM_INIT_AUTOMAKE([gnunet-gtk], [0.7.1pre0]) | 24 | AM_INIT_AUTOMAKE([gnunet-gtk], [0.7.1pre1]) |
25 | AM_CONFIG_HEADER(config.h) | 25 | AM_CONFIG_HEADER(config.h) |
26 | 26 | ||
27 | AH_TOP([#define _GNU_SOURCE 1]) | 27 | AH_TOP([#define _GNU_SOURCE 1]) |
diff --git a/gnunet-gtk.glade b/gnunet-gtk.glade index 568e3f22..dc28921a 100644 --- a/gnunet-gtk.glade +++ b/gnunet-gtk.glade | |||
@@ -3832,6 +3832,7 @@ This release fixes downloads of files from directories. The previous version ha | |||
3832 | <atkproperty name="AtkObject::accessible_description" translatable="yes">Enter the value for the meta-data of the specified type here. | 3832 | <atkproperty name="AtkObject::accessible_description" translatable="yes">Enter the value for the meta-data of the specified type here. |
3833 | Press ENTER to add the data.</atkproperty> | 3833 | Press ENTER to add the data.</atkproperty> |
3834 | </accessibility> | 3834 | </accessibility> |
3835 | <signal name="changed" handler="on_metaDataDialogValueEntry_changed_" last_modification_time="Sun, 03 Dec 2006 22:18:00 GMT"/> | ||
3835 | <accelerator key="Return" modifiers="0" signal="activate"/> | 3836 | <accelerator key="Return" modifiers="0" signal="activate"/> |
3836 | </widget> | 3837 | </widget> |
3837 | <packing> | 3838 | <packing> |
@@ -3844,6 +3845,7 @@ Press ENTER to add the data.</atkproperty> | |||
3844 | <child> | 3845 | <child> |
3845 | <widget class="GtkButton" id="metaDataDialogMetaDataAddButton"> | 3846 | <widget class="GtkButton" id="metaDataDialogMetaDataAddButton"> |
3846 | <property name="visible">True</property> | 3847 | <property name="visible">True</property> |
3848 | <property name="sensitive">False</property> | ||
3847 | <property name="tooltip" translatable="yes">Add the given description to the meta-data describing the uploaded file.</property> | 3849 | <property name="tooltip" translatable="yes">Add the given description to the meta-data describing the uploaded file.</property> |
3848 | <property name="can_focus">True</property> | 3850 | <property name="can_focus">True</property> |
3849 | <property name="label">gtk-add</property> | 3851 | <property name="label">gtk-add</property> |
@@ -3858,6 +3860,25 @@ Press ENTER to add the data.</atkproperty> | |||
3858 | <property name="fill">False</property> | 3860 | <property name="fill">False</property> |
3859 | </packing> | 3861 | </packing> |
3860 | </child> | 3862 | </child> |
3863 | |||
3864 | <child> | ||
3865 | <widget class="GtkButton" id="metaDataDialogMetaDataRemoveButton"> | ||
3866 | <property name="visible">True</property> | ||
3867 | <property name="sensitive">False</property> | ||
3868 | <property name="tooltip" translatable="yes">Remove the selected descriptions from the meta-data describing the uploaded file.</property> | ||
3869 | <property name="can_focus">True</property> | ||
3870 | <property name="label">gtk-remove</property> | ||
3871 | <property name="use_stock">True</property> | ||
3872 | <property name="relief">GTK_RELIEF_NORMAL</property> | ||
3873 | <property name="focus_on_click">True</property> | ||
3874 | <signal name="clicked" handler="on_metaDataDialogMetaDataRemoveButton_clicked_" last_modification_time="Sun, 03 Dec 2006 22:03:32 GMT"/> | ||
3875 | </widget> | ||
3876 | <packing> | ||
3877 | <property name="padding">0</property> | ||
3878 | <property name="expand">False</property> | ||
3879 | <property name="fill">False</property> | ||
3880 | </packing> | ||
3881 | </child> | ||
3861 | </widget> | 3882 | </widget> |
3862 | <packing> | 3883 | <packing> |
3863 | <property name="padding">0</property> | 3884 | <property name="padding">0</property> |
@@ -3974,6 +3995,7 @@ Press ENTER to add the data.</atkproperty> | |||
3974 | <property name="has_frame">True</property> | 3995 | <property name="has_frame">True</property> |
3975 | <property name="invisible_char">*</property> | 3996 | <property name="invisible_char">*</property> |
3976 | <property name="activates_default">False</property> | 3997 | <property name="activates_default">False</property> |
3998 | <signal name="changed" handler="on_fileInformationKeywordEntry_changed_" last_modification_time="Sun, 03 Dec 2006 22:20:08 GMT"/> | ||
3977 | <accelerator key="Return" modifiers="0" signal="activate"/> | 3999 | <accelerator key="Return" modifiers="0" signal="activate"/> |
3978 | </widget> | 4000 | </widget> |
3979 | <packing> | 4001 | <packing> |
@@ -3986,6 +4008,7 @@ Press ENTER to add the data.</atkproperty> | |||
3986 | <child> | 4008 | <child> |
3987 | <widget class="GtkButton" id="metaDataDialogKeywordAddButton"> | 4009 | <widget class="GtkButton" id="metaDataDialogKeywordAddButton"> |
3988 | <property name="visible">True</property> | 4010 | <property name="visible">True</property> |
4011 | <property name="sensitive">False</property> | ||
3989 | <property name="tooltip" translatable="yes">Add the specified keyword to the list of keywords under which the file or directory will be found.</property> | 4012 | <property name="tooltip" translatable="yes">Add the specified keyword to the list of keywords under which the file or directory will be found.</property> |
3990 | <property name="can_focus">True</property> | 4013 | <property name="can_focus">True</property> |
3991 | <property name="label">gtk-add</property> | 4014 | <property name="label">gtk-add</property> |
@@ -4000,6 +4023,25 @@ Press ENTER to add the data.</atkproperty> | |||
4000 | <property name="fill">False</property> | 4023 | <property name="fill">False</property> |
4001 | </packing> | 4024 | </packing> |
4002 | </child> | 4025 | </child> |
4026 | |||
4027 | <child> | ||
4028 | <widget class="GtkButton" id="metaDataDialogKeywordRemoveButton"> | ||
4029 | <property name="visible">True</property> | ||
4030 | <property name="sensitive">False</property> | ||
4031 | <property name="tooltip" translatable="yes">Remove the selected keywords from the list of keywords under which the file or directory will be found.</property> | ||
4032 | <property name="can_focus">True</property> | ||
4033 | <property name="label">gtk-remove</property> | ||
4034 | <property name="use_stock">True</property> | ||
4035 | <property name="relief">GTK_RELIEF_NORMAL</property> | ||
4036 | <property name="focus_on_click">True</property> | ||
4037 | <signal name="clicked" handler="on_metaDataDialogKeywordRemoveButton_clicked_" last_modification_time="Sun, 03 Dec 2006 22:02:02 GMT"/> | ||
4038 | </widget> | ||
4039 | <packing> | ||
4040 | <property name="padding">0</property> | ||
4041 | <property name="expand">False</property> | ||
4042 | <property name="fill">False</property> | ||
4043 | </packing> | ||
4044 | </child> | ||
4003 | </widget> | 4045 | </widget> |
4004 | <packing> | 4046 | <packing> |
4005 | <property name="padding">0</property> | 4047 | <property name="padding">0</property> |
diff --git a/src/plugins/fs/meta.c b/src/plugins/fs/meta.c index cb32959c..6cbab5f5 100644 --- a/src/plugins/fs/meta.c +++ b/src/plugins/fs/meta.c | |||
@@ -56,7 +56,7 @@ void createMetaDataListTreeView(GladeXML * xml, | |||
56 | const char * name, | 56 | const char * name, |
57 | const char * previewName, | 57 | const char * previewName, |
58 | const struct ECRS_MetaData * init) { | 58 | const struct ECRS_MetaData * init) { |
59 | GtkWidget * metaList; | 59 | GtkTreeView * metaList; |
60 | GtkListStore * metamodel; | 60 | GtkListStore * metamodel; |
61 | GtkCellRenderer * renderer; | 61 | GtkCellRenderer * renderer; |
62 | GtkWidget * preview; | 62 | GtkWidget * preview; |
@@ -73,47 +73,39 @@ void createMetaDataListTreeView(GladeXML * xml, | |||
73 | G_TYPE_INT, | 73 | G_TYPE_INT, |
74 | G_TYPE_STRING, | 74 | G_TYPE_STRING, |
75 | G_TYPE_STRING); | 75 | G_TYPE_STRING); |
76 | metaList = glade_xml_get_widget(xml, | 76 | metaList = GTK_TREE_VIEW(glade_xml_get_widget(xml, |
77 | name); | 77 | name)); |
78 | gtk_tree_selection_set_mode(gtk_tree_view_get_selection(metaList), | ||
79 | GTK_SELECTION_MULTIPLE); | ||
78 | renderer = gtk_cell_renderer_text_new(); | 80 | renderer = gtk_cell_renderer_text_new(); |
79 | col = gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(metaList), | 81 | col = gtk_tree_view_insert_column_with_attributes(metaList, |
80 | -1, | 82 | -1, |
81 | _("Category"), | 83 | _("Category"), |
82 | renderer, | 84 | renderer, |
83 | "text", META_STYPE, | 85 | "text", META_STYPE, |
84 | NULL); | 86 | NULL); |
85 | column = gtk_tree_view_get_column(GTK_TREE_VIEW(metaList), | 87 | column = gtk_tree_view_get_column(metaList, |
86 | col - 1); | 88 | col - 1); |
87 | gtk_tree_view_column_set_resizable(column, TRUE); | 89 | gtk_tree_view_column_set_resizable(column, TRUE); |
88 | gtk_tree_view_column_set_clickable(column, TRUE); | 90 | gtk_tree_view_column_set_clickable(column, TRUE); |
89 | gtk_tree_view_column_set_reorderable(column, TRUE); | 91 | gtk_tree_view_column_set_reorderable(column, TRUE); |
90 | gtk_tree_view_column_set_sort_column_id(column, META_STYPE); | 92 | gtk_tree_view_column_set_sort_column_id(column, META_STYPE); |
91 | /*gtk_tree_view_column_set_sort_indicator(column, TRUE);*/ | ||
92 | |||
93 | gtk_tree_view_column_set_resizable(gtk_tree_view_get_column(GTK_TREE_VIEW(metaList), | ||
94 | col - 1), | ||
95 | TRUE); | ||
96 | renderer = gtk_cell_renderer_text_new(); | 93 | renderer = gtk_cell_renderer_text_new(); |
97 | col = gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(metaList), | 94 | col = gtk_tree_view_insert_column_with_attributes(metaList, |
98 | -1, | 95 | -1, |
99 | _("Value"), | 96 | _("Value"), |
100 | renderer, | 97 | renderer, |
101 | "text", META_VALUE, | 98 | "text", META_VALUE, |
102 | NULL); | 99 | NULL); |
103 | column = gtk_tree_view_get_column(GTK_TREE_VIEW(metaList), | 100 | column = gtk_tree_view_get_column(metaList, |
104 | col - 1); | 101 | col - 1); |
105 | gtk_tree_view_column_set_resizable(column, TRUE); | 102 | gtk_tree_view_column_set_resizable(column, TRUE); |
106 | gtk_tree_view_column_set_clickable(column, TRUE); | 103 | gtk_tree_view_column_set_clickable(column, TRUE); |
107 | gtk_tree_view_column_set_reorderable(column, TRUE); | 104 | gtk_tree_view_column_set_reorderable(column, TRUE); |
108 | gtk_tree_view_column_set_sort_column_id(column, META_VALUE); | 105 | gtk_tree_view_column_set_sort_column_id(column, META_VALUE); |
109 | /*gtk_tree_view_column_set_sort_indicator(column, TRUE);*/ | 106 | gtk_tree_view_set_model(metaList, |
110 | gtk_tree_view_column_set_resizable(gtk_tree_view_get_column(GTK_TREE_VIEW(metaList), | ||
111 | col - 1), | ||
112 | TRUE); | ||
113 | gtk_tree_view_set_model(GTK_TREE_VIEW(metaList), | ||
114 | GTK_TREE_MODEL(metamodel)); | 107 | GTK_TREE_MODEL(metamodel)); |
115 | gtk_tree_selection_set_mode(gtk_tree_view_get_selection(GTK_TREE_VIEW(metaList)), | 108 | |
116 | GTK_SELECTION_MULTIPLE); | ||
117 | if (init != NULL) | 109 | if (init != NULL) |
118 | ECRS_getMetaData(init, | 110 | ECRS_getMetaData(init, |
119 | &publishMetaData, | 111 | &publishMetaData, |
@@ -168,7 +160,7 @@ static int publishKeyword(const char * data, | |||
168 | void createKeywordListTreeView(GladeXML * xml, | 160 | void createKeywordListTreeView(GladeXML * xml, |
169 | const char * name, | 161 | const char * name, |
170 | const struct ECRS_URI * init) { | 162 | const struct ECRS_URI * init) { |
171 | GtkWidget * keywordList; | 163 | GtkTreeView * keywordList; |
172 | GtkListStore * keymodel; | 164 | GtkListStore * keymodel; |
173 | GtkCellRenderer * renderer; | 165 | GtkCellRenderer * renderer; |
174 | GtkTreeViewColumn * column; | 166 | GtkTreeViewColumn * column; |
@@ -177,26 +169,25 @@ void createKeywordListTreeView(GladeXML * xml, | |||
177 | keymodel | 169 | keymodel |
178 | = gtk_list_store_new(1, | 170 | = gtk_list_store_new(1, |
179 | G_TYPE_STRING); | 171 | G_TYPE_STRING); |
180 | keywordList = glade_xml_get_widget(xml, | 172 | keywordList = GTK_TREE_VIEW(glade_xml_get_widget(xml, |
181 | name); | 173 | name)); |
174 | gtk_tree_selection_set_mode(gtk_tree_view_get_selection(keywordList), | ||
175 | GTK_SELECTION_MULTIPLE); | ||
182 | renderer = gtk_cell_renderer_text_new(); | 176 | renderer = gtk_cell_renderer_text_new(); |
183 | gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(keywordList), | 177 | gtk_tree_view_insert_column_with_attributes(keywordList, |
184 | -1, | 178 | -1, |
185 | _("Keyword"), | 179 | _("Keyword"), |
186 | renderer, | 180 | renderer, |
187 | "text", 0, | 181 | "text", 0, |
188 | NULL); | 182 | NULL); |
189 | column = gtk_tree_view_get_column(GTK_TREE_VIEW(keywordList), | 183 | column = gtk_tree_view_get_column(keywordList, |
190 | 0); | 184 | 0); |
191 | gtk_tree_view_column_set_resizable(column, TRUE); | 185 | gtk_tree_view_column_set_resizable(column, TRUE); |
192 | gtk_tree_view_column_set_clickable(column, TRUE); | 186 | gtk_tree_view_column_set_clickable(column, TRUE); |
193 | gtk_tree_view_column_set_reorderable(column, TRUE); | 187 | gtk_tree_view_column_set_reorderable(column, TRUE); |
194 | gtk_tree_view_column_set_sort_column_id(column, 0); | 188 | gtk_tree_view_column_set_sort_column_id(column, 0); |
195 | /*gtk_tree_view_column_set_sort_indicator(column, TRUE);*/ | 189 | gtk_tree_view_set_model(keywordList, |
196 | gtk_tree_view_set_model(GTK_TREE_VIEW(keywordList), | ||
197 | GTK_TREE_MODEL(keymodel)); | 190 | GTK_TREE_MODEL(keymodel)); |
198 | gtk_tree_selection_set_mode(gtk_tree_view_get_selection(GTK_TREE_VIEW(keywordList)), | ||
199 | GTK_SELECTION_MULTIPLE); | ||
200 | if (init != NULL) | 191 | if (init != NULL) |
201 | ECRS_getKeywordsFromUri(init, | 192 | ECRS_getKeywordsFromUri(init, |
202 | &publishKeyword, | 193 | &publishKeyword, |
@@ -322,6 +313,26 @@ void handleMetaDataListUpdate(GladeXML * xml, | |||
322 | DEBUG_END(); | 313 | DEBUG_END(); |
323 | } | 314 | } |
324 | 315 | ||
316 | static void removeRow(GtkTreeModel * model, | ||
317 | GtkTreePath * path, | ||
318 | GtkTreeIter * iter, | ||
319 | gpointer unused) { | ||
320 | gtk_list_store_remove(GTK_LIST_STORE(model), | ||
321 | iter); | ||
322 | } | ||
323 | |||
324 | void handleListRemove(GladeXML * xml, | ||
325 | const char * listName) { | ||
326 | GtkWidget * list; | ||
327 | |||
328 | list = glade_xml_get_widget(xml, | ||
329 | listName); | ||
330 | ggc_tree_selection_selected_foreach | ||
331 | (gtk_tree_view_get_selection(GTK_TREE_VIEW(list)), | ||
332 | &removeRow, | ||
333 | NULL); | ||
334 | } | ||
335 | |||
325 | struct ECRS_MetaData * getMetaDataFromList(GladeXML * xml, | 336 | struct ECRS_MetaData * getMetaDataFromList(GladeXML * xml, |
326 | const char * name, | 337 | const char * name, |
327 | const char * previewName) { | 338 | const char * previewName) { |
@@ -587,7 +598,7 @@ const char * getEntryLineValue(GladeXML * xml, | |||
587 | const char * widgetName) { | 598 | const char * widgetName) { |
588 | GtkBin * line; | 599 | GtkBin * line; |
589 | GtkEntry * entry; | 600 | GtkEntry * entry; |
590 | 601 | ||
591 | line = GTK_BIN(glade_xml_get_widget(xml, | 602 | line = GTK_BIN(glade_xml_get_widget(xml, |
592 | widgetName)); | 603 | widgetName)); |
593 | entry = GTK_ENTRY(gtk_bin_get_child(line)); | 604 | entry = GTK_ENTRY(gtk_bin_get_child(line)); |
diff --git a/src/plugins/fs/meta.h b/src/plugins/fs/meta.h index f9650b6a..d9a0e01d 100644 --- a/src/plugins/fs/meta.h +++ b/src/plugins/fs/meta.h | |||
@@ -51,6 +51,9 @@ void handleMetaDataListUpdate(GladeXML * xml, | |||
51 | const char * valueInputLineName, | 51 | const char * valueInputLineName, |
52 | const char * metaDataListName); | 52 | const char * metaDataListName); |
53 | 53 | ||
54 | void handleListRemove(GladeXML * xml, | ||
55 | const char * listName); | ||
56 | |||
54 | struct ECRS_MetaData * | 57 | struct ECRS_MetaData * |
55 | getMetaDataFromList(GladeXML * xml, | 58 | getMetaDataFromList(GladeXML * xml, |
56 | const char * name, | 59 | const char * name, |
diff --git a/src/plugins/fs/upload.c b/src/plugins/fs/upload.c index 91114d11..9d3fea8d 100644 --- a/src/plugins/fs/upload.c +++ b/src/plugins/fs/upload.c | |||
@@ -214,20 +214,108 @@ void on_selectAlternativePreviewButton_selection_changed_fs(GtkWidget * preview, | |||
214 | } | 214 | } |
215 | 215 | ||
216 | void on_metaDataDialogKeywordAddButton_clicked_fs(gpointer dummy, | 216 | void on_metaDataDialogKeywordAddButton_clicked_fs(gpointer dummy, |
217 | GtkWidget * uploadButton) { | 217 | GtkWidget * button) { |
218 | handleKeywordListUpdate(metaXML, | 218 | handleKeywordListUpdate(metaXML, |
219 | "fileInformationKeywordEntry", | 219 | "fileInformationKeywordEntry", |
220 | "metaDataDialogKeywordList"); | 220 | "metaDataDialogKeywordList"); |
221 | } | 221 | } |
222 | 222 | ||
223 | void on_metaDataDialogMetaDataAddButton_clicked_fs(gpointer dummy, | 223 | void on_metaDataDialogMetaDataAddButton_clicked_fs(gpointer dummy, |
224 | GtkWidget * uploadButton) { | 224 | GtkWidget * button) { |
225 | handleMetaDataListUpdate(metaXML, | 225 | handleMetaDataListUpdate(metaXML, |
226 | "metaDataDialogMetaTypeComboBox", | 226 | "metaDataDialogMetaTypeComboBox", |
227 | "metaDataDialogValueEntry", | 227 | "metaDataDialogValueEntry", |
228 | "metaDataDialogMetaDataList"); | 228 | "metaDataDialogMetaDataList"); |
229 | } | 229 | } |
230 | 230 | ||
231 | void on_metaDataDialogKeywordRemoveButton_clicked_fs(gpointer dummy, | ||
232 | GtkWidget * button) { | ||
233 | handleListRemove(metaXML, | ||
234 | "metaDataDialogKeywordList"); | ||
235 | } | ||
236 | |||
237 | void on_metaDataDialogMetaDataRemoveButton_clicked_fs(gpointer dummy, | ||
238 | GtkWidget * button) { | ||
239 | handleListRemove(metaXML, | ||
240 | "metaDataDialogMetaDataList"); | ||
241 | } | ||
242 | |||
243 | /** | ||
244 | * The selection of the keyword list changed. | ||
245 | * Update button status. | ||
246 | */ | ||
247 | static void on_keyword_list_selection_changed(gpointer signal, | ||
248 | gpointer cls) { | ||
249 | GtkTreeSelection * selection; | ||
250 | GtkWidget * button; | ||
251 | |||
252 | selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(glade_xml_get_widget(metaXML, | ||
253 | "metaDataDialogKeywordList"))); | ||
254 | button | ||
255 | = glade_xml_get_widget(metaXML, | ||
256 | "metaDataDialogKeywordRemoveButton"); | ||
257 | gtk_widget_set_sensitive(button, | ||
258 | gtk_tree_selection_count_selected_rows(selection) > 0); | ||
259 | } | ||
260 | |||
261 | /** | ||
262 | * The selection of the metadata list changed. | ||
263 | * Update button status. | ||
264 | */ | ||
265 | static void on_metadata_list_selection_changed(gpointer signal, | ||
266 | gpointer cls) { | ||
267 | GtkTreeSelection * selection; | ||
268 | GtkWidget * button; | ||
269 | |||
270 | selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(glade_xml_get_widget(metaXML, | ||
271 | "metaDataDialogMetaDataList"))); | ||
272 | button | ||
273 | = glade_xml_get_widget(metaXML, | ||
274 | "metaDataDialogMetaDataRemoveButton"); | ||
275 | gtk_widget_set_sensitive(button, | ||
276 | gtk_tree_selection_count_selected_rows(selection) > 0); | ||
277 | } | ||
278 | |||
279 | /** | ||
280 | * The user has edited the metadata entry. | ||
281 | * Update add button status. | ||
282 | */ | ||
283 | void on_metaDataDialogValueEntry_changed_fs(gpointer dummy2, | ||
284 | GtkWidget * searchEntry) { | ||
285 | const char * input; | ||
286 | GtkWidget * button; | ||
287 | |||
288 | input = gtk_entry_get_text(GTK_ENTRY(glade_xml_get_widget(metaXML, | ||
289 | "metaDataDialogValueEntry"))); | ||
290 | if (input == NULL) | ||
291 | return; | ||
292 | button | ||
293 | = glade_xml_get_widget(metaXML, | ||
294 | "metaDataDialogMetaDataAddButton"); | ||
295 | gtk_widget_set_sensitive(button, | ||
296 | strlen(input) > 0); | ||
297 | } | ||
298 | |||
299 | /** | ||
300 | * The user has edited the keyword entry. | ||
301 | * Update add button status. | ||
302 | */ | ||
303 | void on_fileInformationKeywordEntry_changed_fs(gpointer dummy2, | ||
304 | GtkWidget * searchEntry) { | ||
305 | const char * input; | ||
306 | GtkWidget * button; | ||
307 | |||
308 | input = gtk_entry_get_text(GTK_ENTRY(glade_xml_get_widget(metaXML, | ||
309 | "fileInformationKeywordEntry"))); | ||
310 | if (input == NULL) | ||
311 | return; | ||
312 | button | ||
313 | = glade_xml_get_widget(metaXML, | ||
314 | "metaDataDialogKeywordAddButton"); | ||
315 | gtk_widget_set_sensitive(button, | ||
316 | strlen(input) > 0); | ||
317 | } | ||
318 | |||
231 | void on_fsinsertuploadbutton_clicked_fs(gpointer dummy, | 319 | void on_fsinsertuploadbutton_clicked_fs(gpointer dummy, |
232 | GtkWidget * uploadButton) { | 320 | GtkWidget * uploadButton) { |
233 | const char * filenamerest; | 321 | const char * filenamerest; |
@@ -286,6 +374,26 @@ void on_fsinsertuploadbutton_clicked_fs(gpointer dummy, | |||
286 | ECRS_freeUri(keywordURI); | 374 | ECRS_freeUri(keywordURI); |
287 | createMetaTypeComboBox(metaXML, | 375 | createMetaTypeComboBox(metaXML, |
288 | "metaDataDialogMetaTypeComboBox"); | 376 | "metaDataDialogMetaTypeComboBox"); |
377 | |||
378 | |||
379 | g_signal_connect_data(gtk_tree_view_get_selection(GTK_TREE_VIEW(glade_xml_get_widget(metaXML, | ||
380 | "metaDataDialogKeywordList"))), | ||
381 | "changed", | ||
382 | G_CALLBACK(&on_keyword_list_selection_changed), | ||
383 | NULL, | ||
384 | NULL, | ||
385 | 0); | ||
386 | g_signal_connect_data(gtk_tree_view_get_selection(GTK_TREE_VIEW(glade_xml_get_widget(metaXML, | ||
387 | "metaDataDialogMetaDataList"))), | ||
388 | "changed", | ||
389 | G_CALLBACK(&on_metadata_list_selection_changed), | ||
390 | NULL, | ||
391 | NULL, | ||
392 | 0); | ||
393 | |||
394 | |||
395 | |||
396 | |||
289 | gtk_dialog_set_default_response(GTK_DIALOG(dialog), | 397 | gtk_dialog_set_default_response(GTK_DIALOG(dialog), |
290 | GTK_RESPONSE_OK); | 398 | GTK_RESPONSE_OK); |
291 | if (gtk_dialog_run(GTK_DIALOG(dialog)) != GTK_RESPONSE_CANCEL) { | 399 | if (gtk_dialog_run(GTK_DIALOG(dialog)) != GTK_RESPONSE_CANCEL) { |