Use Popen for spawning games again

This commit is contained in:
kramo
2023-05-20 19:53:54 +02:00
parent 48685d2591
commit 0074ef56d4
2 changed files with 23 additions and 23 deletions

View File

@@ -18,7 +18,6 @@
# SPDX-License-Identifier: GPL-3.0-or-later
import os
import shlex
from time import time
from gi.repository import Adw, Gio, GLib, Gtk
@@ -71,7 +70,7 @@ class DetailsWindow(Adw.Window):
self.name.set_text(self.game.name)
if self.game.developer:
self.developer.set_text(self.game.developer)
self.executable.set_text(shlex.join(self.game.executable))
self.executable.set_text(" ".join(self.game.executable))
self.apply_button.set_label(_("Apply"))
self.game_cover.new_cover(self.game.get_cover_path())
@@ -130,21 +129,7 @@ class DetailsWindow(Adw.Window):
final_name = self.name.get_text()
final_developer = self.developer.get_text()
final_executable = self.executable.get_text()
try:
# Attempt to parse using shell parsing rules (doesn't verify executable existence).
final_executable_split = shlex.split(
final_executable, comments=False, posix=True
)
except ValueError as exception:
create_dialog(
self,
_("Couldn't Add Game")
if not self.game
else _("Couldn't Apply Preferences"),
f'{_("Executable")}: {exception}.',
)
return
final_executable_split = final_executable.split()
if not self.game:
if final_name == "":