diff options
author | sr55 <[email protected]> | 2009-09-09 08:10:17 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2009-09-09 08:10:17 +0000 |
commit | c46fb4570f1852083a83960de0124145ab0aa85a (patch) | |
tree | dad26872d152fccf1728f4bb91350b5a86d52a65 | |
parent | 5552e4ba9041e0a810fb63dd175a62de48826906 (diff) |
WinGui:
- Improve autoName reliability - Thanks exdeus
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2809 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r-- | win/C#/Functions/Main.cs | 6 | ||||
-rw-r--r-- | win/C#/frmMain.cs | 21 |
2 files changed, 9 insertions, 18 deletions
diff --git a/win/C#/Functions/Main.cs b/win/C#/Functions/Main.cs index 7516e52da..022a025ba 100644 --- a/win/C#/Functions/Main.cs +++ b/win/C#/Functions/Main.cs @@ -124,7 +124,7 @@ namespace Handbrake.Functions /// Function which generates the filename and path automatically based on
/// the Source Name, DVD title and DVD Chapters
/// </summary>
- public static string autoName(frmMain mainWindow ) //ComboBox drpDvdtitle, string chapter_start, string chatper_end, string source, string dest, int format, Boolean chapters)
+ public static string autoName(frmMain mainWindow) //ComboBox drpDvdtitle, string chapter_start, string chatper_end, string source, string dest, int format, Boolean chapters)
{
string AutoNamePath = string.Empty;
if (mainWindow.drp_dvdtitle.Text != "Automatic")
@@ -178,7 +178,9 @@ namespace Handbrake.Functions {
// Use the path and change the file extension to match the previous destination
AutoNamePath = Path.Combine(Path.GetDirectoryName(mainWindow.text_destination.Text), destinationFilename);
- AutoNamePath = Path.ChangeExtension(AutoNamePath, Path.GetExtension(mainWindow.text_destination.Text));
+
+ if (Path.HasExtension(mainWindow.text_destination.Text))
+ AutoNamePath = Path.ChangeExtension(AutoNamePath, Path.GetExtension(mainWindow.text_destination.Text));
}
}
diff --git a/win/C#/frmMain.cs b/win/C#/frmMain.cs index a668cc69e..b46b5aeab 100644 --- a/win/C#/frmMain.cs +++ b/win/C#/frmMain.cs @@ -723,7 +723,7 @@ namespace Handbrake if (ActivityWindow != null)
ActivityWindow.SetLogView(false);
-
+
}
this.Focus();
}
@@ -861,18 +861,8 @@ namespace Handbrake return;
}
- switch (type) // Start the scan
- {
- case 1: // btn_dvd_source_Click()
- case 3: // mnu_dvd_drive_Click()
- sourcePath = Path.GetFullPath(file);
- startScan(file);
- break;
- case 2: // btn_file_source_Click()
- sourcePath = Path.GetFileName(file);
- startScan(file);
- break;
- }
+ sourcePath = Path.GetFileName(file);
+ startScan(file);
}
private void drp_dvdtitle_Click(object sender, EventArgs e)
{
@@ -1127,9 +1117,8 @@ namespace Handbrake else
newExtension = ".mp4";
- text_destination.Text = text_destination.Text.Replace(".mp4", newExtension);
- text_destination.Text = text_destination.Text.Replace(".m4v", newExtension);
- text_destination.Text = text_destination.Text.Replace(".mkv", newExtension);
+ if (Path.HasExtension(newExtension))
+ text_destination.Text = Path.ChangeExtension(text_destination.Text, newExtension);
}
//Video Tab
|