From f2b90709061e103ca354e31cf3cdfb45b6803274 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Sat, 19 Sep 2015 14:42:19 +0200 Subject: Adapt to using ArcticaProject's remote-logon-service. --- debian/control | 2 +- src/Makefile.am | 2 +- src/remote-login-service.vala | 54 ------------------------------------------- src/remote-logon-service.vala | 54 +++++++++++++++++++++++++++++++++++++++++++ src/user-list.vala | 50 +++++++++++++++++++-------------------- tests/Makefile.am | 2 +- 6 files changed, 82 insertions(+), 82 deletions(-) delete mode 100644 src/remote-login-service.vala create mode 100644 src/remote-logon-service.vala diff --git a/debian/control b/debian/control index 39c3eec..3733920 100644 --- a/debian/control +++ b/debian/control @@ -40,7 +40,7 @@ Recommends: unity-settings-daemon, network-manager-gnome, lightdm-remote-session-freerdp, lightdm-remote-session-x2go, - remote-login-service-x2go, + remote-logon-service, xinput, Provides: lightdm-greeter Breaks: diff --git a/src/Makefile.am b/src/Makefile.am index 4e11310..062c7c9 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -26,7 +26,7 @@ arctica_greeter_SOURCES = \ menubar.vala \ prompt-box.vala \ session-list.vala \ - remote-login-service.vala \ + remote-logon-service.vala \ settings.vala \ settings-daemon.vala \ shutdown-dialog.vala \ diff --git a/src/remote-login-service.vala b/src/remote-login-service.vala deleted file mode 100644 index 7099ac2..0000000 --- a/src/remote-login-service.vala +++ /dev/null @@ -1,54 +0,0 @@ -/* -*- Mode: Vala; indent-tabs-mode: nil; tab-width: 4 -*- - * - * Copyright (C) 2012 Canonical Ltd - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 3 as - * published by the Free Software Foundation. - * - * 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 . - * - */ - -protected struct RemoteServerField -{ - public string type; - public bool required; - public Variant default_value; - public HashTable properties; -} - -protected struct RemoteServerApplication -{ - public string application_id; - public int pin_position; -} - -protected struct RemoteServer -{ - public string type; - public string name; - public string url; - public bool last_used_server; - public RemoteServerField[] fields; - public RemoteServerApplication[] applications; -} - -[DBus (name = "com.canonical.RemoteLogin")] -interface RemoteLoginService : Object -{ - public abstract async void get_servers (out RemoteServer[] serverList) throws IOError; - public abstract async void get_servers_for_login (string url, string emailAddress, string password, bool allowCache, out bool loginSuccess, out string dataType, out RemoteServer[] serverList) throws IOError; - public abstract async void get_cached_domains_for_server (string url, out string[] domains) throws IOError; - public abstract async void set_last_used_server (string uccsUrl, string serverUrl) throws IOError; - - public signal void servers_updated (RemoteServer[] serverList); - public signal void login_servers_updated (string url, string emailAddress, string dataType, RemoteServer[] serverList); - public signal void login_changed (string url, string emailAddress); -} diff --git a/src/remote-logon-service.vala b/src/remote-logon-service.vala new file mode 100644 index 0000000..763c558 --- /dev/null +++ b/src/remote-logon-service.vala @@ -0,0 +1,54 @@ +/* -*- Mode: Vala; indent-tabs-mode: nil; tab-width: 4 -*- + * + * Copyright (C) 2012 Canonical Ltd + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 3 as + * published by the Free Software Foundation. + * + * 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 . + * + */ + +protected struct RemoteServerField +{ + public string type; + public bool required; + public Variant default_value; + public HashTable properties; +} + +protected struct RemoteServerApplication +{ + public string application_id; + public int pin_position; +} + +protected struct RemoteServer +{ + public string type; + public string name; + public string url; + public bool last_used_server; + public RemoteServerField[] fields; + public RemoteServerApplication[] applications; +} + +[DBus (name = "org.ArticaProject.RemoteLogon")] +interface RemoteLoginService : Object +{ + public abstract async void get_servers (out RemoteServer[] serverList) throws IOError; + public abstract async void get_servers_for_login (string url, string emailAddress, string password, bool allowCache, out bool loginSuccess, out string dataType, out RemoteServer[] serverList) throws IOError; + public abstract async void get_cached_domains_for_server (string url, out string[] domains) throws IOError; + public abstract async void set_last_used_server (string uccsUrl, string serverUrl) throws IOError; + + public signal void servers_updated (RemoteServer[] serverList); + public signal void login_servers_updated (string url, string emailAddress, string dataType, RemoteServer[] serverList); + public signal void login_changed (string url, string emailAddress); +} diff --git a/src/user-list.vala b/src/user-list.vala index 2b1a0da..4b3bcc2 100644 --- a/src/user-list.vala +++ b/src/user-list.vala @@ -52,8 +52,8 @@ public class UserList : GreeterList private uint change_background_timeout = 0; - private uint remote_login_service_watch; - private RemoteLoginService remote_login_service; + private uint remote_logon_service_watch; + private RemoteLoginService remote_logon_service; private List remote_directory_server_list = new List (); private List remote_login_server_list = new List (); private HashTable current_remote_fields; @@ -166,11 +166,11 @@ public class UserList : GreeterList if (!ArcticaGreeter.singleton.test_mode && ArcticaGreeter.singleton.show_remote_login_hint ()) - remote_login_service_watch = Bus.watch_name (BusType.SESSION, - "com.canonical.RemoteLogin", + remote_logon_service_watch = Bus.watch_name (BusType.SESSION, + "org.ArticaProject.RemoteLogon", BusNameWatcherFlags.AUTO_START, - on_remote_login_service_appeared, - on_remote_login_service_vanished); + on_remote_logon_service_appeared, + on_remote_logon_service_vanished); } @@ -196,12 +196,12 @@ public class UserList : GreeterList try { RemoteServer[] server_list; - yield remote_login_service.get_servers (out server_list); + yield remote_logon_service.get_servers (out server_list); set_remote_directory_servers (server_list); } catch (IOError e) { - debug ("Calling GetServers on com.canonical.RemoteLogin dbus service failed. Error: %s", e.message); + debug ("Calling GetServers on org.ArticaProject.RemoteLogon dbus service failed. Error: %s", e.message); remove_remote_servers (); } } @@ -346,7 +346,7 @@ public class UserList : GreeterList { if (currently_browsing_server_url == url && currently_browsing_server_email == email_address) { - /* Something happened and we are being asked for re-authentication by the remote-login-service */ + /* Something happened and we are being asked for re-authentication by the remote-logon-service */ remove_remote_login_servers (); currently_browsing_server_url = ""; currently_browsing_server_email = ""; @@ -356,36 +356,36 @@ public class UserList : GreeterList } } - private void on_remote_login_service_appeared (DBusConnection conn, string name) + private void on_remote_logon_service_appeared (DBusConnection conn, string name) { Bus.get_proxy.begin (BusType.SESSION, - "com.canonical.RemoteLogin", - "/com/canonical/RemoteLogin", + "org.ArticaProject.RemoteLogon", + "/org/ArticaProject/RemoteLogon", 0, null, (obj, res) => { try { - remote_login_service = Bus.get_proxy.end (res); - remote_login_service.servers_updated.connect (set_remote_directory_servers); - remote_login_service.login_servers_updated.connect (remote_login_servers_updated); - remote_login_service.login_changed.connect (remote_login_changed); + remote_logon_service = Bus.get_proxy.end (res); + remote_logon_service.servers_updated.connect (set_remote_directory_servers); + remote_logon_service.login_servers_updated.connect (remote_login_servers_updated); + remote_logon_service.login_changed.connect (remote_login_changed); query_directory_servers.begin (); } catch (IOError e) { - debug ("Getting the com.canonical.RemoteLogin dbus service failed. Error: %s", e.message); + debug ("Getting the org.ArticaProject.RemoteLogon dbus service failed. Error: %s", e.message); remove_remote_servers (); - remote_login_service = null; + remote_logon_service = null; } } ); } - private void on_remote_login_service_vanished (DBusConnection conn, string name) + private void on_remote_logon_service_vanished (DBusConnection conn, string name) { remove_remote_servers (); - remote_login_service = null; + remote_logon_service = null; /* provide a fallback manual login option */ if (ArcticaGreeter.singleton.hide_users_hint ()) { @@ -482,14 +482,14 @@ public class UserList : GreeterList // If we had an error and are retrying the same user and server, do not use the cache on R-L-S if (selected_entry.has_errors && currently_browsing_server_email == email && currently_browsing_server_url == url) allowcache = false; - yield remote_login_service.get_servers_for_login (url, email, password_field.text, allowcache, out login_success, out data_type, out server_list); + yield remote_logon_service.get_servers_for_login (url, email, password_field.text, allowcache, out login_success, out data_type, out server_list); } currently_browsing_server_url = url; currently_browsing_server_email = email; } catch (IOError e) { - debug ("Calling get_servers in com.canonical.RemoteLogin dbus service failed. Error: %s", e.message); + debug ("Calling get_servers in org.ArticaProject.RemoteLogon dbus service failed. Error: %s", e.message); } if (login_success) @@ -538,7 +538,7 @@ public class UserList : GreeterList else { ArcticaGreeter.singleton.authenticate_remote (get_lightdm_session (), null); - remote_login_service.set_last_used_server.begin (currently_browsing_server_url, url_from_remote_loding_server_list_name (selected_entry.id)); + remote_logon_service.set_last_used_server.begin (currently_browsing_server_url, url_from_remote_loding_server_list_name (selected_entry.id)); } } @@ -777,12 +777,12 @@ public class UserList : GreeterList if (ArcticaGreeter.singleton.test_mode) email_domains = { "canonical.com", "ubuntu.org", "candy.com", "urban.net" }; else - yield remote_login_service.get_cached_domains_for_server (url, out email_domains); + yield remote_logon_service.get_cached_domains_for_server (url, out email_domains); } catch (IOError e) { email_domains.resize (0); - debug ("Calling get_cached_domains_for_server in com.canonical.RemoteLogin dbus service failed. Error: %s", e.message); + debug ("Calling get_cached_domains_for_server in org.ArticaProject.RemoteLogon dbus service failed. Error: %s", e.message); } var entry = add_prompt (_("Email:") + " / " + _("Username:")); diff --git a/tests/Makefile.am b/tests/Makefile.am index e2f601d..8e2e8de 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -15,7 +15,7 @@ arctica_greeter_test_SOURCES = \ ../src/toggle-box.vala \ ../src/user-list.vala \ ../src/greeter-list.vala \ - ../src/remote-login-service.vala \ + ../src/remote-logon-service.vala \ ../src/background.vala \ ../src/email-autocompleter.vala \ ../src/config.vapi \ -- cgit v1.2.3