This allows them to be translated via po so we don't have to maintain
the translation list by hand or care about empty translation files.
The only downside is that the "overlay layouts" in OVERLAY_NAMES need to
match the ones in the ui file but since a missing one is a clean crash
when selected there's little potential for subtle breackage. We could
even ensure consistency by comparing the two at run time but they change
only slowly this is not much of an issue (compared to how e.g. new
languages can be added now).
The layout for this keyboard exists, however it isn't present in
`resources.rs`, making it unavailable.
Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
Use a GOptionContext to display command line options (that are already
handled by e.g. gtk_init anyway).
This turns:
$ squeekboard -h
Debug: Tried file "/home/agx/.local/share/squeekboard/keyboards/us.yaml", but it's missing: No such file or directory (os error 2)
Info: Loaded layout Resource: us
Debug: Tried file "/home/agx/.local/share/squeekboard/keyboards/us.yaml", but it's missing: No such file or directory (os error 2)
Info: Loaded layout Resource: us
** (squeekboard:8015): WARNING **: 19:03:13.125: DBus unavailable, unclear how to continue. Is Squeekboard already running?
into the more useful
$ squeekboard -h
Usage:
squeekboard [OPTION…] - A on screen keyboard
Help Options:
-h, --help Show help options
--help-all Show all help options
--help-gtk Show GTK+ Options
Application Options:
--display=DISPLAY X display to use
...
It seems that is Squeekboard is already running, the next instance will not fail to acquire a bus name, but instead lose it immediately. This message has been reported by users who experiment with Squeekboard for the first time, so let's make it easier for them to find the solution without having to reach out.
This is the Bulgarian (BDS) layout. I took the liberty to remove "э"
from the layout, as it is not part of the Bulgarian alphabet and it was
left there for historical reasons, also not to mess with the layouts for
physical keyboards. Removing it gives more space for the shift_l and
backspace keys.
I've also added the letter "small i with grave" to the special symbols, as
it is occasionally used in Bulgarian.
Layout type switching outside of overlay was always done with gsettings in the middle, assuming that all clicks on languages in the popover result in a gsettings event. That's a bad assumption if there's only one xkb lang present.
This is a simple work around. A better solution would be to turn the entire system of layout switching into a central object that receives messages about changes that need to be applied, and then applies them.
From now on, all the parameters for loading layout are handled inside a single pure function, which makes them possible to test.
As a side benefit, the old preference order function composed of a mess of nested procedures is gone.