def changeFolder(self, button):
# get download_path from lineEdit
download_path = self.download_folder_lineEdit.text()
# open select folder dialog
fname = QFileDialog.getExistingDirectory(
self, 'Select a directory', download_path)
if fname:
# Returns pathName with the '/' separators converted to separators that are appropriate for the underlying operating system.
# On Windows, toNativeSeparators("c:/winnt/system32") returns
# "c:\winnt\system32".
fname = QDir.toNativeSeparators(fname)
if os.path.isdir(fname):
self.download_folder_lineEdit.setText(fname)
# enable when link_lineEdit is not empty and find size of file.
评论列表
文章目录