From 563b92cf1268f6a4afe61f5d3978cd92cd094a23 Mon Sep 17 00:00:00 2001 From: shawnlaffan Date: Fri, 5 Jan 2024 17:04:48 +1100 Subject: [PATCH] GUI Export interface: reinstate keyboard snooper before returning Otherwise we lose all keyboard shortcuts. --- lib/Biodiverse/GUI/Export.pm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/Biodiverse/GUI/Export.pm b/lib/Biodiverse/GUI/Export.pm index 1ff01f827..7f3d7e65e 100644 --- a/lib/Biodiverse/GUI/Export.pm +++ b/lib/Biodiverse/GUI/Export.pm @@ -36,6 +36,7 @@ sub Run { my $gui = Biodiverse::GUI::GUIManager->instance; # stop keyboard events being applied to any open tabs + my $snooper_status = $gui->keyboard_snooper_active; $gui->activate_keyboard_snooper (0); # Get the Parameters metadata @@ -77,6 +78,7 @@ sub Run { if ($format_response ne 'ok') { $format_dlg->destroy; + $gui->activate_keyboard_snooper ($snooper_status); return; } @@ -98,7 +100,10 @@ sub Run { selected_format => $selected_format, ); - return if !$results->{success}; + if (!$results->{success}) { + $gui->activate_keyboard_snooper($snooper_status); + return; + } my $chooser = $results->{chooser}; my $parameters_table = $results->{param_table}; @@ -139,7 +144,7 @@ sub Run { } $dlg->destroy; - $gui->activate_keyboard_snooper (1); + $gui->activate_keyboard_snooper ($snooper_status); return; }