diff options
author | sr55 <[email protected]> | 2008-11-16 19:29:42 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2008-11-16 19:29:42 +0000 |
commit | 6d6b8677bb42c3b7e2e82a112de57f3d42191bf4 (patch) | |
tree | 87e37babdbcf4b440e041164cd3e425cbdadb5f3 /win | |
parent | 891108eeadf7d48e44acc1c0f414142717c98714 (diff) |
WinGui:
Fix for Ticket #107 - Destination Save File Dialog window now shows extension of currently file in the destination field if there is one.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1924 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win')
-rw-r--r-- | win/C#/frmMain.cs | 37 |
1 files changed, 25 insertions, 12 deletions
diff --git a/win/C#/frmMain.cs b/win/C#/frmMain.cs index b234b05e6..e7345b539 100644 --- a/win/C#/frmMain.cs +++ b/win/C#/frmMain.cs @@ -664,18 +664,31 @@ namespace Handbrake DVD_Save.FileName = DVD_Save.FileName.Replace(".mp4", "").Replace(".m4v", "").Replace(".mkv", "").Replace(".ogm", "").Replace(".avi", "");
// Show the dialog and set the main form file path
- DVD_Save.ShowDialog();
- if (DVD_Save.FileName.StartsWith("\\"))
- MessageBox.Show("Sorry, HandBrake does not support UNC file paths. \nTry mounting the share as a network drive in My Computer", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- else
- {
- setAudioByContainer(DVD_Save.FileName);
- text_destination.Text = DVD_Save.FileName;
+ if (text_destination.Text.EndsWith(".mp4"))
+ DVD_Save.FilterIndex = 1;
+ else if (text_destination.Text.EndsWith(".m4v"))
+ DVD_Save.FilterIndex = 2;
+ else if (text_destination.Text.EndsWith(".avi"))
+ DVD_Save.FilterIndex = 3;
+ else if (text_destination.Text.EndsWith(".ogm"))
+ DVD_Save.FilterIndex = 4;
+ else if (text_destination.Text.EndsWith(".mkv"))
+ DVD_Save.FilterIndex = 5;
+
+ if (DVD_Save.ShowDialog() == DialogResult.OK)
+ {
+ if (DVD_Save.FileName.StartsWith("\\"))
+ MessageBox.Show("Sorry, HandBrake does not support UNC file paths. \nTry mounting the share as a network drive in My Computer", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+ else
+ {
+ setAudioByContainer(DVD_Save.FileName);
+ text_destination.Text = DVD_Save.FileName;
- // Quicktime requires .m4v file for chapter markers to work. If checked, change the extension to .m4v (mp4 and m4v are the same thing)
- if (Check_ChapterMarkers.Checked)
- text_destination.Text = text_destination.Text.Replace(".mp4", ".m4v");
+ // Quicktime requires .m4v file for chapter markers to work. If checked, change the extension to .m4v (mp4 and m4v are the same thing)
+ if (Check_ChapterMarkers.Checked)
+ text_destination.Text = text_destination.Text.Replace(".mp4", ".m4v");
+ }
}
}
private void text_destination_TextChanged(object sender, EventArgs e)
@@ -1442,7 +1455,7 @@ namespace Handbrake {
if (treeView_presets.SelectedNode != null)
presetHandler.remove(treeView_presets.SelectedNode.Text);
-
+
// Remember each nodes expanded status so we can reload it
List<Boolean> nodeStatus = saveTreeViewState();
@@ -1561,7 +1574,7 @@ namespace Handbrake foreach (TreeNode node in treenode.Nodes)
{
if (node.Text.ToString().Equals("Normal"))
- treeView_presets.SelectedNode = treeView_presets.Nodes[treenode.Index].Nodes[0];
+ treeView_presets.SelectedNode = treeView_presets.Nodes[treenode.Index].Nodes[0];
}
}
}
|