Skip to content

Commit

Permalink
Source update
Browse files Browse the repository at this point in the history
  • Loading branch information
marcos4503 committed Sep 12, 2024
1 parent b976f56 commit 1989fe6
Show file tree
Hide file tree
Showing 18 changed files with 854 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@
<Nullable>enable</Nullable>
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
<ApplicationManifest>app.manifest</ApplicationManifest>
<AssemblyVersion>1.0.0</AssemblyVersion>
<ApplicationIcon>motoplay-installer-logo.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Content Include="motoplay-installer-logo.ico">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Avalonia.Desktop" Version="$(AvaloniaVersion)" />
Expand Down
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions Source-Code/Add-Ons/InstallerMotoplay/InstallerMotoplay.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,21 @@
</ItemGroup>

<ItemGroup>
<AvaloniaResource Remove="Assets\motoplay-installer-logo-redistributable.png" />
</ItemGroup>

<ItemGroup>
<None Remove="Assets\info-icon.png" />
<None Remove="Assets\motoplay-installer-logo.ico" />
<None Remove="Assets\motoplay-installer-logo.png" />
</ItemGroup>

<ItemGroup>
<Content Include="Assets\motoplay-installer-logo-redistributable.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Avalonia" Version="$(AvaloniaVersion)" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="$(AvaloniaVersion)" />
Expand All @@ -25,5 +36,6 @@
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="$(AvaloniaVersion)" />
<PackageReference Include="Coroutine" Version="2.1.5" />
<PackageReference Include="MessageBox.Avalonia" Version="3.1.6" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>
</Project>
74 changes: 74 additions & 0 deletions Source-Code/Add-Ons/InstallerMotoplay/Scripts/AppRepositoryInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace InstallerMotoplay.Scripts
{
/*
* This class manage the download info of a JSON
*/

public class AppRepositoryInfo
{
//Classes of script
public class LoadedData
{
//*** Data to be saved ***//

public string version = "";
public string[] downloadPartsLinks = new string[0];
}

//Private variables
private string filePath = "";

//Public variables
public LoadedData loadedData = null;

//Core methods

public AppRepositoryInfo(string filePath)
{
//Check if save file exists
bool saveExists = File.Exists(filePath);

//Store the file path
this.filePath = filePath;

//If have a save file, load it
if (saveExists == true)
Load();
//If a save file don't exists, create it
if (saveExists == false)
Save();
}

private void Load()
{
//Load the data
string loadedDataString = File.ReadAllText(filePath);

//Convert it to a loaded data object
loadedData = JsonConvert.DeserializeObject<LoadedData>(loadedDataString);
}

//Public methods

public void Save()
{
//If the loaded data is null, create one
if (loadedData == null)
loadedData = new LoadedData();

//Save the data
File.WriteAllText(filePath, JsonConvert.SerializeObject(loadedData));

//Load the data to update loaded data
Load();
}
}
}
31 changes: 25 additions & 6 deletions Source-Code/Add-Ons/InstallerMotoplay/Views/MainWindow.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:views="clr-namespace:InstallerMotoplay.Views"
mc:Ignorable="d" x:Class="InstallerMotoplay.Views.MainWindow"
Icon="/Assets/motoplay-installer-logo.ico"
Icon="/Assets/motoplay-installer-ic32x.png"
Title="Motoplay Installer"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Expand All @@ -19,20 +19,39 @@
Background="Transparent"
d:DesignWidth="400" d:DesignHeight="256">

<Border HorizontalAlignment="Left" VerticalAlignment="Top" Width="400" Height="256" CornerRadius="8" Background="White" Padding="8, 8, 8, 8">
<Border HorizontalAlignment="Left" VerticalAlignment="Top" Width="400" Height="256" CornerRadius="8" Background="White" Padding="8, 8, 8, 8" BorderBrush="LightGray" BorderThickness="1">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">

<Grid Name="doingTasksRoot" IsVisible="True" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<StackPanel Orientation="Vertical" Spacing="8" VerticalAlignment="Center" HorizontalAlignment="Stretch" Margin="8, 0, 8, 0">

<TextBlock Name="doingTaskStatus" Text="Place Holder" HorizontalAlignment="Center" Margin="0, 0, 0, 8"></TextBlock>
<ProgressBar IsIndeterminate="True" Maximum="100" Value="50"></ProgressBar>

<ProgressBar Name="doingTasksBar" IsIndeterminate="True" Maximum="100" Value="50"></ProgressBar>
</StackPanel>
</Grid>

<Grid Name="updateMenu" IsVisible="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<StackPanel Orientation="Vertical" Spacing="32" VerticalAlignment="Center" HorizontalAlignment="Stretch">
<TextBlock Name="updateMenuTitle" Text="Choose an Installation/Update Source for Motoplay!" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0, 0, 0, 0"></TextBlock>
<StackPanel Orientation="Horizontal" Spacing="16" HorizontalAlignment="Center" VerticalAlignment="Top">
<StackPanel Orientation="Vertical" Spacing="11" HorizontalAlignment="Left" VerticalAlignment="Top">
<Button Name="installOnlineButton" Content="Online" HorizontalContentAlignment="Center" HorizontalAlignment="Left" VerticalAlignment="Top" Width="150" Height="32"></Button>
<TextBlock Text="Or use &quot;online&quot; Arg." Foreground="Gray" HorizontalAlignment="Center" VerticalAlignment="Top"></TextBlock>
</StackPanel>
<StackPanel Orientation="Vertical" Spacing="8" HorizontalAlignment="Left" VerticalAlignment="Top">
<StackPanel Orientation="Horizontal" Spacing="4" HorizontalAlignment="Left" VerticalAlignment="Top">
<Button Name="installFlashdriveButton" Content="Flash Drive" HorizontalContentAlignment="Center" HorizontalAlignment="Left" VerticalAlignment="Top" Width="140" Height="32"></Button>
<Image Name="installFlashdriveButtonHelp" Source="avares://InstallerMotoplay/Assets/info-icon.png" Width="28" Height="28" Cursor="Help"></Image>
</StackPanel>
<TextBox Name="flashDriveNameInput" Watermark="Flash Drive Name..." HorizontalAlignment="Stretch" VerticalAlignment="Top" Padding="2, 2, 2, 2" MinHeight="24" BorderBrush="Gray"></TextBox>
</StackPanel>
</StackPanel>
</StackPanel>
</Grid>




<TextBlock Name="versionDisplay" Text="0.0.0" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="10" Foreground="LightGray"></TextBlock>

<Button Name="toggleKeyboardButton" IsVisible="True" HorizontalAlignment="Right" VerticalAlignment="Top" Width="32" Height="32" Padding="6, 6, 6, 6">
<Image Name="toggleKeyboardButtonImg" Source="/Assets/keyboard-on.png" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"></Image>
</Button>
Expand Down
Loading

0 comments on commit 1989fe6

Please sign in to comment.