Skip to content

Commit

Permalink
Remove Queue
Browse files Browse the repository at this point in the history
  • Loading branch information
da3dsoul committed Mar 12, 2024
1 parent 74b12a3 commit 114fcb6
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 468 deletions.
2 changes: 1 addition & 1 deletion Shoko.Commons
187 changes: 1 addition & 186 deletions Shoko.Desktop/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -194,13 +194,6 @@
<CommandBinding Command="{StaticResource BookmarkAnimeCommand}" Executed="CommandBinding_BookmarkAnime" />
<CommandBinding Command="{StaticResource RefreshBookmarksCommand}" Executed="CommandBinding_RefreshBookmarks" />

<CommandBinding Command="{StaticResource HasherQueuePauseCommand}" Executed="CommandBinding_HasherQueuePause" />
<CommandBinding Command="{StaticResource HasherQueueResumeCommand}" Executed="CommandBinding_HasherQueueResume" />
<CommandBinding Command="{StaticResource GeneralQueuePauseCommand}" Executed="CommandBinding_GeneralQueuePause" />
<CommandBinding Command="{StaticResource GeneralQueueResumeCommand}" Executed="CommandBinding_GeneralQueueResume" />
<CommandBinding Command="{StaticResource ServerImageQueuePauseCommand}" Executed="CommandBinding_ServerImageQueuePause" />
<CommandBinding Command="{StaticResource ServerImageQueueResumeCommand}" Executed="CommandBinding_ServerImageQueueResume" />

<CommandBinding Command="{StaticResource ShowWebCacheAdminCommand}" Executed="CommandBinding_ShowWebCacheAdmin" />
</Window.CommandBindings>

Expand Down Expand Up @@ -523,138 +516,6 @@

<usercontrols:ImportFolderAdmin Grid.Row="1" Grid.ColumnSpan="6"/>

<Border BorderBrush="LightGray" BorderThickness="1" Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="6" Background="#FFE9ECEF" Margin="0,10,0,5">
<TextBlock Text="{Resx ResxName=Shoko.Commons.Properties.Resources, Key=ShokoServer_ServerStatus}" Margin="5,0,0,0" Padding="3" FontWeight="Bold" VerticalAlignment="Center"></TextBlock>
</Border>


<!-- Hasher clear -->
<Button Name="btnClearHasherQueue" Grid.Column="0" Grid.Row="3" Margin="10,2,2,2" Style="{DynamicResource RoundButtonStyle}">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" >
<Image Height="16" Width="16" Source="/Images/16_clear.png" Margin="0,0,0,0"/>
</StackPanel>
<Button.ToolTip>
<TextBlock Text="{Resx ResxName=Shoko.Commons.Properties.Resources, Key=Tooltip_ClearHash}" Foreground="Black" FontWeight="DemiBold"/>
</Button.ToolTip>
</Button>

<!-- Hasher pause -->
<Button Grid.Column="1" Grid.Row="3" Margin="2,2,2,2" Style="{DynamicResource RoundButtonStyle}" Command="{StaticResource HasherQueuePauseCommand}"
Visibility="{Binding Source={x:Static local:VM_ShokoServer.Instance}, Path=HasherQueueRunning, Converter={StaticResource BooleanToVisibilityConverter}}">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" >
<Image Height="16" Width="16" Source="/Images/16_pause.png" Margin="0,0,0,0"/>
</StackPanel>
</Button>
<!-- Hasher resume -->
<Button Grid.Column="1" Grid.Row="3" Margin="2,2,2,2" Style="{DynamicResource RoundButtonStyle}" Command="{StaticResource HasherQueueResumeCommand}"
Visibility="{Binding Source={x:Static local:VM_ShokoServer.Instance}, Path=HasherQueuePaused, Converter={StaticResource BooleanToVisibilityConverter}}">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" >
<Image Height="16" Width="16" Source="/Images/32_resume.png" Margin="0,0,0,0"/>
</StackPanel>
</Button>

<!-- Hasher status -->
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Grid.Column="2" Grid.Row="3">
<Image Height="16" Width="16" Source="Images/16_server_hash.png" Margin="10,0,5,0" VerticalAlignment="Center"/>
<TextBlock VerticalAlignment="Center" Text="{Resx ResxName=Shoko.Commons.Properties.Resources, Key=QueueHasher}" Margin="0,0,0,0"/>
<TextBlock VerticalAlignment="Center" Text=" - " Margin="0,0,0,0"/>
<TextBlock VerticalAlignment="Center" Text="{Resx ResxName=Shoko.Commons.Properties.Resources, Key=ShokoServer_Running}" Margin="0,0,5,0"
Visibility="{Binding Source={x:Static local:VM_ShokoServer.Instance}, Path=HasherQueueRunning, Converter={StaticResource BooleanToVisibilityConverter}}"/>
<TextBlock VerticalAlignment="Center" Text="{Resx ResxName=Shoko.Commons.Properties.Resources, Key=ShokoServer_Paused}" Margin="0,0,5,0"
Visibility="{Binding Source={x:Static local:VM_ShokoServer.Instance}, Path=HasherQueuePaused, Converter={StaticResource BooleanToVisibilityConverter}}"/>
</StackPanel>

<TextBlock Grid.Column="3" Grid.Row="3" Margin="4,4,0,4" Text="{Binding Source={x:Static local:VM_ShokoServer.Instance},Path=HasherQueueCount}" VerticalAlignment="Center"/>
<TextBlock Grid.Column="4" Grid.Row="3" Margin="20,4,0,4" Text="{Binding Source={x:Static local:VM_ShokoServer.Instance},Path=HasherQueueState}" VerticalAlignment="Center"/>





<!-- General clear -->
<Button Name="btnClearGeneralQueue" Grid.Column="0" Grid.Row="4" Margin="10,2,2,2" Style="{DynamicResource RoundButtonStyle}">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" >
<Image Height="16" Width="16" Source="/Images/16_clear.png" Margin="0,0,0,0"/>
</StackPanel>
<Button.ToolTip>
<TextBlock Text="{Resx ResxName=Shoko.Commons.Properties.Resources, Key=Tooltip_ClearGeneral}" Foreground="Black" FontWeight="DemiBold"/>
</Button.ToolTip>
</Button>

<!-- General pause -->
<Button Grid.Column="1" Grid.Row="4" Margin="2,2,2,2" Style="{DynamicResource RoundButtonStyle}" Command="{StaticResource GeneralQueuePauseCommand}"
Visibility="{Binding Source={x:Static local:VM_ShokoServer.Instance}, Path=GeneralQueueRunning, Converter={StaticResource BooleanToVisibilityConverter}}">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" >
<Image Height="16" Width="16" Source="/Images/16_pause.png" Margin="0,0,0,0"/>
</StackPanel>
</Button>
<!-- General resume -->
<Button Grid.Column="1" Grid.Row="4" Margin="2,2,2,2" Style="{DynamicResource RoundButtonStyle}" Command="{StaticResource GeneralQueueResumeCommand}"
Visibility="{Binding Source={x:Static local:VM_ShokoServer.Instance}, Path=GeneralQueuePaused, Converter={StaticResource BooleanToVisibilityConverter}}">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" >
<Image Height="16" Width="16" Source="/Images/32_resume.png" Margin="0,0,0,0"/>
</StackPanel>
</Button>

<!-- General status -->
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Grid.Column="2" Grid.Row="4">
<Image Height="16" Width="16" Source="Images/16_server_connect.png" Margin="10,0,5,0" VerticalAlignment="Center"/>
<TextBlock VerticalAlignment="Center" Text="{Resx ResxName=Shoko.Commons.Properties.Resources, Key=QueueGeneral}" Margin="0,0,0,0"/>
<TextBlock VerticalAlignment="Center" Text=" - " Margin="0,0,0,0"/>
<TextBlock VerticalAlignment="Center" Text="{Resx ResxName=Shoko.Commons.Properties.Resources, Key=ShokoServer_Running}" Margin="0,0,5,0"
Visibility="{Binding Source={x:Static local:VM_ShokoServer.Instance}, Path=GeneralQueueRunning, Converter={StaticResource BooleanToVisibilityConverter}}"/>
<TextBlock VerticalAlignment="Center" Text="{Resx ResxName=Shoko.Commons.Properties.Resources, Key=ShokoServer_Paused}" Margin="0,0,5,0"
Visibility="{Binding Source={x:Static local:VM_ShokoServer.Instance}, Path=GeneralQueuePaused, Converter={StaticResource BooleanToVisibilityConverter}}"/>
</StackPanel>



<TextBlock Grid.Column="3" Grid.Row="4" Margin="4,4,0,4" Text="{Binding Source={x:Static local:VM_ShokoServer.Instance},Path=GeneralQueueCount}" VerticalAlignment="Center"/>
<TextBlock Grid.Column="4" Grid.Row="4" Margin="20,4,0,4" Text="{Binding Source={x:Static local:VM_ShokoServer.Instance},Path=GeneralQueueState}" VerticalAlignment="Center"/>



<!-- ServerImage clear -->
<Button Name="btnClearServerImageQueue" Grid.Column="0" Grid.Row="5" Margin="10,2,2,2" Style="{DynamicResource RoundButtonStyle}">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" >
<Image Height="16" Width="16" Source="/Images/16_clear.png" Margin="0,0,0,0"/>
</StackPanel>
<Button.ToolTip>
<TextBlock Text="{Resx ResxName=Shoko.Commons.Properties.Resources, Key=Tooltip_ClearGeneral}" Foreground="Black" FontWeight="DemiBold"/>
</Button.ToolTip>
</Button>

<!-- ServerImage pause -->
<Button Grid.Column="1" Grid.Row="5" Margin="2,2,2,2" Style="{DynamicResource RoundButtonStyle}" Command="{StaticResource ServerImageQueuePauseCommand}"
Visibility="{Binding Source={x:Static local:VM_ShokoServer.Instance}, Path=ServerImageQueueRunning, Converter={StaticResource BooleanToVisibilityConverter}}">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" >
<Image Height="16" Width="16" Source="/Images/16_pause.png" Margin="0,0,0,0"/>
</StackPanel>
</Button>
<!-- ServerImage resume -->
<Button Grid.Column="1" Grid.Row="5" Margin="2,2,2,2" Style="{DynamicResource RoundButtonStyle}" Command="{StaticResource ServerImageQueueResumeCommand}"
Visibility="{Binding Source={x:Static local:VM_ShokoServer.Instance}, Path=ServerImageQueuePaused, Converter={StaticResource BooleanToVisibilityConverter}}">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" >
<Image Height="16" Width="16" Source="/Images/32_resume.png" Margin="0,0,0,0"/>
</StackPanel>
</Button>

<!-- Server Images status -->
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Grid.Column="2" Grid.Row="5">
<Image Height="16" Width="16" Source="Images/16_image.png" Margin="10,0,5,0" VerticalAlignment="Center"/>
<TextBlock VerticalAlignment="Center" Text="{Resx ResxName=Shoko.Commons.Properties.Resources, Key=ShokoServer_ServerImage}" Margin="0,0,0,0"/>
<TextBlock VerticalAlignment="Center" Text=" - " Margin="0,0,0,0"/>
<TextBlock VerticalAlignment="Center" Text="{Resx ResxName=Shoko.Commons.Properties.Resources, Key=ShokoServer_Running}" Margin="0,0,5,0"
Visibility="{Binding Source={x:Static local:VM_ShokoServer.Instance}, Path=ServerImageQueueRunning, Converter={StaticResource BooleanToVisibilityConverter}}"/>
<TextBlock VerticalAlignment="Center" Text="{Resx ResxName=Shoko.Commons.Properties.Resources, Key=ShokoServer_Paused}" Margin="0,0,5,0"
Visibility="{Binding Source={x:Static local:VM_ShokoServer.Instance}, Path=ServerImageQueuePaused, Converter={StaticResource BooleanToVisibilityConverter}}"/>
</StackPanel>


<TextBlock Grid.Column="3" Grid.Row="5" Margin="4,4,0,4" Text="{Binding Source={x:Static local:VM_ShokoServer.Instance},Path=ServerImageQueueCount}" VerticalAlignment="Center"/>
<TextBlock Grid.Column="4" Grid.Row="5" Margin="20,4,0,4" Text="{Binding Source={x:Static local:VM_ShokoServer.Instance},Path=ServerImageQueueState}" VerticalAlignment="Center"/>


<Border BorderBrush="LightGray" BorderThickness="1" Grid.Column="0" Grid.Row="7" Grid.ColumnSpan="6" Background="#FFE9ECEF" Margin="0,10,0,5">
<TextBlock Text="{Resx ResxName=Shoko.Commons.Properties.Resources, Key=ServerActions}" Margin="5,0,0,0" Padding="3" FontWeight="Bold" VerticalAlignment="Center"></TextBlock>
</Border>
Expand Down Expand Up @@ -1479,52 +1340,9 @@
<Border Style="{DynamicResource ToolbarBorderControlStyle}" Height="30" Grid.Row="1" Background="#F1F1F1">
<DockPanel>
<StackPanel Name="QueuePanel" Orientation="Horizontal" Background="#F1F1F1" DockPanel.Dock="Left" ToolTipService.ShowDuration="{x:Static Member=System:Int32.MaxValue}">
<StackPanel.ToolTip>
<ToolTip Placement="Top" VerticalOffset="-2" Name="QueueTooltip">
<Border Background="SteelBlue" MinWidth="250" MaxWidth="900">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>

<!-- Icons -->
<Image Grid.Column="0" Grid.Row="0" Height="16" Width="16" Source="/Images/16_server_hash.png" Margin="15,4,0,4" VerticalAlignment="Center"/>
<Image Grid.Column="0" Grid.Row="1" Height="16" Width="16" Source="/Images/16_server_connect.png" Margin="15,4,0,4" VerticalAlignment="Center"/>
<Image Grid.Column="0" Grid.Row="2" Height="16" Width="16" Source="/Images/16_image.png" Margin="15,4,0,4" VerticalAlignment="Center"/>

<!-- Names -->
<TextBlock Grid.Column="1" Grid.Row="0" Text="{Resx ResxName=Shoko.Commons.Properties.Resources, Key=Tooltip_QueueHasher}" FontWeight="Bold" Foreground="White" Padding="6"/>
<TextBlock Grid.Column="1" Grid.Row="1" Text="{Resx ResxName=Shoko.Commons.Properties.Resources, Key=Tooltip_QueueGeneral}" FontWeight="Bold" Foreground="White" Padding="6"/>
<TextBlock Grid.Column="1" Grid.Row="2" Text="{Resx ResxName=Shoko.Commons.Properties.Resources, Key=Tooltip_QueueImages}" FontWeight="Bold" Foreground="White" Padding="6"/>

<!-- States -->
<TextBlock Grid.Column="2" Grid.Row="0" Margin="4,4,4,4" Text="{Binding Source={x:Static local:VM_ShokoServer.Instance},Path=HasherQueueState}" Foreground="White" VerticalAlignment="Center"/>
<TextBlock Grid.Column="2" Grid.Row="1" Margin="4,4,4,4" Text="{Binding Source={x:Static local:VM_ShokoServer.Instance},Path=GeneralQueueState}" Foreground="White" VerticalAlignment="Center"/>
<TextBlock Grid.Column="2" Grid.Row="2" Margin="4,4,4,4" Text="{Binding Source={x:Static local:VM_ShokoServer.Instance},Path=ServerImageQueueState}" Foreground="White" VerticalAlignment="Center"/>
</Grid>
</Border>
</ToolTip>
</StackPanel.ToolTip>

<!-- hasher command queue -->
<Image Height="16" Width="16" Source="/Images/16_server_hash.png" Margin="5,4,0,4" VerticalAlignment="Center"/>
<TextBlock Name="tbHasherQueueCount" Margin="4,4,0,4" Text="{Binding Source={x:Static local:VM_ShokoServer.Instance},Path=HasherQueueCount}" VerticalAlignment="Center"/>

<!-- general command queue -->
<Image Height="16" Width="16" Source="/Images/16_server_connect.png" Margin="15,4,0,4" VerticalAlignment="Center"/>
<TextBlock Name="tbGeneralQueueCount" Margin="4,4,0,4" Text="{Binding Source={x:Static local:VM_ShokoServer.Instance},Path=GeneralQueueCount}" VerticalAlignment="Center"/>

<!-- Image download queue -->
<Image Height="16" Width="16" Source="/Images/16_image.png" Margin="15,4,0,4" VerticalAlignment="Center"/>
<TextBlock Name="tbImageDownloadQueueStatus" Margin="4,4,0,4" Text="{Binding Source={x:Static local:VM_ShokoServer.Instance},Path=ServerImageQueueCount}" VerticalAlignment="Center"/>

<TextBlock Name="tbImageDownloadQueueStatus" Margin="4,4,0,4" Text="0" VerticalAlignment="Center"/>
<!-- Admin Messages -->
<Button Name="btnAdminMessages" Margin="10,2,2,2" Style="{DynamicResource FlatButtonStyle}"
Visibility="{Binding Source={x:Static local:VM_ShokoServer.Instance}, Path=AdminMessagesAvailable, Converter={StaticResource BooleanToVisibilityConverter}}">
Expand All @@ -1546,9 +1364,6 @@
<usercontrols:HyperLinkStandard VerticalAlignment="Center" Margin="10,0,0,0" DisplayText="{Resx ResxName=Shoko.Commons.Properties.Resources, Key=WhatDoesThisMean}" Grid.Column="1"
URL="{Resx ResxName=Shoko.Commons.Properties.Resources, Key=Link_AniDBBan}"/>
</StackPanel>



</StackPanel>


Expand Down
Loading

0 comments on commit 114fcb6

Please sign in to comment.