This commit is contained in:
Yuvi9587
2025-07-13 10:36:52 -07:00
parent dbdf82a079
commit d49c739fe4
2 changed files with 19 additions and 7 deletions

View File

@@ -22,7 +22,7 @@ class MoreOptionsDialog(QDialog):
layout.addWidget(self.description_label) layout.addWidget(self.description_label)
self.radio_button_group = QButtonGroup(self) self.radio_button_group = QButtonGroup(self)
self.radio_content = QRadioButton("Description/Content") self.radio_content = QRadioButton("Description/Content")
self.radio_comments = QRadioButton("Comments") self.radio_comments = QRadioButton("Comments (Not Working)")
self.radio_button_group.addButton(self.radio_content) self.radio_button_group.addButton(self.radio_content)
self.radio_button_group.addButton(self.radio_comments) self.radio_button_group.addButton(self.radio_comments)
layout.addWidget(self.radio_content) layout.addWidget(self.radio_content)

View File

@@ -2227,16 +2227,18 @@ class DownloaderApp (QWidget ):
def _handle_filter_mode_change(self, button, checked): def _handle_filter_mode_change(self, button, checked):
# Add this logic at the very beginning of the method # If a button other than "More" is selected, reset the UI
if button != self.radio_more and checked: if button != self.radio_more and checked:
# If a button other than "More" is selected, reset its text and state
self.radio_more.setText("More") self.radio_more.setText("More")
self.more_filter_scope = None self.more_filter_scope = None
self.single_pdf_setting = False # Reset the setting
# Re-enable the checkboxes
if hasattr(self, 'use_multithreading_checkbox'): self.use_multithreading_checkbox.setEnabled(True)
if hasattr(self, 'use_subfolders_checkbox'): self.use_subfolders_checkbox.setEnabled(True)
if not button or not checked: if not button or not checked:
return return
is_only_links =(button ==self .radio_only_links ) is_only_links =(button ==self .radio_only_links )
is_only_audio =(hasattr (self ,'radio_only_audio')and self .radio_only_audio is not None and button ==self .radio_only_audio ) is_only_audio =(hasattr (self ,'radio_only_audio')and self .radio_only_audio is not None and button ==self .radio_only_audio )
is_only_archives =(hasattr (self ,'radio_only_archives')and self .radio_only_archives is not None and button ==self .radio_only_archives ) is_only_archives =(hasattr (self ,'radio_only_archives')and self .radio_only_archives is not None and button ==self .radio_only_archives )
@@ -2669,20 +2671,30 @@ class DownloaderApp (QWidget ):
current_scope = self.more_filter_scope or MoreOptionsDialog.SCOPE_CONTENT current_scope = self.more_filter_scope or MoreOptionsDialog.SCOPE_CONTENT
current_format = self.text_export_format or 'pdf' current_format = self.text_export_format or 'pdf'
# Pass the current setting to the dialog
dialog = MoreOptionsDialog(self, current_scope=current_scope, current_format=current_format, single_pdf_checked=self.single_pdf_setting) dialog = MoreOptionsDialog(self, current_scope=current_scope, current_format=current_format, single_pdf_checked=self.single_pdf_setting)
if dialog.exec_() == QDialog.Accepted: if dialog.exec_() == QDialog.Accepted:
self.more_filter_scope = dialog.get_selected_scope() self.more_filter_scope = dialog.get_selected_scope()
self.text_export_format = dialog.get_selected_format() self.text_export_format = dialog.get_selected_format()
self.single_pdf_setting = dialog.get_single_pdf_state() # Get the new setting self.single_pdf_setting = dialog.get_single_pdf_state()
scope_text = "Comments" if self.more_filter_scope == MoreOptionsDialog.SCOPE_COMMENTS else "Description" scope_text = "Comments" if self.more_filter_scope == MoreOptionsDialog.SCOPE_COMMENTS else "Description"
# Update button text to show the selected format
format_display = f" ({self.text_export_format.upper()})" format_display = f" ({self.text_export_format.upper()})"
if self.single_pdf_setting: if self.single_pdf_setting:
format_display = " (Single PDF)" format_display = " (Single PDF)"
# --- NEW: Disable checkboxes if Single PDF is active ---
if hasattr(self, 'use_multithreading_checkbox'):
self.use_multithreading_checkbox.setChecked(False)
self.use_multithreading_checkbox.setEnabled(False)
if hasattr(self, 'use_subfolders_checkbox'):
self.use_subfolders_checkbox.setChecked(False)
self.use_subfolders_checkbox.setEnabled(False)
else:
# --- NEW: Re-enable checkboxes if Single PDF is not active ---
if hasattr(self, 'use_multithreading_checkbox'): self.use_multithreading_checkbox.setEnabled(True)
if hasattr(self, 'use_subfolders_checkbox'): self.use_subfolders_checkbox.setEnabled(True)
self.radio_more.setText(f"{scope_text}{format_display}") self.radio_more.setText(f"{scope_text}{format_display}")