Skip to content

Commit e95be20

Browse files
authored
Merge pull request #15 from Thomasedv/smart_wrapper
Merge new changes to master
2 parents d116e52 + dfea474 commit e95be20

20 files changed

+1125
-437
lines changed
File renamed without changes.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ which are not part of the work. For example, Corresponding Source
141141
includes interface definition files associated with source files for
142142
the work, and the source code for shared libraries and dynamically
143143
linked subprograms that the work is specifically designed to require,
144-
such as by intimate get_settings_data communication or control flow between those
144+
such as by intimate settings_data communication or control flow between those
145145
subprograms and other parts of the work.
146146

147147
The Corresponding Source need not include anything that users

Modules/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
from Modules.download_manager import Downloader
66
from Modules.download_tab import MainTab
77
from Modules.main_window import MainWindow
8-
from Modules.parameterTree import ParameterTree
98
from Modules.parameter_tab import ParameterTab
9+
from Modules.parameter_tree import ParameterTree
1010
from Modules.text_manager import TextTab

Modules/about_tab.py

Lines changed: 46 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,39 +6,56 @@ class AboutTab(QWidget):
66
def __init__(self, settings, parent=None):
77
super(AboutTab, self).__init__(parent=parent)
88

9-
self.location_btn = QPushButton('Browse')
10-
# Button to check for youtube-dl updates.
11-
self.update_btn = QPushButton('Update')
12-
# License
9+
# Indicates if license is shown.
10+
self.license_shown = False
11+
12+
# Select folder for textfile to use as download list
13+
self.location_btn = QPushButton('Browse\nTextfile')
14+
self.location_btn.setMinimumHeight(30)
15+
16+
self.update_btn = QPushButton('Update\nYoutube-dl')
17+
self.update_btn.setMinimumHeight(30)
18+
1319
self.license_btn = QPushButton('License')
20+
1421
# Debugging
1522
self.dirinfo_btn = QPushButton('Dirinfo')
16-
# Reset settings, (requires restart!)
23+
self.debug_info = QPushButton('Debug:\nFalse')
24+
self.debug_info.setMinimumHeight(30)
25+
26+
# Parallel / Series toggle for youtube instances
27+
self.dl_mode_btn = QPushButton(('Singular' if not settings.user_options['parallel'] else 'Parallel')
28+
+ '\nDownloads')
29+
self.dl_mode_btn.setMinimumHeight(30)
30+
31+
# Reset settings, (requires restart)
1732
self.reset_btn = QPushButton('Reset\n settings')
18-
# Adjust button size to match naming. (Possibly change later in some form)
1933
self.reset_btn.setMinimumHeight(30)
2034

2135
# Lineedit to show path to text file. (Can be changed later to use same path naming as other elements.)
22-
self.lineedit = QLineEdit()
23-
self.lineedit.setReadOnly(True) # Read only
24-
self.lineedit.setText(settings.user_options['multidl_txt']) # Path from settings.
36+
self.textfile_url = QLineEdit()
37+
self.textfile_url.setReadOnly(True) # Read only
38+
self.textfile_url.setText(settings.user_options['multidl_txt']) # Path from settings.
2539

26-
self.label = QLabel('Textfile:')
40+
self.txt_label = QLabel('Textfile:')
2741

2842
# Textbrowser to adds some info about Grabber.
2943
self.textbrowser = QTextBrowser()
3044
self.textbrowser.setObjectName('AboutText')
3145
self.textbrowser.setOpenExternalLinks(True)
3246

47+
# Sets textbroswer content at startup
3348
self.set_standard_text()
34-
## Layout tab 4.
3549

3650
self.QH = QHBoxLayout()
3751
self.QV = QVBoxLayout()
3852

3953
self.QH.addWidget(self.textbrowser)
4054

55+
self.QV.addWidget(self.dl_mode_btn)
4156
self.QV.addWidget(self.update_btn)
57+
self.QV.addSpacing(15)
58+
self.QV.addWidget(self.debug_info)
4259
self.QV.addWidget(self.dirinfo_btn)
4360
self.QV.addWidget(self.license_btn)
4461
self.QV.addWidget(self.reset_btn)
@@ -48,16 +65,32 @@ def __init__(self, settings, parent=None):
4865
self.QH.addLayout(self.QV)
4966

5067
self.topQH = QHBoxLayout()
51-
self.topQH.addWidget(self.label)
52-
self.topQH.addWidget(self.lineedit)
68+
self.topQH.addWidget(self.txt_label)
69+
self.topQH.addWidget(self.textfile_url)
5370
self.topQH.addWidget(self.location_btn)
5471

5572
self.topQV = QVBoxLayout()
5673
self.topQV.addLayout(self.topQH)
5774
self.topQV.addLayout(self.QH)
5875

76+
self.license_btn.clicked.connect(self.read_license)
77+
5978
self.setLayout(self.topQV)
6079

80+
def read_license(self):
81+
if not self.license_shown:
82+
content = self.window().file_handler.read_textfile(self.window().license_path)
83+
if content is None:
84+
self.parent().alert_message('Error!', 'Failed to find/read license!')
85+
return
86+
self.textbrowser.clear()
87+
self.textbrowser.setText(content)
88+
self.license_shown = True
89+
90+
else:
91+
self.set_standard_text()
92+
self.license_shown = False
93+
6194
def set_standard_text(self):
6295
self.textbrowser.setText('In-development (on my free time) version of a Youtube-dl GUI. \n'
6396
'I\'m just a developer for fun.\nThis is licensed under GPL 3.\n')

0 commit comments

Comments
 (0)