From 41d41d7a970760ace88f13539a3969c85c351d8c Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Mon, 21 May 2007 17:14:17 +0200 Subject: ask before overwriting profiles --- src/gipfel.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/gipfel.cxx') 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(); } -- cgit v1.2.3