[bug 681] Plugin Submission + Generic Plugin Utility Functions & KeyBinding Feature: Mouseless / Mousefree / Keyboard URL opening or yanking #681

- there was a bug wherein the duplicate keybindings from plugins were not throwing the error "Duplicate Key Bindings Are Not Allowed", now while checking they are merged and then final list of keybindings are checked.
This commit is contained in:
Vishweshwar Saran Singh Deo 2022-11-21 16:24:32 +05:30
parent 8802e9b912
commit 7bbb07c993
1 changed files with 7 additions and 2 deletions

View File

@ -1814,8 +1814,14 @@ class PrefsEditor:
current_binding = liststore.get_value(liststore.get_iter(path), 0)
parsed_accel = Gtk.accelerator_parse(accel)
keybindutil = KeyBindUtil()
keybindings = self.config["keybindings"]
#merge give preference to main bindings over plugin
plugin_keyb_act = keybindutil.get_act_to_keys()
keybindings = {**plugin_keyb_act, **keybindings}
duplicate_bindings = []
for conf_binding, conf_accel in self.config["keybindings"].items():
for conf_binding, conf_accel in keybindings.items():
if conf_accel is None:
continue
@ -1859,7 +1865,6 @@ class PrefsEditor:
accel = Gtk.accelerator_name(key, mods)
self.config['keybindings'][binding] = accel
keybindutil = KeyBindUtil()
plugin_keyb_desc = keybindutil.get_act_to_desc()
if binding in plugin_keyb_desc: