From 7bbb07c99348a9d6c57fed8f75e12d13e34ef3fd Mon Sep 17 00:00:00 2001 From: Vishweshwar Saran Singh Deo Date: Mon, 21 Nov 2022 16:24:32 +0530 Subject: [PATCH] [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. --- terminatorlib/prefseditor.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/terminatorlib/prefseditor.py b/terminatorlib/prefseditor.py index 9d3bd7e9..5cdfb336 100755 --- a/terminatorlib/prefseditor.py +++ b/terminatorlib/prefseditor.py @@ -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: