From 2fe7f0a9f585136f5a09aab9fe48ed0468dd3cf3 Mon Sep 17 00:00:00 2001 From: William Hua Date: Fri, 22 Nov 2013 08:33:43 -0500 Subject: Move greeter.vala to unity-greeter.vala. --- lib/Makefile.am | 8 ++++---- lib/greeter.vala | 26 -------------------------- lib/main.vala | 12 ++++++------ lib/unity-greeter.vala | 26 ++++++++++++++++++++++++++ 4 files changed, 36 insertions(+), 36 deletions(-) delete mode 100644 lib/greeter.vala create mode 100644 lib/unity-greeter.vala diff --git a/lib/Makefile.am b/lib/Makefile.am index 72f5f949..1af5469e 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -5,10 +5,10 @@ AM_LDFLAGS = -lm AM_VALAFLAGS = --metadatadir $(top_srcdir)/deps \ --vapidir $(top_srcdir)/deps -indicator_keyboard_service_SOURCES = main.vala \ - source.vala \ - common.vala \ - greeter.vala +indicator_keyboard_service_SOURCES = main.vala \ + source.vala \ + common.vala \ + unity-greeter.vala indicator_keyboard_service_VALAFLAGS = $(AM_VALAFLAGS) \ --pkg gee-1.0 \ --pkg posix \ diff --git a/lib/greeter.vala b/lib/greeter.vala deleted file mode 100644 index c378bbd5..00000000 --- a/lib/greeter.vala +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2013 Canonical Ltd. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, version 3 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - * Authors: William Hua - */ - -[DBus (name="com.canonical.UnityGreeter.List")] -public interface Greeter : Object { - - public abstract string get_active_entry () throws IOError; - public abstract void set_active_entry (string entry_name) throws IOError; - - public signal void entry_selected (string entry_name); -} diff --git a/lib/main.vala b/lib/main.vala index 66147b18..305ebb81 100644 --- a/lib/main.vala +++ b/lib/main.vala @@ -41,7 +41,7 @@ public class Indicator.Keyboard.Service : Object { private MenuModel? menu_model; private Menu? sources_menu; - private Greeter? greeter; + private UnityGreeter? unity_greeter; private string? greeter_user; private uint lightdm_current; @@ -127,9 +127,9 @@ public class Indicator.Keyboard.Service : Object { [DBus (visible = false)] private void update_greeter_user () { - if (greeter_user == null && greeter != null) { + if (greeter_user == null && unity_greeter != null) { try { - greeter_user = ((!) greeter).get_active_entry (); + greeter_user = ((!) unity_greeter).get_active_entry (); } catch (IOError error) { warning ("error: %s", error.message); } @@ -773,8 +773,8 @@ public class Indicator.Keyboard.Service : Object { [DBus (visible = false)] private void handle_name_appeared (DBusConnection connection, string name, string name_owner) { try { - greeter = Bus.get_proxy_sync (BusType.SESSION, name, "/list"); - ((!) greeter).entry_selected.connect (handle_entry_selected); + unity_greeter = Bus.get_proxy_sync (BusType.SESSION, name, "/list"); + ((!) unity_greeter).entry_selected.connect (handle_entry_selected); } catch (IOError error) { warning ("error: %s", error.message); } @@ -782,7 +782,7 @@ public class Indicator.Keyboard.Service : Object { [DBus (visible = false)] private void handle_name_vanished (DBusConnection connection, string name) { - greeter = null; + unity_greeter = null; } [DBus (visible = false)] diff --git a/lib/unity-greeter.vala b/lib/unity-greeter.vala new file mode 100644 index 00000000..2cdfe05c --- /dev/null +++ b/lib/unity-greeter.vala @@ -0,0 +1,26 @@ +/* + * Copyright 2013 Canonical Ltd. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, version 3 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * Authors: William Hua + */ + +[DBus (name="com.canonical.UnityGreeter.List")] +public interface UnityGreeter : Object { + + public abstract string get_active_entry () throws IOError; + public abstract void set_active_entry (string entry_name) throws IOError; + + public signal void entry_selected (string entry_name); +} -- cgit v1.2.3