[gnome-games/wip/exalm/n64: 8/14] error-display: Support showing crashes
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/wip/exalm/n64: 8/14] error-display: Support showing crashes
- Date: Sun, 2 Feb 2020 14:39:32 +0000 (UTC)
commit 4a0a1f71a0fc778da493f080e3814c53b9a1d7c9
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Fri Jan 10 18:57:08 2020 +0500
error-display: Support showing crashes
Add game_crashed() which would show different message and a restart button.
Add restart signal.
data/ui/error-display.ui | 10 ++++++++++
src/ui/error-display.vala | 10 ++++++++++
2 files changed, 20 insertions(+)
---
diff --git a/data/ui/error-display.ui b/data/ui/error-display.ui
index dd61af6f..0ebc9edd 100644
--- a/data/ui/error-display.ui
+++ b/data/ui/error-display.ui
@@ -40,5 +40,15 @@
<property name="wrap">True</property>
</object>
</child>
+ <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="margin-top">12</property>
+ <property name="halign">center</property>
+ <property name="action-name">display.restart</property>
+ </object>
+ </child>
</template>
</interface>
diff --git a/src/ui/error-display.vala b/src/ui/error-display.vala
index 6369ef08..2d2c6e54 100644
--- a/src/ui/error-display.vala
+++ b/src/ui/error-display.vala
@@ -6,6 +6,8 @@ private class Games.ErrorDisplay : Gtk.Box {
private Gtk.Label primary_label;
[GtkChild]
private Gtk.Label secondary_label;
+ [GtkChild]
+ private Gtk.Button restart_btn;
public void running_game_failed (Game game, string message) {
string title;
@@ -15,6 +17,14 @@ private class Games.ErrorDisplay : Gtk.Box {
title = _("Oops! Unable to run the game");
set_labels (title, message);
+ restart_btn.hide ();
+ }
+
+ public void game_crashed (Game game, string message) {
+ var title = _("Oops! The game ā%sā crashed unexpectedly").printf (game.name);
+
+ set_labels (title, message);
+ restart_btn.show ();
}
private void set_labels (string primary, string secondary) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]