[longomatch] Add a new dialog with the player shortcuts



commit 784830e95e755d8de8aea2c769000835cf1c1bd6
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Mon Oct 8 21:33:31 2012 +0200

    Add a new dialog with the player shortcuts

 LongoMatch.GUI/Gui/Dialog/ShortcutsHelpDialog.cs   |   48 ++++++++
 LongoMatch.GUI/Gui/MainWindow.cs                   |    9 ++
 LongoMatch.GUI/LongoMatch.GUI.mdp                  |    2 +
 LongoMatch.GUI/Makefile.am                         |    2 +
 .../LongoMatch.Gui.Dialog.ShortcutsHelpDialog.cs   |   89 +++++++++++++++
 .../gtk-gui/LongoMatch.Gui.MainWindow.cs           |    7 +-
 LongoMatch.GUI/gtk-gui/gui.stetic                  |  116 ++++++++++++++++++++
 7 files changed, 272 insertions(+), 1 deletions(-)
---
diff --git a/LongoMatch.GUI/Gui/Dialog/ShortcutsHelpDialog.cs b/LongoMatch.GUI/Gui/Dialog/ShortcutsHelpDialog.cs
new file mode 100644
index 0000000..185154e
--- /dev/null
+++ b/LongoMatch.GUI/Gui/Dialog/ShortcutsHelpDialog.cs
@@ -0,0 +1,48 @@
+// 
+//  Copyright (C) 2012 Andoni Morales Alastruey
+// 
+//  This program is free software; you can redistribute it and/or modify
+//  it under the terms of the GNU General Public License as published by
+//  the Free Software Foundation; either version 2 of the License, or
+//  (at your option) any later version.
+// 
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+//  GNU General Public License for more details.
+//  
+//  You should have received a copy of the GNU General Public License
+//  along with this program; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+// 
+using System;
+using Gtk;
+using Mono.Unix;
+
+namespace LongoMatch.Gui.Dialog
+{
+	public partial class ShortcutsHelpDialog : Gtk.Dialog
+	{
+		string[,] player_shortcuts = {
+			{"Space", Catalog.GetString ("Pause or play")},
+			{"â", Catalog.GetString ("Step forward one frame")},
+			{"â", Catalog.GetString ("Step backward one frame")},
+			{"Shift + â", Catalog.GetString ("Jump forward X seconds")},
+			{"shift + â", Catalog.GetString ("Jump backward X seconds")},
+			{"â", Catalog.GetString ("Increase playback speed")},
+			{"â", Catalog.GetString ("Decrease playback speed")},
+			};
+			
+		public ShortcutsHelpDialog ()
+		{
+			this.Build ();
+			
+			for (int i=0; i < 7; i++){
+				shortcutsvbox.PackStart(new Label(player_shortcuts[i, 0]));
+				desc_vbox.PackStart(new Label(player_shortcuts[i, 1]));
+			} 
+			ShowAll();
+		}
+	}
+}
+
diff --git a/LongoMatch.GUI/Gui/MainWindow.cs b/LongoMatch.GUI/Gui/MainWindow.cs
index ecbc97b..ee2ca57 100644
--- a/LongoMatch.GUI/Gui/MainWindow.cs
+++ b/LongoMatch.GUI/Gui/MainWindow.cs
@@ -574,6 +574,15 @@ namespace LongoMatch.Gui
 			about.Run();
 			about.Destroy();
 		}
+		
+		protected void OnDialogInfoActionActivated (object sender, System.EventArgs e)
+		{
+			var info = new LongoMatch.Gui.Dialog.ShortcutsHelpDialog();
+			info.TransientFor = this;
+			info.Run();
+			info.Destroy();
+		}
+		
 		#endregion
 
 		protected virtual void OnPlayerbin1Error(object o, string message)
diff --git a/LongoMatch.GUI/LongoMatch.GUI.mdp b/LongoMatch.GUI/LongoMatch.GUI.mdp
index 9c87ed3..3c5aaed 100644
--- a/LongoMatch.GUI/LongoMatch.GUI.mdp
+++ b/LongoMatch.GUI/LongoMatch.GUI.mdp
@@ -155,6 +155,8 @@
     <File subtype="Code" buildaction="Compile" name="Gui/TreeView/PlayersFilterTreeView.cs" />
     <File subtype="Code" buildaction="Compile" name="Gui/TreeView/FilterBaseView.cs" />
     <File subtype="Code" buildaction="Compile" name="Gui/TreeView/CategoriesFilterTreeView.cs" />
+    <File subtype="Code" buildaction="Compile" name="Gui/Dialog/ShortcutsHelpDialog.cs" />
+    <File subtype="Code" buildaction="Compile" name="gtk-gui/LongoMatch.Gui.Dialog.ShortcutsHelpDialog.cs" />
   </Contents>
   <References>
     <ProjectReference type="Gac" localcopy="True" refto="atk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
diff --git a/LongoMatch.GUI/Makefile.am b/LongoMatch.GUI/Makefile.am
index 9ff7c6d..00edc91 100644
--- a/LongoMatch.GUI/Makefile.am
+++ b/LongoMatch.GUI/Makefile.am
@@ -41,6 +41,7 @@ SOURCES = \
 	gtk-gui/LongoMatch.Gui.Dialog.ProjectSelectionDialog.cs \
 	gtk-gui/LongoMatch.Gui.Dialog.ProjectsManager.cs \
 	gtk-gui/LongoMatch.Gui.Dialog.RenderingJobsDialog.cs \
+	gtk-gui/LongoMatch.Gui.Dialog.ShortcutsHelpDialog.cs \
 	gtk-gui/LongoMatch.Gui.Dialog.SnapshotsDialog.cs \
 	gtk-gui/LongoMatch.Gui.Dialog.SubCategoryTagsEditor.cs \
 	gtk-gui/LongoMatch.Gui.Dialog.TaggerDialog.cs \
@@ -98,6 +99,7 @@ SOURCES = \
 	Gui/Dialog/ProjectSelectionDialog.cs \
 	Gui/Dialog/ProjectsManager.cs \
 	Gui/Dialog/RenderingJobsDialog.cs \
+	Gui/Dialog/ShortcutsHelpDialog.cs \
 	Gui/Dialog/SnapshotsDialog.cs \
 	Gui/Dialog/SubCategoryTagsEditor.cs \
 	Gui/Dialog/TaggerDialog.cs \
diff --git a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Dialog.ShortcutsHelpDialog.cs b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Dialog.ShortcutsHelpDialog.cs
new file mode 100644
index 0000000..4c6dfac
--- /dev/null
+++ b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Dialog.ShortcutsHelpDialog.cs
@@ -0,0 +1,89 @@
+
+// This file has been generated by the GUI designer. Do not modify.
+namespace LongoMatch.Gui.Dialog
+{
+	public partial class ShortcutsHelpDialog
+	{
+		private global::Gtk.HBox hbox1;
+		private global::Gtk.VBox shortcutsvbox;
+		private global::Gtk.VBox desc_vbox;
+		private global::Gtk.Button buttonCancel;
+		private global::Gtk.Button buttonOk;
+		
+		protected virtual void Build ()
+		{
+			global::Stetic.Gui.Initialize (this);
+			// Widget LongoMatch.Gui.Dialog.ShortcutsHelpDialog
+			this.Name = "LongoMatch.Gui.Dialog.ShortcutsHelpDialog";
+			this.Icon = global::Gdk.Pixbuf.LoadFromResource ("logo.svg");
+			this.WindowPosition = ((global::Gtk.WindowPosition)(4));
+			this.Modal = true;
+			this.SkipPagerHint = true;
+			this.SkipTaskbarHint = true;
+			// Internal child LongoMatch.Gui.Dialog.ShortcutsHelpDialog.VBox
+			global::Gtk.VBox w1 = this.VBox;
+			w1.Name = "dialog1_VBox";
+			w1.BorderWidth = ((uint)(2));
+			// Container child dialog1_VBox.Gtk.Box+BoxChild
+			this.hbox1 = new global::Gtk.HBox ();
+			this.hbox1.Name = "hbox1";
+			this.hbox1.Spacing = 6;
+			// Container child hbox1.Gtk.Box+BoxChild
+			this.shortcutsvbox = new global::Gtk.VBox ();
+			this.shortcutsvbox.Name = "shortcutsvbox";
+			this.shortcutsvbox.Spacing = 6;
+			this.hbox1.Add (this.shortcutsvbox);
+			global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.shortcutsvbox]));
+			w2.Position = 0;
+			w2.Expand = false;
+			w2.Fill = false;
+			// Container child hbox1.Gtk.Box+BoxChild
+			this.desc_vbox = new global::Gtk.VBox ();
+			this.desc_vbox.Name = "desc_vbox";
+			this.desc_vbox.Spacing = 6;
+			this.hbox1.Add (this.desc_vbox);
+			global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.desc_vbox]));
+			w3.Position = 1;
+			w1.Add (this.hbox1);
+			global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(w1 [this.hbox1]));
+			w4.Position = 0;
+			// Internal child LongoMatch.Gui.Dialog.ShortcutsHelpDialog.ActionArea
+			global::Gtk.HButtonBox w5 = this.ActionArea;
+			w5.Name = "dialog1_ActionArea";
+			w5.Spacing = 10;
+			w5.BorderWidth = ((uint)(5));
+			w5.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4));
+			// Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
+			this.buttonCancel = new global::Gtk.Button ();
+			this.buttonCancel.CanDefault = true;
+			this.buttonCancel.CanFocus = true;
+			this.buttonCancel.Name = "buttonCancel";
+			this.buttonCancel.UseStock = true;
+			this.buttonCancel.UseUnderline = true;
+			this.buttonCancel.Label = "gtk-cancel";
+			this.AddActionWidget (this.buttonCancel, -6);
+			global::Gtk.ButtonBox.ButtonBoxChild w6 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w5 [this.buttonCancel]));
+			w6.Expand = false;
+			w6.Fill = false;
+			// Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
+			this.buttonOk = new global::Gtk.Button ();
+			this.buttonOk.CanDefault = true;
+			this.buttonOk.CanFocus = true;
+			this.buttonOk.Name = "buttonOk";
+			this.buttonOk.UseStock = true;
+			this.buttonOk.UseUnderline = true;
+			this.buttonOk.Label = "gtk-ok";
+			this.AddActionWidget (this.buttonOk, -5);
+			global::Gtk.ButtonBox.ButtonBoxChild w7 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w5 [this.buttonOk]));
+			w7.Position = 1;
+			w7.Expand = false;
+			w7.Fill = false;
+			if ((this.Child != null)) {
+				this.Child.ShowAll ();
+			}
+			this.DefaultWidth = 538;
+			this.DefaultHeight = 248;
+			this.Show ();
+		}
+	}
+}
diff --git a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.MainWindow.cs b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.MainWindow.cs
index 72d0dc4..b5e19ba 100644
--- a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.MainWindow.cs
+++ b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.MainWindow.cs
@@ -33,6 +33,7 @@ namespace LongoMatch.Gui
 		private global::Gtk.Action ExportProjectAction1;
 		private global::Gtk.Action Action;
 		private global::Gtk.Action ExportToProjectFileAction;
+		private global::Gtk.Action dialogInfoAction;
 		private global::Gtk.VBox vbox1;
 		private global::Gtk.VBox menubox;
 		private global::Gtk.MenuBar menubar1;
@@ -156,6 +157,9 @@ namespace LongoMatch.Gui
 			this.ExportToProjectFileAction = new global::Gtk.Action ("ExportToProjectFileAction", global::Mono.Unix.Catalog.GetString ("Export to project file"), null, null);
 			this.ExportToProjectFileAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Export to project file");
 			w1.Add (this.ExportToProjectFileAction, null);
+			this.dialogInfoAction = new global::Gtk.Action ("dialogInfoAction", global::Mono.Unix.Catalog.GetString ("Shortcuts"), null, "gtk-dialog-info");
+			this.dialogInfoAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Shortcuts");
+			w1.Add (this.dialogInfoAction, null);
 			this.UIManager.InsertActionGroup (w1, 0);
 			this.AddAccelGroup (this.UIManager.AccelGroup);
 			this.Name = "LongoMatch.Gui.MainWindow";
@@ -172,7 +176,7 @@ namespace LongoMatch.Gui
 			this.menubox.Name = "menubox";
 			this.menubox.Spacing = 6;
 			// Container child menubox.Gtk.Box+BoxChild
-			this.UIManager.AddUiFromString ("<ui><menubar name='menubar1'><menu name='FileAction' action='FileAction'><menuitem name='NewPojectAction' action='NewPojectAction'/><menuitem name='openAction' action='openAction'/><menuitem name='SaveProjectAction' action='SaveProjectAction'/><menuitem name='CloseProjectAction' action='CloseProjectAction'/><separator/><menuitem name='ImportProjectAction' action='ImportProjectAction'/><separator/><menuitem name='QuitAction' action='QuitAction'/></menu><menu name='ToolsAction' action='ToolsAction'><menuitem name='ProjectsManagerAction' action='ProjectsManagerAction'/><menuitem name='CategoriesTemplatesManagerAction' action='CategoriesTemplatesManagerAction'/><menuitem name='TeamsTemplatesManagerAction' action='TeamsTemplatesManagerAction'/><menu name='ExportProjectAction1' action='ExportProjectAction1'><menuitem name='ExportToProjectFileAction' action='ExportToProjectFileAction'/></menu></menu><menu name='ViewAction' action='ViewAction'><me
 nuitem name='FullScreenAction' action='FullScreenAction'/><menuitem name='HideAllWidgetsAction' action='HideAllWidgetsAction'/><separator/><menuitem name='PlaylistAction' action='PlaylistAction'/><separator/><menuitem name='TaggingViewAction' action='TaggingViewAction'/><menuitem name='ManualTaggingViewAction' action='ManualTaggingViewAction'/><menuitem name='TimelineViewAction' action='TimelineViewAction'/><menuitem name='GameUnitsViewAction' action='GameUnitsViewAction'/></menu><menu name='HelpAction' action='HelpAction'><menuitem name='AboutAction' action='AboutAction'/><menuitem name='HelpAction1' action='HelpAction1'/></menu></menubar></ui>");
+			this.UIManager.AddUiFromString ("<ui><menubar name='menubar1'><menu name='FileAction' action='FileAction'><menuitem name='NewPojectAction' action='NewPojectAction'/><menuitem name='openAction' action='openAction'/><menuitem name='SaveProjectAction' action='SaveProjectAction'/><menuitem name='CloseProjectAction' action='CloseProjectAction'/><separator/><menuitem name='ImportProjectAction' action='ImportProjectAction'/><separator/><menuitem name='QuitAction' action='QuitAction'/></menu><menu name='ToolsAction' action='ToolsAction'><menuitem name='ProjectsManagerAction' action='ProjectsManagerAction'/><menuitem name='CategoriesTemplatesManagerAction' action='CategoriesTemplatesManagerAction'/><menuitem name='TeamsTemplatesManagerAction' action='TeamsTemplatesManagerAction'/><menu name='ExportProjectAction1' action='ExportProjectAction1'><menuitem name='ExportToProjectFileAction' action='ExportToProjectFileAction'/></menu></menu><menu name='ViewAction' action='ViewAction'><me
 nuitem name='FullScreenAction' action='FullScreenAction'/><menuitem name='HideAllWidgetsAction' action='HideAllWidgetsAction'/><separator/><menuitem name='PlaylistAction' action='PlaylistAction'/><separator/><menuitem name='TaggingViewAction' action='TaggingViewAction'/><menuitem name='ManualTaggingViewAction' action='ManualTaggingViewAction'/><menuitem name='TimelineViewAction' action='TimelineViewAction'/><menuitem name='GameUnitsViewAction' action='GameUnitsViewAction'/></menu><menu name='HelpAction' action='HelpAction'><menuitem name='AboutAction' action='AboutAction'/><menuitem name='HelpAction1' action='HelpAction1'/><menuitem name='dialogInfoAction' action='dialogInfoAction'/></menu></menubar></ui>");
 			this.menubar1 = ((global::Gtk.MenuBar)(this.UIManager.GetWidget ("/menubar1")));
 			this.menubar1.Name = "menubar1";
 			this.menubox.Add (this.menubar1);
@@ -341,6 +345,7 @@ namespace LongoMatch.Gui
 			this.DrawingToolAction.Toggled += new global::System.EventHandler (this.OnDrawingToolActionToggled);
 			this.ManualTaggingViewAction.Toggled += new global::System.EventHandler (this.OnViewToggled);
 			this.GameUnitsViewAction.Toggled += new global::System.EventHandler (this.OnViewToggled);
+			this.dialogInfoAction.Activated += new global::System.EventHandler (this.OnDialogInfoActionActivated);
 			this.player.Error += new global::LongoMatch.Handlers.ErrorHandler (this.OnPlayerbin1Error);
 			this.player.SegmentClosedEvent += new global::LongoMatch.Handlers.SegmentClosedHandler (this.OnSegmentClosedEvent);
 			this.capturer.Error += new global::LongoMatch.Handlers.ErrorHandler (this.OnCapturerBinError);
diff --git a/LongoMatch.GUI/gtk-gui/gui.stetic b/LongoMatch.GUI/gtk-gui/gui.stetic
index d095a1b..7c36656 100644
--- a/LongoMatch.GUI/gtk-gui/gui.stetic
+++ b/LongoMatch.GUI/gtk-gui/gui.stetic
@@ -1797,6 +1797,13 @@
         <property name="Label" translatable="yes">Export to project file</property>
         <property name="ShortLabel" translatable="yes">Export to project file</property>
       </action>
+      <action id="dialogInfoAction">
+        <property name="Type">Action</property>
+        <property name="Label" translatable="yes">Shortcuts</property>
+        <property name="ShortLabel" translatable="yes">Shortcuts</property>
+        <property name="StockId">gtk-dialog-info</property>
+        <signal name="Activated" handler="OnDialogInfoActionActivated" />
+      </action>
     </action-group>
     <property name="MemberName" />
     <property name="Title" translatable="yes">LongoMatch</property>
@@ -1847,6 +1854,7 @@
                   <node type="Menu" action="HelpAction">
                     <node type="Menuitem" action="AboutAction" />
                     <node type="Menuitem" action="HelpAction1" />
+                    <node type="Menuitem" action="dialogInfoAction" />
                   </node>
                 </node>
               </widget>
@@ -6831,4 +6839,112 @@ Defining &lt;b&gt; Game Units &lt;/b&gt; will help you during the analysis to in
       </widget>
     </child>
   </widget>
+  <widget class="Gtk.Dialog" id="LongoMatch.Gui.Dialog.ShortcutsHelpDialog" design-size="538 248">
+    <property name="MemberName" />
+    <property name="Icon">resource:logo.svg</property>
+    <property name="WindowPosition">CenterOnParent</property>
+    <property name="Modal">True</property>
+    <property name="SkipPagerHint">True</property>
+    <property name="SkipTaskbarHint">True</property>
+    <property name="Buttons">2</property>
+    <property name="HelpButton">False</property>
+    <child internal-child="VBox">
+      <widget class="Gtk.VBox" id="dialog1_VBox">
+        <property name="MemberName" />
+        <property name="BorderWidth">2</property>
+        <child>
+          <widget class="Gtk.HBox" id="hbox1">
+            <property name="MemberName" />
+            <property name="Spacing">6</property>
+            <child>
+              <widget class="Gtk.VBox" id="shortcutsvbox">
+                <property name="MemberName" />
+                <property name="Spacing">6</property>
+                <child>
+                  <placeholder />
+                </child>
+                <child>
+                  <placeholder />
+                </child>
+                <child>
+                  <placeholder />
+                </child>
+              </widget>
+              <packing>
+                <property name="Position">0</property>
+                <property name="AutoSize">False</property>
+                <property name="Expand">False</property>
+                <property name="Fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="Gtk.VBox" id="desc_vbox">
+                <property name="MemberName" />
+                <property name="Spacing">6</property>
+                <child>
+                  <placeholder />
+                </child>
+                <child>
+                  <placeholder />
+                </child>
+                <child>
+                  <placeholder />
+                </child>
+              </widget>
+              <packing>
+                <property name="Position">1</property>
+                <property name="AutoSize">True</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="Position">0</property>
+            <property name="AutoSize">True</property>
+          </packing>
+        </child>
+      </widget>
+    </child>
+    <child internal-child="ActionArea">
+      <widget class="Gtk.HButtonBox" id="dialog1_ActionArea">
+        <property name="MemberName" />
+        <property name="Spacing">10</property>
+        <property name="BorderWidth">5</property>
+        <property name="Size">2</property>
+        <property name="LayoutStyle">End</property>
+        <child>
+          <widget class="Gtk.Button" id="buttonCancel">
+            <property name="MemberName" />
+            <property name="CanDefault">True</property>
+            <property name="CanFocus">True</property>
+            <property name="UseStock">True</property>
+            <property name="Type">StockItem</property>
+            <property name="StockId">gtk-cancel</property>
+            <property name="ResponseId">-6</property>
+            <property name="label">gtk-cancel</property>
+          </widget>
+          <packing>
+            <property name="Expand">False</property>
+            <property name="Fill">False</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="Gtk.Button" id="buttonOk">
+            <property name="MemberName" />
+            <property name="CanDefault">True</property>
+            <property name="CanFocus">True</property>
+            <property name="UseStock">True</property>
+            <property name="Type">StockItem</property>
+            <property name="StockId">gtk-ok</property>
+            <property name="ResponseId">-5</property>
+            <property name="label">gtk-ok</property>
+          </widget>
+          <packing>
+            <property name="Position">1</property>
+            <property name="Expand">False</property>
+            <property name="Fill">False</property>
+          </packing>
+        </child>
+      </widget>
+    </child>
+  </widget>
 </stetic-interface>
\ No newline at end of file



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