mirror of
https://github.com/tribufu/ServerManagers
synced 2026-05-06 15:17:34 +00:00
Task Priority Changes
- added a new task priority for the four auto processes. - added the task priority selection to the global settings.
This commit is contained in:
parent
138e56878a
commit
fb936241c6
21 changed files with 412 additions and 64 deletions
|
|
@ -808,36 +808,52 @@
|
|||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="*" MinWidth="150"/>
|
||||
<ColumnDefinition Width="Auto" MinWidth="150"/>
|
||||
<ColumnDefinition Width="*" MinWidth="150"/>
|
||||
<ColumnDefinition Width="Auto" MinWidth="150"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="5" Text="{DynamicResource GlobalSettings_AdvancedSettingsInformationLabel}" TextWrapping="Wrap" VerticalAlignment="Center" FontWeight="Bold" Foreground="{DynamicResource WarningMessage}"/>
|
||||
<TextBlock Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="4" Margin="5" Text="{DynamicResource GlobalSettings_AdvancedSettingsInformationLabel}" TextWrapping="Wrap" VerticalAlignment="Center" FontWeight="Bold" Foreground="{DynamicResource WarningMessage}"/>
|
||||
|
||||
<CheckBox Grid.Row="1" Grid.Column="0" Margin="5,0,5,5" Content="{DynamicResource GlobalSettings_UseShutdownCommandLabel}" IsChecked="{Binding Config.ServerShutdown_UseShutdownCommand}" VerticalAlignment="Center" VerticalContentAlignment="Center" ToolTip="{DynamicResource GlobalSettings_UseShutdownCommandTooltip}" HorizontalAlignment="Left"/>
|
||||
<CheckBox Grid.Row="1" Grid.Column="1" Margin="5,0,5,5" Content="{DynamicResource GlobalSettings_BackupWorldFileLabel}" IsChecked="{Binding Config.BackupWorldFile, Mode=TwoWay}" ToolTip="{DynamicResource GlobalSettings_BackupWorldFileTooltip}" HorizontalAlignment="Left"/>
|
||||
<CheckBox Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Margin="5,0,5,5" Content="{DynamicResource GlobalSettings_UseShutdownCommandLabel}" IsChecked="{Binding Config.ServerShutdown_UseShutdownCommand}" VerticalAlignment="Center" VerticalContentAlignment="Center" ToolTip="{DynamicResource GlobalSettings_UseShutdownCommandTooltip}" HorizontalAlignment="Left"/>
|
||||
<CheckBox Grid.Row="1" Grid.Column="2" Grid.ColumnSpan="2" Margin="5,0,5,5" Content="{DynamicResource GlobalSettings_BackupWorldFileLabel}" IsChecked="{Binding Config.BackupWorldFile, Mode=TwoWay}" ToolTip="{DynamicResource GlobalSettings_BackupWorldFileTooltip}" HorizontalAlignment="Left"/>
|
||||
|
||||
<CheckBox Grid.Row="2" Grid.Column="0" Margin="5,0,5,5" Content="{DynamicResource GlobalSettings_CloseShutdownWindowWhenFinishedLabel}" IsChecked="{Binding Config.CloseShutdownWindowWhenFinished, Mode=TwoWay}" ToolTip="{DynamicResource GlobalSettings_CloseShutdownWindowWhenFinishedTooltip}" HorizontalAlignment="Left"/>
|
||||
<CheckBox Grid.Row="2" Grid.Column="1" Margin="5,0,5,5" Content="{DynamicResource GlobalSettings_VerifyServerAfterUpdateLabel}" IsChecked="{Binding Config.AutoUpdate_VerifyServerAfterUpdate, Mode=TwoWay}" ToolTip="{DynamicResource GlobalSettings_VerifyServerAfterUpdateTooltip}" HorizontalAlignment="Left"/>
|
||||
<CheckBox Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Margin="5,0,5,5" Content="{DynamicResource GlobalSettings_CloseShutdownWindowWhenFinishedLabel}" IsChecked="{Binding Config.CloseShutdownWindowWhenFinished, Mode=TwoWay}" ToolTip="{DynamicResource GlobalSettings_CloseShutdownWindowWhenFinishedTooltip}" HorizontalAlignment="Left"/>
|
||||
<CheckBox Grid.Row="2" Grid.Column="2" Grid.ColumnSpan="2" Margin="5,0,5,5" Content="{DynamicResource GlobalSettings_VerifyServerAfterUpdateLabel}" IsChecked="{Binding Config.AutoUpdate_VerifyServerAfterUpdate, Mode=TwoWay}" ToolTip="{DynamicResource GlobalSettings_VerifyServerAfterUpdateTooltip}" HorizontalAlignment="Left"/>
|
||||
|
||||
<CheckBox Grid.Row="3" Grid.Column="0" Margin="5,0,5,5" Content="{DynamicResource GlobalSettings_SteamCmdRemoveQuitLabel}" IsChecked="{Binding CommonConfig.SteamCmdRemoveQuit, Mode=TwoWay}" ToolTip="{DynamicResource GlobalSettings_SteamCmdRemoveQuitTooltip}" HorizontalAlignment="Left"/>
|
||||
<CheckBox Grid.Row="3" Grid.Column="1" Margin="5,0,5,5" Content="{DynamicResource GlobalSettings_UpdateDirectoryPermissionsLabel}" IsChecked="{Binding Config.UpdateDirectoryPermissions, Mode=TwoWay}" ToolTip="{DynamicResource GlobalSettings_UpdateDirectoryPermissionsTooltip}" HorizontalAlignment="Left"/>
|
||||
<CheckBox Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" Margin="5,0,5,5" Content="{DynamicResource GlobalSettings_SteamCmdRemoveQuitLabel}" IsChecked="{Binding CommonConfig.SteamCmdRemoveQuit, Mode=TwoWay}" ToolTip="{DynamicResource GlobalSettings_SteamCmdRemoveQuitTooltip}" HorizontalAlignment="Left"/>
|
||||
<CheckBox Grid.Row="3" Grid.Column="2" Grid.ColumnSpan="2" Margin="5,0,5,5" Content="{DynamicResource GlobalSettings_UpdateDirectoryPermissionsLabel}" IsChecked="{Binding Config.UpdateDirectoryPermissions, Mode=TwoWay}" ToolTip="{DynamicResource GlobalSettings_UpdateDirectoryPermissionsTooltip}" HorizontalAlignment="Left"/>
|
||||
|
||||
<CheckBox Grid.Row="4" Grid.Column="0" Margin="5,0,5,5" Content="{DynamicResource GlobalSettings_SteamCmdRedirectOutputLabel}" IsChecked="{Binding Config.SteamCmdRedirectOutput, Mode=TwoWay}" ToolTip="{DynamicResource GlobalSettings_SteamCmdRedirectOutputTooltip}" HorizontalAlignment="Left"/>
|
||||
<CheckBox Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" Margin="5,0,5,5" Content="{DynamicResource GlobalSettings_SteamCmdRedirectOutputLabel}" IsChecked="{Binding Config.SteamCmdRedirectOutput, Mode=TwoWay}" ToolTip="{DynamicResource GlobalSettings_SteamCmdRedirectOutputTooltip}" HorizontalAlignment="Left"/>
|
||||
|
||||
<CheckBox Grid.Row="5" Grid.Column="0" Margin="5,0,5,5" Content="{DynamicResource GlobalSettings_EnableLoggingLabel}" IsChecked="{Binding Config.LoggingEnabled, Mode=TwoWay}" ToolTip="{DynamicResource GlobalSettings_EnableLoggingTooltip}" HorizontalAlignment="Left" VerticalAlignment="Center"/>
|
||||
<cctl:AnnotatedSlider Grid.Row="5" Grid.Column="1" Margin="0" Label="{DynamicResource GlobalSettings_WorldSaveDelayLabel}" Value="{Binding Config.ServerShutdown_WorldSaveDelay, Converter={cc:IntRangeValueConverter 10, 300}}" Minimum="10" Maximum="300" SmallChange="10" LargeChange="50" TickFrequency="1" LabelRelativeWidth="Auto" SliderRelativeWidth="15*" SuffixRelativeWidth="Auto" Suffix="{DynamicResource SliderUnits_Seconds}" ToolTip="{DynamicResource GlobalSettings_WorldSaveDelayTooltip}"/>
|
||||
<CheckBox Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="2" Margin="5,0,5,5" Content="{DynamicResource GlobalSettings_EnableLoggingLabel}" IsChecked="{Binding Config.LoggingEnabled, Mode=TwoWay}" ToolTip="{DynamicResource GlobalSettings_EnableLoggingTooltip}" HorizontalAlignment="Left" VerticalAlignment="Center"/>
|
||||
<cctl:AnnotatedSlider Grid.Row="5" Grid.Column="2" Grid.ColumnSpan="2" Margin="1" Label="{DynamicResource GlobalSettings_WorldSaveDelayLabel}" Value="{Binding Config.ServerShutdown_WorldSaveDelay, Converter={cc:IntRangeValueConverter 10, 300}}" Minimum="10" Maximum="300" SmallChange="10" LargeChange="50" TickFrequency="1" LabelRelativeWidth="Auto" SliderRelativeWidth="15*" SuffixRelativeWidth="Auto" Suffix="{DynamicResource SliderUnits_Seconds}" ToolTip="{DynamicResource GlobalSettings_WorldSaveDelayTooltip}"/>
|
||||
|
||||
<cctl:AnnotatedSlider Grid.Row="6" Grid.Column="0" Margin="0" Label="{DynamicResource GlobalSettings_LoggingMaxArchiveDaysLabel}" Value="{Binding Config.LoggingMaxArchiveDays}" Minimum="1" Maximum="365" SmallChange="1" LargeChange="5" TickFrequency="5" LabelRelativeWidth="Auto" SliderRelativeWidth="15*" SuffixRelativeWidth="Auto" SuffixRelativeMinWidth="40" Suffix="{DynamicResource SliderUnits_Days}" ToolTip="{DynamicResource GlobalSettings_LoggingMaxArchiveDaysTooltip}" IsEnabled="{Binding Config.LoggingEnabled}"/>
|
||||
|
||||
<cctl:AnnotatedSlider Grid.Row="7" Grid.Column="0" Margin="0" Label="{DynamicResource GlobalSettings_LoggingMaxArchiveFilesLabel}" Value="{Binding Config.LoggingMaxArchiveFiles}" Minimum="1" Maximum="1000" SmallChange="1" LargeChange="5" TickFrequency="5" LabelRelativeWidth="Auto" SliderRelativeWidth="15*" SuffixRelativeWidth="Auto" SuffixRelativeMinWidth="40" Suffix="{DynamicResource SliderUnits_Files}" ToolTip="{DynamicResource GlobalSettings_LoggingMaxArchiveFilesTooltip}" IsEnabled="{Binding Config.LoggingEnabled}"/>
|
||||
<cctl:AnnotatedSlider Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="2" Margin="1" Label="{DynamicResource GlobalSettings_LoggingMaxArchiveDaysLabel}" Value="{Binding Config.LoggingMaxArchiveDays}" Minimum="1" Maximum="365" SmallChange="1" LargeChange="5" TickFrequency="5" LabelRelativeWidth="Auto" SliderRelativeWidth="15*" SuffixRelativeWidth="Auto" SuffixRelativeMinWidth="40" Suffix="{DynamicResource SliderUnits_Days}" ToolTip="{DynamicResource GlobalSettings_LoggingMaxArchiveDaysTooltip}" IsEnabled="{Binding Config.LoggingEnabled}"/>
|
||||
|
||||
<StackPanel Grid.Row="7" Grid.Column="1" Margin="0" Orientation="Horizontal">
|
||||
<Label Content="{DynamicResource GlobalSettings_RCON_ModeLabel}" VerticalAlignment="Center"/>
|
||||
<ComboBox Name="RconMessageModesComboBox" Margin="5" ItemsSource="{Binding ElementName=GlobalSettings, Path=RconMessageModes}" SelectedValue="{Binding Config.RCON_MessageCommand}" ToolTip="{DynamicResource GlobalSettings_RCON_ModeTooltip}" SelectedValuePath="ValueMember" DisplayMemberPath="DisplayMember" PreviewMouseWheel="ComboBox_PreviewMouseWheel"/>
|
||||
</StackPanel>
|
||||
<cctl:AnnotatedSlider Grid.Row="7" Grid.Column="0" Grid.ColumnSpan="2" Margin="1" Label="{DynamicResource GlobalSettings_LoggingMaxArchiveFilesLabel}" Value="{Binding Config.LoggingMaxArchiveFiles}" Minimum="1" Maximum="1000" SmallChange="1" LargeChange="5" TickFrequency="5" LabelRelativeWidth="Auto" SliderRelativeWidth="15*" SuffixRelativeWidth="Auto" SuffixRelativeMinWidth="40" Suffix="{DynamicResource SliderUnits_Files}" ToolTip="{DynamicResource GlobalSettings_LoggingMaxArchiveFilesTooltip}" IsEnabled="{Binding Config.LoggingEnabled}"/>
|
||||
<Label Grid.Row="7" Grid.Column="2" Content="{DynamicResource GlobalSettings_RCON_ModeLabel}" VerticalAlignment="Center"/>
|
||||
<ComboBox Name="RconMessageModesComboBox" Grid.Row="7" Grid.Column="3" Margin="1" ItemsSource="{Binding ElementName=GlobalSettings, Path=RconMessageModes}" SelectedValue="{Binding Config.RCON_MessageCommand}" ToolTip="{DynamicResource GlobalSettings_RCON_ModeTooltip}" SelectedValuePath="ValueMember" DisplayMemberPath="DisplayMember" PreviewMouseWheel="ComboBox_PreviewMouseWheel"/>
|
||||
|
||||
<TextBlock Grid.Row="8" Grid.Column="0" Grid.ColumnSpan="4" Margin="5" Text="{DynamicResource GlobalSettings_TaskPriority_InformationLabel}" TextWrapping="Wrap" VerticalAlignment="Center" FontWeight="Bold" Foreground="{DynamicResource WarningMessage}"/>
|
||||
|
||||
<Label Grid.Row="9" Grid.Column="0" Margin="0" Content="{DynamicResource GlobalSettings_TaskPriority_AutoBackupLabel}" VerticalAlignment="Center"/>
|
||||
<ComboBox Name="TaskPriorityAutoBackupComboBox" Grid.Row="9" Grid.Column="1" Margin="1" ItemsSource="{Binding ElementName=GlobalSettings, Path=TaskPriorities}" SelectedValue="{Binding Config.AutoBackup_TaskPriority}" ToolTip="{DynamicResource GlobalSettings_TaskPriority_Tooltip}" SelectedValuePath="ValueMember" DisplayMemberPath="DisplayMember" PreviewMouseWheel="ComboBox_PreviewMouseWheel"/>
|
||||
|
||||
<Label Grid.Row="9" Grid.Column="2" Margin="0" Content="{DynamicResource GlobalSettings_TaskPriority_AutoUpdateLabel}" VerticalAlignment="Center"/>
|
||||
<ComboBox Name="TaskPriorityAutoUpdateComboBox" Grid.Row="9" Grid.Column="3" Margin="1" ItemsSource="{Binding ElementName=GlobalSettings, Path=TaskPriorities}" SelectedValue="{Binding Config.AutoUpdate_TaskPriority}" ToolTip="{DynamicResource GlobalSettings_TaskPriority_Tooltip}" SelectedValuePath="ValueMember" DisplayMemberPath="DisplayMember" PreviewMouseWheel="ComboBox_PreviewMouseWheel"/>
|
||||
|
||||
<Label Grid.Row="10" Grid.Column="0" Margin="0" Content="{DynamicResource GlobalSettings_TaskPriority_AutoShutdownLabel}" VerticalAlignment="Center"/>
|
||||
<ComboBox Name="TaskPriorityAutoShutdownComboBox" Grid.Row="10" Grid.Column="1" Margin="1" ItemsSource="{Binding ElementName=GlobalSettings, Path=TaskPriorities}" SelectedValue="{Binding Config.AutoShutdown_TaskPriority}" ToolTip="{DynamicResource GlobalSettings_TaskPriority_Tooltip}" SelectedValuePath="ValueMember" DisplayMemberPath="DisplayMember" PreviewMouseWheel="ComboBox_PreviewMouseWheel"/>
|
||||
|
||||
<Label Grid.Row="10" Grid.Column="2" Margin="0" Content="{DynamicResource GlobalSettings_TaskPriority_AutoStartLabel}" VerticalAlignment="Center"/>
|
||||
<ComboBox Name="TaskPriorityAutoStartComboBox" Grid.Row="10" Grid.Column="3" Margin="1" ItemsSource="{Binding ElementName=GlobalSettings, Path=TaskPriorities}" SelectedValue="{Binding Config.AutoStart_TaskPriority}" ToolTip="{DynamicResource GlobalSettings_TaskPriority_Tooltip}" SelectedValuePath="ValueMember" DisplayMemberPath="DisplayMember" PreviewMouseWheel="ComboBox_PreviewMouseWheel"/>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
</Grid>
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ namespace ServerManagerTool
|
|||
public static readonly DependencyProperty DiscordBotLogLevelsProperty = DependencyProperty.Register(nameof(DiscordBotLogLevels), typeof(ComboBoxItemList), typeof(GlobalSettingsControl), new PropertyMetadata(null));
|
||||
public static readonly DependencyProperty DiscordBotWhitelistProperty = DependencyProperty.Register(nameof(DiscordBotWhitelist), typeof(List<DiscordBotWhitelistItem>), typeof(GlobalSettingsControl), new PropertyMetadata(null));
|
||||
public static readonly DependencyProperty RconMessageModesProperty = DependencyProperty.Register(nameof(RconMessageModes), typeof(ComboBoxItemList), typeof(GlobalSettingsControl), new PropertyMetadata(null));
|
||||
public static readonly DependencyProperty TaskPrioritiesProperty = DependencyProperty.Register(nameof(TaskPriorities), typeof(ComboBoxItemList), typeof(GlobalSettingsControl), new PropertyMetadata(null));
|
||||
|
||||
public GlobalSettingsControl()
|
||||
{
|
||||
|
|
@ -54,6 +55,7 @@ namespace ServerManagerTool
|
|||
PopulateWindowsStatesServerMonitorWindowComboBox();
|
||||
PopulateDiscordBotLogLevelsComboBox();
|
||||
PopulateRconMessageModesComboBox();
|
||||
PopulateTaskPrioritiesComboBox();
|
||||
|
||||
DiscordBotWhitelist = new List<DiscordBotWhitelistItem>();
|
||||
if (Config.DiscordBotWhitelist != null)
|
||||
|
|
@ -124,6 +126,12 @@ namespace ServerManagerTool
|
|||
set { SetValue(RconMessageModesProperty, value); }
|
||||
}
|
||||
|
||||
public ComboBoxItemList TaskPriorities
|
||||
{
|
||||
get { return (ComboBoxItemList)GetValue(TaskPrioritiesProperty); }
|
||||
set { SetValue(TaskPrioritiesProperty, value); }
|
||||
}
|
||||
|
||||
public void ApplyChangesToConfig()
|
||||
{
|
||||
if (Config.DiscordBotWhitelist is null)
|
||||
|
|
@ -394,6 +402,7 @@ namespace ServerManagerTool
|
|||
PopulateWindowsStatesMainWindowComboBox();
|
||||
PopulateWindowsStatesServerMonitorWindowComboBox();
|
||||
PopulateRconMessageModesComboBox();
|
||||
PopulateTaskPrioritiesComboBox();
|
||||
|
||||
App.Instance.OnResourceDictionaryChanged(Config.CultureName);
|
||||
}
|
||||
|
|
@ -555,6 +564,39 @@ namespace ServerManagerTool
|
|||
}
|
||||
}
|
||||
|
||||
private void PopulateTaskPrioritiesComboBox()
|
||||
{
|
||||
var selectedValueAutoBackup = this.TaskPriorityAutoBackupComboBox?.SelectedValue ?? Config.AutoBackup_TaskPriority;
|
||||
var selectedValueAutoUpdate = this.TaskPriorityAutoUpdateComboBox?.SelectedValue ?? Config.AutoUpdate_TaskPriority;
|
||||
var selectedValueAutoShutdown = this.TaskPriorityAutoShutdownComboBox?.SelectedValue ?? Config.AutoShutdown_TaskPriority;
|
||||
var selectedValueAutoStart = this.TaskPriorityAutoStartComboBox?.SelectedValue ?? Config.AutoStart_TaskPriority;
|
||||
var list = new ComboBoxItemList();
|
||||
|
||||
foreach (ProcessPriorityClass priority in Enum.GetValues(typeof(ProcessPriorityClass)))
|
||||
{
|
||||
var displayMember = _globalizer.GetResourceString($"TaskPriority_{priority}") ?? priority.ToString();
|
||||
list.Add(new Common.Model.ComboBoxItem(priority.ToString(), displayMember));
|
||||
}
|
||||
|
||||
this.TaskPriorities = list;
|
||||
if (this.TaskPriorityAutoBackupComboBox != null)
|
||||
{
|
||||
this.TaskPriorityAutoBackupComboBox.SelectedValue = selectedValueAutoBackup;
|
||||
}
|
||||
if (this.TaskPriorityAutoUpdateComboBox != null)
|
||||
{
|
||||
this.TaskPriorityAutoUpdateComboBox.SelectedValue = selectedValueAutoUpdate;
|
||||
}
|
||||
if (this.TaskPriorityAutoShutdownComboBox != null)
|
||||
{
|
||||
this.TaskPriorityAutoShutdownComboBox.SelectedValue = selectedValueAutoShutdown;
|
||||
}
|
||||
if (this.TaskPriorityAutoStartComboBox != null)
|
||||
{
|
||||
this.TaskPriorityAutoStartComboBox.SelectedValue = selectedValueAutoStart;
|
||||
}
|
||||
}
|
||||
|
||||
#region Discord Bot Whitelist
|
||||
private void AddDiscordBotWhitelist_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue