Closed cherylli closed 4 years ago
What exactly is this again? You added the button to open the file location, now we want to display the file location?
I think it's more like a message to show "the file has been downloaded to ...." And maybe a button to open the location.
Completed, this issue can be closed now, just make sure this bug isn't reproducible (The gap in the directory)
@chonix take a quick look at the code to see if you can spot any errors?
def getSaveLocation(self):
""" Get user selected directory when the get location button is clicked.
"""
global directory
directory = str(QFileDialog.getExistingDirectory(
self, "Select Directory"))
self.lineEditDownloadLocation.setText(directory)
self.logger.info(f"function: getSaveLocation - directory: {directory}")
def onSaveLocationChange(self):
""" Get save location by user text input
"""
global directory
entered_directory = self.lineEditDownloadLocation.text()
# check if directory exist
if not os.path.isdir(entered_directory):
self.lineEditDownloadLocation.setText("")
self.showPopUp("Directory is not valid. Please re select")
else:
directory = entered_directory
self.logger.info(
f"function: onSaveLocationChange - directory: {directory}")
That gap comes from the popup in pyqt.py. There' a \ there. On line 150. Sorry but cant point it out on mobile right now.
self.showPopUp( f"{ytube.title} - has been downloaded successfully to \ {os.path.abspath(location)}")
Also possibly a button to open the folder location of the downloaded file(s)