Move auto channel change preference

moved to installation tab to make it clearer that it's related to channel preference
This commit is contained in:
pizzaboxer 2023-05-14 02:05:38 +01:00
parent a0bebbaa20
commit 6d72ec973e
No known key found for this signature in database
GPG Key ID: 59D4A1DBAD0F2BA8
4 changed files with 25 additions and 29 deletions

View File

@ -1,9 +1,4 @@
using System.Collections.Generic; namespace Bloxstrap.ViewModels
using System.Linq;
using Bloxstrap.Enums;
namespace Bloxstrap.ViewModels
{ {
public class BehaviourViewModel public class BehaviourViewModel
{ {
@ -24,19 +19,5 @@ namespace Bloxstrap.ViewModels
get => App.Settings.Prop.MultiInstanceLaunching; get => App.Settings.Prop.MultiInstanceLaunching;
set => App.Settings.Prop.MultiInstanceLaunching = value; set => App.Settings.Prop.MultiInstanceLaunching = value;
} }
// todo - move to enum attributes?
public IReadOnlyDictionary<string, ChannelChangeMode> ChannelChangeModes => new Dictionary<string, ChannelChangeMode>
{
{ "Change automatically", ChannelChangeMode.Automatic },
{ "Always prompt", ChannelChangeMode.Prompt },
{ "Never change", ChannelChangeMode.Ignore },
};
public string SelectedChannelChangeMode
{
get => ChannelChangeModes.FirstOrDefault(x => x.Value == App.Settings.Prop.ChannelChangeMode).Key;
set => App.Settings.Prop.ChannelChangeMode = ChannelChangeModes[value];
}
} }
} }

View File

@ -10,6 +10,7 @@ using System.Windows.Input;
using CommunityToolkit.Mvvm.Input; using CommunityToolkit.Mvvm.Input;
using Bloxstrap.Enums;
using Bloxstrap.Models; using Bloxstrap.Models;
namespace Bloxstrap.ViewModels namespace Bloxstrap.ViewModels
@ -117,5 +118,19 @@ namespace Bloxstrap.ViewModels
// cant use data bindings so i have to do whatever tf this is // cant use data bindings so i have to do whatever tf this is
public Visibility ChannelComboBoxVisibility => ManualChannelEntry ? Visibility.Collapsed : Visibility.Visible; public Visibility ChannelComboBoxVisibility => ManualChannelEntry ? Visibility.Collapsed : Visibility.Visible;
public Visibility ChannelTextBoxVisibility => ManualChannelEntry ? Visibility.Visible : Visibility.Collapsed; public Visibility ChannelTextBoxVisibility => ManualChannelEntry ? Visibility.Visible : Visibility.Collapsed;
// todo - move to enum attributes?
public IReadOnlyDictionary<string, ChannelChangeMode> ChannelChangeModes => new Dictionary<string, ChannelChangeMode>
{
{ "Change automatically", ChannelChangeMode.Automatic },
{ "Always prompt", ChannelChangeMode.Prompt },
{ "Never change", ChannelChangeMode.Ignore },
};
public string SelectedChannelChangeMode
{
get => ChannelChangeModes.FirstOrDefault(x => x.Value == App.Settings.Prop.ChannelChangeMode).Key;
set => App.Settings.Prop.ChannelChangeMode = ChannelChangeModes[value];
}
} }
} }

View File

@ -40,14 +40,5 @@
</ui:CardControl.Header> </ui:CardControl.Header>
<ui:ToggleSwitch IsChecked="{Binding MultiInstanceLaunchingEnabled, Mode=TwoWay}" /> <ui:ToggleSwitch IsChecked="{Binding MultiInstanceLaunchingEnabled, Mode=TwoWay}" />
</ui:CardControl> </ui:CardControl>
<ui:CardControl Margin="0,8,0,0" Padding="16,13,16,12">
<ui:CardControl.Header>
<StackPanel>
<TextBlock FontSize="14" Text="Choose what to do on suggested channel change" />
<TextBlock Margin="0,2,0,0" FontSize="12" Text="Roblox or Bloxstrap may try to change your preferred release channel." Foreground="{DynamicResource TextFillColorTertiaryBrush}" />
</StackPanel>
</ui:CardControl.Header>
<ComboBox Margin="5,0,0,0" Padding="10,5,10,5" Width="200" ItemsSource="{Binding ChannelChangeModes.Keys, Mode=OneTime}" Text="{Binding SelectedChannelChangeMode, Mode=TwoWay}" />
</ui:CardControl>
</StackPanel> </StackPanel>
</ui:UiPage> </ui:UiPage>

View File

@ -122,5 +122,14 @@
</Grid> </Grid>
</StackPanel> </StackPanel>
</ui:CardExpander> </ui:CardExpander>
<ui:CardControl Margin="0,8,0,0" Padding="16,13,16,12">
<ui:CardControl.Header>
<StackPanel>
<TextBlock FontSize="14" Text="Automatic channel change action" />
<TextBlock Margin="0,2,0,0" FontSize="12" Text="Roblox or Bloxstrap may try to change your preferred channel." Foreground="{DynamicResource TextFillColorTertiaryBrush}" />
</StackPanel>
</ui:CardControl.Header>
<ComboBox Margin="5,0,0,0" Padding="10,5,10,5" Width="200" ItemsSource="{Binding ChannelChangeModes.Keys, Mode=OneTime}" Text="{Binding SelectedChannelChangeMode, Mode=TwoWay}" />
</ui:CardControl>
</StackPanel> </StackPanel>
</ui:UiPage> </ui:UiPage>