diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-10-11 13:42:26 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-10-11 13:42:26 +0000 |
commit | 8b4386f54a7c94e9c336dad3754fe0b79039af54 (patch) | |
tree | 1fc6f91861274db306bce4a200e96d80468da097 | |
parent | 8189cb15f0d6726ba08f93cdd073babae5fd862a (diff) | |
download | gnunet-gtk-8b4386f54a7c94e9c336dad3754fe0b79039af54.tar.gz gnunet-gtk-8b4386f54a7c94e9c336dad3754fe0b79039af54.zip |
-implement #3063: ask user about running import script, instead of warning about not having run it
-rw-r--r-- | src/namestore/gnunet-namestore-gtk.c | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/src/namestore/gnunet-namestore-gtk.c b/src/namestore/gnunet-namestore-gtk.c index 542d97e0..4723a043 100644 --- a/src/namestore/gnunet-namestore-gtk.c +++ b/src/namestore/gnunet-namestore-gtk.c | |||
@@ -1932,7 +1932,6 @@ static void | |||
1932 | load_zone (const char *name, | 1932 | load_zone (const char *name, |
1933 | struct GNUNET_IDENTITY_Ego *ego) | 1933 | struct GNUNET_IDENTITY_Ego *ego) |
1934 | { | 1934 | { |
1935 | char *emsg; | ||
1936 | char *label; | 1935 | char *label; |
1937 | GtkTreeIter toplevel; | 1936 | GtkTreeIter toplevel; |
1938 | 1937 | ||
@@ -1945,12 +1944,28 @@ load_zone (const char *name, | |||
1945 | } | 1944 | } |
1946 | if (NULL == ego) | 1945 | if (NULL == ego) |
1947 | { | 1946 | { |
1948 | GNUNET_asprintf (&emsg, | 1947 | GtkDialog *diag; |
1949 | _("Could not load zone `%s'; did you run gnunet-gns-import.sh?\n"), | 1948 | gint result; |
1950 | name); | 1949 | |
1951 | show_error_message (_("Failed to load zone"), | 1950 | diag = GTK_DIALOG (gtk_message_dialog_new (NULL, |
1952 | emsg); | 1951 | GTK_DIALOG_MODAL, |
1953 | GNUNET_free (emsg); | 1952 | GTK_MESSAGE_WARNING, |
1953 | GTK_BUTTONS_YES_NO, | ||
1954 | (NULL == name) | ||
1955 | ? _("No zones found. Should I run the import script?") | ||
1956 | : _("Zone `%s' not found. Should I run the import script?"), | ||
1957 | name)); | ||
1958 | result = gtk_dialog_run (diag); | ||
1959 | gtk_widget_destroy (GTK_WIDGET (diag)); | ||
1960 | switch (result) | ||
1961 | { | ||
1962 | case GTK_RESPONSE_YES: | ||
1963 | system ("gnunet-gns-import.sh"); | ||
1964 | break; | ||
1965 | default: | ||
1966 | /* nothing */ | ||
1967 | break; | ||
1968 | } | ||
1954 | gtk_widget_show (GTK_WIDGET (get_object ("gnunet_namestore_gtk_zone_combobox"))); | 1969 | gtk_widget_show (GTK_WIDGET (get_object ("gnunet_namestore_gtk_zone_combobox"))); |
1955 | return; | 1970 | return; |
1956 | } | 1971 | } |