Use sync API on macos

This commit is contained in:
2026-08-12 19:45:59 -04:00
parent a926f19f79
commit e15659f6d2
3 changed files with 46 additions and 18 deletions
+6 -6
View File
@@ -252,9 +252,9 @@ impl GameWindow {
Command::OpenRom => {
let rom = self
.file_picker
.new_dialog()
.pick_file_dialog()
.add_filter("Virtual Boy ROMs", &["vb", "vbrom", "elf", "isx"])
.pick_file();
.open();
if let Some(path) = rom {
self.client
.send_command(EmulatorCommand::LoadGame(self.sim_id, path));
@@ -310,9 +310,9 @@ impl GameWindow {
{
let rom = self
.file_picker
.new_dialog()
.pick_file_dialog()
.add_filter("Virtual Boy ROMs", &["vb", "vbrom", "elf", "isx"])
.pick_file();
.open();
if let Some(path) = rom {
self.client
.send_command(EmulatorCommand::LoadGame(self.sim_id, path));
@@ -466,10 +466,10 @@ impl GameWindow {
let bytes = rx.await.context("Could not take screenshot")?;
let file = self
.file_picker
.new_dialog()
.save_file_dialog()
.add_filter("PNG images", &["png"])
.set_file_name("screenshot.png")
.save_file();
.open();
let Some(path) = file else {
return Ok(None);
};
+2 -2
View File
@@ -64,10 +64,10 @@ impl ProfileWindow {
let bytes_receiver = self.profiler.finish_recording();
let file = self
.file_picker
.new_dialog()
.save_file_dialog()
.add_filter("Profiler files", &["json"])
.set_file_name("profile.json")
.save_file();
.open();
if let Some(path) = file {
let bytes = pollster::block_on(bytes_receiver)?;
let _ = fs::remove_file(&path);