[gnome-subtitles/gtk3] Headers Dialog bugfixing and updating to gtk3



commit 6a13af7670dcd0fcfbfe9c804a8708c7cf2551f3
Author: Pedro Castro <pedro gnomesubtitles org>
Date:   Sat Dec 2 12:17:46 2017 +0000

    Headers Dialog bugfixing and updating to gtk3
    
    Headers Dialog wasn't correctly syncing headers that are used in
    multiple subtitle formats, and also wasn't applying changes correctly
    when closing the dialog.
    Updated to gtk3.

 gnome-subtitles.csproj                             |    1 -
 src/Glade/{ => old.glade}/HeadersDialog.glade      |    0
 .../HeadersDialog.ui}                              |  824 +++++++++++---------
 src/GnomeSubtitles/Dialog/HeadersDialog.cs         |  428 ++++++-----
 src/SubLib/Core/Domain/Headers.cs                  |  330 ++------
 src/SubLib/Core/Domain/SubtitleHeaders.cs          |  536 -------------
 src/SubLib/IO/Input/SubtitleParser.cs              |   59 +-
 .../SubtitleFormatKaraokeLyricsLRC.cs              |    6 +-
 .../SubtitleFormatKaraokeLyricsVKT.cs              |    4 +-
 .../IO/SubtitleFormats/SubtitleFormatMPSub.cs      |    9 +-
 .../SubtitleFormatSubStationAlpha.cs               |  130 ++--
 .../IO/SubtitleFormats/SubtitleFormatSubViewer1.cs |    6 +-
 .../IO/SubtitleFormats/SubtitleFormatSubViewer2.cs |   10 +-
 13 files changed, 859 insertions(+), 1484 deletions(-)
---
diff --git a/gnome-subtitles.csproj b/gnome-subtitles.csproj
index e5d13e1..1a2a669 100644
--- a/gnome-subtitles.csproj
+++ b/gnome-subtitles.csproj
@@ -254,7 +254,6 @@
     <Compile Include="src\SubLib\Core\Domain\Subtitle.cs" />
     <Compile Include="src\SubLib\Core\Domain\SubtitleCollection.cs" />
     <Compile Include="src\SubLib\Core\Domain\SubtitleConstants.cs" />
-    <Compile Include="src\SubLib\Core\Domain\SubtitleHeaders.cs" />
     <Compile Include="src\SubLib\Core\Domain\SubtitleProperties.cs" />
     <Compile Include="src\SubLib\Core\Domain\SubtitleText.cs" />
     <Compile Include="src\SubLib\Core\Domain\SubtitleTypeInfo.cs" />
diff --git a/src/Glade/HeadersDialog.glade b/src/Glade/old.glade/HeadersDialog.glade
similarity index 100%
copy from src/Glade/HeadersDialog.glade
copy to src/Glade/old.glade/HeadersDialog.glade
diff --git a/src/Glade/HeadersDialog.glade b/src/Glade/old.glade/HeadersDialog.ui
similarity index 75%
rename from src/Glade/HeadersDialog.glade
rename to src/Glade/old.glade/HeadersDialog.ui
index 4019da0..0969e96 100644
--- a/src/Glade/HeadersDialog.glade
+++ b/src/Glade/old.glade/HeadersDialog.ui
@@ -1,8 +1,85 @@
 <?xml version="1.0"?>
-<glade-interface>
+<interface>
+  <object class="GtkAdjustment" id="adjustment1">
+    <property name="upper">10000</property>
+    <property name="lower">0</property>
+    <property name="page_increment">10</property>
+    <property name="step_increment">1</property>
+    <property name="page_size">0</property>
+    <property name="value">0</property>
+  </object>
+  <object class="GtkAdjustment" id="adjustment2">
+    <property name="upper">10000</property>
+    <property name="lower">0</property>
+    <property name="page_increment">10</property>
+    <property name="step_increment">1</property>
+    <property name="page_size">0</property>
+    <property name="value">0</property>
+  </object>
+  <object class="GtkAdjustment" id="adjustment3">
+    <property name="upper">10000</property>
+    <property name="lower">0</property>
+    <property name="page_increment">10</property>
+    <property name="step_increment">1</property>
+    <property name="page_size">0</property>
+    <property name="value">0</property>
+  </object>
+  <object class="GtkAdjustment" id="adjustment4">
+    <property name="upper">1000000</property>
+    <property name="lower">0</property>
+    <property name="page_increment">10</property>
+    <property name="step_increment">1</property>
+    <property name="page_size">0</property>
+    <property name="value">0</property>
+  </object>
+  <object class="GtkAdjustment" id="adjustment5">
+    <property name="upper">1000</property>
+    <property name="lower">0</property>
+    <property name="page_increment">10</property>
+    <property name="step_increment">1</property>
+    <property name="page_size">0</property>
+    <property name="value">0</property>
+  </object>
+  <object class="GtkAdjustment" id="adjustment6">
+    <property name="upper">100</property>
+    <property name="lower">1</property>
+    <property name="page_increment">10</property>
+    <property name="step_increment">1</property>
+    <property name="page_size">0</property>
+    <property name="value">1</property>
+  </object>
+  <object class="GtkAdjustment" id="adjustment7">
+    <property name="upper">1000</property>
+    <property name="lower">0</property>
+    <property name="page_increment">10</property>
+    <property name="step_increment">1</property>
+    <property name="page_size">0</property>
+    <property name="value">0</property>
+  </object>
+  <object class="GtkAdjustment" id="adjustment8">
+    <property name="upper">1000000</property>
+    <property name="lower">0</property>
+    <property name="page_increment">10</property>
+    <property name="step_increment">1</property>
+    <property name="page_size">0</property>
+    <property name="value">0</property>
+  </object>
+  <object class="GtkListStore" id="model1">
+    <columns>
+      <column type="gchararray"/>
+    </columns>
+    <data>
+      <row>
+        <col id="0" translatable="yes">Audio</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes">Video</col>
+      </row>
+    </data>
+  </object>
   <!-- interface-requires gtk+ 2.16 -->
   <!-- interface-naming-policy toplevel-contextual -->
-  <widget class="GtkDialog" id="dialog">
+  <object class="GtkDialog" id="dialog">
     <property name="width_request">600</property>
     <property name="height_request">515</property>
     <property name="title" translatable="yes">Headers</property>
@@ -14,17 +91,17 @@
     <property name="skip_pager_hint">True</property>
     <property name="has_separator">False</property>
     <child internal-child="vbox">
-      <widget class="GtkVBox" id="dialogVBox">
+      <object class="GtkVBox" id="dialogVBox">
         <property name="visible">True</property>
         <property name="orientation">vertical</property>
         <child>
-          <widget class="GtkNotebook" id="notebook">
+          <object class="GtkNotebook" id="notebook">
             <property name="visible">True</property>
             <property name="can_focus">True</property>
             <property name="border_width">6</property>
             <property name="tab_pos">left</property>
             <child>
-              <widget class="GtkTable" id="tableKaraokeLyricsLRC">
+              <object class="GtkTable" id="tableKaraokeLyricsLRC">
                 <property name="visible">True</property>
                 <property name="border_width">8</property>
                 <property name="n_rows">7</property>
@@ -32,198 +109,197 @@
                 <property name="column_spacing">6</property>
                 <property name="row_spacing">10</property>
                 <child>
-                  <widget class="GtkEntry" id="entryKaraokeLRCProgram">
+                  <object class="GtkEntry" id="entryKaraokeLRCProgram">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
-                  </widget>
+                  </object>
                   <packing>
                     <property name="left_attach">1</property>
                     <property name="right_attach">2</property>
                     <property name="top_attach">6</property>
                     <property name="bottom_attach">7</property>
-                    <property name="y_options"></property>
+                    <property name="y_options"/>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkEntry" id="entryKaraokeLRCVersion">
+                  <object class="GtkEntry" id="entryKaraokeLRCVersion">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
-                  </widget>
+                  </object>
                   <packing>
                     <property name="left_attach">1</property>
                     <property name="right_attach">2</property>
                     <property name="top_attach">5</property>
                     <property name="bottom_attach">6</property>
-                    <property name="y_options"></property>
+                    <property name="y_options"/>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkLabel" id="labelTitle">
+                  <object class="GtkLabel" id="labelTitle">
                     <property name="visible">True</property>
                     <property name="xalign">0</property>
                     <property name="label" translatable="yes">Title:</property>
-                  </widget>
+                  </object>
                   <packing>
                     <property name="x_options">GTK_FILL</property>
-                    <property name="y_options"></property>
+                    <property name="y_options"/>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkLabel" id="labelAuthor">
+                  <object class="GtkLabel" id="labelAuthor">
                     <property name="visible">True</property>
                     <property name="xalign">0</property>
                     <property name="label" translatable="yes">Author:</property>
-                  </widget>
+                  </object>
                   <packing>
                     <property name="top_attach">1</property>
                     <property name="bottom_attach">2</property>
                     <property name="x_options">GTK_FILL</property>
-                    <property name="y_options"></property>
+                    <property name="y_options"/>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkLabel" id="labelArtist">
+                  <object class="GtkLabel" id="labelArtist">
                     <property name="visible">True</property>
                     <property name="xalign">0</property>
                     <property name="label" translatable="yes">Artist:</property>
-                  </widget>
+                  </object>
                   <packing>
                     <property name="top_attach">2</property>
                     <property name="bottom_attach">3</property>
                     <property name="x_options">GTK_FILL</property>
-                    <property name="y_options"></property>
+                    <property name="y_options"/>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkLabel" id="labelAlbum">
+                  <object class="GtkLabel" id="labelAlbum">
                     <property name="visible">True</property>
                     <property name="xalign">0</property>
                     <property name="label" translatable="yes">Album:</property>
-                  </widget>
+                  </object>
                   <packing>
                     <property name="top_attach">3</property>
                     <property name="bottom_attach">4</property>
                     <property name="x_options">GTK_FILL</property>
-                    <property name="y_options"></property>
+                    <property name="y_options"/>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkLabel" id="labelMaker">
+                  <object class="GtkLabel" id="labelMaker">
                     <property name="visible">True</property>
                     <property name="xalign">0</property>
                     <property name="label" translatable="yes">By:</property>
-                  </widget>
+                  </object>
                   <packing>
                     <property name="top_attach">4</property>
                     <property name="bottom_attach">5</property>
                     <property name="x_options">GTK_FILL</property>
-                    <property name="y_options"></property>
+                    <property name="y_options"/>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkLabel" id="labelVersion">
+                  <object class="GtkLabel" id="labelVersion">
                     <property name="visible">True</property>
                     <property name="xalign">0</property>
                     <property name="label" translatable="yes">Version:</property>
-                  </widget>
+                  </object>
                   <packing>
                     <property name="top_attach">5</property>
                     <property name="bottom_attach">6</property>
                     <property name="x_options">GTK_FILL</property>
-                    <property name="y_options"></property>
+                    <property name="y_options"/>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkLabel" id="labelProgram">
+                  <object class="GtkLabel" id="labelProgram">
                     <property name="visible">True</property>
                     <property name="xalign">0</property>
                     <property name="label" translatable="yes">Program:</property>
-                  </widget>
+                  </object>
                   <packing>
                     <property name="top_attach">6</property>
                     <property name="bottom_attach">7</property>
                     <property name="x_options">GTK_FILL</property>
-                    <property name="y_options"></property>
+                    <property name="y_options"/>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkEntry" id="entryKaraokeLRCTitle">
+                  <object class="GtkEntry" id="entryKaraokeLRCTitle">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
-                  </widget>
+                  </object>
                   <packing>
                     <property name="left_attach">1</property>
                     <property name="right_attach">2</property>
-                    <property name="y_options"></property>
+                    <property name="y_options"/>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkEntry" id="entryKaraokeLRCAuthor">
+                  <object class="GtkEntry" id="entryKaraokeLRCAuthor">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
-                  </widget>
+                  </object>
                   <packing>
                     <property name="left_attach">1</property>
                     <property name="right_attach">2</property>
                     <property name="top_attach">1</property>
                     <property name="bottom_attach">2</property>
-                    <property name="y_options"></property>
+                    <property name="y_options"/>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkEntry" id="entryKaraokeLRCArtist">
+                  <object class="GtkEntry" id="entryKaraokeLRCArtist">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
-                  </widget>
+                  </object>
                   <packing>
                     <property name="left_attach">1</property>
                     <property name="right_attach">2</property>
                     <property name="top_attach">2</property>
                     <property name="bottom_attach">3</property>
-                    <property name="y_options"></property>
+                    <property name="y_options"/>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkEntry" id="entryKaraokeLRCAlbum">
+                  <object class="GtkEntry" id="entryKaraokeLRCAlbum">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
-                  </widget>
+                  </object>
                   <packing>
                     <property name="left_attach">1</property>
                     <property name="right_attach">2</property>
                     <property name="top_attach">3</property>
                     <property name="bottom_attach">4</property>
-                    <property name="y_options"></property>
+                    <property name="y_options"/>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkEntry" id="entryKaraokeLRCMaker">
+                  <object class="GtkEntry" id="entryKaraokeLRCMaker">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
-                  </widget>
+                  </object>
                   <packing>
                     <property name="left_attach">1</property>
                     <property name="right_attach">2</property>
                     <property name="top_attach">4</property>
                     <property name="bottom_attach">5</property>
-                    <property name="y_options"></property>
+                    <property name="y_options"/>
                   </packing>
                 </child>
-              </widget>
+              </object>
             </child>
-            <child>
-              <widget class="GtkLabel" id="labelKaraokeLyricsLRC">
+            <child type="tab">
+              <object class="GtkLabel" id="labelKaraokeLyricsLRC">
                 <property name="visible">True</property>
                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                 <property name="label" translatable="yes">Karaoke Lyrics LRC</property>
-              </widget>
+              </object>
               <packing>
                 <property name="tab_fill">False</property>
-                <property name="type">tab</property>
               </packing>
             </child>
             <child>
-              <widget class="GtkTable" id="tableKaraokeLyricsVKT">
+              <object class="GtkTable" id="tableKaraokeLyricsVKT">
                 <property name="visible">True</property>
                 <property name="border_width">8</property>
                 <property name="n_rows">4</property>
@@ -231,125 +307,121 @@
                 <property name="column_spacing">6</property>
                 <property name="row_spacing">10</property>
                 <child>
-                  <widget class="GtkLabel" id="labelSource">
+                  <object class="GtkLabel" id="labelSource">
                     <property name="visible">True</property>
                     <property name="xalign">0</property>
                     <property name="label" translatable="yes">Source:</property>
-                  </widget>
+                  </object>
                   <packing>
                     <property name="top_attach">1</property>
                     <property name="bottom_attach">2</property>
                     <property name="x_options">GTK_FILL</property>
-                    <property name="y_options"></property>
+                    <property name="y_options"/>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkLabel" id="labelAuthor1">
+                  <object class="GtkLabel" id="labelAuthor1">
                     <property name="visible">True</property>
                     <property name="xalign">0</property>
                     <property name="label" translatable="yes">Author:</property>
-                  </widget>
+                  </object>
                   <packing>
                     <property name="x_options">GTK_FILL</property>
-                    <property name="y_options"></property>
+                    <property name="y_options"/>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkLabel" id="labelDate">
+                  <object class="GtkLabel" id="labelDate">
                     <property name="visible">True</property>
                     <property name="xalign">0</property>
                     <property name="label" translatable="yes">Date:</property>
-                  </widget>
+                  </object>
                   <packing>
                     <property name="top_attach">2</property>
                     <property name="bottom_attach">3</property>
                     <property name="x_options">GTK_FILL</property>
-                    <property name="y_options"></property>
+                    <property name="y_options"/>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkEntry" id="entryKaraokeVKTSource">
+                  <object class="GtkEntry" id="entryKaraokeVKTSource">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="width_chars">12</property>
-                  </widget>
+                  </object>
                   <packing>
                     <property name="left_attach">1</property>
                     <property name="right_attach">2</property>
                     <property name="top_attach">1</property>
                     <property name="bottom_attach">2</property>
-                    <property name="y_options"></property>
+                    <property name="y_options"/>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkEntry" id="entryKaraokeVKTAuthor">
+                  <object class="GtkEntry" id="entryKaraokeVKTAuthor">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
-                  </widget>
+                  </object>
                   <packing>
                     <property name="left_attach">1</property>
                     <property name="right_attach">2</property>
-                    <property name="y_options"></property>
+                    <property name="y_options"/>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkEntry" id="entryKaraokeVKTDate">
+                  <object class="GtkEntry" id="entryKaraokeVKTDate">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
-                  </widget>
+                  </object>
                   <packing>
                     <property name="left_attach">1</property>
                     <property name="right_attach">2</property>
                     <property name="top_attach">2</property>
                     <property name="bottom_attach">3</property>
-                    <property name="y_options"></property>
+                    <property name="y_options"/>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkEntry" id="entryKaraokeVKTFrameRate">
+                  <object class="GtkEntry" id="entryKaraokeVKTFrameRate">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
-                  </widget>
+                  </object>
                   <packing>
                     <property name="left_attach">1</property>
                     <property name="right_attach">2</property>
                     <property name="top_attach">3</property>
                     <property name="bottom_attach">4</property>
-                    <property name="y_options"></property>
+                    <property name="y_options"/>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkLabel" id="labelFrameRate">
+                  <object class="GtkLabel" id="labelFrameRate">
                     <property name="visible">True</property>
                     <property name="xalign">0</property>
                     <property name="label" translatable="yes">Frame rate:</property>
-                  </widget>
+                  </object>
                   <packing>
                     <property name="top_attach">3</property>
                     <property name="bottom_attach">4</property>
                     <property name="x_options">GTK_FILL</property>
-                    <property name="y_options"></property>
+                    <property name="y_options"/>
                   </packing>
                 </child>
-              </widget>
-              <packing>
-                <property name="position">1</property>
-              </packing>
+              </object>
             </child>
-            <child>
-              <widget class="GtkLabel" id="labelKaraokeLyricsVKT">
+            <child type="tab">
+              <object class="GtkLabel" id="labelKaraokeLyricsVKT">
                 <property name="visible">True</property>
                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                 <property name="label" translatable="yes">Karaoke Lyrics VKT</property>
-              </widget>
+              </object>
               <packing>
                 <property name="position">1</property>
                 <property name="tab_fill">False</property>
-                <property name="type">tab</property>
               </packing>
             </child>
             <child>
-              <widget class="GtkTable" id="tableMPSub">
+              <object class="GtkTable" id="tableMPSub">
                 <property name="visible">True</property>
                 <property name="border_width">8</property>
                 <property name="n_rows">5</property>
@@ -357,133 +429,137 @@
                 <property name="column_spacing">6</property>
                 <property name="row_spacing">10</property>
                 <child>
-                  <widget class="GtkLabel" id="labelTitle1">
+                  <object class="GtkLabel" id="labelTitle1">
                     <property name="visible">True</property>
                     <property name="xalign">0</property>
                     <property name="label" translatable="yes">Title:</property>
-                  </widget>
+                  </object>
                   <packing>
                     <property name="x_options">GTK_FILL</property>
-                    <property name="y_options"></property>
+                    <property name="y_options"/>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkLabel" id="labelFile">
+                  <object class="GtkLabel" id="labelFile">
                     <property name="visible">True</property>
                     <property name="xalign">0</property>
                     <property name="label" translatable="yes">File:</property>
-                  </widget>
+                  </object>
                   <packing>
                     <property name="top_attach">1</property>
                     <property name="bottom_attach">2</property>
                     <property name="x_options">GTK_FILL</property>
-                    <property name="y_options"></property>
+                    <property name="y_options"/>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkLabel" id="labelAuthor2">
+                  <object class="GtkLabel" id="labelAuthor2">
                     <property name="visible">True</property>
                     <property name="xalign">0</property>
                     <property name="label" translatable="yes">Author:</property>
-                  </widget>
+                  </object>
                   <packing>
                     <property name="top_attach">2</property>
                     <property name="bottom_attach">3</property>
                     <property name="x_options">GTK_FILL</property>
-                    <property name="y_options"></property>
+                    <property name="y_options"/>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkEntry" id="entryMPSubTitle">
+                  <object class="GtkEntry" id="entryMPSubTitle">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="width_chars">12</property>
-                  </widget>
+                  </object>
                   <packing>
                     <property name="left_attach">1</property>
                     <property name="right_attach">2</property>
-                    <property name="y_options"></property>
+                    <property name="y_options"/>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkEntry" id="entryMPSubFile">
+                  <object class="GtkEntry" id="entryMPSubFile">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
-                  </widget>
+                  </object>
                   <packing>
                     <property name="left_attach">1</property>
                     <property name="right_attach">2</property>
                     <property name="top_attach">1</property>
                     <property name="bottom_attach">2</property>
-                    <property name="y_options"></property>
+                    <property name="y_options"/>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkEntry" id="entryMPSubAuthor">
+                  <object class="GtkEntry" id="entryMPSubAuthor">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
-                  </widget>
+                  </object>
                   <packing>
                     <property name="left_attach">1</property>
                     <property name="right_attach">2</property>
                     <property name="top_attach">2</property>
                     <property name="bottom_attach">3</property>
-                    <property name="y_options"></property>
+                    <property name="y_options"/>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkEntry" id="entryMPSubNote">
+                  <object class="GtkEntry" id="entryMPSubNote">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
-                  </widget>
+                  </object>
                   <packing>
                     <property name="left_attach">1</property>
                     <property name="right_attach">2</property>
                     <property name="top_attach">3</property>
                     <property name="bottom_attach">4</property>
-                    <property name="y_options"></property>
+                    <property name="y_options"/>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkLabel" id="labelNote">
+                  <object class="GtkLabel" id="labelNote">
                     <property name="visible">True</property>
                     <property name="xalign">0</property>
                     <property name="label" translatable="yes">Note:</property>
-                  </widget>
+                  </object>
                   <packing>
                     <property name="top_attach">3</property>
                     <property name="bottom_attach">4</property>
                     <property name="x_options">GTK_FILL</property>
-                    <property name="y_options"></property>
+                    <property name="y_options"/>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkLabel" id="labelType">
+                  <object class="GtkLabel" id="labelType">
                     <property name="visible">True</property>
                     <property name="xalign">0</property>
                     <property name="label" translatable="yes">Type:</property>
-                  </widget>
+                  </object>
                   <packing>
                     <property name="top_attach">4</property>
                     <property name="bottom_attach">5</property>
                     <property name="x_options">GTK_FILL</property>
-                    <property name="y_options"></property>
+                    <property name="y_options"/>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkAlignment" id="typeAlignment">
+                  <object class="GtkAlignment" id="typeAlignment">
                     <property name="visible">True</property>
                     <property name="xalign">0</property>
                     <property name="xscale">0</property>
                     <child>
-                      <widget class="GtkComboBox" id="comboBoxMPSubType">
+                      <object class="GtkComboBox" id="comboBoxMPSubType">
                         <property name="visible">True</property>
-                        <property name="items" translatable="yes">Audio
-Video
-</property>
-                      </widget>
+                        <property name="model">model1</property>
+                        <child>
+                          <object class="GtkCellRendererText" id="renderer1"/>
+                          <attributes>
+                            <attribute name="text">0</attribute>
+                          </attributes>
+                        </child>
+                      </object>
                     </child>
-                  </widget>
+                  </object>
                   <packing>
                     <property name="left_attach">1</property>
                     <property name="right_attach">2</property>
@@ -493,34 +569,30 @@ Video
                     <property name="y_options">GTK_FILL</property>
                   </packing>
                 </child>
-              </widget>
-              <packing>
-                <property name="position">2</property>
-              </packing>
+              </object>
             </child>
-            <child>
-              <widget class="GtkLabel" id="labelMPSub">
+            <child type="tab">
+              <object class="GtkLabel" id="labelMPSub">
                 <property name="visible">True</property>
                 <property name="label">MPSub</property>
-              </widget>
+              </object>
               <packing>
                 <property name="position">2</property>
                 <property name="tab_fill">False</property>
-                <property name="type">tab</property>
               </packing>
             </child>
             <child>
-              <widget class="GtkScrolledWindow" id="scrolledWindowSSAASS">
+              <object class="GtkScrolledWindow" id="scrolledWindowSSAASS">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="hscrollbar_policy">automatic</property>
                 <property name="vscrollbar_policy">automatic</property>
                 <child>
-                  <widget class="GtkViewport" id="viewportSSAASS">
+                  <object class="GtkViewport" id="viewportSSAASS">
                     <property name="visible">True</property>
                     <property name="shadow_type">none</property>
                     <child>
-                      <widget class="GtkTable" id="tableSSAASS">
+                      <object class="GtkTable" id="tableSSAASS">
                         <property name="visible">True</property>
                         <property name="border_width">8</property>
                         <property name="n_rows">12</property>
@@ -528,312 +600,312 @@ Video
                         <property name="column_spacing">6</property>
                         <property name="row_spacing">10</property>
                         <child>
-                          <widget class="GtkLabel" id="labelTitle2">
+                          <object class="GtkLabel" id="labelTitle2">
                             <property name="visible">True</property>
                             <property name="xalign">0</property>
                             <property name="label" translatable="yes">Title:</property>
-                          </widget>
+                          </object>
                           <packing>
                             <property name="x_options">GTK_FILL</property>
-                            <property name="y_options"></property>
+                            <property name="y_options"/>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkLabel" id="labelOriginalScript">
+                          <object class="GtkLabel" id="labelOriginalScript">
                             <property name="visible">True</property>
                             <property name="xalign">0</property>
                             <property name="label" translatable="yes">Original Script:</property>
-                          </widget>
+                          </object>
                           <packing>
                             <property name="top_attach">1</property>
                             <property name="bottom_attach">2</property>
                             <property name="x_options">GTK_FILL</property>
-                            <property name="y_options"></property>
+                            <property name="y_options"/>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkLabel" id="labelOriginalTranslation">
+                          <object class="GtkLabel" id="labelOriginalTranslation">
                             <property name="visible">True</property>
                             <property name="xalign">0</property>
                             <property name="label" translatable="yes">Original Translation:</property>
-                          </widget>
+                          </object>
                           <packing>
                             <property name="top_attach">2</property>
                             <property name="bottom_attach">3</property>
                             <property name="x_options">GTK_FILL</property>
-                            <property name="y_options"></property>
+                            <property name="y_options"/>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkLabel" id="labelOriginalEditing">
+                          <object class="GtkLabel" id="labelOriginalEditing">
                             <property name="visible">True</property>
                             <property name="xalign">0</property>
                             <property name="label" translatable="yes">Original Editing:</property>
-                          </widget>
+                          </object>
                           <packing>
                             <property name="top_attach">3</property>
                             <property name="bottom_attach">4</property>
                             <property name="x_options">GTK_FILL</property>
-                            <property name="y_options"></property>
+                            <property name="y_options"/>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkLabel" id="labelOriginalTiming">
+                          <object class="GtkLabel" id="labelOriginalTiming">
                             <property name="visible">True</property>
                             <property name="xalign">0</property>
                             <property name="label" translatable="yes">Original Timing:</property>
-                          </widget>
+                          </object>
                           <packing>
                             <property name="top_attach">4</property>
                             <property name="bottom_attach">5</property>
                             <property name="x_options">GTK_FILL</property>
-                            <property name="y_options"></property>
+                            <property name="y_options"/>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkLabel" id="labelOriginalScriptChecking">
+                          <object class="GtkLabel" id="labelOriginalScriptChecking">
                             <property name="visible">True</property>
                             <property name="xalign">0</property>
                             <property name="label" translatable="yes">Original Script Checking:</property>
-                          </widget>
+                          </object>
                           <packing>
                             <property name="top_attach">5</property>
                             <property name="bottom_attach">6</property>
                             <property name="x_options">GTK_FILL</property>
-                            <property name="y_options"></property>
+                            <property name="y_options"/>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkLabel" id="labelScriptUpdatedBy">
+                          <object class="GtkLabel" id="labelScriptUpdatedBy">
                             <property name="visible">True</property>
                             <property name="xalign">0</property>
                             <property name="label" translatable="yes">Script Updated By:</property>
-                          </widget>
+                          </object>
                           <packing>
                             <property name="top_attach">6</property>
                             <property name="bottom_attach">7</property>
                             <property name="x_options">GTK_FILL</property>
-                            <property name="y_options"></property>
+                            <property name="y_options"/>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkLabel" id="labelCollisions">
+                          <object class="GtkLabel" id="labelCollisions">
                             <property name="visible">True</property>
                             <property name="xalign">0</property>
                             <property name="label" translatable="yes">Collisions:</property>
-                          </widget>
+                          </object>
                           <packing>
                             <property name="top_attach">7</property>
                             <property name="bottom_attach">8</property>
                             <property name="x_options">GTK_FILL</property>
-                            <property name="y_options"></property>
+                            <property name="y_options"/>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkLabel" id="labelPlayResX">
+                          <object class="GtkLabel" id="labelPlayResX">
                             <property name="visible">True</property>
                             <property name="xalign">0</property>
                             <property name="label" translatable="yes">PlayResX:</property>
-                          </widget>
+                          </object>
                           <packing>
                             <property name="top_attach">9</property>
                             <property name="bottom_attach">10</property>
                             <property name="x_options">GTK_FILL</property>
-                            <property name="y_options"></property>
+                            <property name="y_options"/>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkLabel" id="labelPlayResY">
+                          <object class="GtkLabel" id="labelPlayResY">
                             <property name="visible">True</property>
                             <property name="xalign">0</property>
                             <property name="label" translatable="yes">PlayResY:</property>
-                          </widget>
+                          </object>
                           <packing>
                             <property name="top_attach">10</property>
                             <property name="bottom_attach">11</property>
                             <property name="x_options">GTK_FILL</property>
-                            <property name="y_options"></property>
+                            <property name="y_options"/>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkLabel" id="labelPlayDepth">
+                          <object class="GtkLabel" id="labelPlayDepth">
                             <property name="visible">True</property>
                             <property name="xalign">0</property>
                             <property name="label" translatable="yes">PlayDepth:</property>
-                          </widget>
+                          </object>
                           <packing>
                             <property name="top_attach">11</property>
                             <property name="bottom_attach">12</property>
                             <property name="x_options">GTK_FILL</property>
-                            <property name="y_options"></property>
+                            <property name="y_options"/>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkEntry" id="entrySSAASSTitle">
+                          <object class="GtkEntry" id="entrySSAASSTitle">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
-                          </widget>
+                          </object>
                           <packing>
                             <property name="left_attach">1</property>
                             <property name="right_attach">2</property>
-                            <property name="y_options"></property>
+                            <property name="y_options"/>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkEntry" id="entrySSAASSOriginalScript">
+                          <object class="GtkEntry" id="entrySSAASSOriginalScript">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
-                          </widget>
+                          </object>
                           <packing>
                             <property name="left_attach">1</property>
                             <property name="right_attach">2</property>
                             <property name="top_attach">1</property>
                             <property name="bottom_attach">2</property>
-                            <property name="y_options"></property>
+                            <property name="y_options"/>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkEntry" id="entrySSAASSOriginalTranslation">
+                          <object class="GtkEntry" id="entrySSAASSOriginalTranslation">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
-                          </widget>
+                          </object>
                           <packing>
                             <property name="left_attach">1</property>
                             <property name="right_attach">2</property>
                             <property name="top_attach">2</property>
                             <property name="bottom_attach">3</property>
-                            <property name="y_options"></property>
+                            <property name="y_options"/>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkEntry" id="entrySSAASSOriginalEditing">
+                          <object class="GtkEntry" id="entrySSAASSOriginalEditing">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
-                          </widget>
+                          </object>
                           <packing>
                             <property name="left_attach">1</property>
                             <property name="right_attach">2</property>
                             <property name="top_attach">3</property>
                             <property name="bottom_attach">4</property>
-                            <property name="y_options"></property>
+                            <property name="y_options"/>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkEntry" id="entrySSAASSOriginalTiming">
+                          <object class="GtkEntry" id="entrySSAASSOriginalTiming">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
-                          </widget>
+                          </object>
                           <packing>
                             <property name="left_attach">1</property>
                             <property name="right_attach">2</property>
                             <property name="top_attach">4</property>
                             <property name="bottom_attach">5</property>
-                            <property name="y_options"></property>
+                            <property name="y_options"/>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkEntry" id="entrySSAASSOriginalScriptChecking">
+                          <object class="GtkEntry" id="entrySSAASSOriginalScriptChecking">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
-                          </widget>
+                          </object>
                           <packing>
                             <property name="left_attach">1</property>
                             <property name="right_attach">2</property>
                             <property name="top_attach">5</property>
                             <property name="bottom_attach">6</property>
-                            <property name="y_options"></property>
+                            <property name="y_options"/>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkEntry" id="entrySSAASSScriptUpdatedBy">
+                          <object class="GtkEntry" id="entrySSAASSScriptUpdatedBy">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
-                          </widget>
+                          </object>
                           <packing>
                             <property name="left_attach">1</property>
                             <property name="right_attach">2</property>
                             <property name="top_attach">6</property>
                             <property name="bottom_attach">7</property>
-                            <property name="y_options"></property>
+                            <property name="y_options"/>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkEntry" id="entrySSAASSCollisions">
+                          <object class="GtkEntry" id="entrySSAASSCollisions">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
-                          </widget>
+                          </object>
                           <packing>
                             <property name="left_attach">1</property>
                             <property name="right_attach">2</property>
                             <property name="top_attach">7</property>
                             <property name="bottom_attach">8</property>
-                            <property name="y_options"></property>
+                            <property name="y_options"/>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkLabel" id="labelTimer">
+                          <object class="GtkLabel" id="labelTimer">
                             <property name="visible">True</property>
                             <property name="xalign">0</property>
                             <property name="label" translatable="yes">Timer:</property>
-                          </widget>
+                          </object>
                           <packing>
                             <property name="top_attach">8</property>
                             <property name="bottom_attach">9</property>
                             <property name="x_options">GTK_FILL</property>
-                            <property name="y_options"></property>
+                            <property name="y_options"/>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkEntry" id="entrySSAASSTimer">
+                          <object class="GtkEntry" id="entrySSAASSTimer">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
-                          </widget>
+                          </object>
                           <packing>
                             <property name="left_attach">1</property>
                             <property name="right_attach">2</property>
                             <property name="top_attach">8</property>
                             <property name="bottom_attach">9</property>
-                            <property name="y_options"></property>
+                            <property name="y_options"/>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkAlignment" id="playResXAlignment">
+                          <object class="GtkAlignment" id="playResXAlignment">
                             <property name="visible">True</property>
                             <property name="xalign">0</property>
                             <property name="xscale">0.10000000149011612</property>
                             <child>
-                              <widget class="GtkSpinButton" id="spinButtonSSAASSPlayResX">
+                              <object class="GtkSpinButton" id="spinButtonSSAASSPlayResX">
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
-                                <property name="adjustment">0 0 10000 1 10 0</property>
+                                <property name="adjustment">adjustment1</property>
                                 <property name="climb_rate">1</property>
                                 <property name="numeric">True</property>
-                              </widget>
+                              </object>
                             </child>
-                          </widget>
+                          </object>
                           <packing>
                             <property name="left_attach">1</property>
                             <property name="right_attach">2</property>
                             <property name="top_attach">9</property>
                             <property name="bottom_attach">10</property>
-                            <property name="y_options"></property>
+                            <property name="y_options"/>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkAlignment" id="playResYAlignment">
+                          <object class="GtkAlignment" id="playResYAlignment">
                             <property name="visible">True</property>
                             <property name="xalign">0</property>
                             <property name="xscale">0.10000000149011612</property>
                             <child>
-                              <widget class="GtkSpinButton" id="spinButtonSSAASSPlayResY">
+                              <object class="GtkSpinButton" id="spinButtonSSAASSPlayResY">
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
-                                <property name="adjustment">0 0 10000 1 10 0</property>
+                                <property name="adjustment">adjustment2</property>
                                 <property name="climb_rate">1</property>
                                 <property name="numeric">True</property>
-                              </widget>
+                              </object>
                             </child>
-                          </widget>
+                          </object>
                           <packing>
                             <property name="left_attach">1</property>
                             <property name="right_attach">2</property>
@@ -844,20 +916,20 @@ Video
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkAlignment" id="playDepthAlignment">
+                          <object class="GtkAlignment" id="playDepthAlignment">
                             <property name="visible">True</property>
                             <property name="xalign">0</property>
                             <property name="xscale">0.10000000149011612</property>
                             <child>
-                              <widget class="GtkSpinButton" id="spinButtonSSAASSPlayDepth">
+                              <object class="GtkSpinButton" id="spinButtonSSAASSPlayDepth">
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
-                                <property name="adjustment">0 0 10000 1 10 0</property>
+                                <property name="adjustment">adjustment3</property>
                                 <property name="climb_rate">1</property>
                                 <property name="numeric">True</property>
-                              </widget>
+                              </object>
                             </child>
-                          </widget>
+                          </object>
                           <packing>
                             <property name="left_attach">1</property>
                             <property name="right_attach">2</property>
@@ -867,28 +939,24 @@ Video
                             <property name="y_options">GTK_FILL</property>
                           </packing>
                         </child>
-                      </widget>
+                      </object>
                     </child>
-                  </widget>
+                  </object>
                 </child>
-              </widget>
-              <packing>
-                <property name="position">3</property>
-              </packing>
+              </object>
             </child>
-            <child>
-              <widget class="GtkLabel" id="labelSSAASS">
+            <child type="tab">
+              <object class="GtkLabel" id="labelSSAASS">
                 <property name="visible">True</property>
                 <property name="label">Sub Station Alpha / ASS</property>
-              </widget>
+              </object>
               <packing>
                 <property name="position">3</property>
                 <property name="tab_fill">False</property>
-                <property name="type">tab</property>
               </packing>
             </child>
             <child>
-              <widget class="GtkTable" id="tableSubViewer1">
+              <object class="GtkTable" id="tableSubViewer1">
                 <property name="visible">True</property>
                 <property name="border_width">8</property>
                 <property name="n_rows">7</property>
@@ -896,233 +964,229 @@ Video
                 <property name="column_spacing">6</property>
                 <property name="row_spacing">10</property>
                 <child>
-                  <widget class="GtkLabel" id="labelTitle3">
+                  <object class="GtkLabel" id="labelTitle3">
                     <property name="visible">True</property>
                     <property name="xalign">0</property>
                     <property name="label" translatable="yes">Title:</property>
-                  </widget>
+                  </object>
                   <packing>
                     <property name="x_options">GTK_FILL</property>
-                    <property name="y_options"></property>
+                    <property name="y_options"/>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkLabel" id="labelAuthor3">
+                  <object class="GtkLabel" id="labelAuthor3">
                     <property name="visible">True</property>
                     <property name="xalign">0</property>
                     <property name="label" translatable="yes">Author:</property>
-                  </widget>
+                  </object>
                   <packing>
                     <property name="top_attach">1</property>
                     <property name="bottom_attach">2</property>
                     <property name="x_options">GTK_FILL</property>
-                    <property name="y_options"></property>
+                    <property name="y_options"/>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkLabel" id="labelSource1">
+                  <object class="GtkLabel" id="labelSource1">
                     <property name="visible">True</property>
                     <property name="xalign">0</property>
                     <property name="label" translatable="yes">Source:</property>
-                  </widget>
+                  </object>
                   <packing>
                     <property name="top_attach">2</property>
                     <property name="bottom_attach">3</property>
                     <property name="x_options">GTK_FILL</property>
-                    <property name="y_options"></property>
+                    <property name="y_options"/>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkLabel" id="labelProgram1">
+                  <object class="GtkLabel" id="labelProgram1">
                     <property name="visible">True</property>
                     <property name="xalign">0</property>
                     <property name="label" translatable="yes">Program:</property>
-                  </widget>
+                  </object>
                   <packing>
                     <property name="top_attach">3</property>
                     <property name="bottom_attach">4</property>
                     <property name="x_options">GTK_FILL</property>
-                    <property name="y_options"></property>
+                    <property name="y_options"/>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkLabel" id="labelFilePath">
+                  <object class="GtkLabel" id="labelFilePath">
                     <property name="visible">True</property>
                     <property name="xalign">0</property>
                     <property name="label" translatable="yes">File Path:</property>
-                  </widget>
+                  </object>
                   <packing>
                     <property name="top_attach">4</property>
                     <property name="bottom_attach">5</property>
                     <property name="x_options">GTK_FILL</property>
-                    <property name="y_options"></property>
+                    <property name="y_options"/>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkLabel" id="labelDelay">
+                  <object class="GtkLabel" id="labelDelay">
                     <property name="visible">True</property>
                     <property name="xalign">0</property>
                     <property name="label" translatable="yes">Delay:</property>
-                  </widget>
+                  </object>
                   <packing>
                     <property name="top_attach">5</property>
                     <property name="bottom_attach">6</property>
                     <property name="x_options">GTK_FILL</property>
-                    <property name="y_options"></property>
+                    <property name="y_options"/>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkLabel" id="labelCDTrack">
+                  <object class="GtkLabel" id="labelCDTrack">
                     <property name="visible">True</property>
                     <property name="xalign">0</property>
                     <property name="label" translatable="yes">CD Track:</property>
-                  </widget>
+                  </object>
                   <packing>
                     <property name="top_attach">6</property>
                     <property name="bottom_attach">7</property>
                     <property name="x_options">GTK_FILL</property>
-                    <property name="y_options"></property>
+                    <property name="y_options"/>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkEntry" id="entrySubViewer1Title">
+                  <object class="GtkEntry" id="entrySubViewer1Title">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
-                  </widget>
+                  </object>
                   <packing>
                     <property name="left_attach">1</property>
                     <property name="right_attach">2</property>
-                    <property name="y_options"></property>
+                    <property name="y_options"/>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkEntry" id="entrySubViewer1Author">
+                  <object class="GtkEntry" id="entrySubViewer1Author">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
-                  </widget>
+                  </object>
                   <packing>
                     <property name="left_attach">1</property>
                     <property name="right_attach">2</property>
                     <property name="top_attach">1</property>
                     <property name="bottom_attach">2</property>
-                    <property name="y_options"></property>
+                    <property name="y_options"/>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkEntry" id="entrySubViewer1Source">
+                  <object class="GtkEntry" id="entrySubViewer1Source">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
-                  </widget>
+                  </object>
                   <packing>
                     <property name="left_attach">1</property>
                     <property name="right_attach">2</property>
                     <property name="top_attach">2</property>
                     <property name="bottom_attach">3</property>
-                    <property name="y_options"></property>
+                    <property name="y_options"/>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkEntry" id="entrySubViewer1Program">
+                  <object class="GtkEntry" id="entrySubViewer1Program">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
-                  </widget>
+                  </object>
                   <packing>
                     <property name="left_attach">1</property>
                     <property name="right_attach">2</property>
                     <property name="top_attach">3</property>
                     <property name="bottom_attach">4</property>
-                    <property name="y_options"></property>
+                    <property name="y_options"/>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkEntry" id="entrySubViewer1FilePath">
+                  <object class="GtkEntry" id="entrySubViewer1FilePath">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
-                  </widget>
+                  </object>
                   <packing>
                     <property name="left_attach">1</property>
                     <property name="right_attach">2</property>
                     <property name="top_attach">4</property>
                     <property name="bottom_attach">5</property>
-                    <property name="y_options"></property>
+                    <property name="y_options"/>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkAlignment" id="delayAlignment">
+                  <object class="GtkAlignment" id="delayAlignment">
                     <property name="visible">True</property>
                     <property name="xalign">0</property>
                     <property name="xscale">0.10000000149011612</property>
                     <child>
-                      <widget class="GtkSpinButton" id="spinButtonSubViewer1Delay">
+                      <object class="GtkSpinButton" id="spinButtonSubViewer1Delay">
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
-                        <property name="adjustment">0 0 1000000 1 10 0</property>
+                        <property name="adjustment">adjustment4</property>
                         <property name="climb_rate">1</property>
                         <property name="numeric">True</property>
-                      </widget>
+                      </object>
                     </child>
-                  </widget>
+                  </object>
                   <packing>
                     <property name="left_attach">1</property>
                     <property name="right_attach">2</property>
                     <property name="top_attach">5</property>
                     <property name="bottom_attach">6</property>
                     <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-                    <property name="y_options"></property>
+                    <property name="y_options"/>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkAlignment" id="cdTrackAlignment">
+                  <object class="GtkAlignment" id="cdTrackAlignment">
                     <property name="visible">True</property>
                     <property name="xalign">0</property>
                     <property name="xscale">0.10000000149011612</property>
                     <child>
-                      <widget class="GtkSpinButton" id="spinButtonSubViewer1CDTrack">
+                      <object class="GtkSpinButton" id="spinButtonSubViewer1CDTrack">
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
-                        <property name="adjustment">0 0 1000 1 10 0</property>
+                        <property name="adjustment">adjustment5</property>
                         <property name="climb_rate">1</property>
                         <property name="numeric">True</property>
-                      </widget>
+                      </object>
                     </child>
-                  </widget>
+                  </object>
                   <packing>
                     <property name="left_attach">1</property>
                     <property name="right_attach">2</property>
                     <property name="top_attach">6</property>
                     <property name="bottom_attach">7</property>
                     <property name="x_options">GTK_FILL</property>
-                    <property name="y_options"></property>
+                    <property name="y_options"/>
                   </packing>
                 </child>
-              </widget>
-              <packing>
-                <property name="position">4</property>
-              </packing>
+              </object>
             </child>
-            <child>
-              <widget class="GtkLabel" id="labelSubViewer1">
+            <child type="tab">
+              <object class="GtkLabel" id="labelSubViewer1">
                 <property name="visible">True</property>
                 <property name="label">Sub Viewer 1.0</property>
-              </widget>
+              </object>
               <packing>
                 <property name="position">4</property>
                 <property name="tab_fill">False</property>
-                <property name="type">tab</property>
               </packing>
             </child>
             <child>
-              <widget class="GtkScrolledWindow" id="scrolledWindowSubViewer2">
+              <object class="GtkScrolledWindow" id="scrolledWindowSubViewer2">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="hscrollbar_policy">automatic</property>
                 <property name="vscrollbar_policy">automatic</property>
                 <child>
-                  <widget class="GtkViewport" id="viewportSubViewer2">
+                  <object class="GtkViewport" id="viewportSubViewer2">
                     <property name="visible">True</property>
                     <property name="shadow_type">none</property>
                     <child>
-                      <widget class="GtkTable" id="tableSubViewer2">
+                      <object class="GtkTable" id="tableSubViewer2">
                         <property name="visible">True</property>
                         <property name="border_width">8</property>
                         <property name="n_rows">12</property>
@@ -1130,300 +1194,300 @@ Video
                         <property name="column_spacing">6</property>
                         <property name="row_spacing">10</property>
                         <child>
-                          <widget class="GtkLabel" id="labelTitle4">
+                          <object class="GtkLabel" id="labelTitle4">
                             <property name="visible">True</property>
                             <property name="xalign">0</property>
                             <property name="label" translatable="yes">Title:</property>
-                          </widget>
+                          </object>
                           <packing>
                             <property name="x_options">GTK_FILL</property>
-                            <property name="y_options"></property>
+                            <property name="y_options"/>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkLabel" id="labelAuthor4">
+                          <object class="GtkLabel" id="labelAuthor4">
                             <property name="visible">True</property>
                             <property name="xalign">0</property>
                             <property name="label" translatable="yes">Author:</property>
-                          </widget>
+                          </object>
                           <packing>
                             <property name="top_attach">1</property>
                             <property name="bottom_attach">2</property>
                             <property name="x_options">GTK_FILL</property>
-                            <property name="y_options"></property>
+                            <property name="y_options"/>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkLabel" id="labelSource2">
+                          <object class="GtkLabel" id="labelSource2">
                             <property name="visible">True</property>
                             <property name="xalign">0</property>
                             <property name="label" translatable="yes">Source:</property>
-                          </widget>
+                          </object>
                           <packing>
                             <property name="top_attach">2</property>
                             <property name="bottom_attach">3</property>
                             <property name="x_options">GTK_FILL</property>
-                            <property name="y_options"></property>
+                            <property name="y_options"/>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkLabel" id="labelProgram2">
+                          <object class="GtkLabel" id="labelProgram2">
                             <property name="visible">True</property>
                             <property name="xalign">0</property>
                             <property name="label" translatable="yes">Program:</property>
-                          </widget>
+                          </object>
                           <packing>
                             <property name="top_attach">3</property>
                             <property name="bottom_attach">4</property>
                             <property name="x_options">GTK_FILL</property>
-                            <property name="y_options"></property>
+                            <property name="y_options"/>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkLabel" id="labelFilePath1">
+                          <object class="GtkLabel" id="labelFilePath1">
                             <property name="visible">True</property>
                             <property name="xalign">0</property>
                             <property name="label" translatable="yes">File Path:</property>
-                          </widget>
+                          </object>
                           <packing>
                             <property name="top_attach">4</property>
                             <property name="bottom_attach">5</property>
                             <property name="x_options">GTK_FILL</property>
-                            <property name="y_options"></property>
+                            <property name="y_options"/>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkLabel" id="labelComment">
+                          <object class="GtkLabel" id="labelComment">
                             <property name="visible">True</property>
                             <property name="xalign">0</property>
                             <property name="label" translatable="yes">Comment:</property>
-                          </widget>
+                          </object>
                           <packing>
                             <property name="top_attach">5</property>
                             <property name="bottom_attach">6</property>
                             <property name="x_options">GTK_FILL</property>
-                            <property name="y_options"></property>
+                            <property name="y_options"/>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkLabel" id="labelFontName">
+                          <object class="GtkLabel" id="labelFontName">
                             <property name="visible">True</property>
                             <property name="xalign">0</property>
                             <property name="label" translatable="yes">Font Name:</property>
-                          </widget>
+                          </object>
                           <packing>
                             <property name="top_attach">6</property>
                             <property name="bottom_attach">7</property>
                             <property name="x_options">GTK_FILL</property>
-                            <property name="y_options"></property>
+                            <property name="y_options"/>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkLabel" id="labelFontColor">
+                          <object class="GtkLabel" id="labelFontColor">
                             <property name="visible">True</property>
                             <property name="xalign">0</property>
                             <property name="label" translatable="yes">Font Color:</property>
-                          </widget>
+                          </object>
                           <packing>
                             <property name="top_attach">7</property>
                             <property name="bottom_attach">8</property>
                             <property name="x_options">GTK_FILL</property>
-                            <property name="y_options"></property>
+                            <property name="y_options"/>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkLabel" id="labelFontStyle">
+                          <object class="GtkLabel" id="labelFontStyle">
                             <property name="visible">True</property>
                             <property name="xalign">0</property>
                             <property name="label" translatable="yes">Font Style:</property>
-                          </widget>
+                          </object>
                           <packing>
                             <property name="top_attach">8</property>
                             <property name="bottom_attach">9</property>
                             <property name="x_options">GTK_FILL</property>
-                            <property name="y_options"></property>
+                            <property name="y_options"/>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkLabel" id="labelFontSize">
+                          <object class="GtkLabel" id="labelFontSize">
                             <property name="visible">True</property>
                             <property name="xalign">0</property>
                             <property name="label" translatable="yes">Font Size:</property>
-                          </widget>
+                          </object>
                           <packing>
                             <property name="top_attach">11</property>
                             <property name="bottom_attach">12</property>
                             <property name="x_options">GTK_FILL</property>
-                            <property name="y_options"></property>
+                            <property name="y_options"/>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkEntry" id="entrySubViewer2Title">
+                          <object class="GtkEntry" id="entrySubViewer2Title">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
-                          </widget>
+                          </object>
                           <packing>
                             <property name="left_attach">1</property>
                             <property name="right_attach">2</property>
-                            <property name="y_options"></property>
+                            <property name="y_options"/>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkEntry" id="entrySubViewer2Author">
+                          <object class="GtkEntry" id="entrySubViewer2Author">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
-                          </widget>
+                          </object>
                           <packing>
                             <property name="left_attach">1</property>
                             <property name="right_attach">2</property>
                             <property name="top_attach">1</property>
                             <property name="bottom_attach">2</property>
-                            <property name="y_options"></property>
+                            <property name="y_options"/>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkEntry" id="entrySubViewer2Source">
+                          <object class="GtkEntry" id="entrySubViewer2Source">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
-                          </widget>
+                          </object>
                           <packing>
                             <property name="left_attach">1</property>
                             <property name="right_attach">2</property>
                             <property name="top_attach">2</property>
                             <property name="bottom_attach">3</property>
-                            <property name="y_options"></property>
+                            <property name="y_options"/>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkEntry" id="entrySubViewer2Program">
+                          <object class="GtkEntry" id="entrySubViewer2Program">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
-                          </widget>
+                          </object>
                           <packing>
                             <property name="left_attach">1</property>
                             <property name="right_attach">2</property>
                             <property name="top_attach">3</property>
                             <property name="bottom_attach">4</property>
-                            <property name="y_options"></property>
+                            <property name="y_options"/>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkEntry" id="entrySubViewer2FilePath">
+                          <object class="GtkEntry" id="entrySubViewer2FilePath">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
-                          </widget>
+                          </object>
                           <packing>
                             <property name="left_attach">1</property>
                             <property name="right_attach">2</property>
                             <property name="top_attach">4</property>
                             <property name="bottom_attach">5</property>
-                            <property name="y_options"></property>
+                            <property name="y_options"/>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkEntry" id="entrySubViewer2Comment">
+                          <object class="GtkEntry" id="entrySubViewer2Comment">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
-                          </widget>
+                          </object>
                           <packing>
                             <property name="left_attach">1</property>
                             <property name="right_attach">2</property>
                             <property name="top_attach">5</property>
                             <property name="bottom_attach">6</property>
-                            <property name="y_options"></property>
+                            <property name="y_options"/>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkEntry" id="entrySubViewer2FontName">
+                          <object class="GtkEntry" id="entrySubViewer2FontName">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
-                          </widget>
+                          </object>
                           <packing>
                             <property name="left_attach">1</property>
                             <property name="right_attach">2</property>
                             <property name="top_attach">6</property>
                             <property name="bottom_attach">7</property>
-                            <property name="y_options"></property>
+                            <property name="y_options"/>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkEntry" id="entrySubViewer2FontColor">
+                          <object class="GtkEntry" id="entrySubViewer2FontColor">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
-                          </widget>
+                          </object>
                           <packing>
                             <property name="left_attach">1</property>
                             <property name="right_attach">2</property>
                             <property name="top_attach">7</property>
                             <property name="bottom_attach">8</property>
-                            <property name="y_options"></property>
+                            <property name="y_options"/>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkEntry" id="entrySubViewer2FontStyle">
+                          <object class="GtkEntry" id="entrySubViewer2FontStyle">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
-                          </widget>
+                          </object>
                           <packing>
                             <property name="left_attach">1</property>
                             <property name="right_attach">2</property>
                             <property name="top_attach">8</property>
                             <property name="bottom_attach">9</property>
-                            <property name="y_options"></property>
+                            <property name="y_options"/>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkAlignment" id="fontSizeAlignment">
+                          <object class="GtkAlignment" id="fontSizeAlignment">
                             <property name="visible">True</property>
                             <property name="xalign">0</property>
                             <property name="xscale">0.10000000149011612</property>
                             <child>
-                              <widget class="GtkSpinButton" id="spinButtonSubViewer2FontSize">
+                              <object class="GtkSpinButton" id="spinButtonSubViewer2FontSize">
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
-                                <property name="adjustment">1 1 100 1 10 0</property>
+                                <property name="adjustment">adjustment6</property>
                                 <property name="climb_rate">1</property>
                                 <property name="numeric">True</property>
-                              </widget>
+                              </object>
                             </child>
-                          </widget>
+                          </object>
                           <packing>
                             <property name="left_attach">1</property>
                             <property name="right_attach">2</property>
                             <property name="top_attach">11</property>
                             <property name="bottom_attach">12</property>
                             <property name="x_options">GTK_FILL</property>
-                            <property name="y_options"></property>
+                            <property name="y_options"/>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkLabel" id="labelCDTrack1">
+                          <object class="GtkLabel" id="labelCDTrack1">
                             <property name="visible">True</property>
                             <property name="xalign">0</property>
                             <property name="label" translatable="yes">CD Track:</property>
-                          </widget>
+                          </object>
                           <packing>
                             <property name="top_attach">10</property>
                             <property name="bottom_attach">11</property>
                             <property name="x_options">GTK_FILL</property>
-                            <property name="y_options"></property>
+                            <property name="y_options"/>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkAlignment" id="cdTrackAlignment1">
+                          <object class="GtkAlignment" id="cdTrackAlignment1">
                             <property name="visible">True</property>
                             <property name="xalign">0</property>
                             <property name="xscale">0.10000000149011612</property>
                             <child>
-                              <widget class="GtkSpinButton" id="spinButtonSubViewer2CDTrack">
+                              <object class="GtkSpinButton" id="spinButtonSubViewer2CDTrack">
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
-                                <property name="adjustment">0 0 1000 1 10 0</property>
+                                <property name="adjustment">adjustment7</property>
                                 <property name="climb_rate">1</property>
                                 <property name="numeric">True</property>
-                              </widget>
+                              </object>
                             </child>
-                          </widget>
+                          </object>
                           <packing>
                             <property name="left_attach">1</property>
                             <property name="right_attach">2</property>
@@ -1434,33 +1498,33 @@ Video
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkLabel" id="labelDelay1">
+                          <object class="GtkLabel" id="labelDelay1">
                             <property name="visible">True</property>
                             <property name="xalign">0</property>
                             <property name="label" translatable="yes">Delay:</property>
-                          </widget>
+                          </object>
                           <packing>
                             <property name="top_attach">9</property>
                             <property name="bottom_attach">10</property>
                             <property name="x_options">GTK_FILL</property>
-                            <property name="y_options"></property>
+                            <property name="y_options"/>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkAlignment" id="delayAlignment1">
+                          <object class="GtkAlignment" id="delayAlignment1">
                             <property name="visible">True</property>
                             <property name="xalign">0</property>
                             <property name="xscale">0.10000000149011612</property>
                             <child>
-                              <widget class="GtkSpinButton" id="spinButtonSubViewer2Delay">
+                              <object class="GtkSpinButton" id="spinButtonSubViewer2Delay">
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
-                                <property name="adjustment">0 0 1000000 1 10 0</property>
+                                <property name="adjustment">adjustment8</property>
                                 <property name="climb_rate">1</property>
                                 <property name="numeric">True</property>
-                              </widget>
+                              </object>
                             </child>
-                          </widget>
+                          </object>
                           <packing>
                             <property name="left_attach">1</property>
                             <property name="right_attach">2</property>
@@ -1470,45 +1534,40 @@ Video
                             <property name="y_options">GTK_FILL</property>
                           </packing>
                         </child>
-                      </widget>
+                      </object>
                     </child>
-                  </widget>
+                  </object>
                 </child>
-              </widget>
-              <packing>
-                <property name="position">5</property>
-              </packing>
+              </object>
             </child>
-            <child>
-              <widget class="GtkLabel" id="labelSubViewer2">
+            <child type="tab">
+              <object class="GtkLabel" id="labelSubViewer2">
                 <property name="visible">True</property>
                 <property name="label">SubViewer 2.0</property>
-              </widget>
+              </object>
               <packing>
                 <property name="position">5</property>
                 <property name="tab_fill">False</property>
-                <property name="type">tab</property>
               </packing>
             </child>
-          </widget>
+          </object>
           <packing>
             <property name="position">1</property>
           </packing>
         </child>
         <child internal-child="action_area">
-          <widget class="GtkHButtonBox" id="dialogActionArea">
+          <object class="GtkHButtonBox" id="dialogActionArea">
             <property name="visible">True</property>
             <property name="layout_style">end</property>
             <child>
-              <widget class="GtkButton" id="buttonCancel">
+              <object class="GtkButton" id="buttonCancel">
                 <property name="label">gtk-cancel</property>
-                <property name="response_id">-6</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="can_default">True</property>
                 <property name="receives_default">False</property>
                 <property name="use_stock">True</property>
-              </widget>
+              </object>
               <packing>
                 <property name="expand">False</property>
                 <property name="fill">False</property>
@@ -1516,30 +1575,33 @@ Video
               </packing>
             </child>
             <child>
-              <widget class="GtkButton" id="buttonOK">
+              <object class="GtkButton" id="buttonOK">
                 <property name="label">gtk-ok</property>
-                <property name="response_id">-5</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="can_default">True</property>
                 <property name="has_default">True</property>
                 <property name="receives_default">False</property>
                 <property name="use_stock">True</property>
-              </widget>
+              </object>
               <packing>
                 <property name="expand">False</property>
                 <property name="fill">False</property>
                 <property name="position">1</property>
               </packing>
             </child>
-          </widget>
+          </object>
           <packing>
             <property name="expand">False</property>
             <property name="pack_type">end</property>
             <property name="position">0</property>
           </packing>
         </child>
-      </widget>
+      </object>
     </child>
-  </widget>
-</glade-interface>
+    <action-widgets>
+      <action-widget response="-6">buttonCancel</action-widget>
+      <action-widget response="-5">buttonOK</action-widget>
+    </action-widgets>
+  </object>
+</interface>
diff --git a/src/GnomeSubtitles/Dialog/HeadersDialog.cs b/src/GnomeSubtitles/Dialog/HeadersDialog.cs
index 71d65fc..6bfe47f 100644
--- a/src/GnomeSubtitles/Dialog/HeadersDialog.cs
+++ b/src/GnomeSubtitles/Dialog/HeadersDialog.cs
@@ -19,255 +19,271 @@
 
 using GnomeSubtitles.Core;
 using System;
-//using Glade;
 using Gtk;
 using SubLib.Core.Domain;
+using Mono.Unix;
+using System.Reflection;
+using SubLib.IO.SubtitleFormats;
 
 namespace GnomeSubtitles.Dialog {
 
-public class HeadersDialog : BuilderDialog {
-       private Headers headers = null;
-
-       /* Constant strings */
-       private const string gladeFilename = "HeadersDialog.glade";
-       private const string mpSubAudioTag = "AUDIO";
-       private const string mpSubVideoTag = "VIDEO";
-
-       /* Widgets */
-
-       /* KaraokeLyricsLRC fields */
-       [Builder.Object] private Entry entryKaraokeLRCTitle = null;
-       [Builder.Object] private Entry entryKaraokeLRCAuthor = null;
-       [Builder.Object] private Entry entryKaraokeLRCArtist = null;
-       [Builder.Object] private Entry entryKaraokeLRCAlbum = null;
-       [Builder.Object] private Entry entryKaraokeLRCMaker = null;
-       [Builder.Object] private Entry entryKaraokeLRCVersion = null;
-       [Builder.Object] private Entry entryKaraokeLRCProgram = null;
-
-       /* KaraokeLyricsVKT fields */
-       [Builder.Object] private Entry entryKaraokeVKTFrameRate = null;
-       [Builder.Object] private Entry entryKaraokeVKTAuthor = null;
-       [Builder.Object] private Entry entryKaraokeVKTSource = null;
-       [Builder.Object] private Entry entryKaraokeVKTDate = null;
-
-       /* MPSub fields */
-       [Builder.Object] private Entry entryMPSubTitle = null;
-       [Builder.Object] private Entry entryMPSubFile = null;
-       [Builder.Object] private Entry entryMPSubAuthor = null;
-       [Builder.Object] private Entry entryMPSubNote = null;
-       [Builder.Object] private ComboBox comboBoxMPSubType = null;
-
-       /* SubStationAlphaASS fields */
-       [Builder.Object] private Entry entrySSAASSTitle = null;
-       [Builder.Object] private Entry entrySSAASSOriginalScript = null;
-       [Builder.Object] private Entry entrySSAASSOriginalTranslation = null;
-       [Builder.Object] private Entry entrySSAASSOriginalEditing = null;
-       [Builder.Object] private Entry entrySSAASSOriginalTiming = null;
-       [Builder.Object] private Entry entrySSAASSOriginalScriptChecking = null;
-       [Builder.Object] private Entry entrySSAASSScriptUpdatedBy = null;
-       [Builder.Object] private Entry entrySSAASSCollisions = null;
-       [Builder.Object] private Entry entrySSAASSTimer = null;
-       [Builder.Object] private SpinButton spinButtonSSAASSPlayResX = null;
-       [Builder.Object] private SpinButton spinButtonSSAASSPlayResY = null;
-       [Builder.Object] private SpinButton spinButtonSSAASSPlayDepth = null;
-
-       /* SubViewer1 fields */
-       [Builder.Object] private Entry entrySubViewer1Title = null;
-       [Builder.Object] private Entry entrySubViewer1Author = null;
-       [Builder.Object] private Entry entrySubViewer1Source = null;
-       [Builder.Object] private Entry entrySubViewer1Program = null;
-       [Builder.Object] private Entry entrySubViewer1FilePath = null;
-       [Builder.Object] private SpinButton spinButtonSubViewer1Delay = null;
-       [Builder.Object] private SpinButton spinButtonSubViewer1CDTrack = null;
-
-       /* SubViewer2 fields */
-       [Builder.Object] private Entry entrySubViewer2Title = null;
-       [Builder.Object] private Entry entrySubViewer2Author = null;
-       [Builder.Object] private Entry entrySubViewer2Source = null;
-       [Builder.Object] private Entry entrySubViewer2Program = null;
-       [Builder.Object] private Entry entrySubViewer2FilePath = null;
-       [Builder.Object] private Entry entrySubViewer2Comment = null;
-       [Builder.Object] private Entry entrySubViewer2FontName = null;
-       [Builder.Object] private Entry entrySubViewer2FontColor = null;
-       [Builder.Object] private Entry entrySubViewer2FontStyle = null;
-       [Builder.Object] private SpinButton spinButtonSubViewer2Delay = null;
-       [Builder.Object] private SpinButton spinButtonSubViewer2CDTrack = null;
-       [Builder.Object] private SpinButton spinButtonSubViewer2FontSize = null;
-
-
-       public HeadersDialog () : base(gladeFilename) {
-               headers = Base.Document.Subtitles.Properties.Headers;
-               LoadHeaders();
+public class HeadersDialog : BaseDialog {
+
+       private Gtk.Dialog dialog;
+       private Headers headers;
+
+       //Property Changed event
+       private delegate void PropertyChangedHandler (object sender, string property, object newValue);
+       private event PropertyChangedHandler PropertyChanged;
+
+       public HeadersDialog () : base() {
+               headers = (Headers)Base.Document.Subtitles.Properties.Headers.Clone();
+
+               BuildDialog();
+
+               base.Init(dialog);
        }
 
 
        /* Private members */
 
-       private void LoadHeaders () {
-               LoadKaraokeLRCHeaders();
-               LoadKaraokeVKTHeaders();
-               LoadMPSubHeaders();
-               LoadSSAASSHeaders();
-               LoadSubViewer1Headers();
-               LoadSubViewer2Headers();
+       private void BuildDialog() {
+               dialog = new Gtk.Dialog(Catalog.GetString("Headers"), Base.Ui.Window, DialogFlags.Modal | 
DialogFlagsUseHeaderBar,
+                       Util.GetStockLabel("gtk-cancel"), ResponseType.Cancel, 
Util.GetStockLabel("gtk-apply"), ResponseType.Ok);
+
+               dialog.DefaultResponse = ResponseType.Ok;
+               dialog.DefaultWidth = 600;
+               dialog.DefaultHeight = 550;
+
+               Notebook notebook = new Notebook();
+               notebook.Expand = true;
+               notebook.TabPos = PositionType.Left;
+               notebook.BorderWidth = 6;
+
+               Grid grid;
+
+               //Karaoke Lyrics LRC
+               grid = CreatePageWithGrid(notebook, "Karaoke Lyrics LRC");
+               grid.Attach(CreateLabel(Catalog.GetString("Title:")), 0, 0, 1, 1);
+               grid.Attach(CreateEntry("Title"), 1, 0, 1, 1);
+               grid.Attach(CreateLabel(Catalog.GetString("Author:")), 0, 1, 1, 1);
+               grid.Attach(CreateEntry("Author"), 1, 1, 1, 1);
+               grid.Attach(CreateLabel(Catalog.GetString("Artist:")), 0, 2, 1, 1);
+               grid.Attach(CreateEntry("Artist"), 1, 2, 1, 1);
+               grid.Attach(CreateLabel(Catalog.GetString("Album:")), 0, 3, 1, 1);
+               grid.Attach(CreateEntry("Album"), 1, 3, 1, 1);
+               grid.Attach(CreateLabel(Catalog.GetString("By:")), 0, 4, 1, 1);
+               grid.Attach(CreateEntry("FileCreator"), 1, 4, 1, 1);
+               grid.Attach(CreateLabel(Catalog.GetString("Version:")), 0, 5, 1, 1);
+               grid.Attach(CreateEntry("Version"), 1, 5, 1, 1);
+               grid.Attach(CreateLabel(Catalog.GetString("Program:")), 0, 6, 1, 1);
+               grid.Attach(CreateEntry("Program"), 1, 6, 1, 1);
+
+               //Karaoke Lyrics VKT
+               grid = CreatePageWithGrid(notebook, "Karaoke Lyrics VKT");
+               grid.Attach(CreateLabel(Catalog.GetString("Author:")), 0, 0, 1, 1);
+               grid.Attach(CreateEntry("Author"), 1, 0, 1, 1);
+               grid.Attach(CreateLabel(Catalog.GetString("Source:")), 0, 2, 1, 1);
+               grid.Attach(CreateEntry("Source"), 1, 2, 1, 1);
+               grid.Attach(CreateLabel(Catalog.GetString("Date:")), 0, 3, 1, 1);
+               grid.Attach(CreateEntry("Date"), 1, 3, 1, 1);
+               grid.Attach(CreateLabel(Catalog.GetString("Frame Rate:")), 0, 4, 1, 1);
+               grid.Attach(CreateEntry("FrameRate"), 1, 4, 1, 1);
+
+               //MPSub
+               grid = CreatePageWithGrid(notebook, "MPSub");
+               grid.Attach(CreateLabel(Catalog.GetString("Title:")), 0, 0, 1, 1);
+               grid.Attach(CreateEntry("Title"), 1, 0, 1, 1);
+               grid.Attach(CreateLabel(Catalog.GetString("File:")), 0, 2, 1, 1);
+               grid.Attach(CreateEntry("MPSubFileProperties"), 1, 2, 1, 1);
+               grid.Attach(CreateLabel(Catalog.GetString("Author:")), 0, 3, 1, 1);
+               grid.Attach(CreateEntry("Author"), 1, 3, 1, 1);
+               grid.Attach(CreateLabel(Catalog.GetString("Note:")), 0, 4, 1, 1);
+               grid.Attach(CreateEntry("Comment"), 1, 4, 1, 1);
+               grid.Attach(CreateLabel(Catalog.GetString("Media Type:")), 0, 5, 1, 1);
+               ComboBoxText comboBoxMPSubMediaType = CreateComboBoxText("MPSubMediaType",
+                 SubtitleFormatMPSub.HeaderMediaTypeAudio, Catalog.GetString("Audio"),
+                 SubtitleFormatMPSub.HeaderMediaTypeVideo, Catalog.GetString("Video"));
+               grid.Attach(comboBoxMPSubMediaType, 1, 5, 1, 1);
+
+               //Sub Station Alpha / ASS
+               grid = CreatePageWithGrid(notebook, "Sub Station Alpha / ASS");
+               grid.Attach(CreateLabel(Catalog.GetString("Title:")), 0, 0, 1, 1);
+               grid.Attach(CreateEntry("Title"), 1, 0, 1, 1);
+               grid.Attach(CreateLabel(Catalog.GetString("Original Script:")), 0, 1, 1, 1);
+               grid.Attach(CreateEntry("SubStationAlphaOriginalScript"), 1, 1, 1, 1);
+               grid.Attach(CreateLabel(Catalog.GetString("Original Translation:")), 0, 2, 1, 1);
+               grid.Attach(CreateEntry("SubStationAlphaOriginalTranslation"), 1, 2, 1, 1);
+               grid.Attach(CreateLabel(Catalog.GetString("Original Editing:")), 0, 3, 1, 1);
+               grid.Attach(CreateEntry("SubStationAlphaOriginalEditing"), 1, 3, 1, 1);
+               grid.Attach(CreateLabel(Catalog.GetString("Original Timing:")), 0, 4, 1, 1);
+               grid.Attach(CreateEntry("SubStationAlphaOriginalTiming"), 1, 4, 1, 1);
+               grid.Attach(CreateLabel(Catalog.GetString("Original Script Checking:")), 0, 5, 1, 1);
+               grid.Attach(CreateEntry("SubStationAlphaOriginalScriptChecking"), 1, 5, 1, 1);
+               grid.Attach(CreateLabel(Catalog.GetString("Script Updated By:")), 0, 6, 1, 1);
+               grid.Attach(CreateEntry("SubStationAlphaScriptUpdatedBy"), 1, 6, 1, 1);
+               grid.Attach(CreateLabel(Catalog.GetString("Collisions:")), 0, 7, 1, 1);
+               grid.Attach(CreateEntry("SubStationAlphaCollisions"), 1, 7, 1, 1);
+               grid.Attach(CreateLabel(Catalog.GetString("Timer:")), 0, 8, 1, 1);
+               grid.Attach(CreateEntry("SubStationAlphaTimer"), 1, 8, 1, 1);
+               grid.Attach(CreateLabel(Catalog.GetString("Play Res X:")), 0, 9, 1, 1);
+               grid.Attach(CreateSpinButton("SubStationAlphaPlayResX", 0, 10000, 1), 1, 9, 1, 1);
+               grid.Attach(CreateLabel(Catalog.GetString("Play Res Y:")), 0, 10, 1, 1);
+               grid.Attach(CreateSpinButton("SubStationAlphaPlayResY", 0, 10000, 1), 1, 10, 1, 1);
+               grid.Attach(CreateLabel(Catalog.GetString("Play Depth:")), 0, 11, 1, 1);
+               grid.Attach(CreateSpinButton("SubStationAlphaPlayDepth", 0, 10000, 1), 1, 11, 1, 1);
+
+               //SubViewer 1
+               grid = CreatePageWithGrid(notebook, "SubViewer 1");
+               grid.Attach(CreateLabel(Catalog.GetString("Title:")), 0, 0, 1, 1);
+               grid.Attach(CreateEntry("Title"), 1, 0, 1, 1);
+               grid.Attach(CreateLabel(Catalog.GetString("Author:")), 0, 1, 1, 1);
+               grid.Attach(CreateEntry("Author"), 1, 1, 1, 1);
+               grid.Attach(CreateLabel(Catalog.GetString("Source:")), 0, 2, 1, 1);
+               grid.Attach(CreateEntry("Source"), 1, 2, 1, 1);
+               grid.Attach(CreateLabel(Catalog.GetString("Program:")), 0, 3, 1, 1);
+               grid.Attach(CreateEntry("Program"), 1, 3, 1, 1);
+               grid.Attach(CreateLabel(Catalog.GetString("File Path:")), 0, 4, 1, 1);
+               grid.Attach(CreateEntry("FilePath"), 1, 4, 1, 1);
+               grid.Attach(CreateLabel(Catalog.GetString("Delay:")), 0, 5, 1, 1);
+               grid.Attach(CreateSpinButton("Delay", 0, 1000000, 1), 1, 5, 1, 1);
+               grid.Attach(CreateLabel(Catalog.GetString("CD Track:")), 0, 6, 1, 1);
+               grid.Attach(CreateSpinButton("CDTrack", 1, 1000, 1), 1, 6, 1, 1);
+
+               //SubViewer 2
+               grid = CreatePageWithGrid(notebook, "SubViewer 2");
+               grid.Attach(CreateLabel(Catalog.GetString("Title:")), 0, 0, 1, 1);
+               grid.Attach(CreateEntry("Title"), 1, 0, 1, 1);
+               grid.Attach(CreateLabel(Catalog.GetString("Author:")), 0, 1, 1, 1);
+               grid.Attach(CreateEntry("Author"), 1, 1, 1, 1);
+               grid.Attach(CreateLabel(Catalog.GetString("Source:")), 0, 2, 1, 1);
+               grid.Attach(CreateEntry("Source"), 1, 2, 1, 1);
+               grid.Attach(CreateLabel(Catalog.GetString("Program:")), 0, 3, 1, 1);
+               grid.Attach(CreateEntry("Program"), 1, 3, 1, 1);
+               grid.Attach(CreateLabel(Catalog.GetString("File Path:")), 0, 4, 1, 1);
+               grid.Attach(CreateEntry("FilePath"), 1, 4, 1, 1);
+               grid.Attach(CreateLabel(Catalog.GetString("Font Name:")), 0, 5, 1, 1);
+               grid.Attach(CreateEntry("SubViewer2FontName"), 1, 5, 1, 1);
+               grid.Attach(CreateLabel(Catalog.GetString("Font Color:")), 0, 6, 1, 1);
+               grid.Attach(CreateEntry("SubViewer2FontColor"), 1, 6, 1, 1);
+               grid.Attach(CreateLabel(Catalog.GetString("Font Style:")), 0, 7, 1, 1);
+               grid.Attach(CreateEntry("SubViewer2FontStyle"), 1, 7, 1, 1);
+               grid.Attach(CreateLabel(Catalog.GetString("Font Size:")), 0, 8, 1, 1);
+               grid.Attach(CreateSpinButton("SubViewer2FontSize", 1, 1000, 1), 1, 8, 1, 1);
+               grid.Attach(CreateLabel(Catalog.GetString("Delay:")), 0, 9, 1, 1);
+               grid.Attach(CreateSpinButton("Delay", 0, 1000000, 1), 1, 9, 1, 1);
+               grid.Attach(CreateLabel(Catalog.GetString("CD Track:")), 0, 10, 1, 1);
+               grid.Attach(CreateSpinButton("CDTrack", 1, 1000, 1), 1, 10, 1, 1);
+
+               //Finalize
+               dialog.ContentArea.Add(notebook);
+               dialog.ContentArea.ShowAll();
        }
 
-       private void LoadKaraokeLRCHeaders() {
-               entryKaraokeLRCTitle.Text = headers.Title;
-               entryKaraokeLRCAuthor.Text = headers.MovieAuthor;
-               entryKaraokeLRCArtist.Text = headers.Artist;
-               entryKaraokeLRCAlbum.Text = headers.Album;
-               entryKaraokeLRCMaker.Text = headers.Author;
-               entryKaraokeLRCVersion.Text = headers.Version;
-               entryKaraokeLRCProgram.Text = headers.Program;
+       private Grid CreatePageWithGrid(Notebook notebook, string tabLabel) {
+               ScrolledWindow window = new ScrolledWindow();
+
+               Grid grid = new Grid();
+               grid.BorderWidth = 8;
+               grid.ColumnSpacing = 6;
+               grid.RowSpacing = 10;
+               window.Add(grid);
+
+               notebook.AppendPage(window, new Label(tabLabel));
+               return grid;
        }
 
-       private void LoadKaraokeVKTHeaders() {
-               entryKaraokeVKTFrameRate.Text = headers.FrameRate;
-               entryKaraokeVKTAuthor.Text = headers.Author;
-               entryKaraokeVKTSource.Text = headers.VideoSource;
-               entryKaraokeVKTDate.Text = headers.Date;
+       private Label CreateLabel(string text) {
+               Label label = new Label(text);
+               label.SetAlignment(0, 0.5f);
+               return label;
        }
 
-       private void LoadMPSubHeaders () {
-               entryMPSubTitle.Text = headers.Title;
-               entryMPSubFile.Text = headers.FileProperties;
-               entryMPSubAuthor.Text = headers.Author;
-               entryMPSubNote.Text = headers.Comment;
+       private Entry CreateEntry(string propertyName) {
+               PropertyInfo property = typeof(Headers).GetProperty(propertyName);
+               string value = (string)property.GetValue(headers) ?? ""; //Make sure we don't pass null to 
the entry to avoid gtk warnings
 
-               comboBoxMPSubType.Active = (headers.MediaType == mpSubAudioTag ? 0 : 1);
-       }
+               Entry entry = new Entry(value);
+               entry.Hexpand = true;
+               entry.Changed += (object sender, EventArgs e) => SetProperty(sender, property, 
((Entry)sender).Text);
+               PropertyChanged += (object sender, string prop, object newValue) => {
+                       if ((sender != entry) && (prop == propertyName)) {
+                               entry.Text = (string)newValue;
+                       }
+               };
 
-       private void LoadSSAASSHeaders () {
-               entrySSAASSTitle.Text = headers.Title;
-               entrySSAASSOriginalScript.Text = headers.OriginalScript;
-               entrySSAASSOriginalTranslation.Text = headers.OriginalTranslation;
-               entrySSAASSOriginalEditing.Text = headers.OriginalEditing;
-               entrySSAASSOriginalTiming.Text = headers.OriginalTiming;
-               entrySSAASSOriginalScriptChecking.Text = headers.OriginalScriptChecking;
-               entrySSAASSScriptUpdatedBy.Text = headers.ScriptUpdatedBy;
-               entrySSAASSCollisions.Text = headers.Collisions;
-               entrySSAASSTimer.Text = headers.Timer;
-
-               spinButtonSSAASSPlayResX.Value = headers.PlayResX;
-               spinButtonSSAASSPlayResY.Value = headers.PlayResY;
-               spinButtonSSAASSPlayDepth.Value = headers.PlayDepth;
+               return entry;
        }
 
-       private void LoadSubViewer1Headers () {
-               entrySubViewer1Title.Text = headers.Title;
-               entrySubViewer1Author.Text = headers.Author;
-               entrySubViewer1Source.Text = headers.VideoSource;
-               entrySubViewer1Program.Text = headers.Program;
-               entrySubViewer1FilePath.Text = headers.SubtitlesSource;
+       //Values: (id, text) pairs
+       private ComboBoxText CreateComboBoxText(string propertyName, params string[] values) {
+               PropertyInfo property = typeof(Headers).GetProperty(propertyName);
 
-               spinButtonSubViewer1Delay.Value = headers.Delay;
-               spinButtonSubViewer1CDTrack.Value = headers.CDTrack;
-       }
+               ComboBoxText comboBox = new ComboBoxText();
+               for (int i = 0; i < values.Length; i += 2) {
+                       comboBox.Append(values[i], values[i + 1]);
+               }
 
-       private void LoadSubViewer2Headers () {
-               entrySubViewer2Title.Text = headers.Title;
-               entrySubViewer2Author.Text = headers.Author;
-               entrySubViewer2Source.Text = headers.VideoSource;
-               entrySubViewer2Program.Text = headers.Program;
-               entrySubViewer2FilePath.Text = headers.SubtitlesSource;
-               entrySubViewer2Comment.Text = headers.Comment;
-               entrySubViewer2FontName.Text = headers.FontName;
-               entrySubViewer2FontColor.Text = headers.FontColor;
-               entrySubViewer2FontStyle.Text = headers.FontStyle;
-
-               spinButtonSubViewer2Delay.Value = headers.Delay;
-               spinButtonSubViewer2CDTrack.Value = headers.CDTrack;
-               spinButtonSubViewer2FontSize.Value = headers.FontSize;
-       }
+               comboBox.ActiveId = (string)property.GetValue(headers);
+               comboBox.Changed += (object sender, EventArgs e) => SetProperty(sender, property, 
((ComboBox)sender).ActiveId);
+               PropertyChanged += (object sender, string prop, object newValue) => {
+                       if ((sender != comboBox) && (prop == propertyName)) {
+                               comboBox.ActiveId = (string)newValue;
+                       }
+               };
 
-       private void StoreHeaders () {
-               StoreKaraokeLRCHeaders();
-               StoreKaraokeVKTHeaders();
-               StoreMPSubHeaders();
-               StoreSSAASSHeaders();
-               StoreSubViewer1Headers();
-               StoreSubViewer2Headers();
+               return comboBox;
        }
 
-       private void StoreKaraokeLRCHeaders() {
-               headers.Title = entryKaraokeLRCTitle.Text;
-               headers.MovieAuthor = entryKaraokeLRCAuthor.Text;
-               headers.Artist = entryKaraokeLRCArtist.Text;
-               headers.Album = entryKaraokeLRCAlbum.Text;
-               headers.Author = entryKaraokeLRCMaker.Text;
-               headers.Version = entryKaraokeLRCVersion.Text;
-               headers.Program = entryKaraokeLRCProgram.Text;
-       }
+       private SpinButton CreateSpinButton(string propertyName, int min, int max, int step) {
+               PropertyInfo property = typeof(Headers).GetProperty(propertyName);
+               object value = property.GetValue(headers);
 
-       private void StoreKaraokeVKTHeaders() {
-               headers.FrameRate = entryKaraokeVKTFrameRate.Text;
-               headers.Author = entryKaraokeVKTAuthor.Text;
-               headers.VideoSource = entryKaraokeVKTSource.Text;
-               headers.Date = entryKaraokeVKTDate.Text;
-       }
+               SpinButton spinButton = new SpinButton(min, max, step);
+               spinButton.Numeric = true;
+               spinButton.Value = (int)value;
 
-       private void StoreMPSubHeaders () {
-               headers.Title = entryMPSubTitle.Text;
-               headers.FileProperties = entryMPSubFile.Text;
-               headers.Author = entryMPSubAuthor.Text;
-               headers.Comment = entryMPSubNote.Text;
+               spinButton.ValueChanged += (object sender, EventArgs e) => SetProperty(sender, property, 
((SpinButton)sender).ValueAsInt);
 
-               headers.MediaType = (comboBoxMPSubType.Active == 0 ? mpSubAudioTag : mpSubVideoTag);
-       }
+               PropertyChanged += (object sender, string prop, object newValue) => {
+                       if ((sender != spinButton) && (prop == propertyName)) {
+                               spinButton.Value = (int)newValue;
+                       }
+               };
 
-       private void StoreSSAASSHeaders () {
-               headers.Title = entrySSAASSTitle.Text;
-               headers.OriginalScript = entrySSAASSOriginalScript.Text;
-               headers.OriginalTranslation = entrySSAASSOriginalTranslation.Text;
-               headers.OriginalEditing = entrySSAASSOriginalEditing.Text;
-               headers.OriginalTiming = entrySSAASSOriginalTiming.Text;
-               headers.OriginalScriptChecking = entrySSAASSOriginalScriptChecking.Text;
-               headers.ScriptUpdatedBy = entrySSAASSScriptUpdatedBy.Text;
-               headers.Collisions = entrySSAASSCollisions.Text;
-               headers.Timer = entrySSAASSTimer.Text;
-
-               headers.PlayResX = spinButtonSSAASSPlayResX.ValueAsInt;
-               headers.PlayResY = spinButtonSSAASSPlayResY.ValueAsInt;
-               headers.PlayDepth = spinButtonSSAASSPlayDepth.ValueAsInt;
+               return spinButton;
        }
 
-       private void StoreSubViewer1Headers () {
-               headers.Title = entrySubViewer1Title.Text;
-               headers.Author = entrySubViewer1Author.Text;
-               headers.VideoSource = entrySubViewer1Source.Text;
-               headers.Program = entrySubViewer1Program.Text;
-               headers.SubtitlesSource = entrySubViewer1FilePath.Text;
+       private void SetProperty (object sender, PropertyInfo property, object value) {
+               /* Prevent unnecessary event fires. Ex: when an entry is changed, other entries for the same 
property are also changed.
+                * Changing each of them would trigger a PropertyChanged event, which would then be handled 
again by all the others (in a loop).
+                */
+               object currentValue = property.GetValue(headers);
+               if (Object.Equals(currentValue, value)) { //Comparison with == wasn't working here, even 
though both values are value types
+                       return;
+               }
 
-               headers.Delay = spinButtonSubViewer1Delay.ValueAsInt;
-               headers.CDTrack = spinButtonSubViewer1CDTrack.ValueAsInt;
+               property.SetValue(headers, value);
+               PropertyChanged(sender, property.Name, value);
        }
 
-       private void StoreSubViewer2Headers () {
-               headers.Title = entrySubViewer2Title.Text;
-               headers.Author = entrySubViewer2Author.Text;
-               headers.VideoSource = entrySubViewer2Source.Text;
-               headers.Program = entrySubViewer2Program.Text;
-               headers.SubtitlesSource = entrySubViewer2FilePath.Text;
-               headers.Comment = entrySubViewer2Comment.Text;
-               headers.FontName = entrySubViewer2FontName.Text;
-               headers.FontColor = entrySubViewer2FontColor.Text;
-               headers.FontStyle = entrySubViewer2FontStyle.Text;
-
-               headers.Delay = spinButtonSubViewer2Delay.ValueAsInt;
-               headers.CDTrack = spinButtonSubViewer2CDTrack.ValueAsInt;
-               headers.FontSize = spinButtonSubViewer2FontSize.ValueAsInt;
+       private void SaveHeaders () {
+               Headers targetHeaders = Base.Document.Subtitles.Properties.Headers;
+
+               foreach (PropertyInfo property in typeof(Headers).GetProperties()) {
+                       property.SetValue(targetHeaders, property.GetValue(headers));
+               }
        }
 
        /* Event members */
 
        protected override bool ProcessResponse (ResponseType response) {
                if (response == ResponseType.Ok) {
-                       StoreHeaders();
+                       SaveHeaders();
                }
                return false;
        }
 
 }
 
-}
+}
\ No newline at end of file
diff --git a/src/SubLib/Core/Domain/Headers.cs b/src/SubLib/Core/Domain/Headers.cs
index 44d91a3..dde4acd 100644
--- a/src/SubLib/Core/Domain/Headers.cs
+++ b/src/SubLib/Core/Domain/Headers.cs
@@ -1,6 +1,6 @@
 /*
  * This file is part of SubLib.
- * Copyright (C) 2006-2010 Pedro Castro
+ * Copyright (C) 2006-2017 Pedro Castro
  *
  * SubLib is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -20,309 +20,139 @@
 using System;
 using System.IO;
 using System.Text;
+using SubLib.IO.SubtitleFormats;
 
 namespace SubLib.Core.Domain {
 
+public enum HeadersMediaType { Audio, Video }
+
 /// <summary>Represents the headers of the supported subtitle formats.</summary>
 public class Headers : ICloneable {
 
-       private string title = String.Empty;
-       private string author = String.Empty;
-       private string movieAuthor = String.Empty;
-       private string artist = String.Empty;
-       private string album = String.Empty;
-       private string videoSource = String.Empty;
-       private string subtitlesSource = String.Empty;
-       private string program = String.Empty;
-       private string version = String.Empty;
-       private string comment = String.Empty;
-       private string fontColor = "&HFFFFFF";
-       private string fontStyle = "bd";
-       private string fontName = "Tahoma";
-       private string fileProperties = String.Empty;
-       private string mediaType = "VIDEO";
-       private string originalScript = "<unknown>";
-       private string originalTranslation = String.Empty;
-       private string originalEditing = String.Empty;
-       private string originalTiming = String.Empty;
-       private string originalScriptChecking = String.Empty;
-       private string scriptUpdatedBy = String.Empty;
-       private string collisions = String.Empty;
-       private string timer = String.Empty;
-       private string frameRate = String.Empty;
-       private string date = DateTime.Today.ToString("yyyy-MM-dd");
-       private int playResX = 0;
-       private int playResY = 0;
-       private int playDepth = 0;
-       private int fontSize = 24;
-       private int delay = 0;
-       private int cdTrack = 0;
-
-
-       /* Public properties */
+       /* Common properties */
 
        /// <summary>The movie's title.</summary>
-       public string Title {
-               get { return title; }
-               set { title = value; }
-       }
+       public string Title { get; set; }
 
        /// <summary>The subtitles' author.</summary>
-       public string Author {
-               get { return author; }
-               set { author = value; }
-       }
-
-       /// <summary>The movie's author.</summary>
-       public string MovieAuthor {
-               get { return movieAuthor; }
-               set { movieAuthor = value; }
-       }
+       public string Author { get; set; }
 
        /// <summary>The subtitles' artist.</summary>
-       public string Artist {
-               get { return artist; }
-               set { artist = value; }
-       }
+       public string Artist { get; set; }
 
        /// <summary>The subtitles' album.</summary>
-       public string Album {
-               get { return album; }
-               set { album = value; }
-       }
+       public string Album { get; set; }
 
-       /// <summary>The video' source.</summary>
-       public string VideoSource {
-               get { return videoSource; }
-               set { videoSource = value; }
-       }
-
-       /// <summary>The subtitles' source.</summary>
-       public string SubtitlesSource {
-               get { return subtitlesSource; }
-               set { subtitlesSource = value; }
-       }
+       /// <summary>The subtitles' file creator.</summary>
+       public string FileCreator { get; set; }
 
        /// <summary>The name of the subtitles' program.</summary>
-       public string Program {
-               get { return program; }
-               set { program = value; }
-       }
+       public string Program { get; set; }
 
-       /// <summary>The version of the subtitles.</summary>
-       public string Version {
-               get { return version; }
-               set { version = value; }
-       }
+       /// <summary>Th subtitles' version.</summary>
+       public string Version { get; set; }
+
+       /// <summary>The movie's frame rate.</summary>
+       public string FrameRate { get; set; }
+
+       /// <summary>The subtitles' date.</summary>
+       public string Date { get; set; } = DateTime.Today.ToString("yyyy-MM-dd");
+
+       /// <summary>The video source.</summary>
+       public string Source { get; set; }
+
+       /// <summary>The subtitles' file path.</summary>
+       public string FilePath { get; set; }
 
        /// <summary>A comment or note on the subtitles.</summary>
-       public string Comment {
-               get { return comment; }
-               set { comment = value; }
-       }
+       public string Comment { get; set; }
+
+       /// <summary>The delay of the subtitles.</summary>
+       public int Delay { get; set; } = 0;
+
+       /// <summary>The CD track of the subtitles.</summary>
+       public int CDTrack { get; set; } = 1;
+
+       /// <summary>The Media Type of the subtitles, which can be 'VIDEO' or 'AUDIO'.</summary>
+       /// <remarks>This property is only set if the value is 'VIDEO' or 'AUDIO'. It's case 
insensitive.</remarks>
+       public HeadersMediaType? MediaType { get; set; } = HeadersMediaType.Video;
+
+
+       /* SubViewer 2 */
 
        /// <summary>The subtitles' font color.</summary>
-       public string FontColor {
-               get { return fontColor; }
-               set { fontColor = value; }
-       }
+       public string SubViewer2FontColor { get; set; } = "&HFFFFFF";
 
        /// <summary>The subtitles' font style.</summary>
-       public string FontStyle {
-               get { return fontStyle; }
-               set { fontStyle = value; }
-       }
+       public string SubViewer2FontStyle { get; set; } = "bd";
 
        /// <summary>The subtitles' font name.</summary>
-       public string FontName {
-               get { return fontName; }
-               set { fontName = value; }
-       }
+       public string SubViewer2FontName { get; set; } = "Tahoma";
 
-       /// <summary>The File properties, in the format 'size,md5'.</summary>
-       public string FileProperties {
-               get { return fileProperties; }
-               set { fileProperties = value; }
-       }
+       /// <summary>The subtitles' font size.</summary>
+       public int SubViewer2FontSize { get; set; } = 24;
 
-       /// <summary>The Media Type of the subtitles, which can be 'VIDEO' or 'AUDIO'.</summary>
-       /// <remarks>This property is only set if the value is 'VIDEO' or 'AUDIO'. It's case 
insensitive.</remarks>
-       public string MediaType {
-               get { return mediaType; }
+
+       /* MPSub */
+
+       /// <summary>The File properties, in the format 'size,md5'.</summary>
+       public string MPSubFileProperties { get; set; }
+
+       public string MPSubMediaType {
+               get {
+                       if (MediaType == null) {
+                               return null;
+                       } else {
+                               return MediaType.ToString().ToUpper();
+                       }
+               }
                set {
-                       string type = value.ToUpper();
-                       if (type.Equals("VIDEO") || type.Equals("AUDIO"))
-                               mediaType = type;
+                       if (SubtitleFormatMPSub.HeaderMediaTypeVideo.Equals(value, 
StringComparison.InvariantCultureIgnoreCase)) {
+                               MediaType = HeadersMediaType.Video;
+                       } else if (SubtitleFormatMPSub.HeaderMediaTypeAudio.Equals(value, 
StringComparison.InvariantCultureIgnoreCase)) {
+                               MediaType = HeadersMediaType.Audio;
+                       } else {
+                               MediaType = null;
+                       }
                }
        }
 
+
+       /* Sub Station Alpha */
+
        /// <summary>The Original Script of the subtitles.</summary>
-       public string OriginalScript {
-               get { return originalScript; }
-               set { originalScript = value; }
-       }
+       public string SubStationAlphaOriginalScript { get; set; }
 
        /// <summary>The Original Translation of the subtitles.</summary>
-       public string OriginalTranslation {
-               get { return originalTranslation; }
-               set { originalTranslation = value; }
-       }
+       public string SubStationAlphaOriginalTranslation { get; set; }
 
        /// <summary>The Original Editing of the subtitles.</summary>
-       public string OriginalEditing {
-               get { return originalEditing; }
-               set { originalEditing = value; }
-       }
+       public string SubStationAlphaOriginalEditing { get; set; }
 
        /// <summary>The Original Timing of the subtitles.</summary>
-       public string OriginalTiming {
-               get { return originalTiming; }
-               set { originalTiming = value; }
-       }
+       public string SubStationAlphaOriginalTiming { get; set; }
 
        /// <summary>The Original Script Checking of the subtitles.</summary>
-       public string OriginalScriptChecking {
-               get { return originalScriptChecking; }
-               set { originalScriptChecking = value; }
-       }
+       public string SubStationAlphaOriginalScriptChecking { get; set; }
 
        /// <summary>The Script Updated By of the subtitles.</summary>
-       public string ScriptUpdatedBy {
-               get { return scriptUpdatedBy; }
-               set { scriptUpdatedBy = value; }
-       }
+       public string SubStationAlphaScriptUpdatedBy { get; set; }
 
        /// <summary>The Collisions of the subtitles.</summary>
-       public string Collisions {
-               get { return collisions; }
-               set { collisions = value; }
-       }
+       public string SubStationAlphaCollisions { get; set; }
 
        /// <summary>The Timer of the subtitles.</summary>
-       public string Timer {
-               get { return timer; }
-               set { timer = value; }
-       }
+       public string SubStationAlphaTimer { get; set; }
 
-       /// <summary>The movie's frame rate.</summary>
-       public string FrameRate {
-               get { return frameRate; }
-               set { frameRate = value; }
-       }
-
-       /// <summary>The subtitles' date.</summary>
-       public string Date {
-               get { return date; }
-               set { date = value; }
-       }
 
        /// <summary>The PlayResX of the subtitles.</summary>
-       public int PlayResX {
-               get { return playResX; }
-               set { playResX = value; }
-       }
-
-       /// <summary>The PlayResX of the subtitles as text.</summary>
-       public string PlayResXAsText {
-               get { return playResX.ToString(); }
-               set {
-                       try {
-                               playResX = Convert.ToInt32(value);
-                       }
-                       catch (Exception) {
-                       }
-                }
-       }
+       public int SubStationAlphaPlayResX { get; set; } = 0;
 
        /// <summary>The PlayResY of the subtitles.</summary>
-       public int PlayResY {
-               get { return playResY; }
-               set { playResY = value; }
-       }
-
-       /// <summary>The PlayResY of the subtitles as text.</summary>
-       public string PlayResYAsText {
-               get { return playResY.ToString(); }
-               set {
-                       try {
-                               playResY = Convert.ToInt32(value);
-                       }
-                       catch (Exception) {
-                       }
-                }
-       }
+       public int SubStationAlphaPlayResY { get; set; } = 0;
 
        /// <summary>The PlayDepth of the subtitles.</summary>
-       public int PlayDepth {
-               get { return playDepth; }
-               set { playDepth = value; }
-       }
-
-       /// <summary>The PlayResY of the subtitles as text.</summary>
-       public string PlayDepthAsText {
-               get { return playDepth.ToString(); }
-               set {
-                       try {
-                               playDepth = Convert.ToInt32(value);
-                       }
-                       catch (Exception) {
-                       }
-                }
-       }
-
-       /// <summary>The subtitles' font size.</summary>
-       public int FontSize {
-               get { return fontSize; }
-               set { fontSize = value; }
-       }
-
-       /// <summary>The subtitles' font size as text.</summary>
-       public string FontSizeAsText {
-               get { return fontSize.ToString(); }
-               set {
-                       try {
-                               fontSize = Convert.ToInt32(value);
-                       }
-                       catch (Exception) {
-                       }
-                }
-       }
-
-       /// <summary>The delay of the subtitles.</summary>
-       public int Delay {
-               get { return delay; }
-               set { delay = value; }
-       }
-
-       /// <summary>The delay of the subtitles as text.</summary>
-       public string DelayAsText {
-               get { return delay.ToString(); }
-               set {
-                       try {
-                               delay = Convert.ToInt32(value);
-                       }
-                       catch (Exception) {
-                       }
-                }
-       }
-
-       /// <summary>The CD track of the subtitles.</summary>
-       public int CDTrack {
-               get { return cdTrack; }
-               set { cdTrack = value; }
-       }
-
-       /// <summary>The CD track of the subtitles as text.</summary>
-       public string CDTrackAsText {
-               get { return cdTrack.ToString(); }
-               set {
-                       try {
-                               cdTrack = Convert.ToInt32(value);
-                       }
-                       catch (Exception) {
-                       }
-                }
-       }
+       public int SubStationAlphaPlayDepth { get; set; } = 0;
 
 
        /* Public methods */
diff --git a/src/SubLib/IO/Input/SubtitleParser.cs b/src/SubLib/IO/Input/SubtitleParser.cs
index 943e86e..3f947f8 100644
--- a/src/SubLib/IO/Input/SubtitleParser.cs
+++ b/src/SubLib/IO/Input/SubtitleParser.cs
@@ -1,6 +1,6 @@
 /*
  * This file is part of SubLib.
- * Copyright (C) 2005-2009,2011 Pedro Castro
+ * Copyright (C) 2005-2017 Pedro Castro
  *
  * SubLib is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -157,21 +157,22 @@ internal class SubtitleParser {
 
        private bool ParseHeaderSubViewer1 (Match match, ParsingProperties properties, Headers headers) {
                string result = String.Empty;
+               int intResult = 0;
 
                if (ParseGroup(match, "Title", ref result))
                        headers.Title = result;
                else if (ParseGroup(match, "Author", ref result))
                        headers.Author = result;
                else if (ParseGroup(match, "Source", ref result))
-                       headers.VideoSource = result;
+                       headers.Source = result;
                else if (ParseGroup(match, "Program", ref result))
                        headers.Program = result;
                else if (ParseGroup(match, "FilePath", ref result))
-                       headers.SubtitlesSource = result;
-               else if (ParseGroup(match, "Delay", ref result))
-                       headers.DelayAsText = result;
-               else if (ParseGroup(match, "CdTrack", ref result))
-                       headers.CDTrackAsText = result;
+                       headers.FilePath = result;
+               else if (ParseGroup(match, "Delay", ref intResult))
+                       headers.Delay = intResult;
+               else if (ParseGroup(match, "CdTrack", ref intResult))
+                       headers.CDTrack = intResult;
                else {
                        return false;
                }
@@ -181,18 +182,19 @@ internal class SubtitleParser {
        private bool ParseHeaderSubViewer2 (Match match, ParsingProperties properties) {
                Headers headers = properties.Headers;
                string result = String.Empty;
+               int intResult = 0;
 
                if (!ParseHeaderSubViewer1(match, properties, headers)) {
                        if (ParseGroup(match, "Comment", ref result))
                                headers.Comment = result;
                        else if (ParseGroup(match, "FontName", ref result))
-                               headers.FontName = result;
+                               headers.SubViewer2FontName = result;
                        else if (ParseGroup(match, "FontColor", ref result))
-                               headers.FontColor = result;
+                               headers.SubViewer2FontColor = result;
                        else if (ParseGroup(match, "FontStyle", ref result))
-                               headers.FontStyle = result;
-                       else if (ParseGroup(match, "FontSize", ref result))
-                               headers.FontSizeAsText = result;
+                               headers.SubViewer2FontStyle = result;
+                       else if (ParseGroup(match, "FontSize", ref intResult))
+                               headers.SubViewer2FontSize = intResult;
                        else
                                return false;
                }
@@ -208,7 +210,7 @@ internal class SubtitleParser {
                else if (ParseGroup(match, "Author", ref result))
                        headers.Author = result;
                else if (ParseGroup(match, "Source", ref result))
-                       headers.VideoSource = result;
+                       headers.Source = result;
                else if (ParseGroup(match, "Date", ref result))
                        headers.Date = result;
                else {
@@ -224,13 +226,13 @@ internal class SubtitleParser {
                if (ParseGroup(match, "Title", ref result))
                        headers.Title = result;
                else if (ParseGroup(match, "Author", ref result))
-                       headers.MovieAuthor = result;
+                       headers.Author = result;
                else if (ParseGroup(match, "Artist", ref result))
                        headers.Artist = result;
                else if (ParseGroup(match, "Album", ref result))
                        headers.Album = result;
                else if (ParseGroup(match, "Maker", ref result))
-                       headers.Author = result;
+                       headers.FileCreator = result;
                else if (ParseGroup(match, "Version", ref result))
                        headers.Version = result;
                else if (ParseGroup(match, "Program", ref result))
@@ -238,6 +240,7 @@ internal class SubtitleParser {
                else {
                        return false;
                }
+
                return true;
        }
 
@@ -249,11 +252,11 @@ internal class SubtitleParser {
                if (ParseGroup(match, "Title", ref result))
                        headers.Title = result;
                else if (ParseGroup(match, "File", ref result))
-                       headers.FileProperties = result;
+                       headers.MPSubFileProperties = result;
                else if (ParseGroup(match, "Author", ref result))
                        headers.Author = result;
                else if (ParseGroup(match, "MediaType", ref result))
-                       headers.MediaType = result;
+                       headers.MPSubMediaType = result;
                else if (ParseGroup(match, "Note", ref result))
                        headers.Comment = result;
                //Used to detect if a subtitles' timing mode is Times in the case of a format that supports 
both
@@ -278,27 +281,27 @@ internal class SubtitleParser {
                if (ParseGroup(match, "Title", ref result))
                        headers.Title = result;
                else if (ParseGroup(match, "OriginalScript", ref result))
-                       headers.OriginalScript = result;
+                       headers.SubStationAlphaOriginalScript = result;
                else if (ParseGroup(match, "OriginalTranslation", ref result))
-                       headers.OriginalTranslation = result;
+                       headers.SubStationAlphaOriginalTranslation = result;
                else if (ParseGroup(match, "OriginalEditing", ref result))
-                       headers.OriginalEditing = result;
+                       headers.SubStationAlphaOriginalEditing = result;
                else if (ParseGroup(match, "OriginalTiming", ref result))
-                       headers.OriginalTiming = result;
+                       headers.SubStationAlphaOriginalTiming = result;
                else if (ParseGroup(match, "OriginalScriptChecking", ref result))
-                       headers.OriginalScriptChecking = result;
+                       headers.SubStationAlphaOriginalScriptChecking = result;
                else if (ParseGroup(match, "ScriptUpdatedBy", ref result))
-                       headers.ScriptUpdatedBy = result;
+                       headers.SubStationAlphaScriptUpdatedBy = result;
                else if (ParseGroup(match, "Collisions", ref result))
-                       headers.Collisions = result;
+                       headers.SubStationAlphaCollisions = result;
                else if (ParseGroup(match, "PlayResX", ref intResult))
-                       headers.PlayResX = intResult;
+                       headers.SubStationAlphaPlayResX = intResult;
                else if (ParseGroup(match, "PlayResY", ref intResult))
-                       headers.PlayResY = intResult;
+                       headers.SubStationAlphaPlayResY = intResult;
                else if (ParseGroup(match, "PlayDepth", ref intResult))
-                       headers.PlayDepth = intResult;
+                       headers.SubStationAlphaPlayDepth = intResult;
                else if (ParseGroup(match, "Timer", ref result))
-                       headers.Timer = result;
+                       headers.SubStationAlphaTimer = result;
                else {
                        return false;
                }
diff --git a/src/SubLib/IO/SubtitleFormats/SubtitleFormatKaraokeLyricsLRC.cs 
b/src/SubLib/IO/SubtitleFormats/SubtitleFormatKaraokeLyricsLRC.cs
index f8101ef..920ecc0 100644
--- a/src/SubLib/IO/SubtitleFormats/SubtitleFormatKaraokeLyricsLRC.cs
+++ b/src/SubLib/IO/SubtitleFormats/SubtitleFormatKaraokeLyricsLRC.cs
@@ -1,6 +1,6 @@
 /*
  * This file is part of SubLib.
- * Copyright (C) 2007-2008,2011 Pedro Castro
+ * Copyright (C) 2007-2017 Pedro Castro
  *
  * SubLib is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -56,10 +56,10 @@ internal class SubtitleFormatKaraokeLyricsLRC : SubtitleFormat {
        internal override string HeadersToString (SubtitleProperties subtitleProperties, FileProperties 
fileProperties) {
                Headers headers = subtitleProperties.Headers;
                return "[ti: " + headers.Title + "]\n" +
-                       "[au:" + headers.MovieAuthor + "]\n" +
+                       "[au:" + headers.Author + "]\n" +
                        "[ar:" + headers.Artist + "]\n" +
                        "[al:" + headers.Album + "]\n" +
-                       "[by:" + headers.Author + "]\n" +
+                       "[by:" + headers.FileCreator + "]\n" +
                        "[ve:" + headers.Version + "]\n" +
                        "[re:" + headers.Program + "]\n";
        }
diff --git a/src/SubLib/IO/SubtitleFormats/SubtitleFormatKaraokeLyricsVKT.cs 
b/src/SubLib/IO/SubtitleFormats/SubtitleFormatKaraokeLyricsVKT.cs
index 6a12f09..94b24d1 100644
--- a/src/SubLib/IO/SubtitleFormats/SubtitleFormatKaraokeLyricsVKT.cs
+++ b/src/SubLib/IO/SubtitleFormats/SubtitleFormatKaraokeLyricsVKT.cs
@@ -1,6 +1,6 @@
 /*
  * This file is part of SubLib.
- * Copyright (C) 2007-2008 Pedro Castro
+ * Copyright (C) 2007-2017 Pedro Castro
  *
  * SubLib is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -57,7 +57,7 @@ internal class SubtitleFormatKaraokeLyricsVKT : SubtitleFormat {
                return "# <HEAD>\n" +
                        "# FRAME RATE=" + headers.FrameRate + "\n" +
                        "# CREATOR=" + headers.Author + "\n" +
-                       "# VIDEO SOURCE=" + headers.VideoSource + "\n" +
+                       "# VIDEO SOURCE=" + headers.Source + "\n" +
                        "# DATE=" + headers.Date + "\n" +
                        "# </HEAD>\n#\n";
        }
diff --git a/src/SubLib/IO/SubtitleFormats/SubtitleFormatMPSub.cs 
b/src/SubLib/IO/SubtitleFormats/SubtitleFormatMPSub.cs
index a098497..6b11df2 100644
--- a/src/SubLib/IO/SubtitleFormats/SubtitleFormatMPSub.cs
+++ b/src/SubLib/IO/SubtitleFormats/SubtitleFormatMPSub.cs
@@ -1,6 +1,6 @@
 /*
  * This file is part of SubLib.
- * Copyright (C) 2006-2008,2011 Pedro Castro
+ * Copyright (C) 2006-2017 Pedro Castro
  *
  * SubLib is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -25,6 +25,9 @@ namespace SubLib.IO.SubtitleFormats {
 //TODO: warn when opening files with comments, warn when saving lines with '#' as they will be 
ignored/treated as comments
 internal class SubtitleFormatMPSub : SubtitleFormat {
 
+       public const string HeaderMediaTypeAudio = "AUDIO";
+       public const string HeaderMediaTypeVideo = "VIDEO";
+
        internal SubtitleFormatMPSub () {
                name = "MPSub";
                type = SubtitleType.MPSub;
@@ -57,9 +60,9 @@ internal class SubtitleFormatMPSub : SubtitleFormat {
                Headers headers = subtitleProperties.Headers;
                string format = (fileProperties.TimingMode == TimingMode.Times ? "TIME" : 
subtitleProperties.CurrentFrameRate.ToString());
                return "TITLE=" + headers.Title + "\n" +
-                       "FILE=" + headers.FileProperties + "\n" +
+                       "FILE=" + headers.MPSubFileProperties + "\n" +
                        "AUTHOR=" + headers.Author + "\n" +
-                       "TYPE=" + headers.MediaType + "\n" +
+                       "TYPE=" + headers.MPSubMediaType + "\n" +
                        "FORMAT=" + format + "\n" +
                        "NOTE=" + headers.Comment + "\n\n";
        }
diff --git a/src/SubLib/IO/SubtitleFormats/SubtitleFormatSubStationAlpha.cs 
b/src/SubLib/IO/SubtitleFormats/SubtitleFormatSubStationAlpha.cs
index acae1da..3d2e819 100644
--- a/src/SubLib/IO/SubtitleFormats/SubtitleFormatSubStationAlpha.cs
+++ b/src/SubLib/IO/SubtitleFormats/SubtitleFormatSubStationAlpha.cs
@@ -1,6 +1,6 @@
 /*
  * This file is part of SubLib.
- * Copyright (C) 2006-2008 Pedro Castro
+ * Copyright (C) 2006-2017 Pedro Castro
  *
  * SubLib is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -17,26 +17,26 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-using SubLib.Core.Domain;
-using System;
-using System.Text.RegularExpressions;
-
-namespace SubLib.IO.SubtitleFormats {
-
+using SubLib.Core.Domain;
+using System;
+using System.Text.RegularExpressions;
+
+namespace SubLib.IO.SubtitleFormats {
+
 internal class SubtitleFormatSubStationAlpha : SubtitleFormat {
        private static Regex styleExpression = new Regex(@"\{\\[ubi]\d\}", RegexOptions.IgnoreCase);
 
-       internal SubtitleFormatSubStationAlpha () {
-               name = FormatName;
-       type = FormatType;
-       extensions = FormatExtensions;
+       internal SubtitleFormatSubStationAlpha () {
+               name = FormatName;
+       type = FormatType;
+       extensions = FormatExtensions;
 
        mode = SubtitleMode.Times;
        lineBreak = @"\N";
 
        format = @"\[\s*" + StyleTypeIn + 
@"\s*Styles\s*\][^\[]*\[\s*Events\s*\]\s*Format:\s*[^,\n]*(,[^,\n]*){9}";
 
-       subtitleIn = 
@"Dialogue:[^,]*,(?<StartHours>\d+):(?<StartMinutes>\d+):(?<StartSeconds>\d+)\.(?<StartCentiseconds>\d+),(?<EndHours>\d+):(?<EndMinutes>\d+):(?<EndSeconds>\d+)\.(?<EndCentiseconds>\d+)(,[^,]*){6},(?<Text>.*)";
+       subtitleIn = 
@"Dialogue:[^,]*,(?<StartHours>\d+):(?<StartMinutes>\d+):(?<StartSeconds>\d+)\.(?<StartCentiseconds>\d+),(?<EndHours>\d+):(?<EndMinutes>\d+):(?<EndSeconds>\d+)\.(?<EndCentiseconds>\d+)(,[^,]*){6},(?<Text>.*)";
 
        subtitleOut = FormatSubtitleOut;
         bodyBeginOut = FormatBodyBeginOut;
@@ -56,44 +56,45 @@ internal class SubtitleFormatSubStationAlpha : SubtitleFormat {
                @"Timer:(?<Timer>.*)"
                };
        }
-
-       internal override string StyleToString (Style style) {
-               return StyleToString(style, "1");
-       }
-
-       internal override string EndOfStyleToString (Style style) {
-               return StyleToString(style, "0");
-       }
-       
-       internal override void SubtitleInputPostProcess (Subtitle subtitle) {
-               string subtitleText = subtitle.Text.Get(lineBreak);
-               string styleText = String.Empty;
-               MatchCollection matches = styleExpression.Matches(subtitleText);
-               foreach (Match match in matches) {
-                       styleText += match.Value;
-               }
-               Style style = StringToStyle(styleText);
-               subtitle.Style = style;
-               subtitleText = styleExpression.Replace(subtitleText, String.Empty);
-               subtitle.Text.Set(subtitleText, lineBreak, true);
-       }
-
+
+       internal override string StyleToString (Style style) {
+               return StyleToString(style, "1");
+       }
+
+       internal override string EndOfStyleToString (Style style) {
+               return StyleToString(style, "0");
+       }
+       
+       internal override void SubtitleInputPostProcess (Subtitle subtitle) {
+               string subtitleText = subtitle.Text.Get(lineBreak);
+               string styleText = String.Empty;
+               MatchCollection matches = styleExpression.Matches(subtitleText);
+               foreach (Match match in matches) {
+                       styleText += match.Value;
+               }
+               Style style = StringToStyle(styleText);
+               subtitle.Style = style;
+               subtitleText = styleExpression.Replace(subtitleText, String.Empty);
+               subtitle.Text.Set(subtitleText, lineBreak, true);
+       }
+
        internal override string HeadersToString (SubtitleProperties subtitleProperties, FileProperties 
fileProperties) {
-               Headers headers = subtitleProperties.Headers;
+               Headers headers = subtitleProperties.Headers;
                return "[Script Info]\n" +
-                       Header("Title:", headers.Title, "<untitled>") +                 Header("Original 
Script:", headers.OriginalScript, "<unknown>") +
+                       Header("Title:", headers.Title, "<untitled>") +
+                       Header("Original Script:", headers.SubStationAlphaOriginalScript, "<unknown>") +
                        "Script Type: " + ScriptType + "\n" +
-                       Header("Original Translation:", headers.OriginalTranslation) +
-                       Header("Original Editing:", headers.OriginalEditing) +
-                       Header("Original Timing:", headers.OriginalTiming) +
-                       Header("Original Script Checking:", headers.OriginalScriptChecking) +
-                       Header("Script Updated By:", headers.ScriptUpdatedBy) +
-                       Header("Collisions:", headers.Collisions) +
-                       Header("PlayResX:", headers.PlayResX) +
-                       Header("PlayResY:", headers.PlayResY) +
-                       Header("PlayDepth:", headers.PlayDepth) +
-                       Header("Timer:", headers.Timer) + "\n" +
-                       StyleSection;
+                       Header("Original Translation:", headers.SubStationAlphaOriginalTranslation) +
+                       Header("Original Editing:", headers.SubStationAlphaOriginalEditing) +
+                       Header("Original Timing:", headers.SubStationAlphaOriginalTiming) +
+                       Header("Original Script Checking:", headers.SubStationAlphaOriginalScriptChecking) +
+                       Header("Script Updated By:", headers.SubStationAlphaScriptUpdatedBy) +
+                       Header("Collisions:", headers.SubStationAlphaCollisions) +
+                       Header("PlayResX:", headers.SubStationAlphaPlayResX) +
+                       Header("PlayResY:", headers.SubStationAlphaPlayResY) +
+                       Header("PlayDepth:", headers.SubStationAlphaPlayDepth) +
+                       Header("Timer:", headers.SubStationAlphaTimer) + "\n" +
+                       StyleSection;
        }
 
        /* Protected members */
@@ -128,45 +129,42 @@ internal class SubtitleFormatSubStationAlpha : SubtitleFormat {
 
        protected virtual string StyleSection {
                get {
-                       return "[V4 Styles]\nFormat: Name, Fontname, Fontsize, PrimaryColour, 
SecondaryColour, TertiaryColour, BackColour, Bold, Italic, BorderStyle, Outline, Shadow, Alignment, MarginL, 
MarginR, MarginV, AlphaLevel, Encoding\n" +
+                       return "[V4 Styles]\nFormat: Name, Fontname, Fontsize, PrimaryColour, 
SecondaryColour, TertiaryColour, BackColour, Bold, Italic, BorderStyle, Outline, Shadow, Alignment, MarginL, 
MarginR, MarginV, AlphaLevel, Encoding\n" +
                "Style: Default,Tahoma,24,16777215,16777215,16777215,0,-1,0,1,1,1,2,10,10,30,0,0\n\n";
                }
-       }
+       }
 
        /* Private members */
 
        private string Header (string headerIntro, string headerValue, string defaultValue) {
-               if (headerValue == String.Empty)
+               if (String.IsNullOrEmpty(headerValue))
                        return headerIntro + " " + defaultValue + "\n";
                else
                        return headerIntro + " " + headerValue + "\n";
        }
 
        private string Header (string headerIntro, string headerValue) {
-               if (headerValue == String.Empty)
+               if (String.IsNullOrEmpty(headerValue))
                        return String.Empty;
                else
                        return headerIntro + " " + headerValue + "\n";
        }
 
        private string Header (string headerIntro, int headerValue) {
-               if (headerValue == -1)
-                       return String.Empty;
-               else
-                       return headerIntro + " " + headerValue + "\n";
+               return headerIntro + " " + headerValue + "\n";
        }
 
        protected string StyleToString (Style style, string suffix) {
-               string styleText = String.Empty;
-               if (style.Underline)
-                       styleText += @"{\u" + suffix + "}";
-               if (style.Bold)
-                       styleText += @"{\b" + suffix + "}";
-               if (style.Italic)
-                       styleText += @"{\i" + suffix + "}";
+               string styleText = String.Empty;
+               if (style.Underline)
+                       styleText += @"{\u" + suffix + "}";
+               if (style.Bold)
+                       styleText += @"{\b" + suffix + "}";
+               if (style.Italic)
+                       styleText += @"{\i" + suffix + "}";
                return styleText;
-       }
+       }
+
+}
 
-}
-
-}
+}
diff --git a/src/SubLib/IO/SubtitleFormats/SubtitleFormatSubViewer1.cs 
b/src/SubLib/IO/SubtitleFormats/SubtitleFormatSubViewer1.cs
index 30308ea..58af8e6 100644
--- a/src/SubLib/IO/SubtitleFormats/SubtitleFormatSubViewer1.cs
+++ b/src/SubLib/IO/SubtitleFormats/SubtitleFormatSubViewer1.cs
@@ -1,6 +1,6 @@
 /*
  * This file is part of SubLib.
- * Copyright (C) 2006-2008 Pedro Castro
+ * Copyright (C) 2006-2017 Pedro Castro
  *
  * SubLib is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -60,9 +60,9 @@ internal class SubtitleFormatSubViewer1 : SubtitleFormat {
                Headers headers = subtitleProperties.Headers;
                return "[TITLE]\n" + headers.Title + "\n" +
                        "[AUTHOR]\n" + headers.Author + "\n" +
-                       "[SOURCE]\n" + headers.VideoSource + "\n" +
+                       "[SOURCE]\n" + headers.Source + "\n" +
                        "[PRG]\n" + headers.Program + "\n" +
-                       "[FILEPATH]\n" + headers.SubtitlesSource + "\n" +
+                       "[FILEPATH]\n" + headers.FilePath + "\n" +
                        "[DELAY]\n" + headers.Delay + "\n" +
                        "[CD TRACK]\n" + headers.CDTrack + "\n";
        }
diff --git a/src/SubLib/IO/SubtitleFormats/SubtitleFormatSubViewer2.cs 
b/src/SubLib/IO/SubtitleFormats/SubtitleFormatSubViewer2.cs
index 928eeaa..e5c8dea 100644
--- a/src/SubLib/IO/SubtitleFormats/SubtitleFormatSubViewer2.cs
+++ b/src/SubLib/IO/SubtitleFormats/SubtitleFormatSubViewer2.cs
@@ -1,6 +1,6 @@
 /*
  * This file is part of SubLib.
- * Copyright (C) 2006-2008 Pedro Castro
+ * Copyright (C) 2006-2017 Pedro Castro
  *
  * SubLib is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -59,16 +59,16 @@ internal class SubtitleFormatSubViewer2 : SubtitleFormat {
                return "[INFORMATION]\n" +
                        "[TITLE]" + headers.Title + "\n" +
                        "[AUTHOR]" + headers.Author + "\n" +
-                       "[SOURCE]" + headers.VideoSource + "\n" +
+                       "[SOURCE]" + headers.Source + "\n" +
                        "[PRG]" + headers.Program + "\n" +
-                       "[FILEPATH]" + headers.SubtitlesSource + "\n" +
+                       "[FILEPATH]" + headers.FilePath + "\n" +
                        "[DELAY]" + headers.Delay + "\n" +
                        "[CD TRACK]" + headers.CDTrack + "\n" +
                        "[COMMENT]" + headers.Comment + "\n" +
                        "[END INFORMATION]\n" +
                        "[SUBTITLE]\n" +
-                       "[COLF]" + headers.FontColor + ",[STYLE]" + headers.FontStyle +
-                               ",[SIZE]" + headers.FontSize + ",[FONT]" + headers.FontName + "\n";
+                       "[COLF]" + headers.SubViewer2FontColor + ",[STYLE]" + headers.SubViewer2FontStyle +
+                       ",[SIZE]" + headers.SubViewer2FontSize + ",[FONT]" + headers.SubViewer2FontName + 
"\n";
        }
 
 }


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