Add analysis-dependent control logic and tooltips
Introduces logic to enable or disable UI controls based on whether video analysis is complete, with appropriate tooltips for disabled states. Updates all language files to include new tooltip strings. Ensures controls like subtitle selection, SponsorBlock, and merge subtitles are only enabled after analysis, improving user guidance and preventing invalid actions.
This commit is contained in:
@@ -300,11 +300,21 @@ class VideoInfoMixin:
|
||||
|
||||
# Enable/disable the merge checkbox in the parent window
|
||||
if merge_checkbox:
|
||||
# Only enable merge checkbox if we're not in Audio Only mode
|
||||
# Only enable merge checkbox if we're not in Audio Only mode and analysis is complete
|
||||
is_audio_only = hasattr(self, "audio_button") and self.audio_button.isChecked()
|
||||
has_analysis = getattr(self, "analysis_completed", False)
|
||||
# In audio-only mode, we still allow subtitle selection but not merging
|
||||
should_enable = count > 0 and not is_audio_only
|
||||
should_enable = count > 0 and not is_audio_only and has_analysis
|
||||
merge_checkbox.setEnabled(should_enable)
|
||||
# Update tooltip
|
||||
if not has_analysis:
|
||||
merge_checkbox.setToolTip(_("main_ui.analyze_first_tooltip"))
|
||||
elif is_audio_only:
|
||||
merge_checkbox.setToolTip(_("main_ui.audio_mode_disabled"))
|
||||
elif count == 0:
|
||||
merge_checkbox.setToolTip(_("main_ui.select_subtitles_first"))
|
||||
else:
|
||||
merge_checkbox.setToolTip("")
|
||||
else:
|
||||
logger.warning("merge_subs_checkbox not found on parent window.")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user