Commit graph

17 commits

Author SHA1 Message Date
Matthias Clasen
1e4b0649f4 region: Handle being opened twice gracefully
When the going from the region panel to the overview and back,
the input methods in the list loose their display names. What
is happening is that we recreate the ibus object, but the second
time around it is already connected since ibus uses a shared
singleton connection internally. Thus, the ::connected signal
is never emitted, and we don't fetch the engines.

Work around this by checking if the newly created ibus object
is already connected, and directly calling fetch_ibus_engines
if it is. To make this work, we have to set up the treeview
with its model earlier.
2012-07-19 21:38:48 -04:00
Matthias Clasen
0af48c80a9 region: Make the code more robust
update_ibus_active_sources may very well be called with
an empty treeview. The code that iterates over the model
was assuming that there is at least one item. Fix that
by checking the return value of gtk_tree_model_get_iter_first().
2012-07-19 21:35:49 -04:00
Matthias Clasen
64150f1458 Avoid losing the selection
When the active input sources list is changed in any way (add or
remove or reorder a source), we write the list to the setting,
and then we get a changed signal for the setting, and rebuild
the list from the setting. Doing so loses the selection, unless
we take extra precaution to keep it.

https://bugzilla.gnome.org/show_bug.cgi?id=680027
2012-07-17 00:01:54 -04:00
Matthias Clasen
54835c8f44 Remove one more leftover reference to a filter model
The active input sources are no longer stored in a filter model.
Also, use gtk_list_store_insert_with_values for atomic insertion.
2012-07-16 23:59:03 -04:00
Matthias Clasen
953cc81b0f Region: Remove references to a no-longer-existing filter model
There was some code left around for dealing with a filter model,
but we don't have the active input sources in a filtered list
anymore. This was leading to crashes when removing or rearranging
input sources.
2012-07-16 12:13:18 -04:00
Bastien Nocera
ab0594239c region: Fix compilation failure
A use of the removed tree_view_get_actual_model() crept in.
2012-07-16 17:05:48 +01:00
Bastien Nocera
661019dadc region: Remove unneeded signal blockers
The value isn't going to change from under us, as the settings
object is in delayed mode.
2012-07-16 15:24:23 +01:00
Rui Matos
3579d7bb97 region: Try to keep the current input source when modifying the list
When modifying the input sources list the currently active source's
index might change. We must change the current setting accordingly to
keep it active.

https://bugzilla.gnome.org/show_bug.cgi?id=662489
2012-07-16 15:23:37 +01:00
Rui Matos
49f7d379bc region: Fix a couple of memory leaks
Unref the GSettings object and build the GnomeXkbInfo only
once. There's no need to free and keep rebuilding the latter since it
doesn't keep any state and is a bit expensive to build.

https://bugzilla.gnome.org/show_bug.cgi?id=662489
2012-07-16 15:18:33 +01:00
Bastien Nocera
03f08fd36c region: Never hide items from view
If IBus is unavailable to get the input source's display name,
just show the ID instead, and populate the display name when we get
a change (eg. when fetching the input sources from IBus is done).
2012-07-16 15:17:24 +01:00
Rui Matos
5e737900b0 region: Wire up the input source settings button
For XKB input sources the settings button remains unsensitive. For
IBus sources we make it sensitive and launch the engine's setup tool
on clicked if there is one.

https://bugzilla.gnome.org/show_bug.cgi?id=662489
2012-07-16 15:17:24 +01:00
Rui Matos
412e53079f region: Add IBus input sources
We query IBus for the available engines and present them alongside XKB
layouts.

https://bugzilla.gnome.org/show_bug.cgi?id=662489
2012-07-16 15:17:24 +01:00
Bastien Nocera
e880784fcb region: Update the shortcuts labels on startup
https://bugzilla.gnome.org/show_bug.cgi?id=662489
2012-06-01 19:01:57 +01:00
Rui Matos
0a78c3504e region: Add XKB input sources
We allow the user to choose from all XKB layouts installed and keep a
user picked list in gsettings.

https://bugzilla.gnome.org/show_bug.cgi?id=662489
2012-06-01 18:46:38 +01:00
Rui Matos
375bf2363f region: Improved keynav on the input chooser
This makes the dialog return when the user presses Enter on the filter
entry and prevents the GtkTreeView search popup from being used since
we already handle searching on that tree view.

https://bugzilla.gnome.org/show_bug.cgi?id=662489
2012-06-01 18:46:38 +01:00
Rui Matos
e38f9acf39 region: Improved selection handling on the input chooser
This makes the input chooser list always have a selected row and be
centered on it when the filter is applied.

https://bugzilla.gnome.org/show_bug.cgi?id=662489
2012-06-01 18:46:38 +01:00
Rui Matos
bfaeb6a41d region: Add an initial input sources tab
This is just the scaffolding according to
https://live.gnome.org/Design/SystemSettings/RegionAndLanguage
No code behind it yet.

Original code from Matthias Clasen.

https://bugzilla.gnome.org/show_bug.cgi?id=662489
2012-06-01 18:46:37 +01:00