[gnome-games] display-view: Make restart an action
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] display-view: Make restart an action
- Date: Tue, 28 Jan 2020 14:09:22 +0000 (UTC)
commit 29ffad78ca5feff10cb2e2ec3af627f04e2b9a44
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Tue Jan 28 18:53:03 2020 +0500
display-view: Make restart an action
data/ui/display-header-bar.ui | 2 +-
src/ui/display-header-bar.vala | 5 -----
src/ui/display-view.vala | 6 ++++++
3 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/data/ui/display-header-bar.ui b/data/ui/display-header-bar.ui
index 3021b6bc..a70c27cb 100644
--- a/data/ui/display-header-bar.ui
+++ b/data/ui/display-header-bar.ui
@@ -188,7 +188,7 @@
<object class="GtkModelButton">
<property name="visible">True</property>
<property name="text" translatable="yes">_Restart</property>
- <signal name="clicked" handler="on_restart_clicked"/>
+ <property name="action-name">display.restart</property>
</object>
</child>
<child>
diff --git a/src/ui/display-header-bar.vala b/src/ui/display-header-bar.vala
index 6bab882d..e83c7779 100644
--- a/src/ui/display-header-bar.vala
+++ b/src/ui/display-header-bar.vala
@@ -116,11 +116,6 @@ private class Games.DisplayHeaderBar : Gtk.Bin {
is_showing_snapshots = true;
}
- [GtkCallback]
- private void on_restart_clicked () {
- runner.restart ();
- }
-
[GtkCallback]
private void on_showing_snapshots_changed () {
if (is_showing_snapshots)
diff --git a/src/ui/display-view.vala b/src/ui/display-view.vala
index a00d26d1..378955d4 100644
--- a/src/ui/display-view.vala
+++ b/src/ui/display-view.vala
@@ -54,6 +54,7 @@ private class Games.DisplayView : Object, UiView {
private const ActionEntry[] action_entries = {
{ "load-snapshot", load_snapshot },
+ { "restart", restart },
};
public DisplayView (Gtk.Window window) {
@@ -554,4 +555,9 @@ private class Games.DisplayView : Object, UiView {
is_showing_snapshots = false;
}
+
+ private void restart () {
+ if (box.runner != null && box.runner.is_integrated)
+ box.runner.restart ();
+ }
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]