aboutsummaryrefslogtreecommitdiff
path: root/src/fs/gnunet-fs-gtk_publish-dialog.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fs/gnunet-fs-gtk_publish-dialog.c')
-rw-r--r--src/fs/gnunet-fs-gtk_publish-dialog.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/fs/gnunet-fs-gtk_publish-dialog.c b/src/fs/gnunet-fs-gtk_publish-dialog.c
index 15c6767b..73160fdd 100644
--- a/src/fs/gnunet-fs-gtk_publish-dialog.c
+++ b/src/fs/gnunet-fs-gtk_publish-dialog.c
@@ -1259,7 +1259,6 @@ publish_directory_dialog_response_cb (GtkDialog * dialog,
1259 gpointer user_data) 1259 gpointer user_data)
1260{ 1260{
1261 struct MainPublishingDialogContext *ctx = user_data; 1261 struct MainPublishingDialogContext *ctx = user_data;
1262 GtkWidget *ad;
1263 1262
1264 /* FIXME-UGLY: how about using a separate closure and not needing this mess? 1263 /* FIXME-UGLY: how about using a separate closure and not needing this mess?
1265 In fact, even without it I don't see why we need to disconnect the handler... */ 1264 In fact, even without it I don't see why we need to disconnect the handler... */
@@ -1267,16 +1266,13 @@ publish_directory_dialog_response_cb (GtkDialog * dialog,
1267 g_signal_handler_disconnect (G_OBJECT (dialog), ctx->open_directory_handler_id); 1266 g_signal_handler_disconnect (G_OBJECT (dialog), ctx->open_directory_handler_id);
1268 ctx->open_directory_handler_id = 0; 1267 ctx->open_directory_handler_id = 0;
1269 1268
1270 ad = GTK_WIDGET (gtk_builder_get_object
1271 (ctx->open_directory_builder,
1272 "GNUNET_GTK_publish_directory_dialog"));
1273 if (response_id == -5 /* OK */) 1269 if (response_id == -5 /* OK */)
1274 { 1270 {
1275 char *filename; 1271 char *filename;
1276 int do_index; 1272 int do_index;
1277 struct GNUNET_FS_BlockOptions bo; 1273 struct GNUNET_FS_BlockOptions bo;
1278 1274
1279 filename = GNUNET_GTK_filechooser_get_filename_utf8 (GTK_FILE_CHOOSER (ad)); 1275 filename = GNUNET_GTK_filechooser_get_filename_utf8 (GTK_FILE_CHOOSER (dialog));
1280 if (! GNUNET_GTK_get_selected_anonymity_level 1276 if (! GNUNET_GTK_get_selected_anonymity_level
1281 (ctx->open_directory_builder, 1277 (ctx->open_directory_builder,
1282 "GNUNET_GTK_publish_directory_dialog_anonymity_combobox", 1278 "GNUNET_GTK_publish_directory_dialog_anonymity_combobox",
@@ -1311,8 +1307,7 @@ publish_directory_dialog_response_cb (GtkDialog * dialog,
1311 scan_file_or_directory (ctx, filename, &bo, do_index); 1307 scan_file_or_directory (ctx, filename, &bo, do_index);
1312 g_free (filename); 1308 g_free (filename);
1313 } 1309 }
1314 /* FIXME: do we need to do widget-destroy + builder destroy? */ 1310 gtk_widget_destroy (GTK_WIDGET (dialog));
1315 gtk_widget_destroy (ad);
1316 g_object_unref (G_OBJECT (ctx->open_directory_builder)); 1311 g_object_unref (G_OBJECT (ctx->open_directory_builder));
1317 ctx->open_directory_builder = NULL; 1312 ctx->open_directory_builder = NULL;
1318} 1313}
@@ -1331,7 +1326,6 @@ publish_file_dialog_response_cb (GtkDialog * dialog,
1331 gpointer user_data) 1326 gpointer user_data)
1332{ 1327{
1333 struct MainPublishingDialogContext *ctx = user_data; 1328 struct MainPublishingDialogContext *ctx = user_data;
1334 GtkWidget *ad;
1335 1329
1336 /* FIXME-UGLY: how about using a separate closure and not needing this mess? 1330 /* FIXME-UGLY: how about using a separate closure and not needing this mess?
1337 In fact, even without it I don't see why we need to disconnect the handler... */ 1331 In fact, even without it I don't see why we need to disconnect the handler... */
@@ -1339,15 +1333,13 @@ publish_file_dialog_response_cb (GtkDialog * dialog,
1339 g_signal_handler_disconnect (G_OBJECT (dialog), ctx->open_file_handler_id); 1333 g_signal_handler_disconnect (G_OBJECT (dialog), ctx->open_file_handler_id);
1340 ctx->open_file_handler_id = 0; 1334 ctx->open_file_handler_id = 0;
1341 1335
1342 ad = GTK_WIDGET (gtk_builder_get_object
1343 (ctx->open_file_builder, "GNUNET_GTK_publish_file_dialog"));
1344 if (response_id == -5 /* OK */) 1336 if (response_id == -5 /* OK */)
1345 { 1337 {
1346 char *filename; 1338 char *filename;
1347 struct GNUNET_FS_BlockOptions bo; 1339 struct GNUNET_FS_BlockOptions bo;
1348 int do_index; 1340 int do_index;
1349 1341
1350 filename = GNUNET_GTK_filechooser_get_filename_utf8 (GTK_FILE_CHOOSER (ad)); 1342 filename = GNUNET_GTK_filechooser_get_filename_utf8 (GTK_FILE_CHOOSER (dialog));
1351 if (!GNUNET_GTK_get_selected_anonymity_level 1343 if (!GNUNET_GTK_get_selected_anonymity_level
1352 (ctx->open_file_builder, "GNUNET_GTK_publish_file_dialog_anonymity_combobox", 1344 (ctx->open_file_builder, "GNUNET_GTK_publish_file_dialog_anonymity_combobox",
1353 &bo.anonymity_level)) 1345 &bo.anonymity_level))
@@ -1382,8 +1374,7 @@ publish_file_dialog_response_cb (GtkDialog * dialog,
1382 scan_file_or_directory (ctx, filename, &bo, do_index); 1374 scan_file_or_directory (ctx, filename, &bo, do_index);
1383 g_free (filename); 1375 g_free (filename);
1384 } 1376 }
1385 /* FIXME: do we need to do widget-destroy + builder destroy? */ 1377 gtk_widget_destroy (GTK_WIDGET (dialog));
1386 gtk_widget_destroy (ad);
1387 g_object_unref (G_OBJECT (ctx->open_file_builder)); 1378 g_object_unref (G_OBJECT (ctx->open_file_builder));
1388 ctx->open_file_builder = NULL; 1379 ctx->open_file_builder = NULL;
1389} 1380}