aboutsummaryrefslogtreecommitdiff
path: root/lib/indicator-menu.vala
diff options
context:
space:
mode:
authorWilliam Hua <william.hua@canonical.com>2014-03-27 11:26:46 +1300
committerWilliam Hua <william.hua@canonical.com>2014-03-27 11:26:46 +1300
commit6bef373ae51ecee1fc27cc37756706b907b1e6bd (patch)
tree360632caa3f4b616d4441b60740cb3fd7c5785a5 /lib/indicator-menu.vala
parent809760cd3b6c0b24a62336800367f81eb26fecdf (diff)
downloadayatana-indicator-keyboard-6bef373ae51ecee1fc27cc37756706b907b1e6bd.tar.gz
ayatana-indicator-keyboard-6bef373ae51ecee1fc27cc37756706b907b1e6bd.tar.bz2
ayatana-indicator-keyboard-6bef373ae51ecee1fc27cc37756706b907b1e6bd.zip
Filter out IBus IMs if we don't specify Options.IBUS.
Diffstat (limited to 'lib/indicator-menu.vala')
-rw-r--r--lib/indicator-menu.vala14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/indicator-menu.vala b/lib/indicator-menu.vala
index ab55e808..1d92a6f6 100644
--- a/lib/indicator-menu.vala
+++ b/lib/indicator-menu.vala
@@ -68,15 +68,17 @@ public class Indicator.Keyboard.IndicatorMenu : MenuModel {
sources_section.remove_all ();
for (var i = 0; i < sources.length; i++) {
- var item = new MenuItem (sources[i].name, "indicator.current");
+ if (!sources[i].is_ibus || (options & Options.IBUS) != Options.NONE) {
+ var item = new MenuItem (sources[i].name, "indicator.current");
- item.set_attribute (Menu.ATTRIBUTE_TARGET, "u", i);
+ item.set_attribute (Menu.ATTRIBUTE_TARGET, "u", i);
- if (sources[i].icon != null) {
- item.set_icon ((!) sources[i].icon);
- }
+ if (sources[i].icon != null) {
+ item.set_icon ((!) sources[i].icon);
+ }
- sources_section.append_item (item);
+ sources_section.append_item (item);
+ }
}
}