aboutsummaryrefslogtreecommitdiffstats
path: root/hypervideo_gui/main_ui.py
diff options
context:
space:
mode:
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()