From abba29b4f7138f91f07ef0de8e7ea7bca156a738 Mon Sep 17 00:00:00 2001
From: Johannes Hofmann <Johannes.Hofmann@gmx.de>
Date: Fri, 27 Mar 2009 08:44:53 +0100
Subject: add file dialog to screen dump

---
 src/gipfel.cxx | 11 +++++++----
 1 file 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*) {
-- 
cgit v1.2.3