[chronojump] videos for all tests on main gui



commit 28d527c7f1af35fcedb083e15d9db791f79fced5
Author: Xavier de Blas <xaviblas gmail com>
Date:   Fri Feb 11 14:33:58 2011 +0100

    videos for all tests on main gui

 glade/chronojump.glade |  198 +++++++++++++++++++++++++++++-----
 src/gui/chronojump.cs  |  276 ++++++++++++++++++++++++++++++++++++++----------
 2 files changed, 387 insertions(+), 87 deletions(-)
---
diff --git a/glade/chronojump.glade b/glade/chronojump.glade
index 0a3f5e1..e7a08cf 100644
--- a/glade/chronojump.glade
+++ b/glade/chronojump.glade
@@ -18632,17 +18632,18 @@ by you</property>
                                   </packing>
                                 </child>
                                 <child>
-                                  <widget class="GtkButton" id="button_edit_selected_jump">
+                                  <widget class="GtkButton" id="button_video_play_selected_jump">
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
-                                    <property name="receives_default">False</property>
-                                    <property name="tooltip" translatable="yes">Edit selected (e)</property>
-                                    <signal name="clicked" handler="on_edit_selected_jump_clicked"/>
-                                    <accelerator key="e" signal="clicked"/>
+                                    <property name="receives_default">True</property>
+                                    <property name="has_tooltip">True</property>
+                                    <property name="tooltip" translatable="yes">Play Video (v)</property>
+                                    <signal name="clicked" handler="on_video_play_selected_jump_clicked"/>
+                                    <accelerator key="v" signal="clicked"/>
                                     <child>
-                                      <widget class="GtkImage" id="image1972">
+                                      <widget class="GtkImage" id="image45">
                                         <property name="visible">True</property>
-                                        <property name="stock">gtk-edit</property>
+                                        <property name="stock">gtk-media-play</property>
                                         <property name="icon-size">1</property>
                                       </widget>
                                     </child>
@@ -18654,18 +18655,17 @@ by you</property>
                                   </packing>
                                 </child>
                                 <child>
-                                  <widget class="GtkButton" id="button_video_play_selected_jump">
+                                  <widget class="GtkButton" id="button_edit_selected_jump">
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
-                                    <property name="receives_default">True</property>
-                                    <property name="has_tooltip">True</property>
-                                    <property name="tooltip" translatable="yes">Play Video (v)</property>
-                                    <signal name="clicked" handler="on_video_play_selected_jump_clicked"/>
-                                    <accelerator key="v" signal="clicked"/>
+                                    <property name="receives_default">False</property>
+                                    <property name="tooltip" translatable="yes">Edit selected (e)</property>
+                                    <signal name="clicked" handler="on_edit_selected_jump_clicked"/>
+                                    <accelerator key="e" signal="clicked"/>
                                     <child>
-                                      <widget class="GtkImage" id="image45">
+                                      <widget class="GtkImage" id="image1972">
                                         <property name="visible">True</property>
-                                        <property name="stock">gtk-media-play</property>
+                                        <property name="stock">gtk-edit</property>
                                         <property name="icon-size">1</property>
                                       </widget>
                                     </child>
@@ -19051,6 +19051,29 @@ by you</property>
                                               </packing>
                                             </child>
                                             <child>
+                                              <widget class="GtkButton" id="button_video_play_selected_jump_rj">
+                                                <property name="visible">True</property>
+                                                <property name="can_focus">True</property>
+                                                <property name="receives_default">True</property>
+                                                <property name="has_tooltip">True</property>
+                                                <property name="tooltip" translatable="yes">Play Video (v)</property>
+                                                <signal name="clicked" handler="on_video_play_selected_jump_rj_clicked"/>
+                                                <accelerator key="v" signal="clicked"/>
+                                                <child>
+                                                  <widget class="GtkImage" id="image46">
+                                                    <property name="visible">True</property>
+                                                    <property name="stock">gtk-media-play</property>
+                                                    <property name="icon-size">1</property>
+                                                  </widget>
+                                                </child>
+                                              </widget>
+                                              <packing>
+                                                <property name="expand">False</property>
+                                                <property name="fill">False</property>
+                                                <property name="position">1</property>
+                                              </packing>
+                                            </child>
+                                            <child>
                                               <widget class="GtkButton" id="button_edit_selected_jump_rj">
                                                 <property name="visible">True</property>
                                                 <property name="can_focus">True</property>
@@ -19069,7 +19092,7 @@ by you</property>
                                               <packing>
                                                 <property name="expand">False</property>
                                                 <property name="fill">False</property>
-                                                <property name="position">1</property>
+                                                <property name="position">2</property>
                                               </packing>
                                             </child>
                                             <child>
@@ -19089,7 +19112,7 @@ by you</property>
                                               <packing>
                                                 <property name="expand">False</property>
                                                 <property name="fill">False</property>
-                                                <property name="position">2</property>
+                                                <property name="position">3</property>
                                               </packing>
                                             </child>
                                             <child>
@@ -19109,7 +19132,7 @@ by you</property>
                                               <packing>
                                                 <property name="expand">False</property>
                                                 <property name="fill">False</property>
-                                                <property name="position">3</property>
+                                                <property name="position">4</property>
                                               </packing>
                                             </child>
                                           </widget>
@@ -19566,6 +19589,29 @@ by you</property>
                                               </packing>
                                             </child>
                                             <child>
+                                              <widget class="GtkButton" id="button_video_play_selected_run">
+                                                <property name="visible">True</property>
+                                                <property name="can_focus">True</property>
+                                                <property name="receives_default">True</property>
+                                                <property name="has_tooltip">True</property>
+                                                <property name="tooltip" translatable="yes">Play Video (v)</property>
+                                                <signal name="clicked" handler="on_video_play_selected_run_clicked"/>
+                                                <accelerator key="v" signal="clicked"/>
+                                                <child>
+                                                  <widget class="GtkImage" id="image47">
+                                                    <property name="visible">True</property>
+                                                    <property name="stock">gtk-media-play</property>
+                                                    <property name="icon-size">1</property>
+                                                  </widget>
+                                                </child>
+                                              </widget>
+                                              <packing>
+                                                <property name="expand">False</property>
+                                                <property name="fill">False</property>
+                                                <property name="position">1</property>
+                                              </packing>
+                                            </child>
+                                            <child>
                                               <widget class="GtkButton" id="button_edit_selected_run">
                                                 <property name="visible">True</property>
                                                 <property name="can_focus">True</property>
@@ -19584,7 +19630,7 @@ by you</property>
                                               <packing>
                                                 <property name="expand">False</property>
                                                 <property name="fill">False</property>
-                                                <property name="position">1</property>
+                                                <property name="position">2</property>
                                               </packing>
                                             </child>
                                             <child>
@@ -19604,7 +19650,7 @@ by you</property>
                                               <packing>
                                                 <property name="expand">False</property>
                                                 <property name="fill">False</property>
-                                                <property name="position">2</property>
+                                                <property name="position">3</property>
                                               </packing>
                                             </child>
                                           </widget>
@@ -19921,6 +19967,29 @@ by you</property>
                                   </packing>
                                 </child>
                                 <child>
+                                  <widget class="GtkButton" id="button_video_play_selected_run_interval">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="receives_default">True</property>
+                                    <property name="has_tooltip">True</property>
+                                    <property name="tooltip" translatable="yes">Play Video (v)</property>
+                                    <signal name="clicked" handler="on_video_play_selected_run_interval_clicked"/>
+                                    <accelerator key="v" signal="clicked"/>
+                                    <child>
+                                      <widget class="GtkImage" id="image48">
+                                        <property name="visible">True</property>
+                                        <property name="stock">gtk-media-play</property>
+                                        <property name="icon-size">1</property>
+                                      </widget>
+                                    </child>
+                                  </widget>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">False</property>
+                                    <property name="position">1</property>
+                                  </packing>
+                                </child>
+                                <child>
                                   <widget class="GtkButton" id="button_edit_selected_run_interval">
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
@@ -19939,7 +20008,7 @@ by you</property>
                                   <packing>
                                     <property name="expand">False</property>
                                     <property name="fill">False</property>
-                                    <property name="position">1</property>
+                                    <property name="position">2</property>
                                   </packing>
                                 </child>
                                 <child>
@@ -19959,7 +20028,7 @@ by you</property>
                                   <packing>
                                     <property name="expand">False</property>
                                     <property name="fill">False</property>
-                                    <property name="position">2</property>
+                                    <property name="position">3</property>
                                   </packing>
                                 </child>
                                 <child>
@@ -19979,7 +20048,7 @@ by you</property>
                                   <packing>
                                     <property name="expand">False</property>
                                     <property name="fill">False</property>
-                                    <property name="position">3</property>
+                                    <property name="position">4</property>
                                   </packing>
                                 </child>
                               </widget>
@@ -20112,6 +20181,29 @@ by you</property>
                                   </packing>
                                 </child>
                                 <child>
+                                  <widget class="GtkButton" id="button_video_play_selected_reaction_time">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="receives_default">True</property>
+                                    <property name="has_tooltip">True</property>
+                                    <property name="tooltip" translatable="yes">Play Video (v)</property>
+                                    <signal name="clicked" handler="on_video_play_selected_reaction_time_clicked"/>
+                                    <accelerator key="v" signal="clicked"/>
+                                    <child>
+                                      <widget class="GtkImage" id="image49">
+                                        <property name="visible">True</property>
+                                        <property name="stock">gtk-media-play</property>
+                                        <property name="icon-size">1</property>
+                                      </widget>
+                                    </child>
+                                  </widget>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">False</property>
+                                    <property name="position">1</property>
+                                  </packing>
+                                </child>
+                                <child>
                                   <widget class="GtkButton" id="button_edit_selected_reaction_time">
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
@@ -20130,7 +20222,7 @@ by you</property>
                                   <packing>
                                     <property name="expand">False</property>
                                     <property name="fill">False</property>
-                                    <property name="position">1</property>
+                                    <property name="position">2</property>
                                   </packing>
                                 </child>
                                 <child>
@@ -20150,7 +20242,7 @@ by you</property>
                                   <packing>
                                     <property name="expand">False</property>
                                     <property name="fill">False</property>
-                                    <property name="position">2</property>
+                                    <property name="position">3</property>
                                   </packing>
                                 </child>
                               </widget>
@@ -20327,6 +20419,29 @@ by you</property>
                                   </packing>
                                 </child>
                                 <child>
+                                  <widget class="GtkButton" id="button_video_play_selected_pulse">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="receives_default">True</property>
+                                    <property name="has_tooltip">True</property>
+                                    <property name="tooltip" translatable="yes">Play Video (v)</property>
+                                    <signal name="clicked" handler="on_video_play_selected_pulse_clicked"/>
+                                    <accelerator key="v" signal="clicked"/>
+                                    <child>
+                                      <widget class="GtkImage" id="image50">
+                                        <property name="visible">True</property>
+                                        <property name="stock">gtk-media-play</property>
+                                        <property name="icon-size">1</property>
+                                      </widget>
+                                    </child>
+                                  </widget>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">False</property>
+                                    <property name="position">1</property>
+                                  </packing>
+                                </child>
+                                <child>
                                   <widget class="GtkButton" id="button_edit_selected_pulse">
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
@@ -20345,7 +20460,7 @@ by you</property>
                                   <packing>
                                     <property name="expand">False</property>
                                     <property name="fill">False</property>
-                                    <property name="position">1</property>
+                                    <property name="position">2</property>
                                   </packing>
                                 </child>
                                 <child>
@@ -20365,7 +20480,7 @@ by you</property>
                                   <packing>
                                     <property name="expand">False</property>
                                     <property name="fill">False</property>
-                                    <property name="position">2</property>
+                                    <property name="position">3</property>
                                   </packing>
                                 </child>
                                 <child>
@@ -20385,7 +20500,7 @@ by you</property>
                                   <packing>
                                     <property name="expand">False</property>
                                     <property name="fill">False</property>
-                                    <property name="position">3</property>
+                                    <property name="position">4</property>
                                   </packing>
                                 </child>
                               </widget>
@@ -20641,6 +20756,29 @@ by you</property>
                                   </packing>
                                 </child>
                                 <child>
+                                  <widget class="GtkButton" id="button_video_play_selected_multi_chronopic">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="receives_default">True</property>
+                                    <property name="has_tooltip">True</property>
+                                    <property name="tooltip" translatable="yes">Play Video (v)</property>
+                                    <signal name="clicked" handler="on_video_play_selected_multi_chronopic_clicked"/>
+                                    <accelerator key="v" signal="clicked"/>
+                                    <child>
+                                      <widget class="GtkImage" id="image51">
+                                        <property name="visible">True</property>
+                                        <property name="stock">gtk-media-play</property>
+                                        <property name="icon-size">1</property>
+                                      </widget>
+                                    </child>
+                                  </widget>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">False</property>
+                                    <property name="position">1</property>
+                                  </packing>
+                                </child>
+                                <child>
                                   <widget class="GtkButton" id="button_edit_selected_multi_chronopic">
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
@@ -20659,7 +20797,7 @@ by you</property>
                                   <packing>
                                     <property name="expand">False</property>
                                     <property name="fill">False</property>
-                                    <property name="position">1</property>
+                                    <property name="position">2</property>
                                   </packing>
                                 </child>
                                 <child>
@@ -20679,7 +20817,7 @@ by you</property>
                                   <packing>
                                     <property name="expand">False</property>
                                     <property name="fill">False</property>
-                                    <property name="position">2</property>
+                                    <property name="position">3</property>
                                   </packing>
                                 </child>
                               </widget>
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index 49e51d7..50bd175 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -97,6 +97,7 @@ public class ChronoJumpWindow
 	[Widget] Gtk.Button button_video_play_selected_jump;
 	[Widget] Gtk.Button button_delete_selected_jump;
 	[Widget] Gtk.Button button_edit_selected_jump_rj;
+	[Widget] Gtk.Button button_video_play_selected_jump_rj;
 	[Widget] Gtk.Button button_delete_selected_jump_rj;
 	[Widget] Gtk.Button button_repair_selected_jump_rj;
 	[Widget] Gtk.MenuItem menuitem_jump_type_add;
@@ -131,8 +132,10 @@ public class ChronoJumpWindow
 	[Widget] Gtk.MenuItem menuitem_run_type_delete_simple;
 	[Widget] Gtk.MenuItem menuitem_run_type_delete_intervallic;
 	[Widget] Gtk.Button button_edit_selected_run;
+	[Widget] Gtk.Button button_video_play_selected_run;
 	[Widget] Gtk.Button button_delete_selected_run;
 	[Widget] Gtk.Button button_edit_selected_run_interval;
+	[Widget] Gtk.Button button_video_play_selected_run_interval;
 	[Widget] Gtk.Button button_delete_selected_run_interval;
 	[Widget] Gtk.Button button_repair_selected_run_interval;
 
@@ -157,17 +160,20 @@ public class ChronoJumpWindow
 	//reaction time
 	[Widget] Gtk.MenuItem menuitem_reaction_time;
 	[Widget] Gtk.Button button_edit_selected_reaction_time;
+	[Widget] Gtk.Button button_video_play_selected_reaction_time;
 	[Widget] Gtk.Button button_delete_selected_reaction_time;
 	//pulse
 	[Widget] Gtk.MenuItem menuitem_pulse_free;
 	[Widget] Gtk.MenuItem menuitem_pulse_custom;
 	[Widget] Gtk.Button button_edit_selected_pulse;
+	[Widget] Gtk.Button button_video_play_selected_pulse;
 	[Widget] Gtk.Button button_delete_selected_pulse;
 	[Widget] Gtk.Button button_repair_selected_pulse;
 	//multiChronopic	
 	[Widget] Gtk.MenuItem menuitem_multi_chronopic_start;
 	[Widget] Gtk.MenuItem menuitem_run_analysis;
 	[Widget] Gtk.Button button_edit_selected_multi_chronopic;
+	[Widget] Gtk.Button button_video_play_selected_multi_chronopic;
 	[Widget] Gtk.Button button_delete_selected_multi_chronopic;
 	[Widget] Gtk.Box hbox_multi_chronopic_buttons;
 	[Widget] Gtk.Button button_multi_chronopic_start;
@@ -1170,22 +1176,20 @@ public class ChronoJumpWindow
 		Menu myMenu = new Menu ();
 		Gtk.MenuItem myItem;
 
-		myItem = new MenuItem ( Catalog.GetString("Edit selected") + " " + myJump.Type + " (" + myJump.PersonName + ")");
-		myItem.Activated += on_edit_selected_jump_clicked;
-		myMenu.Attach( myItem, 0, 1, 0, 1 );
-	
-		myItem = new MenuItem ( Catalog.GetString("Play Video") + " " + myJump.Type + " (" + myJump.PersonName + ")");
-		string videoFileName = Util.GetVideoFileName(currentSession.UniqueID, 
-				Constants.TestTypes.JUMP, myTreeViewJumps.EventSelectedID);
-		if(File.Exists(videoFileName)) {
+		myItem = new MenuItem ( Catalog.GetString("Play Video") + " " + 
+				myJump.Type + " (" + myJump.PersonName + ")");
+		if(File.Exists(Util.GetVideoFileName(currentSession.UniqueID, 
+				Constants.TestTypes.JUMP, myTreeViewJumps.EventSelectedID))) {
 			myItem.Activated += on_video_play_selected_jump_clicked;
 			myItem.Sensitive = true;
 		} else 
 			myItem.Sensitive = false;
-		
+		myMenu.Attach( myItem, 0, 1, 0, 1 );
 
+		myItem = new MenuItem ( Catalog.GetString("Edit selected") + " " + myJump.Type + " (" + myJump.PersonName + ")");
+		myItem.Activated += on_edit_selected_jump_clicked;
 		myMenu.Attach( myItem, 0, 1, 1, 2 );
-
+	
 		Gtk.SeparatorMenuItem mySep = new SeparatorMenuItem();
 		myMenu.Attach( mySep, 0, 1, 2, 3 );
 
@@ -1252,20 +1256,30 @@ public class ChronoJumpWindow
 		Menu myMenu = new Menu ();
 		Gtk.MenuItem myItem;
 
+		myItem = new MenuItem ( Catalog.GetString("Play Video") + " " + 
+				myJump.Type + " (" + myJump.PersonName + ")");
+		if(File.Exists(Util.GetVideoFileName(currentSession.UniqueID, 
+				Constants.TestTypes.JUMP_RJ, myTreeViewJumpsRj.EventSelectedID))) {
+			myItem.Activated += on_video_play_selected_jump_rj_clicked;
+			myItem.Sensitive = true;
+		} else 
+			myItem.Sensitive = false;
+		myMenu.Attach( myItem, 0, 1, 0, 1 );
+		
 		myItem = new MenuItem ( Catalog.GetString("Edit selected") + " " + myJump.Type + " (" + myJump.PersonName + ")");
 		myItem.Activated += on_edit_selected_jump_rj_clicked;
-		myMenu.Attach( myItem, 0, 1, 0, 1 );
+		myMenu.Attach( myItem, 0, 1, 1, 2 );
 
 		myItem = new MenuItem ( Catalog.GetString("Repair selected") + " " + myJump.Type + " (" + myJump.PersonName + ")");
 		myItem.Activated += on_repair_selected_jump_rj_clicked;
-		myMenu.Attach( myItem, 0, 1, 1, 2 );
+		myMenu.Attach( myItem, 0, 1, 2, 3 );
 		
 		Gtk.SeparatorMenuItem mySep = new SeparatorMenuItem();
-		myMenu.Attach( mySep, 0, 1, 2, 3 );
+		myMenu.Attach( mySep, 0, 1, 3, 4 );
 
 		myItem = new MenuItem ( Catalog.GetString("Delete selected") + " " + myJump.Type + " (" + myJump.PersonName + ")");
 		myItem.Activated += on_delete_selected_jump_rj_clicked;
-		myMenu.Attach( myItem, 0, 1, 3, 4 );
+		myMenu.Attach( myItem, 0, 1, 5, 6 );
 
 		myMenu.Popup();
 		myMenu.ShowAll();
@@ -1320,16 +1334,26 @@ public class ChronoJumpWindow
 		Menu myMenu = new Menu ();
 		Gtk.MenuItem myItem;
 
+		myItem = new MenuItem ( Catalog.GetString("Play Video") + " " + 
+				myRun.Type + " (" + myRun.PersonName + ")");
+		if(File.Exists(Util.GetVideoFileName(currentSession.UniqueID, 
+				Constants.TestTypes.RUN, myTreeViewRuns.EventSelectedID))) {
+			myItem.Activated += on_video_play_selected_run_clicked;
+			myItem.Sensitive = true;
+		} else 
+			myItem.Sensitive = false;
+		myMenu.Attach( myItem, 0, 1, 0, 1 );
+
 		myItem = new MenuItem ( Catalog.GetString("Edit selected") + " " + myRun.Type + " (" + myRun.PersonName + ")");
 		myItem.Activated += on_edit_selected_run_clicked;
-		myMenu.Attach( myItem, 0, 1, 0, 1 );
+		myMenu.Attach( myItem, 0, 1, 1, 2 );
 
 		Gtk.SeparatorMenuItem mySep = new SeparatorMenuItem();
-		myMenu.Attach( mySep, 0, 1, 1, 2 );
+		myMenu.Attach( mySep, 0, 1, 2, 3 );
 
 		myItem = new MenuItem ( Catalog.GetString("Delete selected") + " " + myRun.Type + " (" + myRun.PersonName + ")");
 		myItem.Activated += on_delete_selected_run_clicked;
-		myMenu.Attach( myItem, 0, 1, 2, 3 );
+		myMenu.Attach( myItem, 0, 1, 3, 4 );
 
 		myMenu.Popup();
 		myMenu.ShowAll();
@@ -1389,20 +1413,30 @@ public class ChronoJumpWindow
 		Menu myMenu = new Menu ();
 		Gtk.MenuItem myItem;
 
+		myItem = new MenuItem ( Catalog.GetString("Play Video") + " " + 
+				myRun.Type + " (" + myRun.PersonName + ")");
+		if(File.Exists(Util.GetVideoFileName(currentSession.UniqueID, 
+				Constants.TestTypes.RUN_I, myTreeViewRunsInterval.EventSelectedID))) {
+			myItem.Activated += on_video_play_selected_run_interval_clicked;
+			myItem.Sensitive = true;
+		} else 
+			myItem.Sensitive = false;
+		myMenu.Attach( myItem, 0, 1, 0, 1 );
+
 		myItem = new MenuItem ( Catalog.GetString("Edit selected") + " " + myRun.Type + " (" + myRun.PersonName + ")");
 		myItem.Activated += on_edit_selected_run_interval_clicked;
-		myMenu.Attach( myItem, 0, 1, 0, 1 );
+		myMenu.Attach( myItem, 0, 1, 1, 2 );
 
 		myItem = new MenuItem ( Catalog.GetString("Repair selected") + " " + myRun.Type + " (" + myRun.PersonName + ")");
 		myItem.Activated += on_repair_selected_run_interval_clicked;
-		myMenu.Attach( myItem, 0, 1, 1, 2 );
+		myMenu.Attach( myItem, 0, 1, 2, 3 );
 		
 		Gtk.SeparatorMenuItem mySep = new SeparatorMenuItem();
-		myMenu.Attach( mySep, 0, 1, 2, 3 );
+		myMenu.Attach( mySep, 0, 1, 3, 4 );
 
 		myItem = new MenuItem ( Catalog.GetString("Delete selected") + " " + myRun.Type + " (" + myRun.PersonName + ")");
 		myItem.Activated += on_delete_selected_run_interval_clicked;
-		myMenu.Attach( myItem, 0, 1, 3, 4 );
+		myMenu.Attach( myItem, 0, 1, 5, 6 );
 
 		myMenu.Popup();
 		myMenu.ShowAll();
@@ -1457,16 +1491,26 @@ public class ChronoJumpWindow
 		Menu myMenu = new Menu ();
 		Gtk.MenuItem myItem;
 
+		myItem = new MenuItem ( Catalog.GetString("Play Video") + " " + 
+				myRt.Type + " (" + myRt.PersonName + ")");
+		if(File.Exists(Util.GetVideoFileName(currentSession.UniqueID, 
+				Constants.TestTypes.RT, myTreeViewReactionTimes.EventSelectedID))) {
+			myItem.Activated += on_video_play_selected_reaction_time_clicked;
+			myItem.Sensitive = true;
+		} else 
+			myItem.Sensitive = false;
+		myMenu.Attach( myItem, 0, 1, 0, 1 );
+		
 		myItem = new MenuItem ( Catalog.GetString("Edit selected") + " " + myRt.Type + " (" + myRt.PersonName + ")");
 		myItem.Activated += on_edit_selected_reaction_time_clicked;
-		myMenu.Attach( myItem, 0, 1, 0, 1 );
+		myMenu.Attach( myItem, 0, 1, 1, 2 );
 
 		Gtk.SeparatorMenuItem mySep = new SeparatorMenuItem();
-		myMenu.Attach( mySep, 0, 1, 1, 2 );
+		myMenu.Attach( mySep, 0, 1, 2, 3 );
 
 		myItem = new MenuItem ( Catalog.GetString("Delete selected") + " " + myRt.Type + " (" + myRt.PersonName + ")");
 		myItem.Activated += on_delete_selected_reaction_time_clicked;
-		myMenu.Attach( myItem, 0, 1, 2, 3 );
+		myMenu.Attach( myItem, 0, 1, 3, 4 );
 
 		myMenu.Popup();
 		myMenu.ShowAll();
@@ -1525,20 +1569,30 @@ public class ChronoJumpWindow
 		Menu myMenu = new Menu ();
 		Gtk.MenuItem myItem;
 
+		myItem = new MenuItem ( Catalog.GetString("Play Video") + " " + 
+				myPulse.Type + " (" + myPulse.PersonName + ")");
+		if(File.Exists(Util.GetVideoFileName(currentSession.UniqueID, 
+				Constants.TestTypes.PULSE, myTreeViewPulses.EventSelectedID))) {
+			myItem.Activated += on_video_play_selected_pulse_clicked;
+			myItem.Sensitive = true;
+		} else 
+			myItem.Sensitive = false;
+		myMenu.Attach( myItem, 0, 1, 0, 1 );
+
 		myItem = new MenuItem ( Catalog.GetString("Edit selected") + " " + myPulse.Type + " (" + myPulse.PersonName + ")");
 		myItem.Activated += on_edit_selected_pulse_clicked;
-		myMenu.Attach( myItem, 0, 1, 0, 1 );
+		myMenu.Attach( myItem, 0, 1, 1, 2 );
 
 		myItem = new MenuItem ( Catalog.GetString("Repair selected") + " " + myPulse.Type + " (" + myPulse.PersonName + ")");
 		myItem.Activated += on_repair_selected_pulse_clicked;
-		myMenu.Attach( myItem, 0, 1, 1, 2 );
+		myMenu.Attach( myItem, 0, 1, 2, 3 );
 		
 		Gtk.SeparatorMenuItem mySep = new SeparatorMenuItem();
-		myMenu.Attach( mySep, 0, 1, 2, 3 );
+		myMenu.Attach( mySep, 0, 1, 3, 4 );
 
 		myItem = new MenuItem ( Catalog.GetString("Delete selected") + " " + myPulse.Type + " (" + myPulse.PersonName + ")");
 		myItem.Activated += on_delete_selected_pulse_clicked;
-		myMenu.Attach( myItem, 0, 1, 3, 4 );
+		myMenu.Attach( myItem, 0, 1, 5, 6 );
 
 		myMenu.Popup();
 		myMenu.ShowAll();
@@ -1608,24 +1662,32 @@ public class ChronoJumpWindow
 		Menu myMenu = new Menu ();
 		Gtk.MenuItem myItem;
 
+		myItem = new MenuItem ( Catalog.GetString("Play Video") + " " + 
+				mc.Type + " (" + mc.PersonName + ")");
+		if(File.Exists(Util.GetVideoFileName(currentSession.UniqueID, 
+				Constants.TestTypes.MULTICHRONOPIC, myTreeViewMultiChronopic.EventSelectedID))) {
+			myItem.Activated += on_video_play_selected_multi_chronopic_clicked;
+			myItem.Sensitive = true;
+		} else 
+			myItem.Sensitive = false;
+		myMenu.Attach( myItem, 0, 1, 0, 1 );
+
 		myItem = new MenuItem ( Catalog.GetString("Edit selected") + " " + mc.Type + " (" + mc.PersonName + ")");
 		myItem.Activated += on_edit_selected_multi_chronopic_clicked;
-		myMenu.Attach( myItem, 0, 1, 0, 1 );
+		myMenu.Attach( myItem, 0, 1, 1, 2 );
 
 		/*
 		myItem = new MenuItem ( Catalog.GetString("Repair selected") + " " + mc.Type + " (" + mc.PersonName + ")");
 		myItem.Activated += on_repair_selected_multi_chronopic_clicked;
-		myMenu.Attach( myItem, 0, 1, 1, 2 );
+		myMenu.Attach( myItem, 0, 1, 2, 3 );
 		*/
 		
 		Gtk.SeparatorMenuItem mySep = new SeparatorMenuItem();
-		//myMenu.Attach( mySep, 0, 1, 2, 3 );
-		myMenu.Attach( mySep, 0, 1, 1, 2 );
+		myMenu.Attach( mySep, 0, 1, 3, 4 );
 
 		myItem = new MenuItem ( Catalog.GetString("Delete selected") + " " + mc.Type + " (" + mc.PersonName + ")");
 		myItem.Activated += on_delete_selected_multi_chronopic_clicked;
-		//myMenu.Attach( myItem, 0, 1, 3, 4 );
-		myMenu.Attach( myItem, 0, 1, 2, 3 );
+		myMenu.Attach( myItem, 0, 1, 5, 6 );
 
 		myMenu.Popup();
 		myMenu.ShowAll();
@@ -4383,25 +4445,77 @@ Console.WriteLine("X");
 	 * ----------------  EVENTS PLAY VIDEO ---------------------
 	 *  --------------------------------------------------------
 	 */
+
+	private void playVideo(string fileName) {
+		if(File.Exists(fileName)) {
+			Log.WriteLine("Exists and clicked " + fileName);
+
+			PlayerBin player = new PlayerBin();
+			player.Open(fileName);
+
+			Gtk.Window d = new Gtk.Window(Catalog.GetString("Playing video"));
+			d.Add(player);
+			d.Modal = true;
+			d.ShowAll();
+			d.DeleteEvent += delegate(object sender, DeleteEventArgs e) {player.Close(); player.Dispose();};
+			player.Play(); 
+		}
+	}
 	
 	private void on_video_play_selected_jump_clicked (object o, EventArgs args) {
-		if (myTreeViewJumps.EventSelectedID > 0) {
-			string videoFileName = Util.GetVideoFileName(currentSession.UniqueID, 
-					Constants.TestTypes.JUMP, myTreeViewJumps.EventSelectedID);
-			if(File.Exists(videoFileName)) {
-				Log.WriteLine("Exists and clicked " + videoFileName);
-
-				PlayerBin player = new PlayerBin();
-				player.Open(videoFileName);
-
-				Gtk.Window d = new Gtk.Window(Catalog.GetString("Playing video"));
-				d.Add(player);
-				d.Modal = true;
-				d.ShowAll();
-				d.DeleteEvent += delegate(object sender, DeleteEventArgs e) {player.Close(); player.Dispose();};
-				player.Play(); 
-			}
-		}
+		if (myTreeViewJumps.EventSelectedID > 0) 
+			playVideo(Util.GetVideoFileName(currentSession.UniqueID, 
+						Constants.TestTypes.JUMP,
+						myTreeViewJumps.EventSelectedID));
+
+	}
+
+	private void on_video_play_selected_jump_rj_clicked (object o, EventArgs args) {
+		if (myTreeViewJumpsRj.EventSelectedID > 0) 
+			playVideo(Util.GetVideoFileName(currentSession.UniqueID, 
+						Constants.TestTypes.JUMP_RJ,
+						myTreeViewJumpsRj.EventSelectedID));
+
+	}
+
+	private void on_video_play_selected_run_clicked (object o, EventArgs args) {
+		if (myTreeViewRuns.EventSelectedID > 0) 
+			playVideo(Util.GetVideoFileName(currentSession.UniqueID, 
+						Constants.TestTypes.RUN,
+						myTreeViewRuns.EventSelectedID));
+
+	}
+
+	private void on_video_play_selected_run_interval_clicked (object o, EventArgs args) {
+		if (myTreeViewRunsInterval.EventSelectedID > 0) 
+			playVideo(Util.GetVideoFileName(currentSession.UniqueID, 
+						Constants.TestTypes.RUN_I,
+						myTreeViewRunsInterval.EventSelectedID));
+
+	}
+
+	private void on_video_play_selected_reaction_time_clicked (object o, EventArgs args) {
+		if (myTreeViewReactionTimes.EventSelectedID > 0) 
+			playVideo(Util.GetVideoFileName(currentSession.UniqueID, 
+						Constants.TestTypes.RT,
+						myTreeViewReactionTimes.EventSelectedID));
+
+	}
+
+	private void on_video_play_selected_pulse_clicked (object o, EventArgs args) {
+		if (myTreeViewPulses.EventSelectedID > 0) 
+			playVideo(Util.GetVideoFileName(currentSession.UniqueID, 
+						Constants.TestTypes.PULSE,
+						myTreeViewPulses.EventSelectedID));
+
+	}
+
+	private void on_video_play_selected_multi_chronopic_clicked (object o, EventArgs args) {
+		if (myTreeViewMultiChronopic.EventSelectedID > 0) 
+			playVideo(Util.GetVideoFileName(currentSession.UniqueID, 
+						Constants.TestTypes.MULTICHRONOPIC,
+						myTreeViewMultiChronopic.EventSelectedID));
+
 	}
 
 
@@ -5108,13 +5222,13 @@ Console.WriteLine("X");
 			menuitem_delete_selected_jump.Sensitive = show;
 			button_edit_selected_jump.Sensitive = show;
 			button_delete_selected_jump.Sensitive = show;
+
 			button_video_play_selected_jump.Sensitive = false;
-			if (myTreeViewJumps.EventSelectedID > 0) {
-				string videoFileName = Util.GetVideoFileName(currentSession.UniqueID, 
-						Constants.TestTypes.JUMP, myTreeViewJumps.EventSelectedID);
-				if(File.Exists(videoFileName)) 
-					button_video_play_selected_jump.Sensitive = true;
-			}
+			if (myTreeViewJumps.EventSelectedID > 0 && File.Exists(Util.GetVideoFileName(
+							currentSession.UniqueID, 
+							Constants.TestTypes.JUMP,
+							myTreeViewJumps.EventSelectedID)))
+				button_video_play_selected_jump.Sensitive = true;
 
 			success = true;
 		} 
@@ -5125,6 +5239,14 @@ Console.WriteLine("X");
 			button_delete_selected_jump_rj.Sensitive = show;
 			button_repair_selected_jump_rj.Sensitive = show;
 			menuitem_repair_selected_jump_rj.Sensitive = show;
+
+			button_video_play_selected_jump_rj.Sensitive = false;
+			if (myTreeViewJumpsRj.EventSelectedID > 0 && File.Exists(Util.GetVideoFileName(
+							currentSession.UniqueID, 
+							Constants.TestTypes.JUMP_RJ,
+							myTreeViewJumpsRj.EventSelectedID)))
+				button_video_play_selected_jump_rj.Sensitive = true;
+
 			success = true;
 		} 
 		if (type == "ALL" || type == "Run") {
@@ -5132,6 +5254,14 @@ Console.WriteLine("X");
 			menuitem_delete_selected_run.Sensitive = show;
 			button_edit_selected_run.Sensitive = show;
 			button_delete_selected_run.Sensitive = show;
+
+			button_video_play_selected_run.Sensitive = false;
+			if (myTreeViewRuns.EventSelectedID > 0 && File.Exists(Util.GetVideoFileName(
+							currentSession.UniqueID, 
+							Constants.TestTypes.RUN,
+							myTreeViewRuns.EventSelectedID)))
+				button_video_play_selected_run.Sensitive = true;
+
 			success = true;
 		} 
 		if (type == "ALL" || type == "RunInterval") {
@@ -5141,11 +5271,27 @@ Console.WriteLine("X");
 			button_delete_selected_run_interval.Sensitive = show;
 			button_repair_selected_run_interval.Sensitive = show;
 			menuitem_repair_selected_run_interval.Sensitive = show;
+			
+			button_video_play_selected_run_interval.Sensitive = false;
+			if (myTreeViewRunsInterval.EventSelectedID > 0 && File.Exists(Util.GetVideoFileName(
+							currentSession.UniqueID, 
+							Constants.TestTypes.RUN_I,
+							myTreeViewRunsInterval.EventSelectedID)))
+				button_video_play_selected_run_interval.Sensitive = true;
+
 			success = true;
 		} 
 		if (type == "ALL" || type == "ReactionTime") {
 			button_edit_selected_reaction_time.Sensitive = show;
 			button_delete_selected_reaction_time.Sensitive = show;
+			
+			button_video_play_selected_reaction_time.Sensitive = false;
+			if (myTreeViewReactionTimes.EventSelectedID > 0 && File.Exists(Util.GetVideoFileName(
+							currentSession.UniqueID, 
+							Constants.TestTypes.RT,
+							myTreeViewReactionTimes.EventSelectedID)))
+				button_video_play_selected_reaction_time.Sensitive = true;
+
 			success = true;
 		} 
 		if (type == "ALL" || type == "Pulse") {
@@ -5154,11 +5300,27 @@ Console.WriteLine("X");
 			button_edit_selected_pulse.Sensitive = show;
 			button_delete_selected_pulse.Sensitive = show;
 			button_repair_selected_pulse.Sensitive = show;
+			
+			button_video_play_selected_pulse.Sensitive = false;
+			if (myTreeViewPulses.EventSelectedID > 0 && File.Exists(Util.GetVideoFileName(
+							currentSession.UniqueID, 
+							Constants.TestTypes.PULSE,
+							myTreeViewPulses.EventSelectedID)))
+				button_video_play_selected_pulse.Sensitive = true;
+
 			success = true;
 		} 
 		if (type == "ALL" || type == Constants.MultiChronopicName) {
 			button_edit_selected_multi_chronopic.Sensitive = show;
 			button_delete_selected_multi_chronopic.Sensitive = show;
+			
+			button_video_play_selected_multi_chronopic.Sensitive = false;
+			if (myTreeViewMultiChronopic.EventSelectedID > 0 && File.Exists(Util.GetVideoFileName(
+							currentSession.UniqueID, 
+							Constants.TestTypes.MULTICHRONOPIC,
+							myTreeViewMultiChronopic.EventSelectedID)))
+				button_video_play_selected_multi_chronopic.Sensitive = true;
+
 			success = true;
 		} 
 		if (!success) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]