GNOME Bugzilla – Bug 676101
Input sources settings schema
Last modified: 2012-06-01 17:00:55 UTC
Created attachment 214098 [details] [review] schemas: Add the input-sources schema These are a pre-requisite for the keyboard and input methods configuration rework. We'll probably need more settings later but these are minimum that we need.
Created attachment 214099 [details] [review] schemas: Add keybindings to switch input sources
Review of attachment 214099 [details] [review]: Other keybindings don't live in gsettings-desktop-schemas, so it makes no sense here.
Review of attachment 214098 [details] [review]: Can't you use the index in the list, or just the identifier for the "current" setting? ::: schemas/org.gnome.desktop.input-sources.gschema.xml.in.in @@ +7,3 @@ + <_description> + Tuple describing the current input source. It's in the form + ('Name', 'Short name', 'XKB layout', 'XKB variant', 'IBus Putting the translated name in the config system means that it will be in the wrong language by default if I don't use US English. @@ +16,3 @@ + <_description> + List of tuples describing the input sources available for + quick switching. The tuples are in the form ('Name', 'Short Ditto.
Created attachment 214696 [details] [review] schemas: Add the input-sources schema -- (In reply to comment #3) > Can't you use the index in the list, or just the identifier for the "current" > setting? Yes, actually I don't even need the current setting if I consider the the first item on the list to be the current one. I've also simplified things to the bare minimum which should allow for a bit more flexibility later by just having a generic "name" here which identifies an input source no matter if it is a plain XKB layout name or an IBus engine name or something else and then work out all the details from that in the code. > Putting the translated name in the config system means that it will be in the > wrong language by default if I don't use US English. Translations could be added to the XKB xml description files and to the IBus engine descriptions but currently they don't exist so that's why I'm also using these identifiers as strings in the UI.
(In reply to comment #4) <snip> > (In reply to comment #3) > > Can't you use the index in the list, or just the identifier for the "current" > > setting? > > Yes, actually I don't even need the current setting if I consider the > the first item on the list to be the current one. And reordering the list all the time? That sounds like a disaster waiting to happen. > > Putting the translated name in the config system means that it will be in the > > wrong language by default if I don't use US English. > > Translations could be added to the XKB xml description files and to > the IBus engine descriptions but currently they don't exist so that's > why I'm also using these identifiers as strings in the UI. They exist. $ LC_ALL=fr_FR.UTF-8 gettext -d xkeyboard-config "English (UK)" Anglais (Royaume-Uni)
Review of attachment 214696 [details] [review]: I don't like the reordering of the list when you're changing the current layout.
Created attachment 214893 [details] [review] schemas: Add the input-sources schema -- (In reply to comment #5) > And reordering the list all the time? That sounds like a disaster waiting to > happen. You're right. The index sounds safer.
Review of attachment 214893 [details] [review]: ::: schemas/org.gnome.desktop.input-sources.gschema.xml.in.in @@ +16,3 @@ + List of input source indentifiers available for quick + switching. + </_description> It would be good to document what the identifiers here are - are these xkb layouts, or full xkb layout/variant/options combinations, input method names, any of the above ?
Review of attachment 214893 [details] [review]: ::: schemas/org.gnome.desktop.input-sources.gschema.xml.in.in @@ +7,3 @@ + <_description> + The index in the input sources list specifying the current one + in effect. Needs about what happens if current > number of items in "sources", and about the value being zero-indexed.
(In reply to comment #8) > Review of attachment 214893 [details] [review]: > > ::: schemas/org.gnome.desktop.input-sources.gschema.xml.in.in > @@ +16,3 @@ > + List of input source indentifiers available for quick > + switching. > + </_description> > > It would be good to document what the identifiers here are - are these xkb > layouts, or full xkb layout/variant/options combinations, input method names, > any of the above ? Right now they are just either "layout+variant" or "ibus_engine_name". But I'm thinking that namespacing the strings might be better. What do you think of "xkb:layout+variant" and "ibus:engine_name"?
You know that with gvariant, there's really no need to mangle the info just to fit it into one string? You can just use string tuples instead, with "a(ss)" type instead of "as". Or even "a(sv)" and use the 'v' component with per-type specific info, e.g. for "xkb" type you can store "(ss)" in the "v" with (layout,variant) separately. Etc.
As mentioned by chpe, if you're going to be creating the identifiers yourself, I'd rather you didn't and used a per-source type value type.
Created attachment 215368 [details] [review] schemas: Add the input-sources schema -- Ok, here it is.
Attachment 215368 [details] pushed as 453ba2a - schemas: Add the input-sources schema
I would have preferred a(sv), but Rui is adamant that it won't be needed. Let's hope this doesn't come back to cause problems.