Skip to content

Binary edit: forced flag support, dirty-state tracking, and UX polish#11498

Merged
niksedk merged 7 commits into
SubtitleEdit:mainfrom
mjuhasz:feat/binary-edit-forced-flags
Jun 8, 2026
Merged

Binary edit: forced flag support, dirty-state tracking, and UX polish#11498
niksedk merged 7 commits into
SubtitleEdit:mainfrom
mjuhasz:feat/binary-edit-forced-flags

Conversation

@mjuhasz

@mjuhasz mjuhasz commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR adds full forced-flag support to the binary subtitle editor, along with several UX improvements and fixes.

Forced flags

  • Preserve IsForced from the source file when loading binary subtitles (BluRay, BDN, VobSub, transport stream, MKV, DVB, etc.)
  • Add a Forced checkbox to the detail pane for toggling the flag on the selected subtitle
  • Add Select forced lines / Select non-forced lines context menu items

Dirty-state tracking & close guard

  • Track edits (subtitle collection changes and property mutations) via CollectionChanged / PropertyChanged subscriptions
  • Prompt "You have unexported changes. Close and discard them?" when closing the window with un-exported edits
  • Clear dirty state after a successful export or file open

Export default filename

  • Pre-populate the save-file dialog with a filename derived from the source file (same directory, same stem, with the target extension) instead of the generic "export" placeholder
  • Appends _export to avoid accidentally overwriting the source when extension would collide

Other UX / fixes

  • Add Close video file menu item to the Video menu
  • Renumber subtitles after a delete operation

Miklos Juhasz added 7 commits June 8, 2026 19:14
…orced menu items

- Add IOcrSubtitle.GetIsForced(int) and implement in all 13 OcrSubtitle
  classes; BluRay .sup, MKV BluRay, VobSub, IBinaryParagraph, BdnXml and
  TransportStream return the real flag from their underlying data sources
- Expose OcrSubtitleItem.IsForced delegating to the source
- BinarySubtitleItem constructor now reads IsForced from the OcrSubtitleItem
  instead of hard-coding false, so forced flags survive load → edit → export
- Add SelectForcedLines and SelectNonForcedLines relay commands to
  BinaryEditViewModel; wire them as always-visible context menu items in
  BinaryEditWindow after Toggle Forced
- Add SelectForcedLines / SelectNonForcedLines language strings
…rompt

Track modifications via CollectionChanged and PropertyChanged subscriptions
(catches direct timing edits via TwoWay bindings, inserts, deletes, and all
bulk operations). Successful export resets dirty state. Closing with unexported
changes shows a Yes/No confirmation dialog.
Uses the source file's stem and directory as the suggested export filename,
falling back to stem + "_export" when re-exporting to the same format would
collide with the source file.
Without this, items removed from Subtitles (e.g. on reload via Clear)
retained a live delegate reference in the ViewModel, preventing GC.
@niksedk niksedk merged commit 7e4c244 into SubtitleEdit:main Jun 8, 2026
2 checks passed
@mjuhasz mjuhasz deleted the feat/binary-edit-forced-flags branch June 9, 2026 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants