summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2009-03-27 08:44:53 +0100
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2009-03-27 08:44:53 +0100
commitabba29b4f7138f91f07ef0de8e7ea7bca156a738 (patch)
tree7b9ecde341e329cd9e18faf511b1ba0539d8df8b
parentc88a67ce878890138dfc5a16d7d834a2f0cce8fc (diff)
add file dialog to screen dump
-rw-r--r--src/gipfel.cxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/gipfel.cxx b/src/gipfel.cxx
index 368d6ae..4c76e40 100644
--- a/src/gipfel.cxx
+++ b/src/gipfel.cxx
@@ -138,10 +138,13 @@ void save_cb() {
}
void dump_cb(Fl_Widget * o, void*) {
- ScreenDump dmp(gipf);
- JPEGOutputImage out("/tmp/dmp.jpg");
-
- dmp.save(&out);
+ ScreenDump dmp(gipf); // needs to be done before fl_file_chooser()
+ char *file = fl_file_chooser("Save Screen Dump As?", "*.jpg", NULL);
+ if (file && confirm_overwrite(file)) {
+ JPEGOutputImage out(file, 95);
+ if (dmp.save(&out))
+ fl_message("ERROR: Saving image %s failed.", file);
+ }
}
void focal_length_cb(Fl_Slider* o, void*) {