diff options
Diffstat (limited to 'src/gipfel.cxx')
-rw-r--r-- | src/gipfel.cxx | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/gipfel.cxx b/src/gipfel.cxx index 3fbf945..6df400f 100644 --- a/src/gipfel.cxx +++ b/src/gipfel.cxx @@ -178,7 +178,9 @@ void save_distortion_cb(Fl_Widget *, void *) { const char * prof_name; double k0, k1, x0; + buf[0] = '\0'; gipf->get_distortion_params(&k0, &k1, &x0); + gipf->get_distortion_profile_name(buf, sizeof(buf)); prof_name = fl_input("Save Distortion Profile (k0=%f, k1=%f, x0=%f)", buf, k0, k1, x0); @@ -187,7 +189,12 @@ void save_distortion_cb(Fl_Widget *, void *) { return; } - gipf->save_distortion_params(prof_name); + if (gipf->save_distortion_params(prof_name, 0) != 0) { + if (fl_choice("A profile with this name exists.\n", + "Cancel", "Overwrite", NULL) == 1) { + gipf->save_distortion_params(prof_name, 1); + } + } set_values(); } @@ -580,7 +587,9 @@ stitch(GipfelWidget::sample_mode_t m, int b_16, snprintf(buf, sizeof(buf), "%s/%s", path, argv[i]); dot = strrchr(buf, '.'); - *dot = '\0'; + if (dot) { + *dot = '\0'; + } strncat(buf, ".tiff", sizeof(buf)); st->set_output(argv[i], new TIFFOutputImage(buf, b_16?16:8)); |