Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
zamgi authored and zamgi committed Feb 10, 2025
1 parent 15306c6 commit 6c9566d
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 78 deletions.
8 changes: 4 additions & 4 deletions m3u8.download.manager/Avalonia/Model/LogRow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ internal static LogRow CreateResponseError( string requestText, string responseE
=> new LogRow( model, rowPropertiesChanged ) { RequestRowType = RequestRowTypeEnum.Error, RequestText = requestText, ResponseText = responseErrorText };


public string RequestText { [M(O.AggressiveInlining)] get; private set; }
public string ResponseText { [M(O.AggressiveInlining)] get; private set; }
public RequestRowTypeEnum RequestRowType { [M(O.AggressiveInlining)] get; private set; }
public int? AttemptRequestNumber { [M(O.AggressiveInlining)] get; private set; }
public RequestRowTypeEnum RequestRowType { [M(O.AggressiveInlining)] get; private set; }
public string RequestText { [M(O.AggressiveInlining)] get; private set; }
public string ResponseText { [M(O.AggressiveInlining)] get; private set; }
public int? AttemptRequestNumber { [M(O.AggressiveInlining)] get; private set; }

[M(O.AggressiveInlining)] public void SetAttemptRequestNumber( int attemptRequestNumber )
{
Expand Down
15 changes: 9 additions & 6 deletions m3u8.download.manager/Avalonia/View/AddNewDownloadForm.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@
<Setter Property="FontSize" Value="12" />
<Setter Property="Margin" Value="5,0,-1,-5" />
<Setter Property="Padding" Value="5,3" />
</Style>
</Style>
<!--
<Style Selector="Button, CheckBox, TextBox, NumericUpDown">
<Setter Property="CornerRadius" Value="1.5" />
</Style>
-->
</Window.Styles>

<Grid>
Expand Down Expand Up @@ -56,7 +61,7 @@
AllowSpin="True" ClipValueToMinMax="True" Foreground="DimGray"
HorizontalAlignment="Left" Margin="10,0,0,0" Padding="0"
ToolTip.Tip="current pattern output file name count-number"
IsVisible="False" />
IsVisible="False"/>
<!--=== live-stream ===========================================-->
<CheckBox x:Name="isLiveStreamCheckBox" Grid.Row="0" Grid.Column="6" Foreground="Silver" Cursor="Hand" Margin="5,0,0,0">this is a live stream</CheckBox>
<TextBlock x:Name="liveStreamMaxSizeInMbTextBlock" Grid.Row="2" Grid.Column="3" Grid.ColumnSpan="3"
Expand All @@ -69,13 +74,13 @@
Minimum="1" Maximum="10000000" Value="250" FormatString="0"
AllowSpin="True" ClipValueToMinMax="True"
HorizontalAlignment="Left" Margin="10,0,0,0" Padding="0"
IsVisible="False" />
IsVisible="False"/>
<!--=== output-directory ===========================================-->
<TextBlock Grid.Row="4" Grid.Column="0" Foreground="SteelBlue" Margin="0,0,5,0" TextAlignment="Right"
TextWrapping="Wrap" TextTrimming="CharacterEllipsis">
output directory :
</TextBlock>
<TextBox x:Name="outputDirectoryTextBox" Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="4" IsReadOnly="True" Margin="0,0,3,0"></TextBox>
<TextBox x:Name="outputDirectoryTextBox" Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="4" IsReadOnly="True" Margin="0,0,3,0"></TextBox>
<Button x:Name="outputDirectorySelectButton" Grid.Row="4" Grid.Column="5" Width="25" Cursor="Hand" Margin="0,0,3,0">=</Button>
<Button x:Name="loadM3u8FileContentButton" Grid.Row="4" Grid.Column="6" Cursor="Hand" Margin="0">(load .m3u8 file-content)</Button>
</Grid>
Expand All @@ -92,8 +97,6 @@
</Grid>
</Grid>
</Grid>


</TabItem>

<TabItem x:Name="requestHeadersTabItem" Header="request header">
Expand Down
4 changes: 4 additions & 0 deletions m3u8.download.manager/Avalonia/View/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,9 @@

<!--<FluentTheme />-->
<!--<StyleInclude Source="avares://Avalonia.Controls.DataGrid/Themes/Fluent.xaml"/>-->

<Style Selector="Button, CheckBox, TextBox, NumericUpDown">
<Setter Property="CornerRadius" Value="1.5" />
</Style>
</Application.Styles>
</Application>
101 changes: 48 additions & 53 deletions m3u8.download.manager/Avalonia/View/FileNameExcludesWordsEditor.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,61 +49,56 @@
</Window.Styles>

<Grid>
<Rectangle x:Name="selectRect" Stretch="Fill" Grid.Row="0"
Stroke="DimGray" StrokeThickness="2" ZIndex="100" IsVisible="False" />
<Rectangle x:Name="selectRect" Stretch="Fill" Grid.Row="0"
Stroke="DimGray" StrokeThickness="2" ZIndex="100" IsVisible="False" />

<Grid RowDefinitions="auto,*,auto" ColumnDefinitions="auto,*,auto" Margin="15">
<TextBlock Grid.Row="0" Grid.Column="0"
VerticalAlignment="Center">filter:</TextBlock>
<TextBox x:Name="filterTextBox" Grid.Row="0" Grid.Column="1"
Margin="10,0,3,0"
TextWrapping="NoWrap"
/>
<Button x:Name="clearFilterButton" Grid.Row="0" Grid.Column="2"
Width="25" Cursor="Hand" IsVisible="False">&#x26CC;</Button>
<Grid RowDefinitions="auto,*,auto" ColumnDefinitions="auto,*,auto" Margin="15">
<TextBlock Grid.Row="0" Grid.Column="0"
VerticalAlignment="Center">filter:</TextBlock>
<TextBox x:Name="filterTextBox" Grid.Row="0" Grid.Column="1"
Margin="10,0,3,0" TextWrapping="NoWrap" />
<Button x:Name="clearFilterButton" Grid.Row="0" Grid.Column="2"
Width="22" Cursor="Hand" IsVisible="False">&#x26CC;</Button>

<DataGrid x:Name="DGV" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="3"
SelectionMode="Extended"
CanUserResizeColumns="False"
CanUserReorderColumns="False"
CanUserSortColumns="True"
IsReadOnly="False"
GridLinesVisibility="All"
VerticalGridLinesBrush="Silver" HorizontalGridLinesBrush="Silver"
BorderBrush="LightGray" BorderThickness="1"
ClipboardCopyMode="None"
Background="LightGray"
>
<DataGrid.Columns>
<DataGridTextColumn Header="#" Binding="{Binding ViewOrderNumber, Mode=OneWay}"
Width="auto" IsReadOnly="True" CanUserSort="False"
CellStyleClasses="order_number" />
<!--
<DataGridTextColumn Header="Exclude word" Binding="{Binding Text, Mode=TwoWay}"
Width="*" CanUserSort="True" SortMemberPath="Text" />
-->
<DataGridTextColumn Binding="{Binding Text, Mode=TwoWay}"
Width="*" CanUserSort="True" SortMemberPath="Text">
<DataGridTextColumn.Header>
<DockPanel>
<TextBlock Grid.Column="0" Text="Exclude word" VerticalAlignment="Center"
Margin="0,0,10,0" />
<Button x:Name="addNewRowButton" Cursor="Hand" ToolTip.Tip="append new row"
Background="Gray" Padding="5,2"
>+</Button>
</DockPanel>
</DataGridTextColumn.Header>
</DataGridTextColumn>

</DataGrid.Columns>
</DataGrid>
<DataGrid x:Name="DGV" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="3"
SelectionMode="Extended"
CanUserResizeColumns="False"
CanUserReorderColumns="False"
CanUserSortColumns="True"
IsReadOnly="False"
GridLinesVisibility="All"
VerticalGridLinesBrush="Silver" HorizontalGridLinesBrush="Silver"
BorderBrush="LightGray" BorderThickness="1"
ClipboardCopyMode="None"
Background="LightGray"
>
<DataGrid.Columns>
<DataGridTextColumn Header="#" Binding="{Binding ViewOrderNumber, Mode=OneWay}"
Width="auto" IsReadOnly="True" CanUserSort="False"
CellStyleClasses="order_number" />
<!--
<DataGridTextColumn Header="Exclude word" Binding="{Binding Text, Mode=TwoWay}"
Width="*" CanUserSort="True" SortMemberPath="Text" />
-->
<DataGridTextColumn Binding="{Binding Text, Mode=TwoWay}"
Width="*" CanUserSort="True" SortMemberPath="Text">
<DataGridTextColumn.Header>
<DockPanel Margin="0,-2,0,-1">
<TextBlock Grid.Column="0" Text="Exclude word" VerticalAlignment="Center"
Margin="0,0,10,0" />
<Button x:Name="addNewRowButton" Cursor="Hand" ToolTip.Tip="append new row"
Background="Gainsboro" Padding="1,1" Height="22" Width="20" Content="+" />
</DockPanel>
</DataGridTextColumn.Header>
</DataGridTextColumn>
</DataGrid.Columns>
</DataGrid>

<DockPanel Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="3"
HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,15,0,0">
<Button x:Name="okButton" HorizontalAlignment="Center" Width="110" Height="30" Cursor="Hand" Margin="0,0,5,0">Ok</Button>
<Button x:Name="cancelButton" HorizontalAlignment="Center" Width="110" Height="30" Cursor="Hand" Margin="5,0,0,0">Cancel</Button>
</DockPanel>
</Grid>

<DockPanel Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="3"
HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,15,0,0">
<Button x:Name="okButton" HorizontalAlignment="Center" Width="110" Height="30" Cursor="Hand" Margin="0,0,5,0">Ok</Button>
<Button x:Name="cancelButton" HorizontalAlignment="Center" Width="110" Height="30" Cursor="Hand" Margin="5,0,0,0">Cancel</Button>
</DockPanel>
</Grid>
</Grid>
</Window>
15 changes: 9 additions & 6 deletions m3u8.download.manager/Avalonia/View/SettingsForm.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
<Setter Property="Margin" Value="5,0,-1,-5" />
<Setter Property="Padding" Value="5,3" />
</Style>
<Style Selector="Border">
<Setter Property="CornerRadius" Value="4" />
</Style>
</Window.Styles>

<Grid RowDefinitions="*,auto"
Expand All @@ -34,7 +37,7 @@
<Grid RowDefinitions="auto,auto,10,auto,auto,10,auto,auto,*"
Margin="7,3">
<TextBlock Grid.Row="0" Foreground="DodgerBlue">downloads parallelism</TextBlock>
<Border Grid.Row="1" BorderBrush="LightGray" BorderThickness="1" CornerRadius="4" Padding="10">
<Border Grid.Row="1" BorderBrush="LightGray" BorderThickness="1" Padding="10">
<StackPanel>
<TextBlock>max download threads:</TextBlock>
<NumericUpDown x:Name="maxDegreeOfParallelismNUD" Minimum="1" Maximum="100" Value="1"
Expand All @@ -51,7 +54,7 @@
</Border>

<TextBlock Grid.Row="3" Foreground="DodgerBlue">download instances</TextBlock>
<Border Grid.Row="4" BorderBrush="LightGray" BorderThickness="1" CornerRadius="4" Padding="10">
<Border Grid.Row="4" BorderBrush="LightGray" BorderThickness="1" Padding="10">
<StackPanel>
<CheckBox x:Name="useMaxCrossDownloadInstanceCheckBox" Background="White" Cursor="Hand" Margin="0,0,0,7">use downloads-instance</CheckBox>
<TextBlock x:Name="maxCrossDownloadInstanceLabel1">max count of downloads-instance for</TextBlock>
Expand All @@ -63,7 +66,7 @@
</Border>

<TextBlock Grid.Row="6" Foreground="DodgerBlue">download speed limit</TextBlock>
<Border Grid.Row="7" BorderBrush="LightGray" BorderThickness="1" CornerRadius="4" Padding="10">
<Border Grid.Row="7" BorderBrush="LightGray" BorderThickness="1" Padding="10">
<StackPanel>
<CheckBox x:Name="isUnlimMaxSpeedThresholdCheckBox" Background="White" Cursor="Hand" Margin="0,0,0,7">Max/Unlimited speed</CheckBox>
<TextBlock x:Name="maxSpeedThresholdLabel">max speed threshold (in Mbps):</TextBlock>
Expand All @@ -87,7 +90,7 @@
<Grid RowDefinitions="auto,auto,auto,auto,auto,auto,*" ColumnDefinitions="*"
Margin="7,3">
<TextBlock Grid.Row="0" Foreground="DodgerBlue">download params</TextBlock>
<Border Grid.Row="1" BorderBrush="LightGray" BorderThickness="1" CornerRadius="4" Padding="10">
<Border Grid.Row="1" BorderBrush="LightGray" BorderThickness="1" Padding="10">
<Grid RowDefinitions="auto,auto,15,auto,auto,15,auto,15,auto"
ColumnDefinitions="*,auto,auto,*"
>
Expand Down Expand Up @@ -129,7 +132,7 @@
</Border>

<TextBlock Grid.Row="2" Foreground="DodgerBlue">UI / download log UI</TextBlock>
<Border Grid.Row="3" BorderBrush="LightGray" BorderThickness="1" CornerRadius="4" Padding="10">
<Border Grid.Row="3" BorderBrush="LightGray" BorderThickness="1" Padding="10">
<StackPanel Margin="20,10">
<CheckBox x:Name="showOnlyRequestRowsWithErrorsCheckBox" Background="White" Cursor="Hand">show only request rows with errors</CheckBox>
<CheckBox x:Name="showDownloadStatisticsInMainFormTitleCheckBox" Background="White" Cursor="Hand">
Expand All @@ -143,7 +146,7 @@
</Border>

<TextBlock Grid.Row="4" Foreground="DodgerBlue">GC</TextBlock>
<Border Grid.Row="5" BorderBrush="LightGray" BorderThickness="1" CornerRadius="4" Padding="10,14">
<Border Grid.Row="5" BorderBrush="LightGray" BorderThickness="1" Padding="10,14">
<StackPanel Margin="20,0">
<Button x:Name="collectGarbageButton" HorizontalAlignment="Center"
Width="110" Height="30" Cursor="Hand" Margin="0,0,5,0"
Expand Down
6 changes: 2 additions & 4 deletions m3u8.download.manager/Avalonia/View/UC/LogUC.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,8 @@ public LogUC()
//this.Styles.Add( GlobalStyles.Dark );

var st = _SC_.SettingsDefault;
_ShowOnlyRequestRowsWithErrors = st.ShowOnlyRequestRowsWithErrors;
_ShowOnlyRequestRowsWithErrorsMenuItemCheckBox.IsChecked = _ShowOnlyRequestRowsWithErrors;
_ScrollToLastRow = st.ScrollToLastRow;
_ScrollToLastRowMenuItemCheckBox.IsChecked = _ScrollToLastRow;
_ShowOnlyRequestRowsWithErrorsMenuItemCheckBox.IsChecked = _ShowOnlyRequestRowsWithErrors = st.ShowOnlyRequestRowsWithErrors;
_ScrollToLastRowMenuItemCheckBox .IsChecked = _ScrollToLastRow = st.ScrollToLastRow;
}
#endregion

Expand Down
9 changes: 4 additions & 5 deletions m3u8.download.manager/WinForms/Model/LogRow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ internal static LogRow CreateResponseError( string requestText, string responseE
=> new LogRow( model, rowPropertiesChanged ) { RequestRowType = RequestRowTypeEnum.Error, RequestText = requestText, ResponseText = responseErrorText };


public string RequestText { [M(O.AggressiveInlining)] get; private set; }
public string ResponseText { [M(O.AggressiveInlining)] get; private set; }
public int? AttemptRequestNumber { [M(O.AggressiveInlining)] get; private set; }
public RequestRowTypeEnum RequestRowType { [M(O.AggressiveInlining)] get; private set; }
public string RequestText { [M(O.AggressiveInlining)] get; private set; }
public string ResponseText { [M(O.AggressiveInlining)] get; private set; }
public int? AttemptRequestNumber { [M(O.AggressiveInlining)] get; private set; }

[M(O.AggressiveInlining)] public void SetAttemptRequestNumber( int attemptRequestNumber )
{
Expand Down Expand Up @@ -97,7 +98,5 @@ public void Append2RequestText( string append2RequestText )

_RowPropertiesChanged.Invoke( this, nameof(RequestRowType) );
}

public RequestRowTypeEnum RequestRowType { [M(O.AggressiveInlining)] get; private set; }
}
}

0 comments on commit 6c9566d

Please sign in to comment.