From 468ef23c79e963598a89cbd23c9c3901275f09f0 Mon Sep 17 00:00:00 2001 From: Ruslan Kashinin Date: Mon, 3 Apr 2023 01:17:02 +0200 Subject: [PATCH 1/2] Fix for issue #676: title field not seem to be working with JSON profile --- terminatorlib/configjson.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/terminatorlib/configjson.py b/terminatorlib/configjson.py index 48c6ab5a..e011ea2f 100644 --- a/terminatorlib/configjson.py +++ b/terminatorlib/configjson.py @@ -54,15 +54,24 @@ class ConfigJson(object): def build_terminal_layout(self, layoutjson, children, parent, order): dbg ('Building a terminal from json: %s' % layoutjson) - + + def from_json(layout_name, json_name=None): + if json_name is None: + json_name = layout_name + + if json_name in layoutjson: + children[parent + "." + str(order)].__setitem__(layout_name, layoutjson[json_name]) + children[parent + "." + str(order)] = { 'type': 'Terminal', 'order': order, 'parent': parent, - 'profile': self.profile_to_use, - 'command': layoutjson['command'] + 'profile': self.profile_to_use } - + + from_json('command') + from_json('title') + def build_container_layout(self, layoutjson, children, parent, order, vertical): if len(layoutjson) == 1: layoutjson = layoutjson[0] From e2a88a28554138f7044052db00b096819dbed58d Mon Sep 17 00:00:00 2001 From: Ruslan Kashinin Date: Sun, 9 Apr 2023 18:01:41 +0200 Subject: [PATCH 2/2] Fix for issue #676: title field not seem to be working with JSON profile --- terminatorlib/configjson.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terminatorlib/configjson.py b/terminatorlib/configjson.py index e011ea2f..81cbcfa2 100644 --- a/terminatorlib/configjson.py +++ b/terminatorlib/configjson.py @@ -60,7 +60,7 @@ class ConfigJson(object): json_name = layout_name if json_name in layoutjson: - children[parent + "." + str(order)].__setitem__(layout_name, layoutjson[json_name]) + children[parent + "." + str(order)][layout_name] = layoutjson[json_name] children[parent + "." + str(order)] = { 'type': 'Terminal',