After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 676101 - Input sources settings schema
Input sources settings schema
Status: RESOLVED FIXED
Product: gsettings-desktop-schemas
Classification: Core
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: gsettings-desktop-schemas-maint
gsettings-desktop-schemas-maint
Depends on:
Blocks: 641531 662489 676102
 
 
Reported: 2012-05-15 14:31 UTC by Rui Matos
Modified: 2012-06-01 17:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
schemas: Add the input-sources schema (2.22 KB, patch)
2012-05-15 14:31 UTC, Rui Matos
needs-work Details | Review
schemas: Add keybindings to switch input sources (1.01 KB, patch)
2012-05-15 14:31 UTC, Rui Matos
rejected Details | Review
schemas: Add the input-sources schema (1.83 KB, patch)
2012-05-22 20:01 UTC, Rui Matos
needs-work Details | Review
schemas: Add the input-sources schema (2.02 KB, patch)
2012-05-24 20:40 UTC, Rui Matos
reviewed Details | Review
schemas: Add the input-sources schema (2.96 KB, patch)
2012-06-01 00:22 UTC, Rui Matos
committed Details | Review

Description Rui Matos 2012-05-15 14:31:05 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.
Comment 1 Rui Matos 2012-05-15 14:31:39 UTC
Created attachment 214099 [details] [review]
schemas: Add keybindings to switch input sources
Comment 2 Bastien Nocera 2012-05-16 16:37:49 UTC
Review of attachment 214099 [details] [review]:

Other keybindings don't live in gsettings-desktop-schemas, so it makes no sense here.
Comment 3 Bastien Nocera 2012-05-16 16:40:15 UTC
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.
Comment 4 Rui Matos 2012-05-22 20:01:01 UTC
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.
Comment 5 Bastien Nocera 2012-05-23 15:08:47 UTC
(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)
Comment 6 Bastien Nocera 2012-05-23 15:10:31 UTC
Review of attachment 214696 [details] [review]:

I don't like the reordering of the list when you're changing the current layout.
Comment 7 Rui Matos 2012-05-24 20:40:13 UTC
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.
Comment 8 Matthias Clasen 2012-05-29 23:02:48 UTC
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 ?
Comment 9 Bastien Nocera 2012-05-30 10:17:45 UTC
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.
Comment 10 Rui Matos 2012-05-30 12:47:15 UTC
(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"?
Comment 11 Christian Persch 2012-05-30 12:53:18 UTC
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.
Comment 12 Bastien Nocera 2012-05-31 15:18:41 UTC
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.
Comment 13 Rui Matos 2012-06-01 00:22:49 UTC
Created attachment 215368 [details] [review]
schemas: Add the input-sources schema

--
Ok, here it is.
Comment 14 Bastien Nocera 2012-06-01 16:59:42 UTC
Attachment 215368 [details] pushed as 453ba2a - schemas: Add the input-sources schema
Comment 15 Bastien Nocera 2012-06-01 17:00:55 UTC
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.