Use sync API on macos
This commit is contained in:
+6
-6
@@ -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);
|
||||
};
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user