From: <avn...@us...> - 2008-05-17 18:37:51
|
Revision: 3086 http://urakawa.svn.sourceforge.net/urakawa/?rev=3086&view=rev Author: avneeshsingh Date: 2008-05-17 11:37:21 -0700 (Sat, 17 May 2008) Log Message: ----------- Fix to bugg: accessible label error in phrase count after ph detection - functions added for this will be useful for other problems also. Modified Paths: -------------- trunk/urakawa/application/Obi/Obi/ProjectView/AudioBlock.cs trunk/urakawa/application/Obi/Obi/ProjectView/Block.cs trunk/urakawa/application/Obi/Obi/ProjectView/ProjectView.cs trunk/urakawa/application/Obi/Obi/ProjectView/Strip.cs trunk/urakawa/application/Obi/Obi/ProjectView/StripsView.cs Modified: trunk/urakawa/application/Obi/Obi/ProjectView/AudioBlock.cs =================================================================== --- trunk/urakawa/application/Obi/Obi/ProjectView/AudioBlock.cs 2008-05-16 21:52:47 UTC (rev 3085) +++ trunk/urakawa/application/Obi/Obi/ProjectView/AudioBlock.cs 2008-05-17 18:37:21 UTC (rev 3086) @@ -78,7 +78,7 @@ } // Update label and waveform when there is new information to display. - protected override void UpdateLabel() + public override void UpdateLabel() { /*string name = mNode.NodeKind == EmptyNode.Kind.Plain ? Localizer.Message("blank_phrase") : mNode.NodeKind == EmptyNode.Kind.Page ? String.Format(Localizer.Message("page_number"), mNode.PageNumber) : Modified: trunk/urakawa/application/Obi/Obi/ProjectView/Block.cs =================================================================== --- trunk/urakawa/application/Obi/Obi/ProjectView/Block.cs 2008-05-16 21:52:47 UTC (rev 3085) +++ trunk/urakawa/application/Obi/Obi/ProjectView/Block.cs 2008-05-17 18:37:21 UTC (rev 3086) @@ -112,7 +112,7 @@ // Generate the label string for this block. // Since there is no content, the width is always that of the label's. - protected virtual void UpdateLabel() + public virtual void UpdateLabel() { mLabel.Text = Node.BaseStringShort(); mLabel.AccessibleName = Node.BaseString(); Modified: trunk/urakawa/application/Obi/Obi/ProjectView/ProjectView.cs =================================================================== --- trunk/urakawa/application/Obi/Obi/ProjectView/ProjectView.cs 2008-05-16 21:52:47 UTC (rev 3085) +++ trunk/urakawa/application/Obi/Obi/ProjectView/ProjectView.cs 2008-05-17 18:37:21 UTC (rev 3086) @@ -1182,7 +1182,11 @@ if (PhraseDetectionDialog.DialogResult == DialogResult.OK) { mPresentation.getUndoRedoManager().execute(new Commands.Node.PhraseDetection(this, PhraseDetectionDialog.Threshold, PhraseDetectionDialog.Gap, PhraseDetectionDialog.LeadingSilence)); - } + + // update blocks labels such that error in label due to serial creation of phrases is removed + if ( SelectedNodeAs<EmptyNode>() != null ) + mStripsView.UpdateBlocksLabelInStrip(SelectedNodeAs<EmptyNode>().ParentAs<SectionNode>() ); + } }// check for phrase node ends else System.Media.SystemSounds.Beep.Play(); Modified: trunk/urakawa/application/Obi/Obi/ProjectView/Strip.cs =================================================================== --- trunk/urakawa/application/Obi/Obi/ProjectView/Strip.cs 2008-05-16 21:52:47 UTC (rev 3085) +++ trunk/urakawa/application/Obi/Obi/ProjectView/Strip.cs 2008-05-17 18:37:21 UTC (rev 3086) @@ -487,5 +487,22 @@ { // System.Diagnostics.Debug.Print("<---> Resize block panel to " + mBlocksPanel.Size); } + + public void UpdateBlockLabelsInStrip() + { + int BlocksCount = mBlocksPanel.Controls.Count; + Control BlockControl = null ; + + for (int i = 0; i < BlocksCount; i++) + { + BlockControl = mBlocksPanel.Controls[i] ; + if (BlockControl is Block ) + { + ((Block)BlockControl).UpdateLabel(); + } + + } + } + } } Modified: trunk/urakawa/application/Obi/Obi/ProjectView/StripsView.cs =================================================================== --- trunk/urakawa/application/Obi/Obi/ProjectView/StripsView.cs 2008-05-16 21:52:47 UTC (rev 3085) +++ trunk/urakawa/application/Obi/Obi/ProjectView/StripsView.cs 2008-05-17 18:37:21 UTC (rev 3086) @@ -1165,5 +1165,13 @@ } } } + + public void UpdateBlocksLabelInStrip(SectionNode node) + { + Strip s = FindStrip(node); + if (s != null) + s.UpdateBlockLabelsInStrip(); + } + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |