Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notes: .ASS support, Drag&Drop support #1762

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

RusAD32
Copy link

@RusAD32 RusAD32 commented Jun 3, 2023

also fixes a bug from this old issue: #695 because it did reproduce for me and bothered my friends and me a lot.

I'm not proficient with C++ so the code is probably very janky, so sorry about that.

@AppVeyorBot

This comment was marked as outdated.

@AppVeyorBot

This comment was marked as outdated.

Copy link
Member

@cfillion cfillion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Some observation from a first glance:

Drag&drop should probably be only active when one of the three subtitles modes is active and the 'import' button is visible.

Drag&drop needs the WS_EX_ACCEPTFILES window extended style to be enabled on Linux/macOS. In sws_extension.rc:

 IDD_SNM_NOTES DIALOGEX 0, 0, 281, 125
 STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU |  WS_THICKFRAME
+EXSTYLE WS_EX_ACCEPTFILES

SnM/SnM_Notes.cpp Outdated Show resolved Hide resolved
SnM/SnM_Notes.cpp Outdated Show resolved Hide resolved
SnM/SnM_Notes.cpp Outdated Show resolved Hide resolved
SnM/SnM_Notes.cpp Outdated Show resolved Hide resolved
SnM/SnM_Notes.cpp Outdated Show resolved Hide resolved
if (ImportAdvancedSubStationFile(fn))
//JFB hard-coded undo label: _ct might be NULL (when called from a button)
// + avoid trailing "..." in undo point name (when called from an action)
Undo_OnStateChangeEx2(NULL, __LOCALIZE("Import ass file","sws_DLG_152"), UNDO_STATE_ALL, -1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't 'ASS' be in uppercase here?

whatsnew.txt Outdated Show resolved Hide resolved
SnM/SnM.h Outdated Show resolved Hide resolved
SnM/SnM_Notes.cpp Outdated Show resolved Hide resolved
@AppVeyorBot

This comment was marked as outdated.

@AppVeyorBot

This comment was marked as outdated.

@AppVeyorBot

This comment was marked as outdated.

…first 1K chars of the name field when larger than one buffer
@cfillion
Copy link
Member

cfillion commented Feb 4, 2024

I've been testing this for potential inclusion in v2.14. It seems too easy to make the parser crash or produce bad data.
Considering the presence of those bugs and the overall fragile-looking state of the parser code, I'm not confident in its robustness and correctness. Fixed some in 0ced4fe above, but I suspect there are others waiting to be found.

[Events]
Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
Dialogue: 0,0:00:00.98,0:00:01.02,handwriting,truncated,,

@AppVeyorBot

This comment was marked as outdated.

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.

3 participants