@@ -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\n Textfile' )
14+ self .location_btn .setMinimumHeight (30 )
15+
16+ self .update_btn = QPushButton ('Update\n Youtube-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:\n False' )
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+ + '\n Downloads' )
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.\n This is licensed under GPL 3.\n ' )
0 commit comments