diff options
| author | Jules Aguillon | 2023-08-10 12:57:31 +0200 |
|---|---|---|
| committer | Jules Aguillon | 2023-08-16 12:21:23 +0200 |
| commit | 500f4e41d3a72f5865aa489c89ad11b947fa54b7 (patch) | |
| tree | 677781ff5e82c320456f21e91b8ffa41819fd439 /gen_layouts.py | |
| parent | 8611dbcfa0ef6d551bf3acb65e5a1990a3ced75b (diff) | |
| download | unexpected-keyboard-500f4e41d3a72f5865aa489c89ad11b947fa54b7.tar.gz unexpected-keyboard-500f4e41d3a72f5865aa489c89ad11b947fa54b7.zip | |
Allow multiple custom layouts
This merges the "Layouts" option with the "Custom layout" option.
A custom layout becomes an item in the "Layouts" list among the other
layouts. It's possible to add several custom layouts.
Selecting the "Custom layout" item in the list opens a second dialog for
entering the layout description.
Layouts are serialized as JSON object and are decoded solely in the
LayoutsPreference class.
Diffstat (limited to 'gen_layouts.py')
| -rw-r--r-- | gen_layouts.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gen_layouts.py b/gen_layouts.py index 44c3563..c2e6e8d 100644 --- a/gen_layouts.py +++ b/gen_layouts.py @@ -54,9 +54,9 @@ def generate_arrays(out, layouts): item.text = s elem.append(item) return elem - none_item = [ ("system", "@string/pref_layout_e_system") ] + system_item = [ ("system", "@string/pref_layout_e_system") ] custom_item = [ ("custom", "@string/pref_layout_e_custom") ] - values_items, entries_items = zip(*(none_item + layouts + custom_item)) # unzip + values_items, entries_items = zip(*(system_item + layouts + custom_item)) # unzip ids_items = map(lambda s: "@xml/%s" % s if s not in ["system", "custom"] else "-1", values_items) root = XML.Element("resources") root.append(XML.Comment(text="DO NOT EDIT. This file is generated, see gen_layouts.py.")) |
