mirror of
https://github.com/csd4ni3l/music-player.git
synced 2025-11-05 04:58:17 +01:00
Fix ffmpeg install script not closing window after install done.
This commit is contained in:
@@ -14,12 +14,12 @@ class FFmpegMissing(arcade.gui.UIView):
|
||||
width=self.window.width / 2,
|
||||
height=self.window.height / 2,
|
||||
title="Third-party FFmpeg Missing",
|
||||
message_text="FFmpeg is a third party software that is required for this application to work. It needs to be downloaded with libavcodec (and) shared libraries included. We provide a basic install script for Windows that might or might not work. For other operating systems, install from the package manager to make sure it is in PATH.",
|
||||
message_text="FFmpeg is a third party software that is required for this application to work. It needs to be downloaded with libavcodec (and) shared libraries included. We provide a basic install script for Windows that might or might not work. If it works, it will close the program so you need to open it again. For other operating systems, install from the package manager to make sure it is in PATH.",
|
||||
buttons=("Exit", "Install")
|
||||
)
|
||||
)
|
||||
|
||||
msgbox.on_action = lambda event: self.install_ffmpeg() if event.action == "Install" else sys.exit()
|
||||
msgbox.on_action = lambda event: self.install_ffmpeg() if event.action == "Install" else lambda event: self.window.close()
|
||||
|
||||
def install_ffmpeg(self):
|
||||
bin_dir = os.path.join(os.getcwd(), "bin")
|
||||
@@ -29,7 +29,7 @@ class FFmpegMissing(arcade.gui.UIView):
|
||||
|
||||
if system == "Linux" or system == "Darwin":
|
||||
msgbox = self.add_widget(arcade.gui.UIMessageBox(message_text="You are on a Linux or Darwin based OS. You need to install FFmpeg and libavcodec shared libraries from your package manager to make sure it is in PATH.", width=self.window.width / 2, height=self.window.height / 2))
|
||||
msgbox.on_action = lambda: sys.exit()
|
||||
msgbox.on_action = lambda event: self.window.close()
|
||||
return
|
||||
|
||||
elif system == "Windows":
|
||||
@@ -39,7 +39,7 @@ class FFmpegMissing(arcade.gui.UIView):
|
||||
"--accept-source-agreements", "--accept-package-agreements"
|
||||
], check=True)
|
||||
logging.debug("FFmpeg installed via winget.")
|
||||
sys.exit()
|
||||
self.window.close()
|
||||
return
|
||||
|
||||
except subprocess.CalledProcessError as e:
|
||||
|
||||
Reference in New Issue
Block a user