[chronojump] Added play video on main gui



commit 77daabc6ff097c477d2b5c462fdb0b552f3ef6b3
Author: Xavier de Blas <xaviblas gmail com>
Date:   Thu Mar 31 18:17:00 2011 +0200

    Added play video on main gui

 glade/chronojump.glade |   29 ++++++++++++++++++++++++-
 src/gui/chronojump.cs  |   52 ++++++++++++++++++++++++++++++++++++++++++-----
 2 files changed, 73 insertions(+), 8 deletions(-)
---
diff --git a/glade/chronojump.glade b/glade/chronojump.glade
index 1deae0f..de336b3 100644
--- a/glade/chronojump.glade
+++ b/glade/chronojump.glade
@@ -19101,16 +19101,41 @@ weight</property>
                                               </packing>
                                             </child>
                                             <child>
-                                              <widget class="GtkHBox" id="hbox67">
+                                              <widget class="GtkHBox" id="hbox_this_test_buttons">
                                                 <property name="visible">True</property>
                                                 <child>
+                                                  <widget class="GtkButton" id="button_video_play_this_test">
+                                                    <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_this_test_clicked"/>
+                                                    <accelerator key="v" signal="clicked"/>
+                                                    <child>
+                                                      <widget class="GtkImage" id="image22">
+                                                        <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="pack_type">end</property>
+                                                    <property name="position">1</property>
+                                                  </packing>
+                                                </child>
+                                                <child>
                                                   <widget class="GtkButton" id="button_delete_this_test">
                                                     <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">Delete this test</property>
+                                                    <property name="tooltip" translatable="yes">Delete this test (d)</property>
                                                     <signal name="clicked" handler="on_delete_this_test_clicked"/>
+                                                    <accelerator key="d" signal="clicked"/>
                                                     <child>
                                                       <widget class="GtkImage" id="image19">
                                                         <property name="visible">True</property>
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index ec689c6..07cc381 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -201,7 +201,7 @@ public partial class ChronoJumpWindow
 	[Widget] Gtk.Button button_image_test_zoom;
 	[Widget] Gtk.Image image_test_zoom;
 	[Widget] Gtk.Label label_image_test;
-	[Widget] Gtk.Button button_delete_this_test;
+	[Widget] Gtk.Box hbox_this_test_buttons;
 
 	//non standard icons	
 	[Widget] Gtk.Image image_volume;
@@ -4509,6 +4509,45 @@ Console.WriteLine("X");
 		}
 	}
 	*/
+	
+	private void on_video_play_this_test_clicked (object o, EventArgs args) {
+		Constants.TestTypes type = Constants.TestTypes.JUMP;
+		int id = 0;
+		switch (currentEventType.Type) {
+			case EventType.Types.JUMP:
+				if(lastJumpIsSimple) {
+					type = Constants.TestTypes.JUMP;
+					id = currentJump.UniqueID;
+				}
+				else {
+					type = Constants.TestTypes.JUMP_RJ;
+					id = currentJumpRj.UniqueID;
+				} break;
+			case EventType.Types.RUN:
+				if(lastRunIsSimple) {
+					type = Constants.TestTypes.RUN;
+					id = currentRun.UniqueID;
+				} else {
+					type = Constants.TestTypes.RUN_I;
+					id = currentRunInterval.UniqueID;
+				}
+				break;
+			case EventType.Types.PULSE:
+				type = Constants.TestTypes.PULSE;
+				id = currentPulse.UniqueID;
+				break;
+			case EventType.Types.REACTIONTIME:
+				type = Constants.TestTypes.RT;
+				id = currentReactionTime.UniqueID;
+				break;
+			case EventType.Types.MULTICHRONOPIC:
+				type = Constants.TestTypes.MULTICHRONOPIC;
+				id = currentMultiChronopic.UniqueID;
+				break;
+		}
+
+		playVideo(Util.GetVideoFileName(currentSession.UniqueID, type, id));
+	}
 
 	private void on_video_play_selected_jump_clicked (object o, EventArgs args) {
 		if (myTreeViewJumps.EventSelectedID > 0) 
@@ -4566,7 +4605,6 @@ Console.WriteLine("X");
 	 */
 	
 	private void on_delete_this_test_clicked (object o, EventArgs args) {
-		TreeIter iter = new TreeIter();
 		switch (currentEventType.Type) {
 			case EventType.Types.JUMP:
 				if(lastJumpIsSimple) {
@@ -4613,7 +4651,7 @@ Console.WriteLine("X");
 	}
 
 	private void deleted_last_test_update_widgets() {
-		button_delete_this_test.Sensitive = false;
+		hbox_this_test_buttons.Sensitive = false;
 		event_execute_clearDrawingArea();
 		notebook_results_data.CurrentPage = 7; //shows "deleted test"
 	}
@@ -5123,6 +5161,8 @@ Console.WriteLine("X");
 				"<tt><b>CTRL+" + Catalog.GetString("CURSOR_UP") + "</b></tt> " + Catalog.GetString("Select previous person") + "\n" +
 				"<tt><b>CTRL+" + Catalog.GetString("CURSOR_DOWN") + "</b></tt> " + Catalog.GetString("Select next person") + "\n" +
 				"<tt><b>(space)</b></tt> " + Catalog.GetString("Execute test") + "\n" +
+				"<tt><b>v</b></tt> " + Catalog.GetString("Play video of this test") + " " + Catalog.GetString("(if available)")+ "\n" +
+				"<tt><b>d</b></tt> " + Catalog.GetString("Delete this test") + "\n" +
 				"\n" + "- " + Catalog.GetString("On results tab:") + "\n\n" +
 				"<tt><b>z</b></tt> " + Catalog.GetString("Zoom change") + "\n" +
 				"<tt><b>v</b></tt> " + Catalog.GetString("Play video of selected test") + " " + Catalog.GetString("(if available)")+ "\n" +
@@ -5219,7 +5259,7 @@ Console.WriteLine("X");
 		vbox_stats.Sensitive = false;
 		frame_share_data.Sensitive = false;
 		
-		button_delete_this_test.Sensitive = false;
+		hbox_this_test_buttons.Sensitive = false;
 		
 		hbox_execute_test.Sensitive = false;
 		button_execute_test.Sensitive = false;
@@ -5290,7 +5330,7 @@ Console.WriteLine("X");
 		table_runs.Sensitive = false;
 		hbox_runs_interval.Sensitive = false;
 		hbox_pulses.Sensitive = false;
-		button_delete_this_test.Sensitive = false;
+		hbox_this_test_buttons.Sensitive = false;
 		
 		hbox_multi_chronopic_buttons.Sensitive = false;
 	}
@@ -5304,7 +5344,7 @@ Console.WriteLine("X");
 		hbox_runs_interval.Sensitive = true;
 		hbox_pulses.Sensitive = true;
 		hbox_multi_chronopic_buttons.Sensitive = true;
-		button_delete_this_test.Sensitive = true;
+		hbox_this_test_buttons.Sensitive = true;
 
 		//allow repeat last jump or run (check also if it wasn't cancelled)
 		if(! currentEventExecute.Cancel) {



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