[gnome-games] savestates-list: Save proper thumbnail when closing window
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] savestates-list: Save proper thumbnail when closing window
- Date: Mon, 12 Aug 2019 12:31:03 +0000 (UTC)
commit c86148cd62dff51ffe6d96d7c0c81e99eea98733
Author: Yetizone <andreii lisita gmail com>
Date: Mon Aug 12 10:13:52 2019 +0300
savestates-list: Save proper thumbnail when closing window
src/command/command-runner.vala | 3 ---
src/core/runner.vala | 4 +---
src/dummy/dummy-runner.vala | 3 ---
src/retro/retro-runner.vala | 4 ++++
src/ui/display-view.vala | 2 --
src/ui/savestates-list.vala | 2 --
6 files changed, 5 insertions(+), 13 deletions(-)
---
diff --git a/src/command/command-runner.vala b/src/command/command-runner.vala
index 1f6a57a3..725edfb3 100644
--- a/src/command/command-runner.vala
+++ b/src/command/command-runner.vala
@@ -53,9 +53,6 @@ public class Games.CommandRunner : Object, Runner {
return null;
}
- public void capture_current_state_pixbuf () {
- }
-
public void preview_current_state () {
}
diff --git a/src/core/runner.vala b/src/core/runner.vala
index dbcf52f9..34932a48 100644
--- a/src/core/runner.vala
+++ b/src/core/runner.vala
@@ -19,12 +19,10 @@ public interface Games.Runner : Object {
public abstract void pause ();
public abstract void stop ();
- public abstract void capture_current_state_pixbuf ();
- public abstract void preview_current_state ();
-
public abstract Savestate? try_create_savestate (bool is_automatic);
public abstract void delete_savestate (Savestate savestate);
public abstract void preview_savestate (Savestate savestate);
+ public abstract void preview_current_state ();
public abstract void load_previewed_savestate () throws Error;
public abstract Savestate[] get_savestates ();
diff --git a/src/dummy/dummy-runner.vala b/src/dummy/dummy-runner.vala
index 6b494162..31fcf721 100644
--- a/src/dummy/dummy-runner.vala
+++ b/src/dummy/dummy-runner.vala
@@ -40,9 +40,6 @@ private class Games.DummyRunner : Object, Runner {
return null;
}
- public void capture_current_state_pixbuf () {
- }
-
public void preview_current_state () {
}
diff --git a/src/retro/retro-runner.vala b/src/retro/retro-runner.vala
index 74fd63bd..e48d1394 100644
--- a/src/retro/retro-runner.vala
+++ b/src/retro/retro-runner.vala
@@ -348,6 +348,10 @@ public class Games.RetroRunner : Object, Runner {
if (!is_initialized)
return;
+ if (!running)
+ return;
+
+ current_state_pixbuf = view.get_pixbuf ();
loop.stop ();
//FIXME:
diff --git a/src/ui/display-view.vala b/src/ui/display-view.vala
index e77100c7..aa410863 100644
--- a/src/ui/display-view.vala
+++ b/src/ui/display-view.vala
@@ -365,8 +365,6 @@ private class Games.DisplayView : Object, UiView {
return true;
}
- box.runner.capture_current_state_pixbuf ();
-
if (box.runner.try_create_savestate (true) != null) {
// Progress saved => can quit game safely
box.runner.stop ();
diff --git a/src/ui/savestates-list.vala b/src/ui/savestates-list.vala
index 9229fa95..4ea0fec5 100644
--- a/src/ui/savestates-list.vala
+++ b/src/ui/savestates-list.vala
@@ -114,9 +114,7 @@ private class Games.SavestatesList : Gtk.Box {
revealer.reveal_child = state.is_revealed;
if (state.is_revealed) {
- runner.capture_current_state_pixbuf ();
runner.pause ();
-
select_savestate_row (null);
}
// Runner isn't resumed here but after the revealer finishes the transition
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]