forked from mia/Aegisub
Remove the realtime visual tool option, as the threaded video display makes it pointless
Originally committed to SVN as r4825.
This commit is contained in:
parent
3174f995fa
commit
6432ea1f94
9 changed files with 25 additions and 96 deletions
|
@ -423,11 +423,7 @@ void SubsEditBox::UpdateFrameTiming () {
|
|||
void SubsEditBox::OnKeyDown(wxKeyEvent &event) {
|
||||
int key = event.GetKeyCode();
|
||||
if (line && (key == WXK_RETURN || key == WXK_NUMPAD_ENTER)) {
|
||||
#ifdef __APPLE__
|
||||
Commit(event.m_metaDown);
|
||||
#else
|
||||
Commit(event.m_controlDown);
|
||||
#endif
|
||||
NextLine();
|
||||
}
|
||||
else {
|
||||
event.Skip();
|
||||
|
@ -435,18 +431,10 @@ void SubsEditBox::OnKeyDown(wxKeyEvent &event) {
|
|||
}
|
||||
|
||||
void SubsEditBox::OnCommitButton(wxCommandEvent &) {
|
||||
#ifdef __APPLE__
|
||||
Commit(wxGetMouseState().CmdDown());
|
||||
#else
|
||||
Commit(wxGetMouseState().ControlDown());
|
||||
#endif
|
||||
if (line) NextLine();
|
||||
}
|
||||
|
||||
void SubsEditBox::Commit(bool stay) {
|
||||
if (stay) {
|
||||
VideoContext::Get()->Refresh();
|
||||
return;
|
||||
}
|
||||
void SubsEditBox::NextLine() {
|
||||
int next = grid->GetLastSelRow() + 1;
|
||||
if (next >= grid->GetRows()) {
|
||||
AssDialogue *cur = grid->GetDialogue(next-1);
|
||||
|
@ -473,13 +461,12 @@ void SubsEditBox::OnChange(wxStyledTextEvent &event) {
|
|||
template<class T, class setter>
|
||||
void SubsEditBox::SetSelectedRows(setter set, T value, wxString desc, bool amend) {
|
||||
using namespace std::tr1::placeholders;
|
||||
static agi::OptionValue* realtime = OPT_GET("Video/Visual Realtime");
|
||||
|
||||
for_each(sel.begin(), sel.end(), std::tr1::bind(set, _1, value));
|
||||
|
||||
commitId = grid->ass->Commit(desc, (amend && desc == lastCommitType) ? commitId : -1);
|
||||
lastCommitType = desc;
|
||||
grid->CommitChanges(false, realtime->GetBool());
|
||||
grid->CommitChanges(false);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
|
|
|
@ -123,9 +123,8 @@ class SubsEditBox : public wxPanel, protected SelectionListener<AssDialogue> {
|
|||
/// Get block number at text position
|
||||
int BlockAtPos(int pos) const;
|
||||
|
||||
/// @brief Refresh the video display and move to the next line
|
||||
/// @param stay Only refresh the video
|
||||
void Commit(bool stay);
|
||||
/// @brief Move to the next line, creating it if needed
|
||||
void NextLine();
|
||||
|
||||
int timeCommitId[3];
|
||||
int commitId;
|
||||
|
|
|
@ -105,8 +105,6 @@ VideoBox::VideoBox(wxWindow *parent, bool isDetached, wxComboBox *zoomBox)
|
|||
visualToolBar->AddTool(Video_Mode_Clip,_("Clip"),GETIMAGE(visual_clip_24),_("Clip subtitles to a rectangle."),wxITEM_RADIO);
|
||||
visualToolBar->AddTool(Video_Mode_Vector_Clip,_("Vector Clip"),GETIMAGE(visual_vector_clip_24),_("Clip subtitles to a vectorial area."),wxITEM_RADIO);
|
||||
visualToolBar->AddSeparator();
|
||||
visualToolBar->AddTool(Video_Mode_Realtime,_("Realtime"),GETIMAGE(visual_realtime_24),_("Toggle realtime display of changes."),wxITEM_CHECK);
|
||||
visualToolBar->ToggleTool(Video_Mode_Realtime,OPT_GET("Video/Visual Realtime")->GetBool());
|
||||
visualToolBar->AddTool(Video_Mode_Help,_("Help"),GETIMAGE(visual_help_24),_("Open the manual page for Visual Typesetting."));
|
||||
visualToolBar->Realize();
|
||||
// Avoid ugly themed background on Vista and possibly also Win7
|
||||
|
@ -163,7 +161,6 @@ BEGIN_EVENT_TABLE(VideoBox, wxPanel)
|
|||
EVT_BUTTON(Video_Stop, VideoBox::OnVideoStop)
|
||||
EVT_TOGGLEBUTTON(Video_Auto_Scroll, VideoBox::OnVideoToggleScroll)
|
||||
|
||||
EVT_TOOL(Video_Mode_Realtime, VideoBox::OnToggleRealtime)
|
||||
EVT_TOOL(Video_Mode_Help, VideoBox::OnHelp)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
|
@ -215,15 +212,6 @@ void VideoBox::OnVideoToggleScroll(wxCommandEvent &event) {
|
|||
OPT_SET("Video/Subtitle Sync")->SetBool(AutoScroll->GetValue());
|
||||
}
|
||||
|
||||
/// @brief Realtime toggle
|
||||
/// @param event
|
||||
///
|
||||
void VideoBox::OnToggleRealtime(wxCommandEvent &event) {
|
||||
OPT_SET("Video/Visual Realtime")->SetBool(event.IsChecked());
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// @brief Help
|
||||
/// @param event
|
||||
///
|
||||
|
|
|
@ -70,7 +70,6 @@ private:
|
|||
void OnVideoStop(wxCommandEvent &event);
|
||||
void OnVideoToggleScroll(wxCommandEvent &event);
|
||||
|
||||
void OnToggleRealtime(wxCommandEvent &event);
|
||||
void OnHelp(wxCommandEvent &event);
|
||||
|
||||
public:
|
||||
|
@ -110,50 +109,19 @@ public:
|
|||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
|
||||
///////
|
||||
// IDs
|
||||
enum {
|
||||
|
||||
/// DOCME
|
||||
Video_Play = 500,
|
||||
|
||||
/// DOCME
|
||||
Video_Play_Line,
|
||||
|
||||
/// DOCME
|
||||
Video_Stop,
|
||||
|
||||
/// DOCME
|
||||
Video_Auto_Scroll,
|
||||
|
||||
|
||||
/// DOCME
|
||||
Video_Mode_Standard,
|
||||
|
||||
/// DOCME
|
||||
Video_Mode_Drag,
|
||||
|
||||
/// DOCME
|
||||
Video_Mode_Rotate_Z,
|
||||
|
||||
/// DOCME
|
||||
Video_Mode_Rotate_XY,
|
||||
|
||||
/// DOCME
|
||||
Video_Mode_Scale,
|
||||
|
||||
/// DOCME
|
||||
Video_Mode_Clip,
|
||||
|
||||
/// DOCME
|
||||
Video_Mode_Vector_Clip,
|
||||
|
||||
/// DOCME
|
||||
Video_Mode_Realtime,
|
||||
|
||||
/// DOCME
|
||||
Video_Mode_Help
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -62,8 +62,7 @@ const wxColour IVisualTool::colour[4] = {wxColour(106,32,19), wxColour(255,169,4
|
|||
|
||||
template<class FeatureType>
|
||||
VisualTool<FeatureType>::VisualTool(VideoDisplay *parent, VideoState const& video)
|
||||
: realtime(OPT_GET("Video/Visual Realtime"))
|
||||
, dragStartX(0)
|
||||
: dragStartX(0)
|
||||
, dragStartY(0)
|
||||
, selChanged(false)
|
||||
, selectedFeatures(selFeatures)
|
||||
|
@ -92,7 +91,6 @@ VisualTool<FeatureType>::~VisualTool() {
|
|||
|
||||
template<class FeatureType>
|
||||
void VisualTool<FeatureType>::OnMouseEvent(wxMouseEvent &event) {
|
||||
bool realTime = realtime->GetBool();
|
||||
bool needRender = false;
|
||||
|
||||
if (event.Leaving()) {
|
||||
|
@ -136,14 +134,9 @@ void VisualTool<FeatureType>::OnMouseEvent(wxMouseEvent &event) {
|
|||
}
|
||||
}
|
||||
UpdateDrag(*cur);
|
||||
|
||||
if (realTime) {
|
||||
CommitDrag(*cur);
|
||||
}
|
||||
}
|
||||
if (realTime) {
|
||||
Commit();
|
||||
}
|
||||
needRender = true;
|
||||
}
|
||||
// end drag
|
||||
|
@ -167,7 +160,7 @@ void VisualTool<FeatureType>::OnMouseEvent(wxMouseEvent &event) {
|
|||
for (selection_iterator cur = selFeatures.begin(); cur != selFeatures.end(); ++cur) {
|
||||
CommitDrag(*cur);
|
||||
}
|
||||
Commit(true);
|
||||
Commit();
|
||||
}
|
||||
|
||||
curFeature = features.end();
|
||||
|
@ -179,22 +172,18 @@ void VisualTool<FeatureType>::OnMouseEvent(wxMouseEvent &event) {
|
|||
// continue hold
|
||||
if (event.LeftIsDown()) {
|
||||
UpdateHold();
|
||||
|
||||
if (realTime) {
|
||||
CommitHold();
|
||||
Commit();
|
||||
}
|
||||
needRender = true;
|
||||
}
|
||||
// end hold
|
||||
else {
|
||||
holding = false;
|
||||
CommitHold();
|
||||
Commit(true);
|
||||
|
||||
parent->ReleaseMouse();
|
||||
parent->SetFocus();
|
||||
}
|
||||
CommitHold();
|
||||
Commit();
|
||||
|
||||
}
|
||||
else if (leftClick) {
|
||||
// start drag
|
||||
|
@ -246,15 +235,14 @@ void VisualTool<FeatureType>::OnMouseEvent(wxMouseEvent &event) {
|
|||
}
|
||||
|
||||
template<class FeatureType>
|
||||
void VisualTool<FeatureType>::Commit(bool full, wxString message) {
|
||||
void VisualTool<FeatureType>::Commit(wxString message) {
|
||||
externalChange = false;
|
||||
if (full) {
|
||||
if (message.empty()) {
|
||||
message = _("visual typesetting");
|
||||
}
|
||||
grid->ass->Commit(message);
|
||||
}
|
||||
grid->CommitChanges(full);
|
||||
|
||||
grid->CommitChanges();
|
||||
externalChange = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -95,7 +95,6 @@ protected:
|
|||
typedef typename std::list<FeatureType>::iterator feature_iterator;
|
||||
typedef typename std::list<FeatureType>::const_iterator feature_const_iterator;
|
||||
private:
|
||||
agi::OptionValue* realtime; /// Realtime updating option
|
||||
int dragStartX; /// Starting x coordinate of the current drag, if any
|
||||
int dragStartY; /// Starting y coordinate of the current drag, if any
|
||||
|
||||
|
@ -185,7 +184,7 @@ protected:
|
|||
void DrawAllFeatures();
|
||||
/// @brief Commit the current file state
|
||||
/// @param message Description of changes for undo
|
||||
void Commit(bool full=false, wxString message = L"");
|
||||
void Commit(wxString message = L"");
|
||||
|
||||
/// @brief Add a feature (and its line) to the selection
|
||||
/// @param i Index in the feature list
|
||||
|
|
|
@ -69,7 +69,7 @@ bool VisualToolCross::Update() {
|
|||
SetOverride(*cur, L"\\pos", wxString::Format(L"(%i,%i)", x1 - dx, y1 - dy));
|
||||
}
|
||||
|
||||
Commit(true, _("positioning"));
|
||||
Commit(_("positioning"));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -109,7 +109,7 @@ void VisualToolDrag::OnSubTool(wxCommandEvent &) {
|
|||
else SetOverride(line, L"\\move",wxString::Format(L"(%i,%i,%i,%i,%i,%i)",x1,y1,x1,y1,0,line->End.GetMS() - line->Start.GetMS()));
|
||||
}
|
||||
|
||||
Commit(true);
|
||||
Commit();
|
||||
Refresh();
|
||||
UpdateToggleButtons();
|
||||
}
|
||||
|
@ -376,7 +376,7 @@ bool VisualToolDrag::Update() {
|
|||
}
|
||||
}
|
||||
|
||||
Commit(true, _("positioning"));
|
||||
Commit(_("positioning"));
|
||||
|
||||
OnFileChanged();
|
||||
return false;
|
||||
|
|
|
@ -323,7 +323,7 @@ bool VisualToolVectorClip::InitializeDrag(feature_iterator feature) {
|
|||
|
||||
Save();
|
||||
MakeFeatures();
|
||||
Commit(true, _("delete control point"));
|
||||
Commit(_("delete control point"));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -402,7 +402,7 @@ bool VisualToolVectorClip::InitializeHold() {
|
|||
// Commit
|
||||
Save();
|
||||
MakeFeatures();
|
||||
Commit(true);
|
||||
Commit();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue