Commit graph

128 commits

Author SHA1 Message Date
Thomas Goyne
96cf5ea7ed Kill the #ifndef AGI_PRE guards
They don't actually improve compilation performance and make it more
annoying to modify what things are in the precompiled header.
2012-12-02 06:33:29 -08:00
Thomas Goyne
e4d6b8661b Add range adaptor for filtering to a specific subclass from a heterogeneous range
This makes looping over the subtitle file and parsed dialogue lines less
awkward in many cases.
2012-11-12 18:35:25 -08:00
Thomas Goyne
67df64e879 Use range-based for loops in a bunch of places 2012-11-12 18:35:25 -08:00
Thomas Goyne
0893ed3f0a Remove references to tr1 2012-11-10 18:05:57 -08:00
Thomas Goyne
83761d881a Convert AssFile::Line to an intrusive list
Gives O(1) pointer -> iterator conversions, better memory usage, better
performance, and overall slightly simplifies the code using it.
2012-11-10 18:05:56 -08:00
Thomas Goyne
b5baacec2c Fix merge error in df60c2e7a4
Although wxSTC defines SetValue, it doesn't actually work correctly.
2012-10-28 07:20:12 -07:00
Thomas Goyne
e44c47c863 Remove $Id$ markers since git doesn't support them 2012-10-25 17:39:49 -07:00
Thomas Goyne
df60c2e7a4 Factor out a bunch of duplicated code for clipboard stuff 2012-10-25 17:39:49 -07:00
Thomas Goyne
6b3cfcebfd Change the Effect box to a combobox like the Actor box. Closes #1461. 2012-10-20 07:34:55 -07:00
Thomas Goyne
cc3ca715a1 Set the focus to the edit box after any of the edit box buttons are clicked 2012-10-12 14:54:09 -07:00
Thomas Goyne
daf28e2005 Use the native placeholder text functionality on OS X 2012-10-12 14:54:09 -07:00
Thomas Goyne
a1fad1f947 Drop support for ASS2
It is very unlikely that anyone has ever actually used ASS2 for
anything, and in practice it was not usable anyway as the bottom margin
was always either ignored or blindly overwritten.
2012-10-12 14:54:08 -07:00
Thomas Goyne
b3486440f3 Show the hotkeys for the edit box buttons in the tooltip 2012-10-12 14:54:08 -07:00
Thomas Goyne
1b68790c4b Convert the subs edit box buttons to commands
This makes they hotkeyable and extracts a large chunk of logic from the
giant mess that is SubsEditBox.
2012-10-12 14:54:08 -07:00
Thomas Goyne
44f0fcce07 Go through TextSelectionController rather than hitting the text edit directly in SubsEditBox 2012-10-12 14:54:08 -07:00
Thomas Goyne
a948924850 Add a TextSelectionController interface to avoid exposing the wxSTC edit directly in the context 2012-10-12 14:54:08 -07:00
Thomas Goyne
e4a6092b36 Use signals for selection change notifications 2012-10-12 14:54:07 -07:00
Thomas Goyne
004b41f0eb Switch the Duration field back to time mode when video is closed 2012-10-09 20:40:47 -07:00
Thomas Goyne
269dd79230 Increase the undo-group-breaking timer to 30 seconds (from 10) 2012-10-09 07:28:16 -07:00
Thomas Goyne
b6e47f1cc0 Remove unused incldue in subs_edit_box.cpp
Originally committed to SVN as r6829.
2012-05-19 03:02:15 +00:00
cantabile
848ebf4d2d Move two accelerators
SubsEditBox: move accelerator so it doesn't conflict with "Timing" menu.
Dummy video dialog: move accelerator so it doesn't conflict with the
Cancel button.

Originally committed to SVN as r6800.
2012-05-15 14:06:55 +00:00
cantabile
68d7677e14 Never focus the comment checkbox (wxGTK only)
The checkbox can be toggled using its accelerator, without needing to
switch focus back to whatever was focused before.

Originally committed to SVN as r6798.
2012-05-15 14:06:44 +00:00
Thomas Goyne
d31b795e60 Move the logic for Enter in a time edit to SubsEditBox
It doesn't make any sense for the time edits used elsewhere, and it made
Enter in a time edit not close dialogs.

Originally committed to SVN as r6790.
2012-05-15 13:40:00 +00:00
Thomas Goyne
8f3b027881 Improve the negative-duration-avoiding behavior of the time edit boxes
Save the initial start and end times of lines before adjusting them to
avoid negative line durations, so that if further changes to the edit
boxes make the adjustment unneccesary the original values can be
restored. This Fixes the problem where changing a line visible from
frames 800-900 to 800-901 would actually result in 90-901, due to the
end frame briefly being 90.

Originally committed to SVN as r6741.
2012-05-02 22:42:25 +00:00
Thomas Goyne
123f02f0fb Process hotkeys in wxEVT_CHAR_HOOK rather than wxEVT_KEY_DOWN
Char hook events propagate by default, removing the need for the event
filter to make key down events propagate, which was causing some funny
issues.

On Windows, the char hook handler runs before menu accelerators, fixing
a bug where Default context hotkeys would override more specific ones
when they appeared on a menu. Unfortunately, this is not the case on
GTK, so the dumb accelerator-disabling hack is still required.

Originally committed to SVN as r6724.
2012-04-27 19:07:49 +00:00
Thomas Goyne
f7a42e8821 Mark the Actor and Effect placeholder texts as translatable
Originally committed to SVN as r6681.
2012-04-10 20:40:43 +00:00
Thomas Goyne
0d4846d012 Handle the cancel button in the color picker dialog better
Return wxNullColor rather than the original color on cancel so that the
calling code can actually tell if it was cancelled.

If one of the subs edit box color buttons is cancelled, undo the changes
made rather than restoring the original text of the active line. This
makes the cancel button actually work with multiple lines selected, and
eliminates some undo state noise.

Closes #1465.

Originally committed to SVN as r6663.
2012-04-06 01:55:14 +00:00
Thomas Goyne
de9cc755d2 Stop key event propagation when checking for hotkeys to avoid checking keypresses that aren't hotkeys several times
Originally committed to SVN as r6577.
2012-03-12 23:34:34 +00:00
Thomas Goyne
b64e1f925c Coalesce typing in the Actor box (but not selections from the dropdown)
Originally committed to SVN as r6539.
2012-03-07 22:40:45 +00:00
Thomas Goyne
94b3764a91 Coalesce changes made in the Effect box
Originally committed to SVN as r6538.
2012-03-07 22:40:35 +00:00
Thomas Goyne
5e96d6e8c3 Remove periods from single-sentence tooltips
Originally committed to SVN as r6449.
2012-02-07 01:22:32 +00:00
Thomas Goyne
c2d3c910c7 Replace some uses of "" with wxString()
Despite special-casing zero-length input, wxString("") takes over four
times as long as wxString() - and on a 10k line script, this change cuts
AssFile's copy constructor's runtime in half.

Originally committed to SVN as r6401.
2012-01-31 00:44:43 +00:00
Thomas Goyne
0bff490b7e Enable/disable the OK button in the TPP dialog when styles are (un)checked
Originally committed to SVN as r6387.
2012-01-27 23:35:31 +00:00
Thomas Goyne
bc9c521cfd Apply the 'Subs Edit Box' hotkey handling to all of the text boxes in the subs edit area rather than just the main text edit. Closes #1431.
Originally committed to SVN as r6380.
2012-01-27 19:23:35 +00:00
Thomas Goyne
a1ad0fa585 Use Scintilla's logic for deciding when to coalesce edit box changes
Scintilla's modification notifications don't expose enough information
to do a very good job of deciding when to group changes with previous
ones, but it does expose when Scintilla thinks undo groups should end,
so just use that.

This should significantly improve the behavior of undo when editing
lines in the edit box.

Originally committed to SVN as r6370.
2012-01-26 22:13:39 +00:00
Thomas Goyne
e026d2a60a Fix copy/paste error that made the end time and duration boxes not work
Originally committed to SVN as r6338.
2012-01-22 18:18:00 +00:00
Thomas Goyne
4675dbb29d Factor out the placeholder text behavior from SubsEditBox and make it work better
Handle switching from placeholder/normal mode when the value is changed
externally (such as from the active line changing) in addition to on
focus/blur, and improve behavior when the user sets the text to the
placeholder text.

Originally committed to SVN as r6321.
2012-01-20 05:14:50 +00:00
Thomas Goyne
1ce9b0d31b Refactor SubsEditBox a bit to make the constructor less of a monolithic behemoth and eliminate some duplicated code.
Originally committed to SVN as r6320.
2012-01-20 05:14:44 +00:00
Thomas Goyne
40e4f887ba Make the enter-key-in-edit-box logic a standard hotkeyed command
Originally committed to SVN as r6294.
2012-01-14 01:40:21 +00:00
Thomas Goyne
54ebe9b37a Fix incorrect (un)wrapping of the subs edit box toolbar on video zoom changes
The size of the contents is not updated until after SubsEditBox::OnSize
is called, so the wrapping logic was being done based on the previous
available area, rather than the new size.

Originally committed to SVN as r6284.
2012-01-13 20:18:29 +00:00
Thomas Goyne
86aacca631 Move SplitLine from SubtitlesGrid to SubsEditCtrl
This still isn't a very good place for the functionality, but it breaks
SubsEditCtrl's dependency on SubtitlesGrid.

Originally committed to SVN as r6275.
2012-01-11 19:19:30 +00:00
Thomas Goyne
68b2ae8275 Eliminate most clang warnings
Originally committed to SVN as r6183.
2011-12-28 21:27:22 +00:00
Thomas Goyne
7adbe07b4e Silence a bunch of PREFast warnings
Originally committed to SVN as r6162.
2011-12-26 22:20:49 +00:00
Thomas Goyne
477dd8a2f6 Try to preserve the value of the styles dropdown across undo/redo
Originally committed to SVN as r6139.
2011-12-22 21:31:29 +00:00
Thomas Goyne
1c2abeae30 Stop coalescing changes made in the edit box after ten seconds of no changes
Originally committed to SVN as r6137.
2011-12-22 21:31:09 +00:00
Thomas Goyne
fd35224cb5 Stop coalescing changes for undo when the active line changes
Originally committed to SVN as r6136.
2011-12-22 21:31:01 +00:00
Thomas Goyne
046d8a6822 Use wxEventBlocker rather than manually enabling and disabling the event handler in SubsEditBox
Originally committed to SVN as r6133.
2011-12-22 21:30:32 +00:00
Thomas Goyne
e5707ca6eb Don't use the ms time value of the Duration time edit control when in frame mode, as with vfr this may not actually represent a consisten number of frames
Originally committed to SVN as r6132.
2011-12-22 21:30:22 +00:00
Thomas Goyne
71345af81a Overload operator int() on AssTime and remove GetMS/SetMS
Originally committed to SVN as r6123.
2011-12-22 21:28:51 +00:00
Thomas Goyne
3a069b7f60 Clean up TimeEdit
Remove some unused or constant arguments and simplify some overly
convoluted logic.

Check for whether timecodes are open rather than whether video is open
to determine if by-frame mode is enabled.

Operate on a project context rather than using VideoContext::Get().

Use non-event-generating setter methods rather than a boolean ready
variable.

Make all member variables private and add setters rather than relying on
the client code calling Update when appropriate.

Eliminate flickering in overwrite mode.

Originally committed to SVN as r6056.
2011-12-22 21:18:16 +00:00