diff options
author | William Hua <william.hua@canonical.com> | 2014-04-04 16:27:41 +1300 |
---|---|---|
committer | William Hua <william.hua@canonical.com> | 2014-04-04 16:27:41 +1300 |
commit | dc64a5387763dda0aae30695741dd62ee9fe8614 (patch) | |
tree | f329170fe2dd157ddaf8adf9eddeb76993099014 /lib/indicator-menu.vala | |
parent | 202d1631f69e473c162c62d5e29b2ac1212390f1 (diff) | |
download | ayatana-indicator-keyboard-dc64a5387763dda0aae30695741dd62ee9fe8614.tar.gz ayatana-indicator-keyboard-dc64a5387763dda0aae30695741dd62ee9fe8614.tar.bz2 ayatana-indicator-keyboard-dc64a5387763dda0aae30695741dd62ee9fe8614.zip |
Separate lock screen menu.
Diffstat (limited to 'lib/indicator-menu.vala')
-rw-r--r-- | lib/indicator-menu.vala | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/lib/indicator-menu.vala b/lib/indicator-menu.vala index 1d92a6f6..e321a2d2 100644 --- a/lib/indicator-menu.vala +++ b/lib/indicator-menu.vala @@ -20,8 +20,9 @@ public class Indicator.Keyboard.IndicatorMenu : MenuModel { public enum Options { NONE = 0x0, - IBUS = 0x1, - SETTINGS = 0x2 + DCONF = 0x1, + IBUS = 0x2, + SETTINGS = 0x4 } private Options options; @@ -30,7 +31,7 @@ public class Indicator.Keyboard.IndicatorMenu : MenuModel { private Menu sources_section; private IBusMenu properties_section; - public IndicatorMenu (ActionMap? action_map = null, Options options = Options.IBUS | Options.SETTINGS) { + public IndicatorMenu (ActionMap? action_map = null, Options options = Options.NONE) { var submenu = new Menu (); sources_section = new Menu (); @@ -69,7 +70,15 @@ public class Indicator.Keyboard.IndicatorMenu : MenuModel { for (var i = 0; i < sources.length; i++) { if (!sources[i].is_ibus || (options & Options.IBUS) != Options.NONE) { - var item = new MenuItem (sources[i].name, "indicator.current"); + string action; + + if ((options & Options.DCONF) != Options.NONE) { + action = "indicator.current"; + } else { + action = "indicator.active"; + } + + var item = new MenuItem (sources[i].name, action); item.set_attribute (Menu.ATTRIBUTE_TARGET, "u", i); |