Skip to content

Commit

Permalink
GUI Export interface: reinstate keyboard snooper before returning
Browse files Browse the repository at this point in the history
Otherwise we lose all keyboard shortcuts.
  • Loading branch information
shawnlaffan committed Jan 5, 2024
1 parent c7aa12b commit 563b92c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/Biodiverse/GUI/Export.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -77,6 +78,7 @@ sub Run {

if ($format_response ne 'ok') {
$format_dlg->destroy;
$gui->activate_keyboard_snooper ($snooper_status);
return;
}

Expand All @@ -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};
Expand Down Expand Up @@ -139,7 +144,7 @@ sub Run {
}

$dlg->destroy;
$gui->activate_keyboard_snooper (1);
$gui->activate_keyboard_snooper ($snooper_status);

return;
}
Expand Down

0 comments on commit 563b92c

Please sign in to comment.