diff options
Diffstat (limited to 'SoundListItemWidget.py')
| -rw-r--r-- | SoundListItemWidget.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/SoundListItemWidget.py b/SoundListItemWidget.py index 194b633..3c62735 100644 --- a/SoundListItemWidget.py +++ b/SoundListItemWidget.py @@ -18,7 +18,7 @@ import sys import shutil from pathlib import Path -from PySide6.QtCore import Signal +from PySide6.QtCore import Signal, QStandardPaths from PySide6.QtWidgets import QFrame, QHBoxLayout, QLabel, QPushButton, QFileDialog from Soundboard import SoundboardSound @@ -64,14 +64,14 @@ class SoundListItemWidget(QFrame): layout.addWidget(self.btn_play) def download(self): + downloads_dir = Path(QStandardPaths.writableLocation(QStandardPaths.StandardLocation.DownloadLocation)) + selected_folder = QFileDialog.getSaveFileName( self, "Save Audio File", - self.sound.title + Path(self.sound.path).suffix, + str(downloads_dir / (self.sound.title + Path(self.sound.path).suffix)), "All Files (*)" ) if selected_folder: self.download_dest = Path(selected_folder[0]) - print(self.download_dest) - - shutil.copy2(self.sound.path, self.download_dest) + shutil.copy2(self.sound.path, self.download_dest) |