diff options
author | sr55 <[email protected]> | 2009-09-14 15:07:37 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2009-09-14 15:07:37 +0000 |
commit | 39d10e17c924480e007ab0ed6940fb8ef35a2688 (patch) | |
tree | 59c45e5662c8a6b5b5158e4eac8a9c5d7ca30bea /win/C# | |
parent | b33262144205a4bd058d92a78fe48b8055b1de27 (diff) |
WinGui:
- Fix: DVD volume name now used for autoName function rather than Video_TS folder. (Thanks RandomEngy)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2820 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#')
-rw-r--r-- | win/C#/Functions/Main.cs | 2 | ||||
-rw-r--r-- | win/C#/frmMain.cs | 46 |
2 files changed, 42 insertions, 6 deletions
diff --git a/win/C#/Functions/Main.cs b/win/C#/Functions/Main.cs index dd618cb52..6f8efaa2b 100644 --- a/win/C#/Functions/Main.cs +++ b/win/C#/Functions/Main.cs @@ -130,7 +130,7 @@ namespace Handbrake.Functions if (mainWindow.drp_dvdtitle.Text != "Automatic")
{
// Get the Source Name
- string sourceName = Path.GetFileNameWithoutExtension(mainWindow.sourcePath);
+ string sourceName = mainWindow.SourceName;
// Get the Selected Title Number
string[] titlesplit = mainWindow.drp_dvdtitle.Text.Split(' ');
diff --git a/win/C#/frmMain.cs b/win/C#/frmMain.cs index 2a32be763..4e3a73ff9 100644 --- a/win/C#/frmMain.cs +++ b/win/C#/frmMain.cs @@ -35,6 +35,9 @@ namespace Handbrake private Form splash;
public string sourcePath;
private string lastAction;
+ private SourceType selectedSourceType;
+ private string dvdDrivePath;
+ private string dvdDriveLabel;
// Delegates **********************************************************
private delegate void UpdateWindowHandler();
@@ -181,6 +184,21 @@ namespace Handbrake }
#endregion
+ #region Properties
+ public string SourceName
+ {
+ get
+ {
+ if (this.selectedSourceType == SourceType.DvdDrive)
+ {
+ return this.dvdDriveLabel;
+ }
+
+ return Path.GetFileNameWithoutExtension(this.sourcePath);
+ }
+ }
+ #endregion
+
#region Events
// Encoding Events for setting up the GUI
private void events()
@@ -825,22 +843,28 @@ namespace Handbrake private void btn_dvd_source_Click(object sender, EventArgs e)
{
if (DVD_Open.ShowDialog() == DialogResult.OK)
+ {
+ this.selectedSourceType = SourceType.Folder;
selectSource(DVD_Open.SelectedPath);
+ }
else
UpdateSourceLabel();
}
private void btn_file_source_Click(object sender, EventArgs e)
{
if (ISO_Open.ShowDialog() == DialogResult.OK)
+ {
+ this.selectedSourceType = SourceType.VideoFile;
selectSource(ISO_Open.FileName);
+ }
else
UpdateSourceLabel();
}
private void mnu_dvd_drive_Click(object sender, EventArgs e)
{
- if (!mnu_dvd_drive.Text.Contains("VIDEO_TS")) return;
- string[] path = mnu_dvd_drive.Text.Split(' ');
- selectSource(path[0]);
+ if (this.dvdDrivePath == null) return;
+ this.selectedSourceType = SourceType.DvdDrive;
+ selectSource(this.dvdDrivePath);
}
private void selectSource(string file)
{
@@ -1573,7 +1597,7 @@ namespace Handbrake }
private void UpdateSourceLabel()
{
- labelSource.Text = string.IsNullOrEmpty(sourcePath) ? "Select \"Source\" to continue." : Path.GetFileName(sourcePath);
+ labelSource.Text = string.IsNullOrEmpty(sourcePath) ? "Select \"Source\" to continue." : this.SourceName;
}
#endregion
@@ -1655,7 +1679,9 @@ namespace Handbrake {
if (File.Exists(curDrive.RootDirectory + "VIDEO_TS\\VIDEO_TS.IFO"))
{
- mnu_dvd_drive.Text = curDrive.RootDirectory + "VIDEO_TS (" + curDrive.VolumeLabel + ")";
+ this.dvdDrivePath = curDrive.RootDirectory + "VIDEO_TS";
+ this.dvdDriveLabel = curDrive.VolumeLabel;
+ mnu_dvd_drive.Text = this.dvdDrivePath + " (" + this.dvdDriveLabel + ")";
foundDrive = true;
break;
}
@@ -1735,6 +1761,16 @@ namespace Handbrake }
#endregion
+ #region enum
+ private enum SourceType
+ {
+ None = 0,
+ Folder,
+ DvdDrive,
+ VideoFile
+ }
+ #endregion
+
// This is the END of the road ****************************************
}
}
\ No newline at end of file |