summaryrefslogtreecommitdiffstats
path: root/win/C#/Functions
diff options
context:
space:
mode:
authorsr55 <[email protected]>2010-05-07 18:58:46 +0000
committersr55 <[email protected]>2010-05-07 18:58:46 +0000
commit3698468402be2e371a53489fb65d0deb9b17659f (patch)
tree1657d95bb5e669b244229400181757d4a11e1051 /win/C#/Functions
parentbcc3c4e2ac8dbb14353a3e9f4ba643725daa3beb (diff)
WinGui:
- Added Export support to the Chapters Tab. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3287 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/Functions')
-rw-r--r--win/C#/Functions/Main.cs32
1 files changed, 32 insertions, 0 deletions
diff --git a/win/C#/Functions/Main.cs b/win/C#/Functions/Main.cs
index 80d806b49..552c6a95b 100644
--- a/win/C#/Functions/Main.cs
+++ b/win/C#/Functions/Main.cs
@@ -136,6 +136,38 @@ namespace Handbrake.Functions
}
/// <summary>
+ /// Create a CSV file with the data from the Main Window Chapters tab
+ /// </summary>
+ /// <param name="mainWindow">Main Window</param>
+ /// <param name="filePathName">Path to save the csv file</param>
+ /// <returns>True if successful </returns>
+ public static bool SaveChapterMarkersToCsv(frmMain mainWindow, string filePathName)
+ {
+ try
+ {
+ string csv = string.Empty;
+
+ foreach (DataGridViewRow row in mainWindow.data_chpt.Rows)
+ {
+ csv += row.Cells[0].Value.ToString();
+ csv += ",";
+ csv += row.Cells[1].Value.ToString().Replace(",", "\\,");
+ csv += Environment.NewLine;
+ }
+ StreamWriter file = new StreamWriter(filePathName);
+ file.Write(csv);
+ file.Close();
+ file.Dispose();
+ return true;
+ }
+ catch (Exception exc)
+ {
+ MessageBox.Show("Unable to save Chapter Makrers file! \nChapter marker names will NOT be saved in your encode \n\n" + exc, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+ return false;
+ }
+ }
+
+ /// <summary>
/// Function which generates the filename and path automatically based on
/// the Source Name, DVD title and DVD Chapters
/// </summary>