[gnome-games/wip/exalm/statuspage: 6/6] error-display: Replace with HdyStatusPage
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/wip/exalm/statuspage: 6/6] error-display: Replace with HdyStatusPage
- Date: Mon, 28 Dec 2020 22:17:07 +0000 (UTC)
commit 9adc747c9c1b4f921bb5ff0ca33c50c4ebb55d75
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Tue Dec 29 03:12:01 2020 +0500
error-display: Replace with HdyStatusPage
src/meson.build | 1 -
src/org.gnome.Games.gresource.xml | 1 -
src/ui/display-view.ui | 18 ++++++++-----
src/ui/display-view.vala | 18 ++++++++++---
src/ui/error-display.ui | 54 ---------------------------------------
src/ui/error-display.vala | 34 ------------------------
6 files changed, 26 insertions(+), 100 deletions(-)
---
diff --git a/src/meson.build b/src/meson.build
index 50ac4d12..f3479bd6 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -141,7 +141,6 @@ vala_sources = [
'ui/collections-page.vala',
'ui/display-bin.vala',
'ui/display-view.vala',
- 'ui/error-display.vala',
'ui/error-info-bar.vala',
'ui/flash-box.vala',
'ui/fullscreen-box.vala',
diff --git a/src/org.gnome.Games.gresource.xml b/src/org.gnome.Games.gresource.xml
index c99a9d96..ae879acc 100644
--- a/src/org.gnome.Games.gresource.xml
+++ b/src/org.gnome.Games.gresource.xml
@@ -47,7 +47,6 @@
<file preprocess="xml-stripblanks">ui/collections-main-page.ui</file>
<file preprocess="xml-stripblanks">ui/collections-page.ui</file>
<file preprocess="xml-stripblanks">ui/display-view.ui</file>
- <file preprocess="xml-stripblanks">ui/error-display.ui</file>
<file preprocess="xml-stripblanks">ui/error-info-bar.ui</file>
<file preprocess="xml-stripblanks">ui/fullscreen-box.ui</file>
<file preprocess="xml-stripblanks">ui/games-page.ui</file>
diff --git a/src/ui/display-view.ui b/src/ui/display-view.ui
index 88b5b61e..7d98f8a6 100644
--- a/src/ui/display-view.ui
+++ b/src/ui/display-view.ui
@@ -189,12 +189,19 @@
<object class="GtkStack" id="stack">
<property name="visible">True</property>
<child>
- <object class="GamesErrorDisplay" id="error_display">
+ <object class="HdyStatusPage" id="error_display">
<property name="visible">True</property>
+ <property name="icon-name">face-uncertain-symbolic</property>
+ <child>
+ <object class="GtkButton" id="restart_btn">
+ <property name="visible">True</property>
+ <property name="label">_Restart Game</property>
+ <property name="use-underline">True</property>
+ <property name="halign">center</property>
+ <property name="action-name">display.restart</property>
+ </object>
+ </child>
</object>
- <packing>
- <property name="name">error</property>
- </packing>
</child>
<child>
<object class="GtkOverlay" id="display_overlay">
@@ -221,9 +228,6 @@
</object>
</child>
</object>
- <packing>
- <property name="name">display</property>
- </packing>
</child>
</object>
</child>
diff --git a/src/ui/display-view.vala b/src/ui/display-view.vala
index dbb8e8b2..aac71c32 100644
--- a/src/ui/display-view.vala
+++ b/src/ui/display-view.vala
@@ -25,7 +25,9 @@ private class Games.DisplayView : Gtk.Box, UiView {
[GtkChild]
private Gtk.Stack stack;
[GtkChild]
- private ErrorDisplay error_display;
+ private Hdy.StatusPage error_display;
+ [GtkChild]
+ private Gtk.Button restart_btn;
[GtkChild]
private Gtk.Overlay display_overlay;
[GtkChild]
@@ -384,7 +386,10 @@ private class Games.DisplayView : Gtk.Box, UiView {
stack.visible_child = error_display;
is_showing_snapshots = false;
- error_display.game_crashed (game, message);
+
+ error_display.title = _("Oops! The game ā%sā crashed unexpectedly").printf
(game.name);
+ error_display.description = message;
+ restart_btn.show ();
});
update_actions ();
@@ -418,7 +423,14 @@ private class Games.DisplayView : Gtk.Box, UiView {
reset_display_page ();
stack.visible_child = error_display;
- error_display.running_game_failed (game, e.message);
+
+ if (game != null)
+ error_display.title = _("Oops! Unable to run ā%sā").printf (game.name);
+ else
+ error_display.title = _("Oops! Unable to run the game");
+
+ error_display.description = e.message;
+ restart_btn.hide ();
return null;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]