gnome-subtitles r1063 - in trunk: . src/Glade src/GnomeSubtitles/Core src/GnomeSubtitles/Dialog



Author: pcastro
Date: Sat Oct  4 23:15:38 2008
New Revision: 1063
URL: http://svn.gnome.org/viewvc/gnome-subtitles?rev=1063&view=rev

Log:
Introduction of the Synchronize dialog (nonfunctional ATM).

Added:
   trunk/src/Glade/TimingsSynchronizeDialog.glade
   trunk/src/GnomeSubtitles/Dialog/TimingsSynchronizeDialog.cs
Modified:
   trunk/gnome-subtitles.mdp
   trunk/src/GnomeSubtitles/Core/EventHandlers.cs
   trunk/src/GnomeSubtitles/Dialog/Dialogs.cs

Modified: trunk/gnome-subtitles.mdp
==============================================================================
--- trunk/gnome-subtitles.mdp	(original)
+++ trunk/gnome-subtitles.mdp	Sat Oct  4 23:15:38 2008
@@ -134,6 +134,8 @@
     <File name="src/GnomeSubtitles/Dialog/BasicErrorDialog.cs" subtype="Code" buildaction="Compile" />
     <File name="src/GnomeSubtitles/Dialog/VideoSeekToDialog.cs" subtype="Code" buildaction="Compile" />
     <File name="src/Glade/VideoSeekToDialog.glade" subtype="Code" buildaction="EmbedAsResource" />
+    <File name="src/GnomeSubtitles/Dialog/TimingsSynchronizeDialog.cs" subtype="Code" buildaction="Compile" />
+    <File name="src/Glade/TimingsSynchronizeDialog.glade" subtype="Code" buildaction="EmbedAsResource" />
   </Contents>
   <References>
     <ProjectReference type="Gac" localcopy="True" refto="gtk-sharp, Version=2.8.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />

Added: trunk/src/Glade/TimingsSynchronizeDialog.glade
==============================================================================
--- (empty file)
+++ trunk/src/Glade/TimingsSynchronizeDialog.glade	Sat Oct  4 23:15:38 2008
@@ -0,0 +1,147 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
+<!--Generated with glade3 3.4.5 on Sat Oct  4 21:44:06 2008 -->
+<glade-interface>
+  <widget class="GtkDialog" id="dialog">
+    <property name="border_width">5</property>
+    <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
+    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+    <property name="has_separator">False</property>
+    <child internal-child="vbox">
+      <widget class="GtkVBox" id="dialogVBox">
+        <property name="visible">True</property>
+        <property name="spacing">2</property>
+        <child>
+          <widget class="GtkVBox" id="vbox1">
+            <property name="visible">True</property>
+            <property name="spacing">5</property>
+            <child>
+              <widget class="GtkLabel" id="label2">
+                <property name="visible">True</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">Add sync points by selecting a subtitle and setting the video to its correct position.</property>
+                <property name="wrap">True</property>
+              </widget>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkTreeView" id="treeview1">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="headers_clickable">True</property>
+              </widget>
+              <packing>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkHBox" id="hbox1">
+                <property name="visible">True</property>
+                <child>
+                  <widget class="GtkButton" id="button1">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">True</property>
+                    <property name="response_id">0</property>
+                    <child>
+                      <widget class="GtkHBox" id="hbox2">
+                        <property name="visible">True</property>
+                        <child>
+                          <widget class="GtkImage" id="image1">
+                            <property name="visible">True</property>
+                            <property name="stock">gtk-add</property>
+                          </widget>
+                        </child>
+                        <child>
+                          <widget class="GtkLabel" id="label1">
+                            <property name="visible">True</property>
+                            <property name="label" translatable="yes">Add from video</property>
+                          </widget>
+                          <packing>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                      </widget>
+                    </child>
+                  </widget>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkButton" id="button2">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">True</property>
+                    <property name="label" translatable="yes">gtk-remove</property>
+                    <property name="use_stock">True</property>
+                    <property name="response_id">0</property>
+                  </widget>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                    <property name="pack_type">GTK_PACK_END</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+              </widget>
+              <packing>
+                <property name="pack_type">GTK_PACK_END</property>
+                <property name="position">2</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child internal-child="action_area">
+          <widget class="GtkHButtonBox" id="dialog-action_area1">
+            <property name="visible">True</property>
+            <property name="layout_style">GTK_BUTTONBOX_END</property>
+            <child>
+              <widget class="GtkButton" id="button3">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="label" translatable="yes">gtk-cancel</property>
+                <property name="use_stock">True</property>
+                <property name="response_id">0</property>
+              </widget>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkButton" id="button4">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="label" translatable="yes">gtk-ok</property>
+                <property name="use_stock">True</property>
+                <property name="response_id">0</property>
+              </widget>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="pack_type">GTK_PACK_END</property>
+          </packing>
+        </child>
+      </widget>
+    </child>
+  </widget>
+</glade-interface>

Modified: trunk/src/GnomeSubtitles/Core/EventHandlers.cs
==============================================================================
--- trunk/src/GnomeSubtitles/Core/EventHandlers.cs	(original)
+++ trunk/src/GnomeSubtitles/Core/EventHandlers.cs	Sat Oct  4 23:15:38 2008
@@ -217,6 +217,10 @@
 		Base.Dialogs.TimingsShiftDialog.Show();
 	}
 	
+	public void OnTimingsSynchronize (object o, EventArgs args) {
+		Base.Dialogs.TimingsSynchronizeDialog.Show();
+	}
+	
 	
 	/* Video Menu */
 		

Modified: trunk/src/GnomeSubtitles/Dialog/Dialogs.cs
==============================================================================
--- trunk/src/GnomeSubtitles/Dialog/Dialogs.cs	(original)
+++ trunk/src/GnomeSubtitles/Dialog/Dialogs.cs	Sat Oct  4 23:15:38 2008
@@ -26,6 +26,7 @@
 	private FileSaveAsDialog translationSaveAsDialog = null;
 	private SearchDialog searchDialog = null;
 	private TimingsShiftDialog timingsShiftDialog = null;
+	private TimingsSynchronizeDialog timingsSynchronizeDialog = null;
 	
 	public FileSaveAsDialog FileSaveAsDialog {
 		get {
@@ -63,6 +64,14 @@
 		}
 	}
 
+	public TimingsSynchronizeDialog TimingsSynchronizeDialog {
+		get {
+			if (timingsSynchronizeDialog == null)
+				timingsSynchronizeDialog = new TimingsSynchronizeDialog();
+			
+			return timingsSynchronizeDialog;		
+		}
+	}
 
 
 

Added: trunk/src/GnomeSubtitles/Dialog/TimingsSynchronizeDialog.cs
==============================================================================
--- (empty file)
+++ trunk/src/GnomeSubtitles/Dialog/TimingsSynchronizeDialog.cs	Sat Oct  4 23:15:38 2008
@@ -0,0 +1,57 @@
+/*
+ * This file is part of Gnome Subtitles.
+ * Copyright (C) 2008 Pedro Castro
+ *
+ * Gnome Subtitles 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.
+ *
+ * Gnome Subtitles 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 Gtk;
+
+namespace GnomeSubtitles.Dialog {
+
+
+public class TimingsSynchronizeDialog : GladeDialog {
+	
+	/* Constant strings */
+	private const string gladeFilename = "TimingsSynchronizeDialog.glade";
+	
+	/* Widgets */
+
+	public TimingsSynchronizeDialog () : base(gladeFilename){
+	
+	}
+	
+	
+	private void OnResponse (object o, ResponseArgs args) {
+		/*if (args.ResponseId == ResponseType.Ok) {
+			SelectionIntended selectionIntended = (allSubtitlesRadioButton.Active ? SelectionIntended.All : SelectionIntended.Range);
+			
+			if (timingMode == TimingMode.Times) {
+				TimeSpan firstTime = TimeSpan.Parse(firstSubtitleNewStartSpinButton.Text);
+				TimeSpan lastTime = TimeSpan.Parse(lastSubtitleNewStartSpinButton.Text);
+				Base.CommandManager.Execute(new AdjustTimingsCommand(firstTime, lastTime, selectionIntended));
+			}
+			else {
+				int firstFrame = (int)firstSubtitleNewStartSpinButton.Value;
+				int lastFrame = (int)lastSubtitleNewStartSpinButton.Value;
+				Base.CommandManager.Execute(new AdjustTimingsCommand(firstFrame, lastFrame, selectionIntended));
+			}
+		}*/
+		Close();
+	}
+
+}
+
+}



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