aboutsummaryrefslogtreecommitdiffstats
path: root/hypervideo_gui/main_ui.py
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2019-12-14 09:58:36 -0500
committerJesús <heckyel@hyperbola.info>2019-12-14 09:58:36 -0500
commita65a6e08e708a23f7aec40a2ae3e24aab23de4be (patch)
treee9c48e9650711e81a325c7dbd94e383da3d918be /hypervideo_gui/main_ui.py
parentaf9b2dcaf5ace76bbfe0719bc8f70a2291da3c72 (diff)
downloadhypervideo-gui-a65a6e08e708a23f7aec40a2ae3e24aab23de4be.tar.lz
hypervideo-gui-a65a6e08e708a23f7aec40a2ae3e24aab23de4be.tar.xz
hypervideo-gui-a65a6e08e708a23f7aec40a2ae3e24aab23de4be.zip
Fix infinite download self
Diffstat (limited to 'hypervideo_gui/main_ui.py')
-rw-r--r--hypervideo_gui/main_ui.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/hypervideo_gui/main_ui.py b/hypervideo_gui/main_ui.py
index ab217a1..3421d9f 100644
--- a/hypervideo_gui/main_ui.py
+++ b/hypervideo_gui/main_ui.py
@@ -118,8 +118,8 @@ class App(QMainWindow):
self.video_format_combobox.activated[str].connect(self.video_format_change)
# add download button
- download_button = QPushButton('Download')
- download_button.clicked.connect(self.download_video_callback)
+ self.download_button = QPushButton('Download')
+ self.download_button.clicked.connect(self.download_video_callback)
# create grid layout
layout = QGridLayout()
@@ -131,7 +131,7 @@ class App(QMainWindow):
layout.addWidget(self.output_entry_combobox, 2, 1)
layout.addWidget(detect_formats_label, 3, 0)
layout.addWidget(self.video_format_combobox, 3, 1)
- layout.addWidget(download_button, 5, 0)
+ layout.addWidget(self.download_button, 5, 0)
# add grid layout as central widget for main window
main_widget = QWidget()
@@ -177,6 +177,7 @@ class App(QMainWindow):
ydl.download([self.url_catch()])
self.statusBar().showMessage('Downloading Video... Done!', msecs=0)
+ self.download_button.setEnabled(True)
# make sure a valid output directory was entered
if not os.path.isdir(self.output_entry_combobox.currentText()):
@@ -225,6 +226,7 @@ class App(QMainWindow):
self.statusBar().showMessage('Please add a URL...')
else:
self.statusBar().showMessage('Downloading Video...')
+ self.download_button.setEnabled(False)
thread = threading.Thread(target=download_video_thread_helper, args=(self, ydl_opts, ))
thread.daemon = True
thread.start()