diff options
| author | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2026-07-24 22:56:08 +0530 |
|---|---|---|
| committer | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2026-07-24 22:56:08 +0530 |
| commit | b157a25b2dfff122908da1c89b7a620655521a64 (patch) | |
| tree | 942cdf514d6cab52dc82a82ada3d599729e2b6a5 /SoundListItemWidget.py | |
| parent | 130ca2c3b8d871fd32db91924eb67c991ad72fb3 (diff) | |
default download directory set to downloads folder
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) |