diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2014-12-06 10:35:38 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2014-12-06 10:35:38 +0100 |
commit | c3bbc8fbf85d58e029ffec9ce6415859e55b66eb (patch) | |
tree | f3e14691fb07766c72be06c31c2b05acc34e1a95 | |
parent | 2bc848327d75839aa87a5fc0619d2e2f49709efb (diff) | |
download | arctica-greeter-c3bbc8fbf85d58e029ffec9ce6415859e55b66eb.tar.gz arctica-greeter-c3bbc8fbf85d58e029ffec9ce6415859e55b66eb.tar.bz2 arctica-greeter-c3bbc8fbf85d58e029ffec9ce6415859e55b66eb.zip |
Improve selection code of new entry if an entry is removed.
-rw-r--r-- | debian/changelog | 1 | ||||
-rw-r--r-- | src/greeter-list.vala | 21 |
2 files changed, 12 insertions, 10 deletions
diff --git a/debian/changelog b/debian/changelog index 4e0df52..a225090 100644 --- a/debian/changelog +++ b/debian/changelog @@ -12,6 +12,7 @@ unity-greeter-x2go (14.04.10-0x2go1) UNRELEASED; urgency=medium - Show Remote Login box if no other boxes (usernames, other login, guest login) are to be shown. - Fix config parameter (show-remote-login -> greeter-show-remote-login). + - Improve selection code of new entry if an entry is removed. * debian/control: + Add to S: lightdm-remote-session-x2go. + Drop from S: lightdm-remote-session-uccsconfigure. diff --git a/src/greeter-list.vala b/src/greeter-list.vala index 62f3681..2433a10 100644 --- a/src/greeter-list.vala +++ b/src/greeter-list.vala @@ -456,22 +456,23 @@ public abstract class GreeterList : FadableBox return; var index = entries.index (entry); - entry.destroy (); - entries.remove (entry); - /* Select another entry if the selected one was removed */ + /* Select another entry if the selected one was removed */ if (entry == selected_entry) { - if (entries.length () == 1) - index = 0; - else if (index >= entries.length () && index > 0) + if (index > 0) { index--; - else if (index < entries.length ()) + if (entries.nth_data (index) != null) + select_entry (entries.nth_data (index), -1.0); + } + else if (index < entries.length () -1 ) { index++; - - if (entries.nth_data (index) != null) - select_entry (entries.nth_data (index), -1.0); + if (entries.nth_data (index) != null) + select_entry (entries.nth_data (index), +1.0); + } } + entries.remove (entry); + entry.destroy (); /* Show a manual login if no users and no remote login entry */ if (!have_entries () && !UnityGreeter.singleton.show_remote_login_hint ()) |