Skip to content

Commit

Permalink
Merge pull request #36 from AmusementClub/patch/hardcode-stripCommonP…
Browse files Browse the repository at this point in the history
…athComponents

Revert configurable stripCommonPathComponents
  • Loading branch information
LittlePox authored Dec 9, 2021
2 parents d5d0bba + d6604d1 commit 34ae62a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 16 deletions.
6 changes: 2 additions & 4 deletions OKEGui/OKEGui/Gui/ConfigPanel.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
xmlns:local="clr-namespace:OKEGui"
DataContext="{Binding RelativeSource={RelativeSource Self}}"
mc:Ignorable="d"
Title="设置" Height="370" Width="500">
Title="设置" Height="300" Width="500">
<Window.Resources>
<Style TargetType="DataGridCell">
<Setter Property="HorizontalContentAlignment" Value="Left" />
Expand All @@ -16,7 +16,7 @@
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="70"/>
<RowDefinition Height="187"/>
<RowDefinition Height="105"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid Grid.Row="0" Height="70" VerticalAlignment="Top">
Expand Down Expand Up @@ -60,8 +60,6 @@
<CheckBox HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Row="1" Grid.Column="1" IsChecked="{Binding Config.singleNuma}"/>
<TextBlock Margin="10,9" Height="30" Grid.Row="2" Grid.Column="0" Text="开启AVX512烤鸡模式"/>
<CheckBox HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Row="2" Grid.Column="1" IsChecked="{Binding Config.avx512}"/>
<TextBlock Margin="10,44,10,-39" Height="30" Grid.Row="2" Grid.Column="0" Text="删除工作/输出目录路径中的以下目录层次(使用 / 分割)"/>
<TextBox Grid.Row="2" Text="{Binding Config.stripCommonPathCompnents}" Margin="10,74,13,-80" Grid.ColumnSpan="2"/>
</Grid>
<Grid Grid.Row="2">
<Grid.ColumnDefinitions>
Expand Down
3 changes: 2 additions & 1 deletion OKEGui/OKEGui/Gui/WizardWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,8 @@ private void WizardFinish(object sender, RoutedEventArgs e)
inputFile + "\"" + inputTemplate[3];

string inputSuffixPath = inputFile.Replace(':', '_');
string[] strippedComponents = Initializer.Config.stripCommonPathCompnents.Split(new char[] { '/', '\\' }, StringSplitOptions.RemoveEmptyEntries);
const string stripCommonPathComponents = "BDBOX/BDROM/BD/BDMV/STREAM/BD_VIDEO"; // FIXME: do not hardcode this.
string[] strippedComponents = stripCommonPathComponents.Split(new char[] { '/', '\\' }, StringSplitOptions.RemoveEmptyEntries);
foreach (var comp in strippedComponents)
{
inputSuffixPath = Regex.Replace(inputSuffixPath, @"[/\\]" + Regex.Escape(comp) + @"[/\\]", "\\");
Expand Down
11 changes: 0 additions & 11 deletions OKEGui/OKEGui/Utils/Initializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,6 @@ public int memoryTotal
NotifyPropertyChanged();
}
}

private string _stripCommonPathCompnents = "BDBOX/BDROM/BD/BDMV/STREAM/BD_VIDEO";
public string stripCommonPathCompnents
{
get => _stripCommonPathCompnents;
set
{
_stripCommonPathCompnents = value;
NotifyPropertyChanged();
}
}
}

static class Initializer
Expand Down

0 comments on commit 34ae62a

Please sign in to comment.