Update all shortcuts (including manually added ones) when closing the preset editor

This commit is contained in:
Alessandro Ranellucci 2017-04-29 20:55:30 +02:00
parent 202a00c270
commit 2efb863a87

View File

@ -577,11 +577,13 @@ sub _on_select_preset {
my $shortcuts = $config->get('shortcuts'); my $shortcuts = $config->get('shortcuts');
# Add/remove options (we do it this way for preserving current options) # Add/remove options (we do it this way for preserving current options)
foreach my $opt_key (@$shortcuts) { foreach my $opt_key (@{$o_config->get_keys}, @$shortcuts) {
# Populate option with the default value taken from configuration # Populate option with the default value taken from configuration
# (re-set the override always, because if we here it means user # (re-set the override always, because if we here it means user
# switched to this preset or opened/closed the editor, so he expects # switched to this preset or opened/closed the editor, so he expects
# the new values set in the editor to be used). # the new values set in the editor to be used).
# Do this for both the current options and the configured shortcuts
# to make sure everything gets updated.
$o_config->set($opt_key, $config->get($opt_key)); $o_config->set($opt_key, $config->get($opt_key));
} }
foreach my $opt_key (@{$o_config->get_keys}) { foreach my $opt_key (@{$o_config->get_keys}) {