diff options
Diffstat (limited to 'src/fs/gnunet-fs-gtk_publish-edit-dialog.c')
-rw-r--r-- | src/fs/gnunet-fs-gtk_publish-edit-dialog.c | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/src/fs/gnunet-fs-gtk_publish-edit-dialog.c b/src/fs/gnunet-fs-gtk_publish-edit-dialog.c index 196726a1..3f84c820 100644 --- a/src/fs/gnunet-fs-gtk_publish-edit-dialog.c +++ b/src/fs/gnunet-fs-gtk_publish-edit-dialog.c | |||
@@ -353,9 +353,8 @@ GNUNET_GTK_edit_publication_type_combo_changed_cb (GtkComboBox * widget, | |||
353 | * @param ts the tree selection object | 353 | * @param ts the tree selection object |
354 | * @param user_data the 'struct EditPublicationDialogContext' | 354 | * @param user_data the 'struct EditPublicationDialogContext' |
355 | */ | 355 | */ |
356 | /* FIXME-GTK3: connect this signal via glade (modern versions of Glade support this) */ | 356 | void |
357 | static void | 357 | GNUNET_GTK_edit_publication_metadata_treeview_selection_changed_cb (GtkTreeSelection *ts, |
358 | metadata_selection_changed_cb (GtkTreeSelection *ts, | ||
359 | gpointer user_data) | 358 | gpointer user_data) |
360 | { | 359 | { |
361 | struct EditPublicationDialogContext *ctx = user_data; | 360 | struct EditPublicationDialogContext *ctx = user_data; |
@@ -607,9 +606,8 @@ GNUNET_GTK_edit_publication_metadata_preview_file_chooser_button_file_set_cb (Gt | |||
607 | * @param ts the tree selection object | 606 | * @param ts the tree selection object |
608 | * @param user_data the 'struct EditPublicationDialogContext' | 607 | * @param user_data the 'struct EditPublicationDialogContext' |
609 | */ | 608 | */ |
610 | /* FIXME-GTK3: connect this signal via glade (modern versions of Glade support this) */ | 609 | void |
611 | static void | 610 | GNUNET_GTK_edit_publication_keyword_list_treeview_selection_changed_cb (GtkTreeSelection *ts, |
612 | keywords_selection_changed_cb (GtkTreeSelection *ts, | ||
613 | gpointer user_data) | 611 | gpointer user_data) |
614 | { | 612 | { |
615 | struct EditPublicationDialogContext *ctx = user_data; | 613 | struct EditPublicationDialogContext *ctx = user_data; |
@@ -1057,7 +1055,7 @@ file_information_update (void *cls, struct GNUNET_FS_FileInformation *fi, | |||
1057 | /* fall back to Gtk mime-detection; this only works on GNU */ | 1055 | /* fall back to Gtk mime-detection; this only works on GNU */ |
1058 | GFileInfo *finfo; | 1056 | GFileInfo *finfo; |
1059 | const char *gmime; | 1057 | const char *gmime; |
1060 | 1058 | ||
1061 | finfo = g_file_query_info (f, G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE, | 1059 | finfo = g_file_query_info (f, G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE, |
1062 | 0, NULL, NULL); | 1060 | 0, NULL, NULL); |
1063 | gmime = g_file_info_get_attribute_string (finfo, | 1061 | gmime = g_file_info_get_attribute_string (finfo, |
@@ -1241,11 +1239,11 @@ file_information_import (void *cls, | |||
1241 | * | 1239 | * |
1242 | * @param parent parent window of the dialog | 1240 | * @param parent parent window of the dialog |
1243 | * @param fip information about the file information that is to be edited | 1241 | * @param fip information about the file information that is to be edited |
1244 | * @param is_namespace_edit GNUNET_YES if we are editing a namespace advertisement; | 1242 | * @param is_namespace_edit #GNUNET_YES if we are editing a namespace advertisement; |
1245 | * this means that keywords are required and that a "root" can be | 1243 | * this means that keywords are required and that a "root" can be |
1246 | * entered | 1244 | * entered |
1247 | * @param cb function to call when the dialog is closed | 1245 | * @param cb function to call when the dialog is closed |
1248 | * @param cb_cls closure for 'cb' | 1246 | * @param cb_cls closure for @a cb |
1249 | */ | 1247 | */ |
1250 | void | 1248 | void |
1251 | GNUNET_FS_GTK_edit_publish_dialog (GtkWindow * parent, | 1249 | GNUNET_FS_GTK_edit_publish_dialog (GtkWindow * parent, |
@@ -1260,10 +1258,8 @@ GNUNET_FS_GTK_edit_publish_dialog (GtkWindow * parent, | |||
1260 | GtkLabel *index_label; | 1258 | GtkLabel *index_label; |
1261 | GtkLabel *root_label; | 1259 | GtkLabel *root_label; |
1262 | struct EditPublicationDialogContext *ctx; | 1260 | struct EditPublicationDialogContext *ctx; |
1263 | GtkTreeSelection *meta_selection; | ||
1264 | GtkTreeSelection *keywords_selection; | ||
1265 | 1261 | ||
1266 | ctx = GNUNET_malloc (sizeof (struct EditPublicationDialogContext)); | 1262 | ctx = GNUNET_new (struct EditPublicationDialogContext); |
1267 | ctx->fip = fip; | 1263 | ctx->fip = fip; |
1268 | ctx->preview_changed = GNUNET_NO; | 1264 | ctx->preview_changed = GNUNET_NO; |
1269 | ctx->allow_no_keywords = is_namespace_edit ? GNUNET_NO : GNUNET_YES; | 1265 | ctx->allow_no_keywords = is_namespace_edit ? GNUNET_NO : GNUNET_YES; |
@@ -1273,7 +1269,7 @@ GNUNET_FS_GTK_edit_publish_dialog (GtkWindow * parent, | |||
1273 | ctx->meta_combo_selected_type_id = -1; | 1269 | ctx->meta_combo_selected_type_id = -1; |
1274 | ctx->builder = GNUNET_GTK_get_new_builder ("gnunet_fs_gtk_edit_publication.glade", ctx); | 1270 | ctx->builder = GNUNET_GTK_get_new_builder ("gnunet_fs_gtk_edit_publication.glade", ctx); |
1275 | 1271 | ||
1276 | if (ctx->builder == NULL) | 1272 | if (NULL == ctx->builder) |
1277 | { | 1273 | { |
1278 | GNUNET_free (ctx); | 1274 | GNUNET_free (ctx); |
1279 | return; | 1275 | return; |
@@ -1365,14 +1361,6 @@ GNUNET_FS_GTK_edit_publish_dialog (GtkWindow * parent, | |||
1365 | gtk_widget_set_visible (GTK_WIDGET (root_label), | 1361 | gtk_widget_set_visible (GTK_WIDGET (root_label), |
1366 | is_namespace_edit ? TRUE : FALSE); | 1362 | is_namespace_edit ? TRUE : FALSE); |
1367 | 1363 | ||
1368 | /* FIXME-GTK3: these signal handlers can be set by (modern) versions of Glade */ | ||
1369 | keywords_selection = gtk_tree_view_get_selection (ctx->keywords_treeview); | ||
1370 | g_signal_connect (G_OBJECT (keywords_selection), "changed", | ||
1371 | G_CALLBACK (keywords_selection_changed_cb), ctx); | ||
1372 | meta_selection = gtk_tree_view_get_selection (ctx->meta_treeview); | ||
1373 | g_signal_connect (G_OBJECT (meta_selection), "changed", | ||
1374 | G_CALLBACK (metadata_selection_changed_cb), ctx); | ||
1375 | |||
1376 | /* import meta data and options */ | 1364 | /* import meta data and options */ |
1377 | GNUNET_FS_file_information_inspect (fip, &file_information_import, ctx); | 1365 | GNUNET_FS_file_information_inspect (fip, &file_information_import, ctx); |
1378 | 1366 | ||