summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsr55 <[email protected]>2013-07-20 13:29:01 +0000
committersr55 <[email protected]>2013-07-20 13:29:01 +0000
commitc28c8dd123d13e08b85a29745f440cf024b1c5ba (patch)
treea03b3f03d9a82a4c76c028ea79b60fea4819aa33
parent5aeff5b7f02a26fa3d20c124322c61c34b0e3b8c (diff)
WinGui: Misc fixes and improvements
- Added "Open This Directory" right click context menu on the destination box. - Fixed the av_mp4/mkv file extension bug. - Add new autoname options {time} {bitrate} {quality} git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5653 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--win/CS/HandBrakeWPF/Constants.cs20
-rw-r--r--win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs13
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs21
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs8
-rw-r--r--win/CS/HandBrakeWPF/Views/MainView.xaml8
-rw-r--r--win/CS/HandBrakeWPF/Views/OptionsView.xaml2
6 files changed, 64 insertions, 8 deletions
diff --git a/win/CS/HandBrakeWPF/Constants.cs b/win/CS/HandBrakeWPF/Constants.cs
index 1d279427a..36732611d 100644
--- a/win/CS/HandBrakeWPF/Constants.cs
+++ b/win/CS/HandBrakeWPF/Constants.cs
@@ -38,5 +38,25 @@ namespace HandBrakeWPF
/// The title.
/// </summary>
public const string Title = "{title}";
+
+ /// <summary>
+ /// The quality.
+ /// </summary>
+ public const string Quality = "{quality}";
+
+ /// <summary>
+ /// The quality.
+ /// </summary>
+ public const string Date = "{date}";
+
+ /// <summary>
+ /// The quality.
+ /// </summary>
+ public const string Time = "{time}";
+
+ /// <summary>
+ /// The bitrate.
+ /// </summary>
+ public const string Bitrate = "{bitrate}";
}
}
diff --git a/win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs b/win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs
index c96d86c35..b6e7ce1c6 100644
--- a/win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs
+++ b/win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs
@@ -19,6 +19,7 @@ namespace HandBrakeWPF.Helpers
using HandBrake.ApplicationServices.Model;
using HandBrake.ApplicationServices.Model.Encoding;
using HandBrake.ApplicationServices.Services.Interfaces;
+ using HandBrake.Interop.Model.Encoding;
/// <summary>
/// The Destination AutoName Helper
@@ -88,7 +89,17 @@ namespace HandBrakeWPF.Helpers
destinationFilename = destinationFilename.Replace("{source}", sourceName)
.Replace(Constants.Title, dvdTitle)
.Replace(Constants.Chapters, combinedChapterTag)
- .Replace("{date}", DateTime.Now.Date.ToShortDateString().Replace('/', '-'));
+ .Replace(Constants.Date, DateTime.Now.Date.ToShortDateString().Replace('/', '-'))
+ .Replace(Constants.Time, DateTime.Now.ToString("HH:mm"));
+
+ if (task.VideoEncodeRateType == VideoEncodeRateType.ConstantQuality)
+ {
+ destinationFilename = destinationFilename.Replace(Constants.Quality, task.Quality.ToString());
+ }
+ else
+ {
+ destinationFilename = destinationFilename.Replace(Constants.Bitrate, task.VideoBitrate.ToString());
+ }
}
else
destinationFilename = sourceName + "_T" + dvdTitle + "_C" + combinedChapterTag;
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
index 74f11abf2..8fdb4577c 100644
--- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
@@ -879,7 +879,7 @@ namespace HandBrakeWPF.ViewModels
this.NotifyOfPropertyChange(() => SelectedOutputFormat);
this.NotifyOfPropertyChange(() => this.CurrentTask.OutputFormat);
this.NotifyOfPropertyChange(() => IsMkv);
- this.SetExtension(string.Format(".{0}", this.selectedOutputFormat.ToString().ToLower())); // TODO, tidy up
+ this.SetExtension(string.Format(".{0}", this.selectedOutputFormat.ToString().Replace("av_", string.Empty).ToLower())); // TODO, tidy up
this.VideoViewModel.RefreshTask();
this.AudioViewModel.RefreshTask();
@@ -1450,6 +1450,25 @@ namespace HandBrakeWPF.ViewModels
}
/// <summary>
+ /// The open destination directory.
+ /// </summary>
+ public void OpenDestinationDirectory()
+ {
+ if (!string.IsNullOrEmpty(this.Destination))
+ {
+ string directory = Path.GetDirectoryName(this.Destination);
+ if (!string.IsNullOrEmpty(directory))
+ {
+ Process.Start(directory);
+ }
+ else
+ {
+ Process.Start(AppDomain.CurrentDomain.BaseDirectory);
+ }
+ }
+ }
+
+ /// <summary>
/// Add a Preset
/// </summary>
public void PresetAdd()
diff --git a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs
index a91dc4d3d..743a9c561 100644
--- a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs
@@ -823,7 +823,7 @@ namespace HandBrakeWPF.ViewModels
case Anamorphic.Custom:
double dispWidth = Math.Round((result.OutputWidth * result.OutputParWidth / result.OutputParHeight), 0);
this.DisplaySize = this.sourceResolution.IsEmpty
- ? "No Title Selected"
+ ? string.Empty
: string.Format("Storage: {0}x{1}, Display: {2}x{3}", result.OutputWidth, result.OutputHeight, dispWidth, result.OutputHeight);
break;
}
@@ -1023,14 +1023,14 @@ namespace HandBrakeWPF.ViewModels
double dispWidth = Math.Round((result.OutputWidth * result.OutputParWidth / result.OutputParHeight), 0);
this.DisplaySize = this.sourceResolution.IsEmpty
- ? "No Title Selected"
+ ? string.Empty
: string.Format("Output: {0}x{1}, Anamorphic: {2}x{3}", result.OutputWidth, result.OutputHeight, dispWidth, result.OutputHeight);
}
else
{
this.DisplaySize = this.sourceResolution.IsEmpty
- ? "No Title Selected"
- : string.Format("Output: {0}x{1}, Anamorphic: {2}x{3}", this.Width, this.Height, this.Width, this.Height);
+ ? string.Empty
+ : string.Format("Output: {0}x{1}", this.Width, this.Height);
}
}
diff --git a/win/CS/HandBrakeWPF/Views/MainView.xaml b/win/CS/HandBrakeWPF/Views/MainView.xaml
index 4815e77bc..e900053c2 100644
--- a/win/CS/HandBrakeWPF/Views/MainView.xaml
+++ b/win/CS/HandBrakeWPF/Views/MainView.xaml
@@ -467,7 +467,13 @@
Margin="8,0,0,0"
Text="{Binding Destination,
UpdateSourceTrigger=PropertyChanged}"
- />
+ >
+ <TextBox.ContextMenu>
+ <ContextMenu>
+ <MenuItem Header="Open this Directory" Micro:Message.Attach="[Event Click] = [Action OpenDestinationDirectory]" />
+ </ContextMenu>
+ </TextBox.ContextMenu>
+ </TextBox>
<Button Name="DestinationBrowser"
Grid.Column="2"
Margin="8,0,0,0"
diff --git a/win/CS/HandBrakeWPF/Views/OptionsView.xaml b/win/CS/HandBrakeWPF/Views/OptionsView.xaml
index 40e47958a..d1dc2f03a 100644
--- a/win/CS/HandBrakeWPF/Views/OptionsView.xaml
+++ b/win/CS/HandBrakeWPF/Views/OptionsView.xaml
@@ -176,7 +176,7 @@
<TextBlock VerticalAlignment="Center" Text="Format:" />
<TextBox Name="autoNameFormat" Text="{Binding AutonameFormat}" Width="180" ToolTip=" {Source} = Source Name, {Title} = Title Number, {Chapters} = Selected Chapters, {Date} = Todays Date," />
</StackPanel>
- <TextBlock Text="Available Options: {source} {title} {chapters} {date}" />
+ <TextBlock Text="Available Options: {source} {title} {chapters} {date} {time} {quality} {bitrate}" />
<StackPanel Orientation="Horizontal" Margin="0,15,0,0">
<CheckBox Content="Replace underscores with a space" IsChecked="{Binding RemoveUnderscores}"/>