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.c73
1 files changed, 39 insertions, 34 deletions
diff --git a/src/fs/gnunet-fs-gtk_publish-dialog.c b/src/fs/gnunet-fs-gtk_publish-dialog.c
index 4f33fc62..20a05400 100644
--- a/src/fs/gnunet-fs-gtk_publish-dialog.c
+++ b/src/fs/gnunet-fs-gtk_publish-dialog.c
@@ -1215,10 +1215,10 @@ scan_file_or_directory (struct MainPublishingDialogContext *ctx,
1215 * @param response_id result of the dialog ("-5" means to "run") 1215 * @param response_id result of the dialog ("-5" means to "run")
1216 * @param user_data master publishing dialog context of our window 1216 * @param user_data master publishing dialog context of our window
1217 */ 1217 */
1218static void 1218void
1219publish_directory_dialog_response_cb (GtkDialog * dialog, 1219GNUNET_GTK_publish_directory_dialog_response_cb (GtkDialog * dialog,
1220 gint response_id, 1220 gint response_id,
1221 gpointer user_data) 1221 gpointer user_data)
1222{ 1222{
1223 struct MainPublishingDialogContext *ctx = user_data; 1223 struct MainPublishingDialogContext *ctx = user_data;
1224 1224
@@ -1276,10 +1276,10 @@ publish_directory_dialog_response_cb (GtkDialog * dialog,
1276 * @param response_id result of the dialog ("-5" means to "run") 1276 * @param response_id result of the dialog ("-5" means to "run")
1277 * @param user_data master publishing dialog context of our window 1277 * @param user_data master publishing dialog context of our window
1278 */ 1278 */
1279static void 1279void
1280publish_file_dialog_response_cb (GtkDialog * dialog, 1280GNUNET_GTK_publish_file_dialog_response_cb (GtkDialog * dialog,
1281 gint response_id, 1281 gint response_id,
1282 gpointer user_data) 1282 gpointer user_data)
1283{ 1283{
1284 struct MainPublishingDialogContext *ctx = user_data; 1284 struct MainPublishingDialogContext *ctx = user_data;
1285 1285
@@ -1344,13 +1344,9 @@ GNUNET_GTK_master_publish_dialog_add_button_clicked_cb (GtkWidget * dummy,
1344 gpointer user_data) 1344 gpointer user_data)
1345{ 1345{
1346 struct MainPublishingDialogContext *ctx = user_data; 1346 struct MainPublishingDialogContext *ctx = user_data;
1347 GtkWidget *ad;
1348 GtkComboBox *combo;
1349 1347
1350 ctx->open_file_builder = GNUNET_GTK_get_new_builder ("gnunet_fs_gtk_publish_file_dialog.glade", ctx); 1348 ctx->open_file_builder = GNUNET_GTK_get_new_builder ("gnunet_fs_gtk_publish_file_dialog.glade", ctx);
1351 GNUNET_FS_GTK_setup_expiration_year_adjustment (ctx->open_file_builder); 1349 GNUNET_FS_GTK_setup_expiration_year_adjustment (ctx->open_file_builder);
1352 ad = GTK_WIDGET (gtk_builder_get_object
1353 (ctx->open_file_builder, "GNUNET_GTK_publish_file_dialog"));
1354 1350
1355 /* FIXME-FEATURE: Use some kind of adjustable defaults instead of 1000, 0 and TRUE */ 1351 /* FIXME-FEATURE: Use some kind of adjustable defaults instead of 1000, 0 and TRUE */
1356 gtk_spin_button_set_value (GTK_SPIN_BUTTON (gtk_builder_get_object (ctx->open_file_builder, 1352 gtk_spin_button_set_value (GTK_SPIN_BUTTON (gtk_builder_get_object (ctx->open_file_builder,
@@ -1360,17 +1356,24 @@ GNUNET_GTK_master_publish_dialog_add_button_clicked_cb (GtkWidget * dummy,
1360 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (ctx->open_file_builder, 1356 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (ctx->open_file_builder,
1361 "GNUNET_GTK_publish_file_dialog_do_index_checkbutton")), TRUE); 1357 "GNUNET_GTK_publish_file_dialog_do_index_checkbutton")), TRUE);
1362 1358
1363 /* FIXME-STYLE: automatically connect using glade instead */ 1359 {
1364 g_signal_connect (G_OBJECT (ad), "response", 1360 GtkComboBox *combo;
1365 G_CALLBACK (publish_file_dialog_response_cb), ctx); 1361
1366 combo = GTK_COMBO_BOX (gtk_builder_get_object (ctx->open_file_builder, 1362 combo = GTK_COMBO_BOX (gtk_builder_get_object (ctx->open_file_builder,
1367 "GNUNET_GTK_publish_file_dialog_anonymity_combobox")); 1363 "GNUNET_GTK_publish_file_dialog_anonymity_combobox"));
1368 gtk_combo_box_set_model (combo, 1364 gtk_combo_box_set_model (combo,
1369 GNUNET_FS_GTK_get_anonymity_level_list_store ()); 1365 GNUNET_FS_GTK_get_anonymity_level_list_store ());
1370 1366 }
1367
1371 /* show dialog */ 1368 /* show dialog */
1372 gtk_window_set_transient_for (GTK_WINDOW (ad), ctx->master_pubdialog); 1369 {
1373 gtk_window_present (GTK_WINDOW (ad)); 1370 GtkWidget *ad;
1371
1372 ad = GTK_WIDGET (gtk_builder_get_object
1373 (ctx->open_file_builder, "GNUNET_GTK_publish_file_dialog"));
1374 gtk_window_set_transient_for (GTK_WINDOW (ad), ctx->master_pubdialog);
1375 gtk_window_present (GTK_WINDOW (ad));
1376 }
1374} 1377}
1375 1378
1376 1379
@@ -1388,8 +1391,6 @@ GNUNET_GTK_master_publish_dialog_open_button_clicked_cb (GtkWidget * dummy,
1388 gpointer user_data) 1391 gpointer user_data)
1389{ 1392{
1390 struct MainPublishingDialogContext *ctx = user_data; 1393 struct MainPublishingDialogContext *ctx = user_data;
1391 GtkWidget *ad;
1392 GtkComboBox *combo;
1393 1394
1394 ctx->open_directory_builder = GNUNET_GTK_get_new_builder ("gnunet_fs_gtk_publish_directory_dialog.glade", ctx); 1395 ctx->open_directory_builder = GNUNET_GTK_get_new_builder ("gnunet_fs_gtk_publish_directory_dialog.glade", ctx);
1395 GNUNET_FS_GTK_setup_expiration_year_adjustment (ctx->open_directory_builder); 1396 GNUNET_FS_GTK_setup_expiration_year_adjustment (ctx->open_directory_builder);
@@ -1402,19 +1403,23 @@ GNUNET_GTK_master_publish_dialog_open_button_clicked_cb (GtkWidget * dummy,
1402 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (ctx->open_directory_builder, 1403 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (ctx->open_directory_builder,
1403 "GNUNET_GTK_publish_directory_dialog_do_index_checkbutton")), TRUE); 1404 "GNUNET_GTK_publish_directory_dialog_do_index_checkbutton")), TRUE);
1404 1405
1405 ad = GTK_WIDGET (gtk_builder_get_object 1406 {
1406 (ctx->open_directory_builder, "GNUNET_GTK_publish_directory_dialog")); 1407 GtkComboBox *combo;
1407 1408
1408 /* FIXME-STYLE: automatically connect using glade instead */ 1409 combo = GTK_COMBO_BOX (gtk_builder_get_object (ctx->open_directory_builder,
1409 g_signal_connect (G_OBJECT (ad), "response", 1410 "GNUNET_GTK_publish_directory_dialog_anonymity_combobox"));
1410 G_CALLBACK (publish_directory_dialog_response_cb), ctx); 1411 gtk_combo_box_set_model (combo, GNUNET_FS_GTK_get_anonymity_level_list_store ());
1411 combo = GTK_COMBO_BOX (gtk_builder_get_object (ctx->open_directory_builder, 1412 }
1412 "GNUNET_GTK_publish_directory_dialog_anonymity_combobox"));
1413 gtk_combo_box_set_model (combo, GNUNET_FS_GTK_get_anonymity_level_list_store ());
1414 1413
1415 /* show dialog */ 1414 /* show dialog */
1416 gtk_window_set_transient_for (GTK_WINDOW (ad), ctx->master_pubdialog); 1415 {
1417 gtk_window_present (GTK_WINDOW (ad)); 1416 GtkWidget *ad;
1417
1418 ad = GTK_WIDGET (gtk_builder_get_object
1419 (ctx->open_directory_builder, "GNUNET_GTK_publish_directory_dialog"));
1420 gtk_window_set_transient_for (GTK_WINDOW (ad), ctx->master_pubdialog);
1421 gtk_window_present (GTK_WINDOW (ad));
1422 }
1418} 1423}
1419 1424
1420 1425