def __init__(self, link_url: str, dl_path: str, parent=None):
super(Downloader, self).__init__(parent)
self.parent = parent
self.dltool_cmd = find_executable(self.download_cmd)
self.download_link = link_url
self.download_path = dl_path
if self.dltool_cmd.strip():
self.dltool_args = self.dltool_args.format(dl_path=self.download_path, dl_link=self.download_link)
self.console = QTextEdit(self.parent)
self.console.setWindowTitle('%s Downloader' % qApp.applicationName())
self.proc = QProcess(self.parent)
layout = QVBoxLayout()
layout.addWidget(self.console)
self.setLayout(layout)
self.setFixedSize(QSize(400, 300))
else:
QMessageBox.critical(self.parent, 'DOWNLOADER ERROR', '<p>The <b>aria2c</b> executable binary could not ' +
'be found in your installation folders. The binary comes packaged with this ' +
'application so it is likely that it was accidentally deleted via human ' +
'intervntion or incorrect file permissions are preventing access to it.</p>' +
'<p>You may either download and install <b>aria2</b> manually yourself, ensuring ' +
'its installation location is globally accessible via PATH environmnt variables or ' +
'simply reinstall this application again. If the issue is not resolved then try ' +
'to download the application again incase the orignal you installed already was ' +
'corrupted/broken.', buttons=QMessageBox.Close)
评论列表
文章目录