aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-11-16 15:25:43 +0000
committerChristian Grothoff <christian@grothoff.org>2013-11-16 15:25:43 +0000
commita65355f164607f544b62e36e0dcb0d8c2b0dad69 (patch)
tree87401f46e9211a7d76d57980926cfb741dd99ee6
parent5a30b1e16a10726205af6f481973a4bcfa82cc9e (diff)
downloadgnunet-gtk-a65355f164607f544b62e36e0dcb0d8c2b0dad69.tar.gz
gnunet-gtk-a65355f164607f544b62e36e0dcb0d8c2b0dad69.zip
-fix #3110
-rw-r--r--src/namestore/gnunet-namestore-gtk.c52
1 files changed, 39 insertions, 13 deletions
diff --git a/src/namestore/gnunet-namestore-gtk.c b/src/namestore/gnunet-namestore-gtk.c
index edca2a64..b71a4158 100644
--- a/src/namestore/gnunet-namestore-gtk.c
+++ b/src/namestore/gnunet-namestore-gtk.c
@@ -2403,6 +2403,34 @@ zone_iteration_proc (void *cls,
2403 2403
2404 2404
2405/** 2405/**
2406 * The user has selected a response in the dialog asking him
2407 * if we should run the import script. If the response was
2408 * positive, run the import script.
2409 *
2410 * @param dialog the dialog object, should be destroyed
2411 * @param response_id response in the dialog
2412 * @param user_data NULL
2413 */
2414static void
2415handle_import_dialog_response (GtkDialog *dialog,
2416 gint response_id,
2417 gpointer user_data)
2418{
2419 gtk_widget_destroy (GTK_WIDGET (dialog));
2420 switch (response_id)
2421 {
2422 case GTK_RESPONSE_YES:
2423 system ("gnunet-gns-import.sh");
2424 break;
2425 default:
2426 /* nothing */
2427 break;
2428 }
2429 gtk_widget_show (GTK_WIDGET (get_object ("gnunet_namestore_gtk_zone_combobox")));
2430}
2431
2432
2433/**
2406 * Method called to switch the model to a new zone. 2434 * Method called to switch the model to a new zone.
2407 * 2435 *
2408 * @param name name of the zone 2436 * @param name name of the zone
@@ -2425,7 +2453,8 @@ load_zone (const char *name,
2425 if (NULL == ego) 2453 if (NULL == ego)
2426 { 2454 {
2427 GtkDialog *diag; 2455 GtkDialog *diag;
2428 gint result; 2456 GtkWidget *dummy;
2457 GtkWidget *toplevel;
2429 2458
2430 diag = GTK_DIALOG (gtk_message_dialog_new (NULL, 2459 diag = GTK_DIALOG (gtk_message_dialog_new (NULL,
2431 GTK_DIALOG_MODAL, 2460 GTK_DIALOG_MODAL,
@@ -2435,18 +2464,15 @@ load_zone (const char *name,
2435 ? _("No zones found. Should I run the import script?") 2464 ? _("No zones found. Should I run the import script?")
2436 : _("Zone `%s' not found. Should I run the import script?"), 2465 : _("Zone `%s' not found. Should I run the import script?"),
2437 name)); 2466 name));
2438 result = gtk_dialog_run (diag); 2467 dummy = GTK_WIDGET (get_object ("gnunet_namestore_gtk_dialog"));
2439 gtk_widget_destroy (GTK_WIDGET (diag)); 2468 toplevel = gtk_widget_get_toplevel (dummy);
2440 switch (result) 2469 if (GTK_IS_WINDOW (toplevel))
2441 { 2470 gtk_window_set_transient_for (GTK_WINDOW (diag), GTK_WINDOW (toplevel));
2442 case GTK_RESPONSE_YES: 2471 gtk_window_set_modal (GTK_WINDOW (diag), TRUE);
2443 system ("gnunet-gns-import.sh"); 2472 g_signal_connect (diag, "response",
2444 break; 2473 G_CALLBACK (handle_import_dialog_response),
2445 default: 2474 NULL);
2446 /* nothing */ 2475 gtk_window_present (GTK_WINDOW (diag));
2447 break;
2448 }
2449 gtk_widget_show (GTK_WIDGET (get_object ("gnunet_namestore_gtk_zone_combobox")));
2450 return; 2476 return;
2451 } 2477 }
2452 current_zone_option = GNUNET_strdup (name); 2478 current_zone_option = GNUNET_strdup (name);