[longomatch] Added new dialog to prompt when closing a capture project



commit 354a8c7dcfc596c2f892635fa1120a4b11e6f758
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Sat Mar 13 13:21:44 2010 +0100

    Added new dialog to prompt when closing a capture project

 LongoMatch/Common/Enums.cs                         |    6 +
 LongoMatch/Gui/Dialog/EndCaptureDialog.cs          |   44 +++++
 LongoMatch/LongoMatch.mdp                          |    2 +
 LongoMatch/Makefile.am                             |    2 +
 .../LongoMatch.Gui.Dialog.EndCaptureDialog.cs      |  194 ++++++++++++++++++++
 LongoMatch/gtk-gui/gui.stetic                      |  152 +++++++++++++++
 6 files changed, 400 insertions(+), 0 deletions(-)
---
diff --git a/LongoMatch/Common/Enums.cs b/LongoMatch/Common/Enums.cs
index 72fe580..0911359 100644
--- a/LongoMatch/Common/Enums.cs
+++ b/LongoMatch/Common/Enums.cs
@@ -29,4 +29,10 @@ namespace LongoMatch.Common
 		EditProject,
 		None,
 	}
+	
+	public enum EndCaptureResponse {
+		Return = 234,
+		Quit = 235,
+		Save = 236
+	}
 }
diff --git a/LongoMatch/Gui/Dialog/EndCaptureDialog.cs b/LongoMatch/Gui/Dialog/EndCaptureDialog.cs
new file mode 100644
index 0000000..ae1b84d
--- /dev/null
+++ b/LongoMatch/Gui/Dialog/EndCaptureDialog.cs
@@ -0,0 +1,44 @@
+// 
+//  Copyright (C) 2010 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 LongoMatch.Common;
+
+namespace LongoMatch.Gui.Dialog
+{
+	
+	
+	public partial class EndCaptureDialog : Gtk.Dialog
+	{
+		
+		public EndCaptureDialog()
+		{
+			this.Build();
+		}
+
+		protected virtual void OnQuit (object sender, System.EventArgs e)
+		{
+			if (sender == quitbutton)
+				Respond((int)EndCaptureResponse.Quit);
+			else if (sender == savebutton)
+				Respond((int)EndCaptureResponse.Save);
+			else
+				Respond((int)EndCaptureResponse.Return);
+		}
+	}
+}
diff --git a/LongoMatch/LongoMatch.mdp b/LongoMatch/LongoMatch.mdp
index 4870500..6a8da4f 100644
--- a/LongoMatch/LongoMatch.mdp
+++ b/LongoMatch/LongoMatch.mdp
@@ -179,6 +179,8 @@
     <File name="Common/Constants.cs" subtype="Code" buildaction="Compile" />
     <File name="gtk-gui/LongoMatch.Gui.Dialog.ProjectSelectionDialog.cs" subtype="Code" buildaction="Compile" />
     <File name="Gui/Dialog/ProjectSelectionDialog.cs" subtype="Code" buildaction="Compile" />
+    <File name="Gui/Dialog/EndCaptureDialog.cs" subtype="Code" buildaction="Compile" />
+    <File name="gtk-gui/LongoMatch.Gui.Dialog.EndCaptureDialog.cs" subtype="Code" buildaction="Compile" />
   </Contents>
   <References>
     <ProjectReference type="Gac" localcopy="True" refto="Mono.Posix, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" />
diff --git a/LongoMatch/Makefile.am b/LongoMatch/Makefile.am
index f3f87ad..c37191e 100644
--- a/LongoMatch/Makefile.am
+++ b/LongoMatch/Makefile.am
@@ -121,6 +121,7 @@ FILES = \
 	gtk-gui/LongoMatch.Gui.Dialog.DrawingTool.cs \
 	gtk-gui/LongoMatch.Gui.Dialog.EditCategoryDialog.cs \
 	gtk-gui/LongoMatch.Gui.Dialog.EditPlayerDialog.cs \
+	gtk-gui/LongoMatch.Gui.Dialog.EndCaptureDialog.cs \
 	gtk-gui/LongoMatch.Gui.Dialog.EntryDialog.cs \
 	gtk-gui/LongoMatch.Gui.Dialog.FramesCaptureProgressDialog.cs \
 	gtk-gui/LongoMatch.Gui.Dialog.HotKeySelectorDialog.cs \
@@ -163,6 +164,7 @@ FILES = \
 	Gui/Dialog/DrawingTool.cs \
 	Gui/Dialog/EditCategoryDialog.cs \
 	Gui/Dialog/EditPlayerDialog.cs \
+	Gui/Dialog/EndCaptureDialog.cs \
 	Gui/Dialog/EntryDialog.cs \
 	Gui/Dialog/FramesCaptureProgressDialog.cs \
 	Gui/Dialog/HotKeySelectorDialog.cs \
diff --git a/LongoMatch/gtk-gui/LongoMatch.Gui.Dialog.EndCaptureDialog.cs b/LongoMatch/gtk-gui/LongoMatch.Gui.Dialog.EndCaptureDialog.cs
new file mode 100644
index 0000000..e9dec90
--- /dev/null
+++ b/LongoMatch/gtk-gui/LongoMatch.Gui.Dialog.EndCaptureDialog.cs
@@ -0,0 +1,194 @@
+// ------------------------------------------------------------------------------
+//  <autogenerated>
+//      This code was generated by a tool.
+//      
+// 
+//      Changes to this file may cause incorrect behavior and will be lost if 
+//      the code is regenerated.
+//  </autogenerated>
+// ------------------------------------------------------------------------------
+
+namespace LongoMatch.Gui.Dialog {
+    
+    
+    public partial class EndCaptureDialog {
+        
+        private Gtk.VBox vbox2;
+        
+        private Gtk.HBox hbox2;
+        
+        private Gtk.Image image439;
+        
+        private Gtk.Label label1;
+        
+        private Gtk.HBox hbox3;
+        
+        private Gtk.Button returnbutton;
+        
+        private Gtk.Button quitbutton;
+        
+        private Gtk.Button savebutton;
+        
+        private Gtk.Button buttonCancel;
+        
+        protected virtual void Build() {
+            Stetic.Gui.Initialize(this);
+            // Widget LongoMatch.Gui.Dialog.EndCaptureDialog
+            this.Name = "LongoMatch.Gui.Dialog.EndCaptureDialog";
+            this.Title = "";
+            this.Icon = Stetic.IconLoader.LoadIcon(this, "longomatch", Gtk.IconSize.Menu, 16);
+            this.WindowPosition = ((Gtk.WindowPosition)(4));
+            this.Modal = true;
+            this.HasSeparator = false;
+            // Internal child LongoMatch.Gui.Dialog.EndCaptureDialog.VBox
+            Gtk.VBox w1 = this.VBox;
+            w1.Name = "dialog1_VBox";
+            w1.BorderWidth = ((uint)(2));
+            // Container child dialog1_VBox.Gtk.Box+BoxChild
+            this.vbox2 = new Gtk.VBox();
+            this.vbox2.Name = "vbox2";
+            this.vbox2.Spacing = 6;
+            // Container child vbox2.Gtk.Box+BoxChild
+            this.hbox2 = new Gtk.HBox();
+            this.hbox2.Name = "hbox2";
+            this.hbox2.Spacing = 6;
+            // Container child hbox2.Gtk.Box+BoxChild
+            this.image439 = new Gtk.Image();
+            this.image439.Name = "image439";
+            this.image439.Pixbuf = Stetic.IconLoader.LoadIcon(this, "stock_dialog-question", Gtk.IconSize.Dialog, 48);
+            this.hbox2.Add(this.image439);
+            Gtk.Box.BoxChild w2 = ((Gtk.Box.BoxChild)(this.hbox2[this.image439]));
+            w2.Position = 0;
+            w2.Expand = false;
+            w2.Fill = false;
+            // Container child hbox2.Gtk.Box+BoxChild
+            this.label1 = new Gtk.Label();
+            this.label1.Name = "label1";
+            this.label1.LabelProp = Mono.Unix.Catalog.GetString("A capture project is actually running.\nYou can continue with the current capture, cancel it or save your project. \n\n<b>Warning: If you cancel the current project all your changes will be lost.</b>");
+            this.label1.UseMarkup = true;
+            this.label1.Justify = ((Gtk.Justification)(2));
+            this.hbox2.Add(this.label1);
+            Gtk.Box.BoxChild w3 = ((Gtk.Box.BoxChild)(this.hbox2[this.label1]));
+            w3.Position = 1;
+            this.vbox2.Add(this.hbox2);
+            Gtk.Box.BoxChild w4 = ((Gtk.Box.BoxChild)(this.vbox2[this.hbox2]));
+            w4.Position = 0;
+            // Container child vbox2.Gtk.Box+BoxChild
+            this.hbox3 = new Gtk.HBox();
+            this.hbox3.Name = "hbox3";
+            this.hbox3.Spacing = 6;
+            // Container child hbox3.Gtk.Box+BoxChild
+            this.returnbutton = new Gtk.Button();
+            this.returnbutton.CanFocus = true;
+            this.returnbutton.Name = "returnbutton";
+            this.returnbutton.UseUnderline = true;
+            // Container child returnbutton.Gtk.Container+ContainerChild
+            Gtk.Alignment w5 = new Gtk.Alignment(0.5F, 0.5F, 0F, 0F);
+            // Container child GtkAlignment.Gtk.Container+ContainerChild
+            Gtk.HBox w6 = new Gtk.HBox();
+            w6.Spacing = 2;
+            // Container child GtkHBox.Gtk.Container+ContainerChild
+            Gtk.Image w7 = new Gtk.Image();
+            w7.Pixbuf = Stetic.IconLoader.LoadIcon(this, "gtk-undo", Gtk.IconSize.Button, 20);
+            w6.Add(w7);
+            // Container child GtkHBox.Gtk.Container+ContainerChild
+            Gtk.Label w9 = new Gtk.Label();
+            w9.LabelProp = Mono.Unix.Catalog.GetString("Return");
+            w9.UseUnderline = true;
+            w6.Add(w9);
+            w5.Add(w6);
+            this.returnbutton.Add(w5);
+            this.hbox3.Add(this.returnbutton);
+            Gtk.Box.BoxChild w13 = ((Gtk.Box.BoxChild)(this.hbox3[this.returnbutton]));
+            w13.Position = 0;
+            w13.Fill = false;
+            // Container child hbox3.Gtk.Box+BoxChild
+            this.quitbutton = new Gtk.Button();
+            this.quitbutton.CanFocus = true;
+            this.quitbutton.Name = "quitbutton";
+            this.quitbutton.UseUnderline = true;
+            // Container child quitbutton.Gtk.Container+ContainerChild
+            Gtk.Alignment w14 = new Gtk.Alignment(0.5F, 0.5F, 0F, 0F);
+            // Container child GtkAlignment1.Gtk.Container+ContainerChild
+            Gtk.HBox w15 = new Gtk.HBox();
+            w15.Spacing = 2;
+            // Container child GtkHBox1.Gtk.Container+ContainerChild
+            Gtk.Image w16 = new Gtk.Image();
+            w16.Pixbuf = Stetic.IconLoader.LoadIcon(this, "gtk-cancel", Gtk.IconSize.Button, 20);
+            w15.Add(w16);
+            // Container child GtkHBox1.Gtk.Container+ContainerChild
+            Gtk.Label w18 = new Gtk.Label();
+            w18.LabelProp = Mono.Unix.Catalog.GetString("Cancel capture");
+            w18.UseUnderline = true;
+            w15.Add(w18);
+            w14.Add(w15);
+            this.quitbutton.Add(w14);
+            this.hbox3.Add(this.quitbutton);
+            Gtk.Box.BoxChild w22 = ((Gtk.Box.BoxChild)(this.hbox3[this.quitbutton]));
+            w22.Position = 1;
+            w22.Fill = false;
+            // Container child hbox3.Gtk.Box+BoxChild
+            this.savebutton = new Gtk.Button();
+            this.savebutton.CanFocus = true;
+            this.savebutton.Name = "savebutton";
+            this.savebutton.UseUnderline = true;
+            // Container child savebutton.Gtk.Container+ContainerChild
+            Gtk.Alignment w23 = new Gtk.Alignment(0.5F, 0.5F, 0F, 0F);
+            // Container child GtkAlignment2.Gtk.Container+ContainerChild
+            Gtk.HBox w24 = new Gtk.HBox();
+            w24.Spacing = 2;
+            // Container child GtkHBox2.Gtk.Container+ContainerChild
+            Gtk.Image w25 = new Gtk.Image();
+            w25.Pixbuf = Stetic.IconLoader.LoadIcon(this, "gtk-save", Gtk.IconSize.Button, 20);
+            w24.Add(w25);
+            // Container child GtkHBox2.Gtk.Container+ContainerChild
+            Gtk.Label w27 = new Gtk.Label();
+            w27.LabelProp = Mono.Unix.Catalog.GetString("Stop capture and save project");
+            w27.UseUnderline = true;
+            w24.Add(w27);
+            w23.Add(w24);
+            this.savebutton.Add(w23);
+            this.hbox3.Add(this.savebutton);
+            Gtk.Box.BoxChild w31 = ((Gtk.Box.BoxChild)(this.hbox3[this.savebutton]));
+            w31.Position = 2;
+            w31.Fill = false;
+            this.vbox2.Add(this.hbox3);
+            Gtk.Box.BoxChild w32 = ((Gtk.Box.BoxChild)(this.vbox2[this.hbox3]));
+            w32.Position = 1;
+            w32.Expand = false;
+            w32.Fill = false;
+            w1.Add(this.vbox2);
+            Gtk.Box.BoxChild w33 = ((Gtk.Box.BoxChild)(w1[this.vbox2]));
+            w33.Position = 0;
+            // Internal child LongoMatch.Gui.Dialog.EndCaptureDialog.ActionArea
+            Gtk.HButtonBox w34 = this.ActionArea;
+            w34.Sensitive = false;
+            w34.Name = "dialog1_ActionArea";
+            w34.Spacing = 6;
+            w34.BorderWidth = ((uint)(5));
+            w34.LayoutStyle = ((Gtk.ButtonBoxStyle)(4));
+            // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
+            this.buttonCancel = new 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);
+            Gtk.ButtonBox.ButtonBoxChild w35 = ((Gtk.ButtonBox.ButtonBoxChild)(w34[this.buttonCancel]));
+            w35.Expand = false;
+            w35.Fill = false;
+            if ((this.Child != null)) {
+                this.Child.ShowAll();
+            }
+            this.DefaultWidth = 517;
+            this.DefaultHeight = 175;
+            w34.Hide();
+            this.Show();
+            this.returnbutton.Clicked += new System.EventHandler(this.OnQuit);
+            this.quitbutton.Clicked += new System.EventHandler(this.OnQuit);
+            this.savebutton.Clicked += new System.EventHandler(this.OnQuit);
+        }
+    }
+}
diff --git a/LongoMatch/gtk-gui/gui.stetic b/LongoMatch/gtk-gui/gui.stetic
index 1935049..f7e7e5d 100644
--- a/LongoMatch/gtk-gui/gui.stetic
+++ b/LongoMatch/gtk-gui/gui.stetic
@@ -5368,9 +5368,11 @@ You can add new tags using the text entry and clicking "Add Tag"</property>
                     <property name="MemberName" />
                     <property name="CanFocus">True</property>
                     <property name="Label" translatable="yes" />
+                    <property name="Active">True</property>
                     <property name="DrawIndicator">True</property>
                     <property name="HasLabel">False</property>
                     <property name="UseUnderline">True</property>
+                    <property name="FocusOnClick">False</property>
                     <property name="Group">project</property>
                     <child>
                       <placeholder />
@@ -5498,4 +5500,154 @@ You can add new tags using the text entry and clicking "Add Tag"</property>
       </widget>
     </child>
   </widget>
+  <widget class="Gtk.Dialog" id="LongoMatch.Gui.Dialog.EndCaptureDialog" design-size="517 175">
+    <property name="MemberName" />
+    <property name="Title" translatable="yes" />
+    <property name="Icon">stock:longomatch Menu</property>
+    <property name="WindowPosition">CenterOnParent</property>
+    <property name="Modal">True</property>
+    <property name="Buttons">1</property>
+    <property name="HelpButton">False</property>
+    <property name="HasSeparator">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.VBox" id="vbox2">
+            <property name="MemberName" />
+            <property name="Spacing">6</property>
+            <child>
+              <widget class="Gtk.HBox" id="hbox2">
+                <property name="MemberName" />
+                <property name="Spacing">6</property>
+                <child>
+                  <widget class="Gtk.Image" id="image439">
+                    <property name="MemberName" />
+                    <property name="Pixbuf">stock:stock_dialog-question Dialog</property>
+                  </widget>
+                  <packing>
+                    <property name="Position">0</property>
+                    <property name="AutoSize">True</property>
+                    <property name="Expand">False</property>
+                    <property name="Fill">False</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="Gtk.Label" id="label1">
+                    <property name="MemberName" />
+                    <property name="LabelProp" translatable="yes">A capture project is actually running.
+You can continue with the current capture, cancel it or save your project. 
+
+&lt;b&gt;Warning: If you cancel the current project all your changes will be lost.&lt;/b&gt;</property>
+                    <property name="UseMarkup">True</property>
+                    <property name="Justify">Center</property>
+                  </widget>
+                  <packing>
+                    <property name="Position">1</property>
+                    <property name="AutoSize">False</property>
+                  </packing>
+                </child>
+              </widget>
+              <packing>
+                <property name="Position">0</property>
+                <property name="AutoSize">False</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="Gtk.HBox" id="hbox3">
+                <property name="MemberName" />
+                <property name="Spacing">6</property>
+                <child>
+                  <widget class="Gtk.Button" id="returnbutton">
+                    <property name="MemberName" />
+                    <property name="CanFocus">True</property>
+                    <property name="Type">TextAndIcon</property>
+                    <property name="Icon">stock:gtk-undo Button</property>
+                    <property name="Label" translatable="yes">Return</property>
+                    <property name="UseUnderline">True</property>
+                    <signal name="Clicked" handler="OnQuit" />
+                  </widget>
+                  <packing>
+                    <property name="Position">0</property>
+                    <property name="AutoSize">False</property>
+                    <property name="Fill">False</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="Gtk.Button" id="quitbutton">
+                    <property name="MemberName" />
+                    <property name="CanFocus">True</property>
+                    <property name="Type">TextAndIcon</property>
+                    <property name="Icon">stock:gtk-cancel Button</property>
+                    <property name="Label" translatable="yes">Cancel capture</property>
+                    <property name="UseUnderline">True</property>
+                    <signal name="Clicked" handler="OnQuit" />
+                  </widget>
+                  <packing>
+                    <property name="Position">1</property>
+                    <property name="AutoSize">False</property>
+                    <property name="Fill">False</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="Gtk.Button" id="savebutton">
+                    <property name="MemberName" />
+                    <property name="CanFocus">True</property>
+                    <property name="Type">TextAndIcon</property>
+                    <property name="Icon">stock:gtk-save Button</property>
+                    <property name="Label" translatable="yes">Stop capture and save project</property>
+                    <property name="UseUnderline">True</property>
+                    <signal name="Clicked" handler="OnQuit" />
+                  </widget>
+                  <packing>
+                    <property name="Position">2</property>
+                    <property name="AutoSize">False</property>
+                    <property name="Fill">False</property>
+                  </packing>
+                </child>
+              </widget>
+              <packing>
+                <property name="Position">1</property>
+                <property name="AutoSize">True</property>
+                <property name="Expand">False</property>
+                <property name="Fill">False</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="Position">0</property>
+            <property name="AutoSize">False</property>
+          </packing>
+        </child>
+      </widget>
+    </child>
+    <child internal-child="ActionArea">
+      <widget class="Gtk.HButtonBox" id="dialog1_ActionArea">
+        <property name="MemberName" />
+        <property name="Visible">False</property>
+        <property name="Sensitive">False</property>
+        <property name="Spacing">6</property>
+        <property name="BorderWidth">5</property>
+        <property name="Size">1</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>
+      </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]