[gnome-games] ui: Prepare the display page before displaying an error
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] ui: Prepare the display page before displaying an error
- Date: Fri, 17 Feb 2017 14:53:42 +0000 (UTC)
commit 65e904e2bf7e71a8ad95a02d4fab4bade7cea5c2
Author: Adrien Plazas <kekun plazas laposte net>
Date: Fri Feb 17 15:49:27 2017 +0100
ui: Prepare the display page before displaying an error
Ensure the error page is in a good state when displaying an error.
https://bugzilla.gnome.org/show_bug.cgi?id=778774
src/ui/application-window.vala | 16 +++++++++++-----
1 files changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/src/ui/application-window.vala b/src/ui/application-window.vala
index 4ce8fd7..f62d707 100644
--- a/src/ui/application-window.vala
+++ b/src/ui/application-window.vala
@@ -214,11 +214,7 @@ private class Games.ApplicationWindow : Gtk.ApplicationWindow {
// Reset the UI parts depending on the runner to avoid an
// inconsistent state is case we couldn't retrieve it.
- display_header_bar.can_fullscreen = false;
- display_box.header_bar.can_fullscreen = false;
- display_box.runner = null;
- display_header_bar.media_set = null;
- display_box.header_bar.media_set = null;
+ reset_display_page ();
var runner = try_get_runner (game);
if (runner == null)
@@ -245,12 +241,14 @@ private class Games.ApplicationWindow : Gtk.ApplicationWindow {
if (runner.check_is_valid (out error_message))
return runner;
+ reset_display_page ();
display_box.display_running_game_failed (game, error_message);
return null;
}
catch (Error e) {
warning (e.message);
+ reset_display_page ();
display_box.display_running_game_failed (game, _("An unexpected error occured."));
return null;
@@ -490,4 +488,12 @@ private class Games.ApplicationWindow : Gtk.ApplicationWindow {
inhibit_cookie = new_cookie;
inhibit_flags = new_flags;
}
+
+ private void reset_display_page () {
+ display_header_bar.can_fullscreen = false;
+ display_box.header_bar.can_fullscreen = false;
+ display_box.runner = null;
+ display_header_bar.media_set = null;
+ display_box.header_bar.media_set = null;
+ }
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]