From e8015f084087c936b61a428d6a37519b7f327b5d Mon Sep 17 00:00:00 2001 From: "Curtis L. Olson" Date: Tue, 3 May 2011 10:15:07 -0500 Subject: [PATCH 1/2] Add warning message if attempting to take a snapshot with a non-singlethreaded threading model defined. --- keyboard.xml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/keyboard.xml b/keyboard.xml index c2c3d3e28..e1fb65596 100644 --- a/keyboard.xml +++ b/keyboard.xml @@ -1123,10 +1123,21 @@ top down before the key bindings are parsed. From b2f9f52f889a1a5509f502f7ff33120fa7c92c0a Mon Sep 17 00:00:00 2001 From: "Curtis L. Olson" Date: Tue, 3 May 2011 10:50:36 -0500 Subject: [PATCH 2/2] Add a basic "ok" message if an error condition occurs with the snapshot (based on tip from Melchior) --- keyboard.xml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/keyboard.xml b/keyboard.xml index e1fb65596..53d8b2905 100644 --- a/keyboard.xml +++ b/keyboard.xml @@ -1125,19 +1125,20 @@ top down before the key bindings are parsed. var path = getprop("/sim/paths/screenshot-last"); var threading = getprop("/sim/rendering/multithreading-mode"); var message = ""; - var delay = 3; - if (success) { - message = "Screenshot written to '" ~ path ~ "'"; - delay = 2; - } else { - message = "Error writing screenshot '" ~ path ~ "'"; - delay = 5; - } - if ( threading != nil and threading != "" and threading != "SingleThreaded" ) { + if ( threading != nil and threading != "" and + threading != "SingleThreaded" ) + { message = "Threading model must be SingleThreaded (or not defined) for snapshots to work."; - delay = 7; + gui.popupTip(message, 600, { button: { legend: "Ok", default: 1, binding: { command: "dialog-close" }}}); + } else { + if (success) { + message = "Screenshot written to '" ~ path ~ "'"; + gui.popupTip(message, 2); + } else { + message = "Error writing screenshot '" ~ path ~ "'"; + gui.popupTip(message, 600, { button: { legend: "Ok", default: 1, binding: { command: "dialog-close" }}}); + } } - gui.popupTip(message, delay);