aboutsummaryrefslogtreecommitdiff
path: root/lib/main.vala
diff options
context:
space:
mode:
authorWilliam Hua <william.hua@canonical.com>2014-04-04 16:27:41 +1300
committerWilliam Hua <william.hua@canonical.com>2014-04-04 16:27:41 +1300
commitdc64a5387763dda0aae30695741dd62ee9fe8614 (patch)
treef329170fe2dd157ddaf8adf9eddeb76993099014 /lib/main.vala
parent202d1631f69e473c162c62d5e29b2ac1212390f1 (diff)
downloadayatana-indicator-keyboard-dc64a5387763dda0aae30695741dd62ee9fe8614.tar.gz
ayatana-indicator-keyboard-dc64a5387763dda0aae30695741dd62ee9fe8614.tar.bz2
ayatana-indicator-keyboard-dc64a5387763dda0aae30695741dd62ee9fe8614.zip
Separate lock screen menu.
Diffstat (limited to 'lib/main.vala')
-rw-r--r--lib/main.vala29
1 files changed, 27 insertions, 2 deletions
diff --git a/lib/main.vala b/lib/main.vala
index d8c1f060..cc78c384 100644
--- a/lib/main.vala
+++ b/lib/main.vala
@@ -47,6 +47,7 @@ public class Indicator.Keyboard.Service : Object {
private SimpleAction? indicator_action;
private IndicatorMenu? desktop_menu;
private IndicatorMenu? desktop_greeter_menu;
+ private IndicatorMenu? desktop_lockscreen_menu;
private UnitySession? unity_session;
private uint session_current;
@@ -81,6 +82,10 @@ public class Indicator.Keyboard.Service : Object {
get_desktop_greeter_menu ().set_sources (get_sources ());
}
+ if (desktop_lockscreen_menu != null) {
+ get_desktop_lockscreen_menu ().set_sources (get_sources ());
+ }
+
if (indicator_action != null) {
update_indicator_action ();
}
@@ -758,7 +763,11 @@ public class Indicator.Keyboard.Service : Object {
[DBus (visible = false)]
public IndicatorMenu get_desktop_menu () {
if (desktop_menu == null) {
- desktop_menu = new IndicatorMenu (get_action_group ());
+ var options = IndicatorMenu.Options.DCONF
+ | IndicatorMenu.Options.IBUS
+ | IndicatorMenu.Options.SETTINGS;
+
+ desktop_menu = new IndicatorMenu (get_action_group (), options);
((!) desktop_menu).set_sources (get_sources ());
((!) desktop_menu).activate.connect ((property, state) => {
var panel = get_ibus_panel ();
@@ -779,7 +788,9 @@ public class Indicator.Keyboard.Service : Object {
[DBus (visible = false)]
public IndicatorMenu get_desktop_greeter_menu () {
if (desktop_greeter_menu == null) {
- desktop_greeter_menu = new IndicatorMenu (get_action_group (), IndicatorMenu.Options.NONE);
+ var options = IndicatorMenu.Options.DCONF;
+
+ desktop_greeter_menu = new IndicatorMenu (get_action_group (), options);
((!) desktop_greeter_menu).set_sources (get_sources ());
}
@@ -787,6 +798,18 @@ public class Indicator.Keyboard.Service : Object {
}
[DBus (visible = false)]
+ public IndicatorMenu get_desktop_lockscreen_menu () {
+ if (desktop_lockscreen_menu == null) {
+ var options = IndicatorMenu.Options.NONE;
+
+ desktop_lockscreen_menu = new IndicatorMenu (get_action_group (), options);
+ ((!) desktop_lockscreen_menu).set_sources (get_sources ());
+ }
+
+ return (!) desktop_lockscreen_menu;
+ }
+
+ [DBus (visible = false)]
private void handle_changed_visible (string key) {
update_indicator_action ();
}
@@ -803,6 +826,7 @@ public class Indicator.Keyboard.Service : Object {
get_desktop_menu ().set_sources (get_sources ());
get_desktop_greeter_menu ().set_sources (get_sources ());
+ get_desktop_lockscreen_menu ().set_sources (get_sources ());
update_indicator_action ();
update_login_layout ();
}
@@ -939,6 +963,7 @@ public class Indicator.Keyboard.Service : Object {
connection.export_action_group ("/com/canonical/indicator/keyboard", get_action_group ());
connection.export_menu_model ("/com/canonical/indicator/keyboard/desktop", get_desktop_menu ());
connection.export_menu_model ("/com/canonical/indicator/keyboard/desktop_greeter", get_desktop_greeter_menu ());
+ connection.export_menu_model ("/com/canonical/indicator/keyboard/desktop_lockscreen", get_desktop_lockscreen_menu ());
} catch (Error error) {
warning ("error: %s", error.message);
}