diff options
Diffstat (limited to 'win/C#')
-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
|