add localization
This commit is contained in:
parent
864a07c75c
commit
ab49284f2f
10 changed files with 475 additions and 50 deletions
|
|
@ -3,6 +3,7 @@
|
|||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:vm="using:MetaforceInstaller.UI.ViewModels"
|
||||
xmlns:lang="using:MetaforceInstaller.UI.Lang"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:CompileBindings="True"
|
||||
x:DataType="vm:MainWindowViewModel"
|
||||
|
|
@ -43,7 +44,12 @@
|
|||
|
||||
<Button Grid.Row="0" Name="NewInstallationButton" Margin="20" VerticalAlignment="Center"
|
||||
HorizontalAlignment="Right">
|
||||
+ Add new installation
|
||||
<Button.Content>
|
||||
<StackPanel Orientation="Horizontal" Spacing="4">
|
||||
<TextBlock Text="+" />
|
||||
<TextBlock Text="{x:Static lang:Resources.AddInstallation}" />
|
||||
</StackPanel>
|
||||
</Button.Content>
|
||||
</Button>
|
||||
|
||||
<ScrollViewer Grid.Row="1">
|
||||
|
|
@ -51,23 +57,22 @@
|
|||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Expander Header="{Binding Title}" Margin="16, 8" HorizontalAlignment="Stretch">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Grid.Column="0" Orientation="Vertical">
|
||||
<Label Content="{Binding Id, StringFormat='ID: {0}'}" />
|
||||
<Label Content="{Binding InstalledAt, StringFormat='Installed: {0}'}" />
|
||||
<StackPanel Orientation="Vertical">
|
||||
<Label Content="{Binding Id, StringFormat='ID: {0}'}" />
|
||||
<Label Content="{Binding InstalledAt, StringFormat='Installed: {0}'}" />
|
||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||
<Button Name="LaunchServerButton" Click="OnLaunchServerClick"
|
||||
Content="{x:Static lang:Resources.LaunchServer}" />
|
||||
<Button Name="LaunchPcAdminButton" Click="OnLaunchAdminClick"
|
||||
Content="{x:Static lang:Resources.LaunchPCAdmin}" />
|
||||
<Button Name="InstallVrClientButton"
|
||||
Content="{x:Static lang:Resources.InstallVRClient}" />
|
||||
<Button Name="InstallAndroidAdminButton"
|
||||
Content="{x:Static lang:Resources.InstallAndroidAdmin}" />
|
||||
<Button Name="DeleteButton" Click="OnDeleteInstallationClick"
|
||||
Content="{x:Static lang:Resources.Delete}" />
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="1" Orientation="Vertical">
|
||||
<Button Name="LaunchServerButton" Click="OnLaunchServerClick">Launch server</Button>
|
||||
<Button Name="LaunchPcAdminButton" Click="OnLaunchAdminClick">Launch PC admin</Button>
|
||||
<Button Name="InstallVrClientButton">Install VR client</Button>
|
||||
<Button Name="InstallAndroidAdminButton">Install Android admin</Button>
|
||||
<Button Name="DeleteButton" Click="OnDeleteInstallationClick">Delete</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</Expander>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:lang="clr-namespace:MetaforceInstaller.UI.Lang"
|
||||
mc:Ignorable="d" d:DesignWidth="200" d:DesignHeight="400"
|
||||
x:Class="MetaforceInstaller.UI.Windows.NewInstallationDialog"
|
||||
Title="MetaforceInstaller - Add new installation"
|
||||
|
|
@ -9,19 +10,19 @@
|
|||
CanResize="False">
|
||||
|
||||
<StackPanel Margin="24" Spacing="12">
|
||||
<Label FontSize="36">Add new installation</Label>
|
||||
<TextBox Name="TitleTextBox" Watermark="Name of new installation"/>
|
||||
<Button Name="ChooseZip">Choose .zip with installation</Button>
|
||||
<CheckBox Name="ServerCheckBox">Install server</CheckBox>
|
||||
<CheckBox Name="PcAdminCheckBox">Install admin</CheckBox>
|
||||
<CheckBox Name="AndroidAdminCheckbox">Save android admin</CheckBox>
|
||||
<CheckBox Name="VrClientCheckbox">Save VR client</CheckBox>
|
||||
<Label FontSize="36" Content="{x:Static lang:Resources.AddInstallation}" />
|
||||
<TextBox Name="TitleTextBox" Watermark="{x:Static lang:Resources.NameOfNewInstallation}" />
|
||||
<Button Name="ChooseZip" Content="{x:Static lang:Resources.ChooseZip}" />
|
||||
<CheckBox Name="ServerCheckBox" Content="{x:Static lang:Resources.InstallServerCheckbox}" />
|
||||
<CheckBox Name="PcAdminCheckBox" Content="{x:Static lang:Resources.InstallAdminCheckbox}" />
|
||||
<CheckBox Name="AndroidAdminCheckbox" Content="{x:Static lang:Resources.SaveAndroidAdminCheckbox}" />
|
||||
<CheckBox Name="VrClientCheckbox" Content="{x:Static lang:Resources.SaveVRClientCheckbox}" />
|
||||
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Bottom" Spacing="8">
|
||||
<Button Name="InstallButton">Install</Button>
|
||||
<Button Name="CancelButton">Cancel</Button>
|
||||
<Button Name="InstallButton" Content="{x:Static lang:Resources.InstallButton}" />
|
||||
<Button Name="CancelButton" Content="{x:Static lang:Resources.CancelButton}" />
|
||||
</StackPanel>
|
||||
<ProgressBar Name="ProgressBar" Minimum="0" Maximum="100" Value="0"/>
|
||||
<ProgressBar Name="ProgressBar" Minimum="0" Maximum="100" Value="0" />
|
||||
</StackPanel>
|
||||
|
||||
</Window>
|
||||
|
|
@ -23,9 +23,9 @@ public partial class NewInstallationDialog : Window
|
|||
public NewInstallationDialog(IStorageService storageService)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
|
||||
_storageService = storageService;
|
||||
|
||||
|
||||
RefreshCheckboxes();
|
||||
CancelButton.Click += OnCancelClick;
|
||||
ChooseZip.Click += OnChooseZipClick;
|
||||
|
|
@ -39,13 +39,13 @@ public partial class NewInstallationDialog : Window
|
|||
var pcAdminCheckbox = PcAdminCheckBox;
|
||||
var androidAdminCheckbox = AndroidAdminCheckbox;
|
||||
var vrClientCheckbox = VrClientCheckbox;
|
||||
serverCheckbox.Content = TextDefaults.InstallServer;
|
||||
serverCheckbox.Content = Lang.Resources.InstallServerCheckbox;
|
||||
serverCheckbox.IsEnabled = true;
|
||||
pcAdminCheckbox.Content = TextDefaults.InstallAdmin;
|
||||
pcAdminCheckbox.Content = Lang.Resources.InstallAdminCheckbox;
|
||||
pcAdminCheckbox.IsEnabled = true;
|
||||
androidAdminCheckbox.Content = TextDefaults.SaveAndroidAdmin;
|
||||
androidAdminCheckbox.Content = Lang.Resources.SaveAndroidAdminCheckbox;
|
||||
androidAdminCheckbox.IsEnabled = true;
|
||||
vrClientCheckbox.Content = TextDefaults.SaveVRClient;
|
||||
vrClientCheckbox.Content = Lang.Resources.SaveVRClientCheckbox;
|
||||
vrClientCheckbox.IsEnabled = true;
|
||||
}
|
||||
|
||||
|
|
@ -94,7 +94,7 @@ public partial class NewInstallationDialog : Window
|
|||
});
|
||||
|
||||
InstallButton.IsEnabled = false;
|
||||
|
||||
|
||||
var appData = _storageService.Load();
|
||||
|
||||
var updatedParts = ZipScrapper.UpdatePathsAfterExtraction(_installationParts, extractedPath);
|
||||
|
|
@ -123,34 +123,34 @@ public partial class NewInstallationDialog : Window
|
|||
if (string.IsNullOrEmpty(_installationParts.WindowsServerPath))
|
||||
{
|
||||
serverCheckbox.IsEnabled = false;
|
||||
serverCheckbox.Content += "\nCouldn't find directory with server";
|
||||
serverCheckbox.Content += $"\n{Lang.Resources.NoServerError}";
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(_installationParts.WindowsAdminPath))
|
||||
{
|
||||
pcAdminCheckbox.IsEnabled = false;
|
||||
pcAdminCheckbox.Content += "\nCouldn't find directory with PC admin";
|
||||
pcAdminCheckbox.Content += $"\n{Lang.Resources.NoPCAdminError}";
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(_installationParts.WindowsContentPath))
|
||||
{
|
||||
pcAdminCheckbox.IsEnabled = false;
|
||||
pcAdminCheckbox.Content += "\nCouldn't find windows content";
|
||||
pcAdminCheckbox.Content += $"\n{Lang.Resources.NoWindowsContentError}";
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(_installationParts.AndroidContentPath))
|
||||
{
|
||||
vrClientCheckbox.IsEnabled = false;
|
||||
vrClientCheckbox.Content += "\nCouldn't find android content";
|
||||
vrClientCheckbox.Content += $"\n{Lang.Resources.NoAndroidContentError}";
|
||||
androidAdminCheckbox.IsEnabled = false;
|
||||
androidAdminCheckbox.Content += "\nCouldn't find android content";
|
||||
androidAdminCheckbox.Content += $"\n{Lang.Resources.NoAndroidContentError}";
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(_installationParts.PicoClientPath) &&
|
||||
string.IsNullOrEmpty(_installationParts.OculusClientPath))
|
||||
{
|
||||
vrClientCheckbox.IsEnabled = false;
|
||||
vrClientCheckbox.Content += "\nCouldn't find any VR clients";
|
||||
vrClientCheckbox.Content += $"\n{Lang.Resources.NoVRClientsError}";
|
||||
}
|
||||
|
||||
InstallButton.IsEnabled = new List<CheckBox?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue