Don't create the default visual tool until video is loaded so that visual tools can assume video is loaded.
Originally committed to SVN as r4630.
This commit is contained in:
parent
dfb844b6ab
commit
d30326b20d
|
@ -265,7 +265,7 @@ void SubsEditBox::SetSplitLineMode(wxSize newSize) {
|
|||
/// @param timeOnly
|
||||
/// @param weak
|
||||
///
|
||||
void SubsEditBox::Update (bool timeOnly,bool weak,bool video) {
|
||||
void SubsEditBox::Update (bool timeOnly,bool weak) {
|
||||
if (enabled) {
|
||||
AssDialogue *curdiag = grid->GetActiveLine();
|
||||
if (curdiag) {
|
||||
|
@ -301,7 +301,6 @@ void SubsEditBox::Update (bool timeOnly,bool weak,bool video) {
|
|||
|
||||
// Video
|
||||
VideoContext::Get()->curLine = curdiag;
|
||||
if (video) VideoContext::Get()->UpdateDisplays(false);
|
||||
|
||||
TextEdit->EmptyUndoBuffer();
|
||||
}
|
||||
|
|
|
@ -255,7 +255,7 @@ public:
|
|||
|
||||
void SetSplitLineMode(wxSize size=wxSize(-1,-1));
|
||||
void CommitText(bool weak=false);
|
||||
void Update(bool timeOnly=false,bool weak=false,bool video=true);
|
||||
void Update(bool timeOnly=false,bool weak=false);
|
||||
void UpdateGlobals();
|
||||
void UpdateFrameTiming();
|
||||
void DoKeyPress(wxKeyEvent &event);
|
||||
|
|
|
@ -320,6 +320,8 @@ void VideoContext::RemoveDisplay(VideoDisplay *display) {
|
|||
/// @param full
|
||||
///
|
||||
void VideoContext::UpdateDisplays(bool full) {
|
||||
if (!loaded) return;
|
||||
|
||||
for (std::list<VideoDisplay*>::iterator cur=displayList.begin();cur!=displayList.end();cur++) {
|
||||
VideoDisplay *display = *cur;
|
||||
|
||||
|
|
|
@ -134,7 +134,6 @@ VideoDisplay::VideoDisplay(VideoBox *box, VideoSlider *ControlSlider, wxTextCtrl
|
|||
, SubsPosition(SubsPosition)
|
||||
, PositionDisplay(PositionDisplay)
|
||||
, videoOut(new VideoOutGL())
|
||||
, tool(new VisualToolCross(this, video, box->visualSubToolBar))
|
||||
, activeMode(Video_Mode_Standard)
|
||||
, toolBar(box->visualSubToolBar)
|
||||
, scriptW(INT_MIN)
|
||||
|
|
|
@ -90,10 +90,8 @@ VisualTool<FeatureType>::VisualTool(VideoDisplay *parent, VideoState const& vide
|
|||
, ctrlDown(false)
|
||||
, altDown(false)
|
||||
{
|
||||
if (VideoContext::Get()->IsLoaded()) {
|
||||
frame_n = VideoContext::Get()->GetFrameN();
|
||||
VideoContext::Get()->grid->AddSelectionListener(this);
|
||||
}
|
||||
grid->AddSelectionListener(this);
|
||||
|
||||
PopulateFeatureList();
|
||||
}
|
||||
|
@ -284,7 +282,7 @@ void VisualTool<FeatureType>::Commit(bool full, wxString message) {
|
|||
}
|
||||
grid->CommitChanges(false,!full);
|
||||
if (full)
|
||||
grid->editBox->Update(false, true, false);
|
||||
grid->editBox->Update(false, true);
|
||||
}
|
||||
|
||||
template<class FeatureType>
|
||||
|
|
Loading…
Reference in a new issue