summaryrefslogtreecommitdiff
path: root/src/gipfel.cxx
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2007-05-21 17:14:17 +0200
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2007-05-21 17:14:17 +0200
commit41d41d7a970760ace88f13539a3969c85c351d8c (patch)
tree17329bbe98bd6827dcb413c8abe93f1dcb6f67fd /src/gipfel.cxx
parentd2242935374419b6ee9c642104fc3a1cc09a5c37 (diff)
ask before overwriting profiles
Diffstat (limited to 'src/gipfel.cxx')
-rw-r--r--src/gipfel.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gipfel.cxx b/src/gipfel.cxx
index 2fcce48..108c3ad 100644
--- a/src/gipfel.cxx
+++ b/src/gipfel.cxx
@@ -176,6 +176,8 @@ void save_distortion_cb(Fl_Widget *, void *) {
const char * prof_name;
double k0, k1;
+ buf[0] = '\0';
+
gipf->get_distortion_params(&k0, &k1);
gipf->get_distortion_profile_name(buf, sizeof(buf));
prof_name = fl_input("Save Distortion Profile (k0=%f, k1=%f)",
@@ -185,7 +187,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();
}