From fb984bf8ce07384e809ed6907d9284272599de13 Mon Sep 17 00:00:00 2001
From: ThorstenB <brehmt@gmail.com>
Date: Sun, 21 Aug 2011 15:17:16 +0200
Subject: [PATCH] Option to set screenshot directory.

---
 Nasal/gui.nas   | 11 +++++++++++
 gui/menubar.xml |  7 +++++++
 2 files changed, 18 insertions(+)

diff --git a/Nasal/gui.nas b/Nasal/gui.nas
index bb15dd82d..debc7fba9 100644
--- a/Nasal/gui.nas
+++ b/Nasal/gui.nas
@@ -583,6 +583,17 @@ var load_flight = func {
     load_flight_sel.open();
 }
 
+##
+# Screen-shot directory menu function
+#
+var set_screenshotdir_sel = nil;
+var set_screenshotdir = func {
+    if (set_screenshotdir_sel == nil)
+        set_screenshotdir_sel = gui.DirSelector.new(
+            func(result) { setprop("/sim/paths/screenshot-dir", result.getValue()); },
+            "Select Screenshot Directory", "Ok", getprop("/sim/paths/screenshot-dir"));
+    set_screenshotdir_sel.open();
+}
 
 ##
 # Open property browser with given target path.
diff --git a/gui/menubar.xml b/gui/menubar.xml
index cd8babbdf..e75a0715d 100644
--- a/gui/menubar.xml
+++ b/gui/menubar.xml
@@ -62,6 +62,13 @@
 				</script>
 			</binding>
 		</item>
+		<item>
+			<label>Screenshot Directory</label>
+			<binding>
+				<command>nasal</command>
+				<script>gui.set_screenshotdir()</script>
+			</binding>
+		</item>
 		<!--
 		<item>
 		<label>Last snapshot</label>