Add option to export ROMs as ZIP files.

This commit is contained in:
2020-08-24 23:27:03 +01:00
parent ec2717c73a
commit 09ca223f02
8 changed files with 722 additions and 0 deletions

View File

@@ -0,0 +1,66 @@
<!--
// /***************************************************************************
// RomRepoMgr - ROM repository manager
//
//
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// [ License ]
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General public License for more details.
//
// You should have received a copy of the GNU General public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
//
// Copyright © 2020 Natalia Portillo
// ****************************************************************************/
-->
<Window xmlns="https://github.com/avaloniaui" 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:vm="clr-namespace:RomRepoMgr.ViewModels;assembly=RomRepoMgr" mc:Ignorable="d" d:DesignWidth="800"
d:DesignHeight="450" Width="480" Height="150" x:Class="RomRepoMgr.Views.ExportRoms"
Icon="/Assets/avalonia-logo.ico" CanResize="False" Title="{Binding Title}" WindowStartupLocation="CenterOwner">
<Design.DataContext>
<vm:ExportRomsViewModel />
</Design.DataContext>
<Border Padding="15">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition Height="Auto" /> <RowDefinition Height="*" /> <RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Stretch">
<TextBlock Text="{Binding PathLabel}" FontWeight="Bold" /> <TextBlock Text="{Binding FolderPath}" />
</StackPanel>
<TextBlock Grid.Row="1" Text="{Binding StatusMessage}" FontWeight="Bold" HorizontalAlignment="Center" />
<ProgressBar Grid.Row="2" Minimum="{Binding ProgressMinimum}" Maximum="{Binding ProgressMaximum}"
Value="{Binding ProgressValue}" IsIndeterminate="{Binding ProgressIsIndeterminate}"
IsVisible="{Binding ProgressVisible}" />
<StackPanel Grid.Row="3" IsVisible="{Binding Progress2Visible}">
<TextBlock Text="{Binding Status2Message}" />
<ProgressBar Minimum="{Binding Progress2Minimum}" Maximum="{Binding Progress2Maximum}"
Value="{Binding Progress2Value}" IsIndeterminate="{Binding Progress2IsIndeterminate}" />
</StackPanel>
<StackPanel Grid.Row="4" IsVisible="{Binding Progress3Visible}">
<TextBlock Text="{Binding Status3Message}" />
<ProgressBar Minimum="{Binding Progress3Minimum}" Maximum="{Binding Progress3Maximum}"
Value="{Binding Progress3Value}" IsIndeterminate="{Binding Progress3IsIndeterminate}" />
</StackPanel>
<Button Grid.Row="5" HorizontalAlignment="Right" VerticalAlignment="Center" IsEnabled="{Binding CanClose}"
Command="{Binding CloseCommand}">
<TextBlock Text="{Binding CloseLabel}" />
</Button>
</Grid>
</Border>
</Window>

View File

@@ -0,0 +1,45 @@
/******************************************************************************
// RomRepoMgr - ROM repository manager
// ----------------------------------------------------------------------------
//
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2020 Natalia Portillo
*******************************************************************************/
using System;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using RomRepoMgr.ViewModels;
namespace RomRepoMgr.Views
{
public sealed class ExportRoms : Window
{
public ExportRoms() => InitializeComponent();
void InitializeComponent() => AvaloniaXamlLoader.Load(this);
protected override void OnOpened(EventArgs e)
{
base.OnOpened(e);
(DataContext as ExportRomsViewModel)?.OnOpened();
}
}
}

View File

@@ -21,6 +21,7 @@
</MenuItem>
<MenuItem Header="ROM _sets"
IsEnabled="{Binding SelectedRomSet, Converter={x:Static ObjectConverters.IsNotNull}}">
<MenuItem Header="_Save ROMs to folder" Command="{Binding ExportRomsCommand}" /> <Separator />
<MenuItem Header="_Save DAT file" Command="{Binding ExportDatCommand}" /> <Separator />
<MenuItem Header="_Edit" Command="{Binding EditRomSetCommand}" /> <Separator />
<MenuItem Header="_Delete" Command="{Binding DeleteRomSetCommand}" /> <Separator />