- Fixed add to queue error handling on 2 code paths that ignored errors returned.
- AutoName will now guarantee a unique filename rather than stop after the first attempt.
- Options Pane now lists the available format and path variables that can be used in the UI (rather than the tooltip)
- Ordering of validation rules changed to be more sensible, especially when handling paths that end up same as source.
// Add to Queue (Ctrl+A)\r
if (gesture.Modifiers == ModifierKeys.Control && gesture.Key == Key.A)\r
{\r
- mainViewModel.AddToQueue();\r
+ mainViewModel.AddToQueueWithErrorHandling();\r
}\r
\r
// Add all to Queue (Alt+A)\r
string requestedPath = Path.Combine(directory, savedPath);\r
\r
autoNamePath = Path.Combine(requestedPath, destinationFilename);\r
- if (autoNamePath == task.Source)\r
- {\r
- // Append out_ to files that already exist or is the source file\r
- autoNamePath = Path.Combine(Path.GetDirectoryName(task.Source), "output_" + destinationFilename);\r
- }\r
}\r
else if (userSettingService.GetUserSetting<string>(UserSettingConstants.AutoNamePath).Contains("{source_folder_name}") && !string.IsNullOrEmpty(task.Source))\r
{\r
// Use the path and change the file extension to match the previous destination\r
autoNamePath = Path.Combine(Path.GetDirectoryName(task.Destination), destinationFilename);\r
}\r
+\r
+ // Append out_ to files that already exist or is the source file\r
+ if (autoNamePath?.ToLower() == task.Source?.ToLower())\r
+ {\r
+ autoNamePath = Path.Combine(Path.GetDirectoryName(task.Source), "output_" + destinationFilename);\r
+\r
+ int counter = 1;\r
+ while (autoNamePath == task.Source)\r
+ {\r
+ autoNamePath = Path.Combine(Path.GetDirectoryName(task.Source), string.Format("output{0}_", counter) + destinationFilename);\r
+ counter = counter + 1;\r
+ }\r
+ }\r
}\r
\r
return autoNamePath;\r
}
}
- /// <summary>
- /// Looks up a localized string similar to You cannot overwrite the source file you want to convert.
- ///Please choose a different filename..
- /// </summary>
- public static string Main_SourceDestinationMatchError {
- get {
- return ResourceManager.GetString("Main_SourceDestinationMatchError", resourceCulture);
- }
- }
-
/// <summary>
/// Looks up a localized string similar to Start Encode.
/// </summary>
}
}
+ /// <summary>
+ /// Looks up a localized string similar to Live Update Options: {source} {title} {chapters}
+ ///Non-Live Options: {date} {time} {creation-date} {creation-time} {quality} {bitrate} (These only change if you scan a new source, change title or chapters).
+ /// </summary>
+ public static string OptionsView_FormatOptions {
+ get {
+ return ResourceManager.GetString("OptionsView_FormatOptions", resourceCulture);
+ }
+ }
+
/// <summary>
/// Looks up a localized string similar to Hardware encoding support is currently disabled. Please make sure you are running up-to-date drivers for all graphics adaptors in this system.
///
}
}
+ /// <summary>
+ /// Looks up a localized string similar to Available Options: {source_path} {source_folder_name} (Not both at the same time!).
+ /// </summary>
+ public static string OptionsView_PathOptions {
+ get {
+ return ResourceManager.GetString("OptionsView_PathOptions", resourceCulture);
+ }
+ }
+
/// <summary>
/// Looks up a localized string similar to Play a sound when each encode completes.
/// </summary>
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
- <xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
- <xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0"/>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
- <xsd:attribute name="name" use="required" type="xsd:string"/>
- <xsd:attribute name="type" type="xsd:string"/>
- <xsd:attribute name="mimetype" type="xsd:string"/>
- <xsd:attribute ref="xml:space"/>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
- <xsd:attribute name="alias" type="xsd:string"/>
- <xsd:attribute name="name" type="xsd:string"/>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
- <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"/>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1"/>
- <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"/>
- <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"/>
- <xsd:attribute ref="xml:space"/>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
<data name="Video_EncoderExtraArgsTooltip" xml:space="preserve">
<value>Zusätzliche erweiterte Argumente, die vom Videoenkoder angewendet werden.</value>
</data>
- <data name="Main_SourceDestinationMatchError" xml:space="preserve">
- <value>Die Quelldatei die konvertiert werden soll kann nicht überschrieben werden.
-Bitte einen anderen Dateinamen wählen.</value>
- </data>
<data name="Subtitles_BurnInBehaviourModes" xml:space="preserve">
<value>Keine - Es werden nur Spuren eingebrannt, bei denen der Container das Format nicht unterstützt.
Fremdsprachenspur - Die Fremdsprachenspur wird eingebrannt, falls vorhanden.
<data name="QueueView_Import" xml:space="preserve">
<value>Importieren</value>
</data>
-</root>
+</root>
\ No newline at end of file
<data name="Video_EncoderExtraArgsTooltip" xml:space="preserve">\r
<value>Additional advanced arguments that can be passed to the video encoder.</value>\r
</data>\r
- <data name="Main_SourceDestinationMatchError" xml:space="preserve">\r
- <value>You cannot overwrite the source file you want to convert.\r
-Please choose a different filename.</value>\r
- </data>\r
<data name="Subtitles_BurnInBehaviourModes" xml:space="preserve">\r
<value>None - Only tracks where the container does not support the format will be burned in.\r
Foreign Audio Track - The Foreign Audio track will be burned in if available. \r
<data name="Startup_InitFailed" xml:space="preserve">\r
<value>HandBrake's engine failed to initialise. This is often caused by out of date GPU drivers.\n Please update the GPU drivers for any onboard and discrete graphics your system has.</value>\r
</data>\r
+ <data name="OptionsView_FormatOptions" xml:space="preserve">\r
+ <value>Live Update Options: {source} {title} {chapters} \r
+Non-Live Options: {date} {time} {creation-date} {creation-time} {quality} {bitrate} (These only change if you scan a new source, change title or chapters)</value>\r
+ </data>\r
+ <data name="OptionsView_PathOptions" xml:space="preserve">\r
+ <value>Available Options: {source_path} {source_folder_name} (Not both at the same time!)</value>\r
+ </data>\r
</root>
\ No newline at end of file
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
- <xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
- <xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0"/>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
- <xsd:attribute name="name" use="required" type="xsd:string"/>
- <xsd:attribute name="type" type="xsd:string"/>
- <xsd:attribute name="mimetype" type="xsd:string"/>
- <xsd:attribute ref="xml:space"/>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
- <xsd:attribute name="alias" type="xsd:string"/>
- <xsd:attribute name="name" type="xsd:string"/>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
- <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"/>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1"/>
- <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"/>
- <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"/>
- <xsd:attribute ref="xml:space"/>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
<data name="Video_EncoderExtraArgsTooltip" xml:space="preserve">
<value>可以传递给视频编码器的其他高级参数。</value>
</data>
- <data name="Main_SourceDestinationMatchError" xml:space="preserve">
- <value>您无法覆盖要转换的源文件。
-请选择其他文件名。</value>
- </data>
<data name="Subtitles_BurnInBehaviourModes" xml:space="preserve">
<value>None - 只有容器不支持的轨道才会被烧入。
Foreign Audio Track - 如果可用,外语轨道将被烧入。
<data name="QueueView_Import" xml:space="preserve">
<value>导入</value>
</data>
-</root>
+</root>
\ No newline at end of file
/// True if added, false if error\r
/// </returns>\r
AddQueueError AddToQueue();\r
+ void AddToQueueWithErrorHandling();\r
void AddAllToQueue();\r
void AddSelectionToQueue();\r
\r
\r
if (value == this.ScannedSource.ScanPath)\r
{\r
- this.Destination = this.CurrentTask.Destination;\r
- this.errorService.ShowMessageBox(Resources.Main_SourceDestinationMatchError, Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error);\r
+ this.errorService.ShowMessageBox(Resources.Main_MatchingFileOverwriteWarning, Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error);\r
return;\r
}\r
}\r
return new AddQueueError(Resources.Main_SetDestination, Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error);\r
}\r
\r
+ if (this.Destination.ToLower() == this.ScannedSource.ScanPath.ToLower())\r
+ {\r
+ return new AddQueueError(Resources.Main_MatchingFileOverwriteWarning, Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error);\r
+ }\r
+\r
if (File.Exists(this.CurrentTask.Destination))\r
{\r
MessageBoxResult result = this.errorService.ShowMessageBox(string.Format(Resources.Main_QueueOverwritePrompt, Path.GetFileName(this.CurrentTask.Destination)), Resources.Question, MessageBoxButton.YesNo, MessageBoxImage.Question);\r
}\r
\r
// Sanity check the filename\r
- if (!string.IsNullOrEmpty(this.Destination) && FileHelper.FilePathHasInvalidChars(this.Destination))\r
+ if (FileHelper.FilePathHasInvalidChars(this.Destination))\r
{\r
this.NotifyOfPropertyChange(() => this.Destination);\r
return new AddQueueError(Resources.Main_InvalidDestination, Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error);\r
}\r
\r
- if (this.Destination == this.ScannedSource.ScanPath)\r
- {\r
- this.Destination = null;\r
- return new AddQueueError(Resources.Main_SourceDestinationMatchError, Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error);\r
- }\r
-\r
- if (this.scannedSource != null && !string.IsNullOrEmpty(this.scannedSource.ScanPath) && this.Destination.ToLower() == this.scannedSource.ScanPath.ToLower())\r
- {\r
- return new AddQueueError(Resources.Main_MatchingFileOverwriteWarning, Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error);\r
- }\r
-\r
// defer to subtitle's validation messages\r
if (!this.SubtitleViewModel.ValidateSubtitles())\r
{\r
return null;\r
}\r
\r
+ public void AddToQueueWithErrorHandling()\r
+ {\r
+ var addError = this.AddToQueue();\r
+ if (addError != null)\r
+ {\r
+ this.errorService.ShowMessageBox(addError.Message, addError.Header, addError.Buttons, addError.ErrorType);\r
+ }\r
+ }\r
+\r
/// <summary>\r
/// Add all Items to the queue\r
/// </summary>\r
}\r
\r
// Otherwise assume it's a main area click and add to queue.\r
- ((IMainViewModel)this.DataContext).AddToQueue();\r
+ ((IMainViewModel)this.DataContext).AddToQueueWithErrorHandling();\r
}\r
\r
private void TabControl_OnSelectionChanged(object sender, SelectionChangedEventArgs e)\r
<Grid Margin="0,5,0,0">\r
<Grid.RowDefinitions>\r
<RowDefinition Height="Auto"/>\r
- <RowDefinition Height="5"/>\r
+ <RowDefinition Height="Auto"/>\r
+ <RowDefinition Height="7"/>\r
\r
<RowDefinition Height="Auto"/>\r
+ <RowDefinition Height="Auto"/>\r
+ <RowDefinition Height="Auto"/>\r
</Grid.RowDefinitions>\r
<Grid.ColumnDefinitions>\r
<ColumnDefinition Width="Auto" />\r
<ColumnDefinition Width="Auto" />\r
- <ColumnDefinition Width="Auto" />\r
+ <ColumnDefinition Width="*" />\r
</Grid.ColumnDefinitions>\r
\r
<TextBlock VerticalAlignment="Center" Text="{x:Static Properties:Resources.Options_DefaultPath}" Grid.Column="0" Grid.Row="0" />\r
<TextBox Name="autoNameOutputPath" Text="{Binding AutoNameDefaultPath}" Width="380" Grid.Column="1" Grid.Row="0" \r
- ToolTip="{x:Static Properties:Resources.Options_DefaultPathAdditionalParams}" />\r
- <Button Content="Browse" Margin="5,0,0,0" Grid.Column="2" Grid.Row="0" \r
- cal:Message.Attach="[Event Click] = [Action BrowseAutoNamePath]" />\r
-\r
- <TextBlock VerticalAlignment="Center" Text="{x:Static Properties:Resources.Options_Format}" Grid.Column="0" Grid.Row="2" Margin="0,5,0,0" />\r
- <TextBox Name="autoNameFormat" Text="{Binding AutonameFormat, UpdateSourceTrigger=PropertyChanged}" Width="380" Grid.Column="1" Grid.Row="2" Margin="0,0,0,0"\r
- ToolTip="{x:Static Properties:Resources.Options_AdditionalFormatOptions}" />\r
+ ToolTip="{x:Static Properties:Resources.Options_DefaultPathAdditionalParams}" HorizontalAlignment="Left" />\r
+ <Button Content="Browse" Margin="5,0,0,0" Grid.Column="2" Grid.Row="0" cal:Message.Attach="[Event Click] = [Action BrowseAutoNamePath]" HorizontalAlignment="Left" />\r
+ <TextBlock Text="{x:Static Properties:Resources.OptionsView_PathOptions}" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" FontStyle="Italic" FontSize="11" TextWrapping="Wrap" />\r
+\r
+ <TextBlock VerticalAlignment="Center" Text="{x:Static Properties:Resources.Options_Format}" Grid.Column="0" Grid.Row="3" Margin="0,5,0,0" />\r
+ <TextBox Name="autoNameFormat" Text="{Binding AutonameFormat, UpdateSourceTrigger=PropertyChanged}" Width="380" Grid.Column="1" Grid.Row="3" Margin="0,0,0,0"\r
+ ToolTip="{x:Static Properties:Resources.Options_AdditionalFormatOptions}" HorizontalAlignment="Left" />\r
+ <TextBlock Text="{x:Static Properties:Resources.OptionsView_FormatOptions}" Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="2" FontStyle="Italic" FontSize="11" TextWrapping="Wrap" />\r
</Grid>\r
\r
<StackPanel Orientation="Vertical" Margin="0,15,0,0">\r