diff --git a/src/MainWindow.vala b/src/MainWindow.vala index 959b5b04d..9beb2365b 100644 --- a/src/MainWindow.vala +++ b/src/MainWindow.vala @@ -395,41 +395,26 @@ public class Greeter.MainWindow : Gtk.ApplicationWindow { var action_group = get_action_group ("session"); try { lightdm_greeter.start_session_sync (action_group.get_action_state ("select").get_string ()); + return; } catch (Error e) { - critical (e.message); - if (current_card is Greeter.UserCard) { - switch_to_card ((Greeter.UserCard) current_card); - } - - current_card.connecting = false; - current_card.wrong_credentials (); - } - } else { - if (current_card is Greeter.UserCard) { - switch_to_card ((Greeter.UserCard) current_card); + var error_dialog = new Granite.MessageDialog.with_image_from_icon_name ( + _("Unable to Log In"), + _("Starting the session has failed."), + "dialog-error", + Gtk.ButtonsType.CLOSE + ); + error_dialog.show_error_details (e.message); + error_dialog.run (); + error_dialog.destroy (); } + } - current_card.connecting = false; - current_card.wrong_credentials (); + if (current_card is Greeter.UserCard) { + switch_to_card ((Greeter.UserCard) current_card); } - /*if (lightdm.is_authenticated) { - // Check if the LoginMask actually got userinput that confirms - // that the user wants to start a session now. - if (had_prompt) { - // If yes, start a session - awaiting_start_session = true; - login_successful (); - } else { - message ("Auth complete, but we await user-interaction before we" - + "start a session"); - // If no, send a prompt and await the confirmation via respond. - // This variables is checked in respond as a special case. - awaiting_confirmation = true; - current_login.show_prompt (PromptType.CONFIRM_LOGIN); - } - } else { - current_login.not_authenticated (); - }*/ + + current_card.connecting = false; + current_card.wrong_credentials (); } private async void load_users () {