mirror of
https://github.com/claunia/romrepomgr.git
synced 2025-12-16 19:24:51 +00:00
Compare commits
8 Commits
8f789484ca
...
52946eca2e
| Author | SHA1 | Date | |
|---|---|---|---|
|
52946eca2e
|
|||
|
de9ad80eef
|
|||
|
a7985955b4
|
|||
|
054b9ffd0d
|
|||
|
a8921f640d
|
|||
|
3e731115f2
|
|||
|
dc630f3e78
|
|||
|
5937e0d83e
|
@@ -392,5 +392,11 @@ namespace RomRepoMgr.Core.Resources {
|
||||
return ResourceManager.GetString("DatImportSuccess", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string ImportingFile {
|
||||
get {
|
||||
return ResourceManager.GetString("ImportingFile", resourceCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -186,4 +186,7 @@
|
||||
<data name="AddingMedias" xml:space="preserve">
|
||||
<value>Añadiendo medios...</value>
|
||||
</data>
|
||||
<data name="ImportingFile" xml:space="preserve">
|
||||
<value>Importando fichero...</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -196,4 +196,7 @@
|
||||
<data name="DatImportSuccess" xml:space="preserve">
|
||||
<value>Imported {0} machines with {1} ROMs.</value>
|
||||
</data>
|
||||
<data name="ImportingFile" xml:space="preserve">
|
||||
<value>Importing file...</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -15,13 +15,15 @@ using RomRepoMgr.Core.Models;
|
||||
using RomRepoMgr.Core.Resources;
|
||||
using RomRepoMgr.Database;
|
||||
using RomRepoMgr.Database.Models;
|
||||
using RomRepoMgr.Settings;
|
||||
using SabreTools.FileTypes.Aaru;
|
||||
using SabreTools.FileTypes.CHD;
|
||||
using SharpCompress.Common;
|
||||
using SharpCompress.Compressors.LZMA;
|
||||
using SharpCompress.Readers;
|
||||
using ZstdSharp;
|
||||
using ZstdSharp.Unsafe;
|
||||
using CompressionMode = SharpCompress.Compressors.CompressionMode;
|
||||
using CompressionType = RomRepoMgr.Settings.CompressionType;
|
||||
|
||||
namespace RomRepoMgr.Core.Workers;
|
||||
|
||||
@@ -84,6 +86,77 @@ public sealed class FileImporter
|
||||
Finished?.Invoke(this, System.EventArgs.Empty);
|
||||
}
|
||||
|
||||
public void SeparateFilesAndArchivesManaged()
|
||||
{
|
||||
SetProgressBounds?.Invoke(this,
|
||||
new ProgressBoundsEventArgs
|
||||
{
|
||||
Minimum = 0,
|
||||
Maximum = Files.Count
|
||||
});
|
||||
|
||||
ConcurrentBag<string> files = [];
|
||||
ConcurrentBag<string> archives = [];
|
||||
|
||||
Parallel.ForEach(Files,
|
||||
file =>
|
||||
{
|
||||
SetProgress?.Invoke(this,
|
||||
new ProgressEventArgs
|
||||
{
|
||||
Value = _position
|
||||
});
|
||||
|
||||
SetMessage?.Invoke(this,
|
||||
new MessageEventArgs
|
||||
{
|
||||
Message = "Checking archives. Found " +
|
||||
archives.Count +
|
||||
" archives and " +
|
||||
files.Count +
|
||||
" files."
|
||||
});
|
||||
|
||||
SetMessage2?.Invoke(this,
|
||||
new MessageEventArgs
|
||||
{
|
||||
Message =
|
||||
$"Checking if file {Path.GetFileName(file)} is an archive..."
|
||||
});
|
||||
|
||||
SetIndeterminateProgress2?.Invoke(this, System.EventArgs.Empty);
|
||||
|
||||
try
|
||||
{
|
||||
using var fs = new FileStream(file, FileMode.Open, FileAccess.Read);
|
||||
using IReader reader = ReaderFactory.Open(fs);
|
||||
|
||||
archives.Add(file);
|
||||
}
|
||||
catch(InvalidOperationException)
|
||||
{
|
||||
files.Add(file);
|
||||
}
|
||||
|
||||
Interlocked.Increment(ref _position);
|
||||
});
|
||||
|
||||
Files = files.Order().ToList();
|
||||
Archives = archives.Order().ToList();
|
||||
|
||||
SetMessage?.Invoke(this,
|
||||
new MessageEventArgs
|
||||
{
|
||||
Message = "Finished checking archives. Found " +
|
||||
Archives.Count +
|
||||
" archives and " +
|
||||
Files.Count +
|
||||
" files."
|
||||
});
|
||||
|
||||
Finished?.Invoke(this, System.EventArgs.Empty);
|
||||
}
|
||||
|
||||
public void SeparateFilesAndArchives()
|
||||
{
|
||||
SetProgressBounds?.Invoke(this,
|
||||
@@ -278,11 +351,8 @@ public sealed class FileImporter
|
||||
}
|
||||
}
|
||||
|
||||
public bool ExtractArchive(string archive)
|
||||
public bool ExtractArchiveManaged(string archive)
|
||||
{
|
||||
string archiveFormat = null;
|
||||
long archiveFiles = 0;
|
||||
|
||||
SetIndeterminateProgress2?.Invoke(this, System.EventArgs.Empty);
|
||||
|
||||
SetMessage2?.Invoke(this,
|
||||
@@ -291,7 +361,60 @@ public sealed class FileImporter
|
||||
Message = Localization.CheckingIfFIleIsAnArchive
|
||||
});
|
||||
|
||||
archiveFormat = GetArchiveFormat(archive, out archiveFiles);
|
||||
try
|
||||
{
|
||||
using var fs = new FileStream(archive, FileMode.Open, FileAccess.Read);
|
||||
using IReader reader = ReaderFactory.Open(fs);
|
||||
|
||||
if(!Directory.Exists(Settings.Settings.Current.TemporaryFolder))
|
||||
Directory.CreateDirectory(Settings.Settings.Current.TemporaryFolder);
|
||||
|
||||
_archiveFolder = Path.Combine(Settings.Settings.Current.TemporaryFolder, Path.GetRandomFileName());
|
||||
|
||||
Directory.CreateDirectory(_archiveFolder);
|
||||
|
||||
SetIndeterminateProgress2?.Invoke(this, System.EventArgs.Empty);
|
||||
|
||||
SetMessage2?.Invoke(this,
|
||||
new MessageEventArgs
|
||||
{
|
||||
Message = Localization.ExtractingArchive
|
||||
});
|
||||
|
||||
reader.WriteAllToDirectory(_archiveFolder,
|
||||
new ExtractionOptions
|
||||
{
|
||||
ExtractFullPath = true,
|
||||
Overwrite = true
|
||||
});
|
||||
|
||||
Files = Directory.GetFiles(_archiveFolder, "*", SearchOption.AllDirectories).Order().ToList();
|
||||
|
||||
SetMessage2?.Invoke(this,
|
||||
new MessageEventArgs
|
||||
{
|
||||
Message = "Finished extracting files. Extracted " + Files.Count + " files."
|
||||
});
|
||||
|
||||
return true;
|
||||
}
|
||||
catch(InvalidOperationException)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public bool ExtractArchive(string archive)
|
||||
{
|
||||
SetIndeterminateProgress2?.Invoke(this, System.EventArgs.Empty);
|
||||
|
||||
SetMessage2?.Invoke(this,
|
||||
new MessageEventArgs
|
||||
{
|
||||
Message = Localization.CheckingIfFIleIsAnArchive
|
||||
});
|
||||
|
||||
string archiveFormat = GetArchiveFormat(archive, out long archiveFiles);
|
||||
|
||||
// If a floppy contains only the archive, unar will recognize it, on its skipping of SFXs.
|
||||
if(archiveFormat != null && FAT.Identify(archive)) archiveFormat = null;
|
||||
@@ -417,6 +540,295 @@ public sealed class FileImporter
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsCrcInDb(long crc32)
|
||||
{
|
||||
lock(DbLock)
|
||||
{
|
||||
return _ctx.Files.Any(f => f.Crc32 == crc32.ToString("x8"));
|
||||
}
|
||||
}
|
||||
|
||||
public void ImportAndHashRom(Stream stream, string filename, string tempPath, long size)
|
||||
{
|
||||
try
|
||||
{
|
||||
var outFs = new FileStream(tempPath, FileMode.Create, FileAccess.Write);
|
||||
|
||||
SetMessage2?.Invoke(this,
|
||||
new MessageEventArgs
|
||||
{
|
||||
Message = Localization.ImportingFile
|
||||
});
|
||||
|
||||
byte[] buffer;
|
||||
var checksumWorker = new Checksum();
|
||||
Stream zStream;
|
||||
|
||||
switch(Settings.Settings.Current.Compression)
|
||||
{
|
||||
case CompressionType.Zstd:
|
||||
{
|
||||
var zstdStream = new CompressionStream(outFs, 15);
|
||||
zstdStream.SetParameter(ZSTD_cParameter.ZSTD_c_nbWorkers, Environment.ProcessorCount);
|
||||
zStream = zstdStream;
|
||||
|
||||
break;
|
||||
}
|
||||
case CompressionType.None:
|
||||
zStream = outFs;
|
||||
|
||||
break;
|
||||
default:
|
||||
zStream = new LZipStream(outFs, CompressionMode.Compress);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if(size > BUFFER_SIZE)
|
||||
{
|
||||
SetProgressBounds2?.Invoke(this,
|
||||
new ProgressBoundsEventArgs
|
||||
{
|
||||
Minimum = 0,
|
||||
Maximum = size
|
||||
});
|
||||
|
||||
long offset;
|
||||
long remainder = size % BUFFER_SIZE;
|
||||
|
||||
for(offset = 0; offset < size - remainder; offset += (int)BUFFER_SIZE)
|
||||
{
|
||||
SetProgress2?.Invoke(this,
|
||||
new ProgressEventArgs
|
||||
{
|
||||
Value = offset
|
||||
});
|
||||
|
||||
buffer = new byte[BUFFER_SIZE];
|
||||
stream.EnsureRead(buffer, 0, (int)BUFFER_SIZE);
|
||||
checksumWorker.Update(buffer);
|
||||
zStream.Write(buffer, 0, buffer.Length);
|
||||
}
|
||||
|
||||
SetProgress2?.Invoke(this,
|
||||
new ProgressEventArgs
|
||||
{
|
||||
Value = offset
|
||||
});
|
||||
|
||||
buffer = new byte[remainder];
|
||||
stream.EnsureRead(buffer, 0, (int)remainder);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetIndeterminateProgress2?.Invoke(this, System.EventArgs.Empty);
|
||||
buffer = new byte[size];
|
||||
stream.EnsureRead(buffer, 0, (int)size);
|
||||
}
|
||||
|
||||
checksumWorker.Update(buffer);
|
||||
zStream.Write(buffer, 0, buffer.Length);
|
||||
|
||||
Dictionary<ChecksumType, string> checksums = checksumWorker.End();
|
||||
|
||||
ulong uSize = (ulong)size;
|
||||
bool fileInDb = true;
|
||||
|
||||
bool knownFile = _pendingFiles.TryGetValue(checksums[ChecksumType.Sha512], out DbFile dbFile);
|
||||
|
||||
lock(DbLock)
|
||||
{
|
||||
dbFile ??= _ctx.Files.FirstOrDefault(f => (f.Sha512 == checksums[ChecksumType.Sha512] ||
|
||||
f.Sha384 == checksums[ChecksumType.Sha384] ||
|
||||
f.Sha256 == checksums[ChecksumType.Sha256] ||
|
||||
f.Sha1 == checksums[ChecksumType.Sha1] ||
|
||||
f.Md5 == checksums[ChecksumType.Md5] ||
|
||||
f.Crc32 == checksums[ChecksumType.Crc32]) &&
|
||||
f.Size == uSize);
|
||||
}
|
||||
|
||||
if(dbFile == null)
|
||||
{
|
||||
if(onlyKnown)
|
||||
{
|
||||
ImportedRom?.Invoke(this,
|
||||
new ImportedRomItemEventArgs
|
||||
{
|
||||
Item = new ImportRomItem
|
||||
{
|
||||
Filename = filename,
|
||||
Status = Localization.UnknownFile
|
||||
}
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
dbFile = new DbFile
|
||||
{
|
||||
Crc32 = checksums[ChecksumType.Crc32],
|
||||
Md5 = checksums[ChecksumType.Md5],
|
||||
Sha1 = checksums[ChecksumType.Sha1],
|
||||
Sha256 = checksums[ChecksumType.Sha256],
|
||||
Sha384 = checksums[ChecksumType.Sha384],
|
||||
Sha512 = checksums[ChecksumType.Sha512],
|
||||
Size = uSize,
|
||||
CreatedOn = DateTime.UtcNow,
|
||||
UpdatedOn = DateTime.UtcNow,
|
||||
OriginalFileName = Path.GetFileName(filename)
|
||||
};
|
||||
|
||||
fileInDb = false;
|
||||
}
|
||||
|
||||
if(!knownFile) _pendingFiles[checksums[ChecksumType.Sha512]] = dbFile;
|
||||
|
||||
byte[] sha384Bytes = new byte[48];
|
||||
string sha384 = checksums[ChecksumType.Sha384];
|
||||
|
||||
for(int i = 0; i < 48; i++)
|
||||
{
|
||||
if(sha384[i * 2] >= 0x30 && sha384[i * 2] <= 0x39)
|
||||
sha384Bytes[i] = (byte)((sha384[i * 2] - 0x30) * 0x10);
|
||||
else if(sha384[i * 2] >= 0x41 && sha384[i * 2] <= 0x46)
|
||||
sha384Bytes[i] = (byte)((sha384[i * 2] - 0x37) * 0x10);
|
||||
else if(sha384[i * 2] >= 0x61 && sha384[i * 2] <= 0x66)
|
||||
sha384Bytes[i] = (byte)((sha384[i * 2] - 0x57) * 0x10);
|
||||
|
||||
if(sha384[i * 2 + 1] >= 0x30 && sha384[i * 2 + 1] <= 0x39)
|
||||
sha384Bytes[i] += (byte)(sha384[i * 2 + 1] - 0x30);
|
||||
else if(sha384[i * 2 + 1] >= 0x41 && sha384[i * 2 + 1] <= 0x46)
|
||||
sha384Bytes[i] += (byte)(sha384[i * 2 + 1] - 0x37);
|
||||
else if(sha384[i * 2 + 1] >= 0x61 && sha384[i * 2 + 1] <= 0x66)
|
||||
sha384Bytes[i] += (byte)(sha384[i * 2 + 1] - 0x57);
|
||||
}
|
||||
|
||||
string sha384B32 = Base32.ToBase32String(sha384Bytes);
|
||||
|
||||
string repoPath = Path.Combine(Settings.Settings.Current.RepositoryPath,
|
||||
"files",
|
||||
sha384B32[0].ToString(),
|
||||
sha384B32[1].ToString(),
|
||||
sha384B32[2].ToString(),
|
||||
sha384B32[3].ToString(),
|
||||
sha384B32[4].ToString());
|
||||
|
||||
if(!Directory.Exists(repoPath)) Directory.CreateDirectory(repoPath);
|
||||
|
||||
repoPath = Settings.Settings.Current.Compression switch
|
||||
{
|
||||
CompressionType.Zstd => Path.Combine(repoPath, sha384B32 + ".zst"),
|
||||
CompressionType.None => Path.Combine(repoPath, sha384B32),
|
||||
_ => Path.Combine(repoPath, sha384B32 + ".lz")
|
||||
};
|
||||
|
||||
if(dbFile.Crc32 == null)
|
||||
{
|
||||
dbFile.Crc32 = checksums[ChecksumType.Crc32];
|
||||
dbFile.UpdatedOn = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
if(dbFile.Md5 == null)
|
||||
{
|
||||
dbFile.Md5 = checksums[ChecksumType.Md5];
|
||||
dbFile.UpdatedOn = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
if(dbFile.Sha1 == null)
|
||||
{
|
||||
dbFile.Sha1 = checksums[ChecksumType.Sha1];
|
||||
dbFile.UpdatedOn = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
if(dbFile.Sha256 == null)
|
||||
{
|
||||
dbFile.Sha256 = checksums[ChecksumType.Sha256];
|
||||
dbFile.UpdatedOn = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
if(dbFile.Sha384 == null)
|
||||
{
|
||||
dbFile.Sha384 = checksums[ChecksumType.Sha384];
|
||||
dbFile.UpdatedOn = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
if(dbFile.Sha512 == null)
|
||||
{
|
||||
dbFile.Sha512 = checksums[ChecksumType.Sha512];
|
||||
dbFile.UpdatedOn = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
if(File.Exists(repoPath))
|
||||
{
|
||||
dbFile.IsInRepo = true;
|
||||
dbFile.UpdatedOn = DateTime.UtcNow;
|
||||
|
||||
if(!fileInDb) _newFiles.Add(dbFile);
|
||||
|
||||
zStream.Close();
|
||||
outFs.Dispose();
|
||||
|
||||
File.Delete(tempPath);
|
||||
|
||||
ImportedRom?.Invoke(this,
|
||||
new ImportedRomItemEventArgs
|
||||
{
|
||||
Item = new ImportRomItem
|
||||
{
|
||||
Filename = filename,
|
||||
Status = Localization.OK
|
||||
}
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
SetIndeterminateProgress2?.Invoke(this, System.EventArgs.Empty);
|
||||
|
||||
SetMessage2?.Invoke(this,
|
||||
new MessageEventArgs
|
||||
{
|
||||
Message = Localization.Finishing
|
||||
});
|
||||
|
||||
zStream.Close();
|
||||
outFs.Dispose();
|
||||
|
||||
File.Move(tempPath, repoPath, true);
|
||||
|
||||
dbFile.IsInRepo = true;
|
||||
dbFile.UpdatedOn = DateTime.UtcNow;
|
||||
|
||||
if(!fileInDb) _newFiles.Add(dbFile);
|
||||
|
||||
ImportedRom?.Invoke(this,
|
||||
new ImportedRomItemEventArgs
|
||||
{
|
||||
Item = new ImportRomItem
|
||||
{
|
||||
Filename = filename,
|
||||
Status = Localization.OK
|
||||
}
|
||||
});
|
||||
}
|
||||
catch(Exception)
|
||||
{
|
||||
ImportedRom?.Invoke(this,
|
||||
new ImportedRomItemEventArgs
|
||||
{
|
||||
Item = new ImportRomItem
|
||||
{
|
||||
Filename = filename,
|
||||
Status = Localization.UnhandledExceptionWhenImporting
|
||||
}
|
||||
});
|
||||
|
||||
#pragma warning disable ERP022
|
||||
}
|
||||
#pragma warning restore ERP022
|
||||
}
|
||||
|
||||
bool ImportRom(string path)
|
||||
{
|
||||
try
|
||||
@@ -696,7 +1108,7 @@ public sealed class FileImporter
|
||||
|
||||
return true;
|
||||
}
|
||||
catch(Exception ex)
|
||||
catch(Exception)
|
||||
{
|
||||
_lastMessage = Localization.UnhandledExceptionWhenImporting;
|
||||
|
||||
|
||||
@@ -42,11 +42,12 @@ public enum CompressionType
|
||||
|
||||
public sealed class SetSettings
|
||||
{
|
||||
public string DatabasePath { get; set; }
|
||||
public string RepositoryPath { get; set; }
|
||||
public string TemporaryFolder { get; set; }
|
||||
public string UnArchiverPath { get; set; }
|
||||
public CompressionType Compression { get; set; }
|
||||
public string DatabasePath { get; set; }
|
||||
public string RepositoryPath { get; set; }
|
||||
public string TemporaryFolder { get; set; }
|
||||
public string UnArchiverPath { get; set; }
|
||||
public CompressionType Compression { get; set; }
|
||||
public bool UseInternalDecompressor { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>Manages statistics</summary>
|
||||
@@ -56,7 +57,7 @@ public static class Settings
|
||||
const string XDG_CONFIG_HOME_RESOLVED = ".config";
|
||||
/// <summary>Current statistics</summary>
|
||||
public static SetSettings Current;
|
||||
public static bool UnArUsable { get; set; }
|
||||
public static bool CanDecompress { get; set; }
|
||||
|
||||
/// <summary>Loads settings</summary>
|
||||
public static void LoadSettings()
|
||||
@@ -118,6 +119,10 @@ public static class Settings
|
||||
((NSNumber)obj).ToString())
|
||||
: CompressionType.Lzip;
|
||||
|
||||
Current.UseInternalDecompressor =
|
||||
parsedPreferences.TryGetValue("UseInternalDecompressor", out obj) &&
|
||||
((NSNumber)obj).ToBool();
|
||||
|
||||
prefsFs.Close();
|
||||
}
|
||||
else
|
||||
@@ -159,10 +164,11 @@ public static class Settings
|
||||
return;
|
||||
}
|
||||
|
||||
Current.DatabasePath = key.GetValue("DatabasePath") as string;
|
||||
Current.RepositoryPath = key.GetValue("RepositoryPath") as string;
|
||||
Current.TemporaryFolder = key.GetValue("TemporaryFolder") as string;
|
||||
Current.UnArchiverPath = key.GetValue("UnArchiverPath") as string;
|
||||
Current.DatabasePath = key.GetValue("DatabasePath") as string;
|
||||
Current.RepositoryPath = key.GetValue("RepositoryPath") as string;
|
||||
Current.TemporaryFolder = key.GetValue("TemporaryFolder") as string;
|
||||
Current.UnArchiverPath = key.GetValue("UnArchiverPath") as string;
|
||||
Current.UseInternalDecompressor = key.GetValue("UseInternalDecompressor") as int? > 0;
|
||||
|
||||
if(key.GetValue("Compression") is int compression)
|
||||
Current.Compression = (CompressionType)compression;
|
||||
@@ -243,6 +249,9 @@ public static class Settings
|
||||
},
|
||||
{
|
||||
"Compression", (NSNumber)(int)Current.Compression
|
||||
},
|
||||
{
|
||||
"UseInternalDecompressor", new NSNumber(Current.UseInternalDecompressor ? 1 : 0)
|
||||
}
|
||||
};
|
||||
|
||||
@@ -273,11 +282,12 @@ public static class Settings
|
||||
|
||||
RegistryKey key = parentKey?.CreateSubKey("RomRepoMgr");
|
||||
|
||||
key?.SetValue("DatabasePath", Current.DatabasePath);
|
||||
key?.SetValue("RepositoryPath", Current.RepositoryPath);
|
||||
key?.SetValue("TemporaryFolder", Current.TemporaryFolder);
|
||||
key?.SetValue("UnArchiverPath", Current.UnArchiverPath);
|
||||
key?.SetValue("Compression", (int)Current.Compression);
|
||||
key?.SetValue("DatabasePath", Current.DatabasePath);
|
||||
key?.SetValue("RepositoryPath", Current.RepositoryPath);
|
||||
key?.SetValue("TemporaryFolder", Current.TemporaryFolder);
|
||||
key?.SetValue("UnArchiverPath", Current.UnArchiverPath);
|
||||
key?.SetValue("Compression", (int)Current.Compression);
|
||||
key?.SetValue("UseInternalDecompressor", Current.UseInternalDecompressor ? 1 : 0);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
@@ -49,7 +49,6 @@ internal static class Program
|
||||
try
|
||||
{
|
||||
Log.Information("Starting up");
|
||||
Log.Debug("Testing debug logging");
|
||||
|
||||
BuildAvaloniaApp().StartWithClassicDesktopLifetime(args);
|
||||
}
|
||||
|
||||
12
RomRepoMgr/Resources/Localization.Designer.cs
generated
12
RomRepoMgr/Resources/Localization.Designer.cs
generated
@@ -776,5 +776,17 @@ namespace RomRepoMgr.Resources {
|
||||
return ResourceManager.GetString("CompressionType", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
public static string UseInternalDecompressorLabel {
|
||||
get {
|
||||
return ResourceManager.GetString("UseInternalDecompressorLabel", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
public static string ProcessingArchive {
|
||||
get {
|
||||
return ResourceManager.GetString("ProcessingArchive", resourceCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -384,4 +384,10 @@ Tardará mucho tiempo...</value>
|
||||
<data name="CompressionType" xml:space="preserve">
|
||||
<value>Compresión</value>
|
||||
</data>
|
||||
<data name="UseInternalDecompressorLabel" xml:space="preserve">
|
||||
<value>Usar decompresor interno (soporta menos formatos)</value>
|
||||
</data>
|
||||
<data name="ProcessingArchive" xml:space="preserve">
|
||||
<value>Procesando archivo: {0}</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -392,4 +392,10 @@ This will take a long time...</value>
|
||||
<data name="CompressionType" xml:space="preserve">
|
||||
<value>Compression</value>
|
||||
</data>
|
||||
<data name="UseInternalDecompressorLabel" xml:space="preserve">
|
||||
<value>Use internal decompressor (supports less formats)</value>
|
||||
</data>
|
||||
<data name="ProcessingArchive" xml:space="preserve">
|
||||
<value>Processing archive: {0}</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -20,6 +20,7 @@ using RomRepoMgr.Models;
|
||||
using RomRepoMgr.Resources;
|
||||
using Serilog;
|
||||
using Serilog.Extensions.Logging;
|
||||
using SharpCompress.Readers;
|
||||
|
||||
namespace RomRepoMgr.ViewModels;
|
||||
|
||||
@@ -27,10 +28,11 @@ public sealed partial class ImportRomFolderViewModel : ViewModelBase
|
||||
{
|
||||
readonly Context _ctx =
|
||||
Context.Create(Settings.Settings.Current.DatabasePath, new SerilogLoggerFactory(Log.Logger));
|
||||
readonly ConcurrentBag<DbDisk> _newDisks = [];
|
||||
readonly ConcurrentBag<DbFile> _newFiles = [];
|
||||
readonly ConcurrentBag<DbMedia> _newMedias = [];
|
||||
readonly Stopwatch _stopwatch = new();
|
||||
readonly Stopwatch _mainStopwatch = new();
|
||||
readonly ConcurrentBag<DbDisk> _newDisks = [];
|
||||
readonly ConcurrentBag<DbFile> _newFiles = [];
|
||||
readonly ConcurrentBag<DbMedia> _newMedias = [];
|
||||
readonly Stopwatch _stopwatch = new();
|
||||
[ObservableProperty]
|
||||
bool _canChoose;
|
||||
[ObservableProperty]
|
||||
@@ -87,7 +89,7 @@ public sealed partial class ImportRomFolderViewModel : ViewModelBase
|
||||
CanClose = true;
|
||||
RemoveFilesChecked = false;
|
||||
KnownOnlyChecked = true;
|
||||
RecurseArchivesChecked = Settings.Settings.UnArUsable;
|
||||
RecurseArchivesChecked = Settings.Settings.CanDecompress;
|
||||
RemoveFilesEnabled = false;
|
||||
CanChoose = true;
|
||||
}
|
||||
@@ -97,7 +99,7 @@ public sealed partial class ImportRomFolderViewModel : ViewModelBase
|
||||
public ICommand StartCommand { get; }
|
||||
public Window View { get; init; }
|
||||
|
||||
public bool RecurseArchivesEnabled => Settings.Settings.UnArUsable;
|
||||
public bool RecurseArchivesEnabled => Settings.Settings.CanDecompress;
|
||||
|
||||
public bool RecurseArchivesChecked
|
||||
{
|
||||
@@ -128,6 +130,7 @@ public sealed partial class ImportRomFolderViewModel : ViewModelBase
|
||||
IsImporting = true;
|
||||
IsReady = false;
|
||||
CanChoose = false;
|
||||
_mainStopwatch.Start();
|
||||
|
||||
_ = Task.Run(() => _rootImporter.FindFiles(FolderPath));
|
||||
}
|
||||
@@ -184,7 +187,11 @@ public sealed partial class ImportRomFolderViewModel : ViewModelBase
|
||||
_ = Task.Run(() =>
|
||||
{
|
||||
_stopwatch.Restart();
|
||||
_rootImporter.SeparateFilesAndArchives();
|
||||
|
||||
if(Settings.Settings.Current.UseInternalDecompressor)
|
||||
_rootImporter.SeparateFilesAndArchivesManaged();
|
||||
else
|
||||
_rootImporter.SeparateFilesAndArchives();
|
||||
});
|
||||
}
|
||||
else
|
||||
@@ -259,6 +266,9 @@ public sealed partial class ImportRomFolderViewModel : ViewModelBase
|
||||
IsReady = false;
|
||||
IsImporting = false;
|
||||
StatusMessage = Localization.Finished;
|
||||
_mainStopwatch.Stop();
|
||||
|
||||
Log.Debug("Took {TotalSeconds} seconds to import ROMs", _mainStopwatch.Elapsed.TotalSeconds);
|
||||
}
|
||||
|
||||
void ProcessArchives()
|
||||
@@ -291,7 +301,9 @@ public sealed partial class ImportRomFolderViewModel : ViewModelBase
|
||||
RemoveFilesChecked);
|
||||
|
||||
// Extract archive
|
||||
bool ret = archiveImporter.ExtractArchive(archive);
|
||||
bool ret = Settings.Settings.Current.UseInternalDecompressor
|
||||
? archiveImporter.ExtractArchiveManaged(archive)
|
||||
: archiveImporter.ExtractArchive(archive);
|
||||
|
||||
if(!ret) return;
|
||||
|
||||
@@ -340,6 +352,97 @@ public sealed partial class ImportRomFolderViewModel : ViewModelBase
|
||||
ProcessFiles();
|
||||
}
|
||||
|
||||
void ProcessArchivesManaged()
|
||||
{
|
||||
// For each archive
|
||||
ProgressMaximum = _rootImporter.Archives.Count;
|
||||
ProgressMinimum = 0;
|
||||
ProgressValue = 0;
|
||||
ProgressIsIndeterminate = false;
|
||||
Progress2Visible = false;
|
||||
StatusMessage2Visible = false;
|
||||
_listPosition = 0;
|
||||
_stopwatch.Restart();
|
||||
|
||||
Parallel.ForEach(_rootImporter.Archives,
|
||||
archive =>
|
||||
{
|
||||
Dispatcher.UIThread.Post(() =>
|
||||
{
|
||||
StatusMessage =
|
||||
string.Format(Localization.ProcessingArchive, Path.GetFileName(archive));
|
||||
|
||||
ProgressValue = _listPosition;
|
||||
});
|
||||
|
||||
// Create FileImporter
|
||||
var archiveImporter = new FileImporter(_ctx,
|
||||
_newFiles,
|
||||
_newDisks,
|
||||
_newMedias,
|
||||
KnownOnlyChecked,
|
||||
RemoveFilesChecked);
|
||||
|
||||
// Open archive
|
||||
try
|
||||
{
|
||||
using var fs = new FileStream(archive, FileMode.Open, FileAccess.Read);
|
||||
using IReader reader = ReaderFactory.Open(fs);
|
||||
|
||||
// Process files in archive
|
||||
while(reader.MoveToNextEntry())
|
||||
{
|
||||
if(reader.Entry.IsDirectory) continue;
|
||||
|
||||
if(reader.Entry.Crc == 0 && KnownOnlyChecked) continue;
|
||||
|
||||
if(!archiveImporter.IsCrcInDb(reader.Entry.Crc) && KnownOnlyChecked) continue;
|
||||
|
||||
var model = new RomImporter
|
||||
{
|
||||
Filename = Path.GetFileName(reader.Entry.Key),
|
||||
Indeterminate = true
|
||||
};
|
||||
|
||||
var worker = new FileImporter(_ctx,
|
||||
_newFiles,
|
||||
_newDisks,
|
||||
_newMedias,
|
||||
KnownOnlyChecked,
|
||||
RemoveFilesChecked);
|
||||
|
||||
worker.SetIndeterminateProgress2 += model.OnSetIndeterminateProgress;
|
||||
worker.SetMessage2 += model.OnSetMessage;
|
||||
worker.SetProgress2 += model.OnSetProgress;
|
||||
worker.SetProgressBounds2 += model.OnSetProgressBounds;
|
||||
worker.ImportedRom += model.OnImportedRom;
|
||||
worker.WorkFinished += model.OnWorkFinished;
|
||||
|
||||
Dispatcher.UIThread.Post(() => Importers.Add(model));
|
||||
|
||||
worker.ImportAndHashRom(reader.OpenEntryStream(),
|
||||
reader.Entry.Key,
|
||||
Path.Combine(Settings.Settings.Current.RepositoryPath,
|
||||
Path.GetFileName(Path.GetTempFileName())),
|
||||
reader.Entry.Size);
|
||||
}
|
||||
}
|
||||
catch(InvalidOperationException) {}
|
||||
finally
|
||||
{
|
||||
Interlocked.Increment(ref _listPosition);
|
||||
}
|
||||
});
|
||||
|
||||
_stopwatch.Stop();
|
||||
Log.Debug("Took {TotalSeconds} seconds to process archives", _stopwatch.Elapsed.TotalSeconds);
|
||||
|
||||
Progress2Visible = false;
|
||||
StatusMessage2Visible = false;
|
||||
|
||||
ProcessFiles();
|
||||
}
|
||||
|
||||
void CheckArchivesFinished(object sender, EventArgs e)
|
||||
{
|
||||
_stopwatch.Stop();
|
||||
@@ -350,7 +453,10 @@ public sealed partial class ImportRomFolderViewModel : ViewModelBase
|
||||
|
||||
_rootImporter.Finished -= CheckArchivesFinished;
|
||||
|
||||
ProcessArchives();
|
||||
if(Settings.Settings.Current.UseInternalDecompressor)
|
||||
ProcessArchivesManaged();
|
||||
else
|
||||
ProcessArchives();
|
||||
}
|
||||
|
||||
void SetMessage(object sender, MessageEventArgs e)
|
||||
|
||||
@@ -65,6 +65,8 @@ public sealed partial class SettingsViewModel : ViewModelBase
|
||||
string _unArPath;
|
||||
[ObservableProperty]
|
||||
string _unArVersion;
|
||||
bool _useInternalDecompressor;
|
||||
bool _useInternalDecompressorChanged;
|
||||
|
||||
// Mock
|
||||
public SettingsViewModel() {}
|
||||
@@ -84,11 +86,12 @@ public sealed partial class SettingsViewModel : ViewModelBase
|
||||
DatabaseCommand = new AsyncRelayCommand(ExecuteDatabaseCommandAsync);
|
||||
SaveCommand = new RelayCommand(ExecuteSaveCommand);
|
||||
|
||||
DatabasePath = Settings.Settings.Current.DatabasePath;
|
||||
RepositoryPath = Settings.Settings.Current.RepositoryPath;
|
||||
TemporaryPath = Settings.Settings.Current.TemporaryFolder;
|
||||
UnArPath = Settings.Settings.Current.UnArchiverPath;
|
||||
Compression = Settings.Settings.Current.Compression;
|
||||
DatabasePath = Settings.Settings.Current.DatabasePath;
|
||||
RepositoryPath = Settings.Settings.Current.RepositoryPath;
|
||||
TemporaryPath = Settings.Settings.Current.TemporaryFolder;
|
||||
UnArPath = Settings.Settings.Current.UnArchiverPath;
|
||||
Compression = Settings.Settings.Current.Compression;
|
||||
UseInternalDecompressor = Settings.Settings.Current.UseInternalDecompressor;
|
||||
|
||||
if(!string.IsNullOrWhiteSpace(UnArPath)) CheckUnAr();
|
||||
}
|
||||
@@ -145,6 +148,16 @@ public sealed partial class SettingsViewModel : ViewModelBase
|
||||
}
|
||||
}
|
||||
|
||||
public bool UseInternalDecompressor
|
||||
{
|
||||
get => _useInternalDecompressor;
|
||||
set
|
||||
{
|
||||
SetProperty(ref _useInternalDecompressor, value);
|
||||
_useInternalDecompressorChanged = true;
|
||||
}
|
||||
}
|
||||
|
||||
void CheckUnAr()
|
||||
{
|
||||
var worker = new Compression();
|
||||
@@ -347,12 +360,19 @@ public sealed partial class SettingsViewModel : ViewModelBase
|
||||
if(_unArChanged)
|
||||
{
|
||||
Settings.Settings.Current.UnArchiverPath = UnArPath;
|
||||
Settings.Settings.UnArUsable = true;
|
||||
Settings.Settings.CanDecompress = true;
|
||||
}
|
||||
|
||||
if(_compressionChanged) Settings.Settings.Current.Compression = Compression;
|
||||
|
||||
if(_databaseChanged || _repositoryChanged || _temporaryChanged || _unArChanged || _compressionChanged)
|
||||
if(_useInternalDecompressorChanged) Settings.Settings.Current.UseInternalDecompressor = UseInternalDecompressor;
|
||||
|
||||
if(_databaseChanged ||
|
||||
_repositoryChanged ||
|
||||
_temporaryChanged ||
|
||||
_unArChanged ||
|
||||
_compressionChanged ||
|
||||
_useInternalDecompressorChanged)
|
||||
Settings.Settings.SaveSettings();
|
||||
|
||||
_view.Close();
|
||||
|
||||
@@ -144,7 +144,9 @@ public sealed partial class SplashWindowViewModel : ViewModelBase
|
||||
try
|
||||
{
|
||||
var worker = new Compression();
|
||||
Settings.Settings.UnArUsable = worker.CheckUnAr(Settings.Settings.Current.UnArchiverPath);
|
||||
|
||||
Settings.Settings.CanDecompress = worker.CheckUnAr(Settings.Settings.Current.UnArchiverPath) ||
|
||||
Settings.Settings.Current.UseInternalDecompressor;
|
||||
|
||||
Dispatcher.UIThread.Post(LoadDatabase);
|
||||
}
|
||||
|
||||
@@ -40,106 +40,106 @@
|
||||
<Design.DataContext>
|
||||
<vm:AboutViewModel />
|
||||
</Design.DataContext>
|
||||
<Border Padding="15">
|
||||
<Grid RowDefinitions="Auto,*,Auto">
|
||||
<Grid Grid.Row="0"
|
||||
ColumnDefinitions="Auto,*">
|
||||
<Border Grid.Column="0"
|
||||
BorderThickness="5">
|
||||
<Image Source="/Assets/avalonia-logo.ico"
|
||||
Width="48"
|
||||
Height="48" />
|
||||
</Border>
|
||||
<Grid Grid.Column="1"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
RowDefinitions="Auto,Auto">
|
||||
<TextBlock Grid.Row="0"
|
||||
Text="{Binding SoftwareName, Mode=OneWay}"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="16"
|
||||
FontWeight="Bold" />
|
||||
<TextBlock Grid.Row="1"
|
||||
Text="{Binding VersionText, Mode=OneWay}"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center" />
|
||||
</Grid>
|
||||
<Grid RowDefinitions="Auto,*,Auto"
|
||||
Margin="16"
|
||||
RowSpacing="8">
|
||||
<Grid Grid.Row="0"
|
||||
ColumnSpacing="8"
|
||||
ColumnDefinitions="Auto,*">
|
||||
<Image Source="/Assets/avalonia-logo.ico"
|
||||
Width="48"
|
||||
Height="48" />
|
||||
<Grid Grid.Column="1"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
RowDefinitions="Auto,Auto"
|
||||
RowSpacing="8">
|
||||
<TextBlock Grid.Row="0"
|
||||
Text="{Binding SoftwareName, Mode=OneWay}"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="16"
|
||||
FontWeight="Bold" />
|
||||
<TextBlock Grid.Row="1"
|
||||
Text="{Binding VersionText, Mode=OneWay}"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center" />
|
||||
</Grid>
|
||||
<TabControl Grid.Row="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch">
|
||||
<TabItem>
|
||||
<TabItem.Header>
|
||||
<TextBlock Text="{x:Static resources:Localization.AboutLabel}" />
|
||||
</TabItem.Header>
|
||||
<Grid RowDefinitions="Auto,12,Auto,12,Auto,Auto,*">
|
||||
<TextBlock Grid.Row="0"
|
||||
Text="{Binding SuiteName, Mode=OneWay}" />
|
||||
<TextBlock Grid.Row="2"
|
||||
Text="{Binding Copyright, Mode=OneWay}" />
|
||||
<Button Grid.Row="4"
|
||||
BorderThickness="0"
|
||||
Background="Transparent"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Padding="0"
|
||||
Command="{Binding WebsiteCommand, Mode=OneWay}">
|
||||
<!-- TODO: TextDecorations="Underline" in next Avalonia UI version -->
|
||||
<TextBlock Text="{Binding Website, Mode=OneWay}"
|
||||
Foreground="Blue" />
|
||||
</Button>
|
||||
<Button Grid.Row="5"
|
||||
BorderThickness="0"
|
||||
Background="Transparent"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Padding="0"
|
||||
Command="{Binding LicenseCommand, Mode=OneWay}">
|
||||
<!-- TODO: TextDecorations="Underline" in next Avalonia UI version -->
|
||||
<TextBlock Text="{x:Static resources:Localization.LicenseLabel}"
|
||||
Foreground="Blue" />
|
||||
</Button>
|
||||
</Grid>
|
||||
</TabItem>
|
||||
<TabItem>
|
||||
<TabItem.Header>
|
||||
<TextBlock Text="{x:Static resources:Localization.LibrariesLabel}" />
|
||||
</TabItem.Header>
|
||||
<DataGrid ItemsSource="{Binding Assemblies, Mode=OneWay}"
|
||||
HorizontalScrollBarVisibility="Visible">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Binding="{Binding Name, Mode=OneWay}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{x:Static resources:Localization.AssembliesLibraryText}" />
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding Version, Mode=OneWay}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{x:Static resources:Localization.AssembliesVersionText}" />
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</TabItem>
|
||||
<TabItem>
|
||||
<TabItem.Header>
|
||||
<TextBlock Text="{x:Static resources:Localization.AuthorsLabel}" />
|
||||
</TabItem.Header>
|
||||
<TextBox IsReadOnly="True"
|
||||
Text="{x:Static resources:Localization.AuthorsText}" />
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
<Button Grid.Row="2"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Command="{Binding CloseCommand, Mode=OneWay}">
|
||||
<TextBlock Text="{x:Static resources:Localization.CloseLabel}" />
|
||||
</Button>
|
||||
</Grid>
|
||||
</Border>
|
||||
<TabControl Grid.Row="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch">
|
||||
<TabItem>
|
||||
<TabItem.Header>
|
||||
<TextBlock Text="{x:Static resources:Localization.AboutLabel}" />
|
||||
</TabItem.Header>
|
||||
<Grid RowDefinitions="Auto,Auto,Auto,Auto,Auto,*"
|
||||
RowSpacing="8">
|
||||
<TextBlock Grid.Row="0"
|
||||
Text="{Binding SuiteName, Mode=OneWay}" />
|
||||
<TextBlock Grid.Row="1"
|
||||
Text="{Binding Copyright, Mode=OneWay}" />
|
||||
<Button Grid.Row="2"
|
||||
Background="Transparent"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Padding="0"
|
||||
BorderThickness="0"
|
||||
Command="{Binding WebsiteCommand, Mode=OneWay}">
|
||||
<TextBlock Text="{Binding Website, Mode=OneWay}"
|
||||
Foreground="Blue"
|
||||
TextDecorations="Underline" />
|
||||
</Button>
|
||||
<Button Grid.Row="3"
|
||||
Background="Transparent"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Padding="0"
|
||||
BorderThickness="0"
|
||||
Command="{Binding LicenseCommand, Mode=OneWay}">
|
||||
<TextBlock Text="{x:Static resources:Localization.LicenseLabel}"
|
||||
Foreground="Blue"
|
||||
TextDecorations="Underline" />
|
||||
</Button>
|
||||
</Grid>
|
||||
</TabItem>
|
||||
<TabItem>
|
||||
<TabItem.Header>
|
||||
<TextBlock Text="{x:Static resources:Localization.LibrariesLabel}" />
|
||||
</TabItem.Header>
|
||||
<DataGrid ItemsSource="{Binding Assemblies, Mode=OneWay}"
|
||||
HorizontalScrollBarVisibility="Visible">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Binding="{Binding Name, Mode=OneWay}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{x:Static resources:Localization.AssembliesLibraryText}" />
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding Version, Mode=OneWay}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{x:Static resources:Localization.AssembliesVersionText}" />
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</TabItem>
|
||||
<TabItem>
|
||||
<TabItem.Header>
|
||||
<TextBlock Text="{x:Static resources:Localization.AuthorsLabel}" />
|
||||
</TabItem.Header>
|
||||
<TextBox IsReadOnly="True"
|
||||
Text="{x:Static resources:Localization.AuthorsText}" />
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
<Button Grid.Row="2"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Command="{Binding CloseCommand, Mode=OneWay}">
|
||||
<TextBlock Text="{x:Static resources:Localization.CloseLabel}" />
|
||||
</Button>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -41,226 +41,212 @@
|
||||
<Design.DataContext>
|
||||
<vm:EditDatViewModel />
|
||||
</Design.DataContext>
|
||||
<Border Padding="15">
|
||||
<Grid RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto">
|
||||
<Grid Grid.Row="0"
|
||||
ColumnDefinitions="140,*">
|
||||
<TextBlock Grid.Column="0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Text="{x:Static resources:Localization.RomSetNameLabel}"
|
||||
FontWeight="Bold"
|
||||
Padding="5" />
|
||||
<TextBox Grid.Column="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Name, Mode=TwoWay}"
|
||||
Padding="5" />
|
||||
</Grid>
|
||||
<Grid Grid.Row="1"
|
||||
ColumnDefinitions="140,*">
|
||||
<TextBlock Grid.Column="0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Text="{x:Static resources:Localization.RomSetVersionLabel}"
|
||||
FontWeight="Bold"
|
||||
Padding="5" />
|
||||
<TextBox Grid.Column="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Version, Mode=TwoWay}"
|
||||
Padding="5" />
|
||||
</Grid>
|
||||
<Grid Grid.Row="2"
|
||||
ColumnDefinitions="140,*">
|
||||
<TextBlock Grid.Column="0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Text="{x:Static resources:Localization.RomSetAuthorLabel}"
|
||||
FontWeight="Bold"
|
||||
Padding="5" />
|
||||
<TextBox Grid.Column="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Author, Mode=TwoWay}"
|
||||
Padding="5" />
|
||||
</Grid>
|
||||
<Grid Grid.Row="3"
|
||||
ColumnDefinitions="140,*">
|
||||
<TextBlock Grid.Column="0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Text="{x:Static resources:Localization.RomSetCategoryLabel}"
|
||||
FontWeight="Bold"
|
||||
Padding="5" />
|
||||
<TextBox Grid.Column="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Category, Mode=TwoWay}"
|
||||
Padding="5" />
|
||||
</Grid>
|
||||
<Grid Grid.Row="4"
|
||||
ColumnDefinitions="140,*">
|
||||
<TextBlock Grid.Column="0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Text="{x:Static resources:Localization.RomSetCommentLabel}"
|
||||
FontWeight="Bold"
|
||||
Padding="5" />
|
||||
<TextBox Grid.Column="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Comment, Mode=TwoWay}"
|
||||
Padding="5" />
|
||||
</Grid>
|
||||
<Grid Grid.Row="5"
|
||||
ColumnDefinitions="140,*">
|
||||
<TextBlock Grid.Column="0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Text="{x:Static resources:Localization.RomSetDateLabel}"
|
||||
FontWeight="Bold"
|
||||
Padding="5" />
|
||||
<TextBox Grid.Column="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Date, Mode=TwoWay}"
|
||||
Padding="5" />
|
||||
</Grid>
|
||||
<Grid Grid.Row="6"
|
||||
ColumnDefinitions="140,*">
|
||||
<TextBlock Grid.Column="0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Text="{x:Static resources:Localization.RomSetDescriptionLabel}"
|
||||
FontWeight="Bold"
|
||||
Padding="5" />
|
||||
<TextBox Grid.Column="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Description, Mode=TwoWay}"
|
||||
Padding="5" />
|
||||
</Grid>
|
||||
<Grid Grid.Row="7"
|
||||
ColumnDefinitions="140,*">
|
||||
<TextBlock Grid.Column="0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Text="{x:Static resources:Localization.HomepageLabel}"
|
||||
FontWeight="Bold"
|
||||
Padding="5" />
|
||||
<TextBox Grid.Column="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Homepage, Mode=TwoWay}"
|
||||
Padding="5" />
|
||||
</Grid>
|
||||
<Grid Grid.Row="8"
|
||||
ColumnDefinitions="140,*">
|
||||
<TextBlock Grid.Column="0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Text="{x:Static resources:Localization.TotalMachinesLabel}"
|
||||
FontWeight="Bold"
|
||||
Padding="5" />
|
||||
<TextBlock Grid.Column="1"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding TotalMachines, Mode=OneWay}"
|
||||
Padding="5" />
|
||||
</Grid>
|
||||
<Grid Grid.Row="9"
|
||||
ColumnDefinitions="140,*">
|
||||
<TextBlock Grid.Column="0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Text="{x:Static resources:Localization.CompleteMachinesLabel}"
|
||||
FontWeight="Bold"
|
||||
Padding="5" />
|
||||
<TextBlock Grid.Column="1"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding CompleteMachines, Mode=OneWay}"
|
||||
Padding="5" />
|
||||
</Grid>
|
||||
<Grid Grid.Row="10"
|
||||
ColumnDefinitions="140,*">
|
||||
<TextBlock Grid.Column="0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Text="{x:Static resources:Localization.IncompleteMachinesLabel}"
|
||||
FontWeight="Bold"
|
||||
Padding="5" />
|
||||
<TextBlock Grid.Column="1"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding IncompleteMachines, Mode=OneWay}"
|
||||
Padding="5" />
|
||||
</Grid>
|
||||
<Grid Grid.Row="11"
|
||||
ColumnDefinitions="140,*">
|
||||
<TextBlock Grid.Column="0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Text="{x:Static resources:Localization.TotalRomsLabel}"
|
||||
FontWeight="Bold"
|
||||
Padding="5" />
|
||||
<TextBlock Grid.Column="1"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding TotalRoms, Mode=OneWay}"
|
||||
Padding="5" />
|
||||
</Grid>
|
||||
<Grid Grid.Row="12"
|
||||
ColumnDefinitions="140,*">
|
||||
<TextBlock Grid.Column="0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Text="{x:Static resources:Localization.HaveRomsLabel}"
|
||||
FontWeight="Bold"
|
||||
Padding="5" />
|
||||
<TextBlock Grid.Column="1"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding HaveRoms, Mode=OneWay}"
|
||||
Padding="5" />
|
||||
</Grid>
|
||||
<Grid Grid.Row="13"
|
||||
ColumnDefinitions="140,*">
|
||||
<TextBlock Grid.Column="0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Text="{x:Static resources:Localization.MissRomsLabel}"
|
||||
FontWeight="Bold"
|
||||
Padding="5" />
|
||||
<TextBlock Grid.Column="1"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding MissRoms, Mode=OneWay}"
|
||||
Padding="5" />
|
||||
</Grid>
|
||||
<StackPanel Grid.Row="14"
|
||||
Orientation="Horizontal"
|
||||
HorizontalAlignment="Right">
|
||||
<Button HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Command="{Binding SaveCommand, Mode=OneWay}"
|
||||
IsVisible="{Binding Modified, Mode=OneWay}">
|
||||
<TextBlock Text="{x:Static resources:Localization.SaveLabel}" />
|
||||
</Button>
|
||||
<Button HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Command="{Binding CancelCommand, Mode=OneWay}"
|
||||
IsVisible="{Binding Modified, Mode=OneWay}">
|
||||
<TextBlock Text="{x:Static resources:Localization.CancelLabel}" />
|
||||
</Button>
|
||||
<Button HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Command="{Binding CloseCommand, Mode=OneWay}"
|
||||
IsVisible="{Binding !Modified, Mode=OneWay}">
|
||||
<TextBlock Text="{x:Static resources:Localization.CloseLabel}" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<Grid RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto"
|
||||
Margin="16"
|
||||
RowSpacing="8">
|
||||
<Grid Grid.Row="0"
|
||||
ColumnSpacing="8"
|
||||
ColumnDefinitions="140,*">
|
||||
<TextBlock Grid.Column="0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Text="{x:Static resources:Localization.RomSetNameLabel}"
|
||||
FontWeight="Bold" />
|
||||
<TextBox Grid.Column="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Name, Mode=TwoWay}" />
|
||||
</Grid>
|
||||
</Border>
|
||||
<Grid Grid.Row="1"
|
||||
ColumnSpacing="8"
|
||||
ColumnDefinitions="140,*">
|
||||
<TextBlock Grid.Column="0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Text="{x:Static resources:Localization.RomSetVersionLabel}"
|
||||
FontWeight="Bold" />
|
||||
<TextBox Grid.Column="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Version, Mode=TwoWay}" />
|
||||
</Grid>
|
||||
<Grid Grid.Row="2"
|
||||
ColumnSpacing="8"
|
||||
ColumnDefinitions="140,*">
|
||||
<TextBlock Grid.Column="0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Text="{x:Static resources:Localization.RomSetAuthorLabel}"
|
||||
FontWeight="Bold" />
|
||||
<TextBox Grid.Column="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Author, Mode=TwoWay}" />
|
||||
</Grid>
|
||||
<Grid Grid.Row="3"
|
||||
ColumnSpacing="8"
|
||||
ColumnDefinitions="140,*">
|
||||
<TextBlock Grid.Column="0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Text="{x:Static resources:Localization.RomSetCategoryLabel}"
|
||||
FontWeight="Bold" />
|
||||
<TextBox Grid.Column="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Category, Mode=TwoWay}" />
|
||||
</Grid>
|
||||
<Grid Grid.Row="4"
|
||||
ColumnSpacing="8"
|
||||
ColumnDefinitions="140,*">
|
||||
<TextBlock Grid.Column="0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Text="{x:Static resources:Localization.RomSetCommentLabel}"
|
||||
FontWeight="Bold" />
|
||||
<TextBox Grid.Column="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Comment, Mode=TwoWay}" />
|
||||
</Grid>
|
||||
<Grid Grid.Row="5"
|
||||
ColumnSpacing="8"
|
||||
ColumnDefinitions="140,*">
|
||||
<TextBlock Grid.Column="0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Text="{x:Static resources:Localization.RomSetDateLabel}"
|
||||
FontWeight="Bold" />
|
||||
<TextBox Grid.Column="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Date, Mode=TwoWay}" />
|
||||
</Grid>
|
||||
<Grid Grid.Row="6"
|
||||
ColumnSpacing="8"
|
||||
ColumnDefinitions="140,*">
|
||||
<TextBlock Grid.Column="0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Text="{x:Static resources:Localization.RomSetDescriptionLabel}"
|
||||
FontWeight="Bold" />
|
||||
<TextBox Grid.Column="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Description, Mode=TwoWay}" />
|
||||
</Grid>
|
||||
<Grid Grid.Row="7"
|
||||
ColumnSpacing="8"
|
||||
ColumnDefinitions="140,*">
|
||||
<TextBlock Grid.Column="0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Text="{x:Static resources:Localization.HomepageLabel}"
|
||||
FontWeight="Bold" />
|
||||
<TextBox Grid.Column="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Homepage, Mode=TwoWay}" />
|
||||
</Grid>
|
||||
<Grid Grid.Row="8"
|
||||
ColumnSpacing="8"
|
||||
ColumnDefinitions="140,*">
|
||||
<TextBlock Grid.Column="0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Text="{x:Static resources:Localization.TotalMachinesLabel}"
|
||||
FontWeight="Bold" />
|
||||
<TextBlock Grid.Column="1"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding TotalMachines, Mode=OneWay}" />
|
||||
</Grid>
|
||||
<Grid Grid.Row="9"
|
||||
ColumnSpacing="8"
|
||||
ColumnDefinitions="140,*">
|
||||
<TextBlock Grid.Column="0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Text="{x:Static resources:Localization.CompleteMachinesLabel}"
|
||||
FontWeight="Bold" />
|
||||
<TextBlock Grid.Column="1"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding CompleteMachines, Mode=OneWay}" />
|
||||
</Grid>
|
||||
<Grid Grid.Row="10"
|
||||
ColumnSpacing="8"
|
||||
ColumnDefinitions="140,*">
|
||||
<TextBlock Grid.Column="0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Text="{x:Static resources:Localization.IncompleteMachinesLabel}"
|
||||
FontWeight="Bold" />
|
||||
<TextBlock Grid.Column="1"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding IncompleteMachines, Mode=OneWay}" />
|
||||
</Grid>
|
||||
<Grid Grid.Row="11"
|
||||
ColumnSpacing="8"
|
||||
ColumnDefinitions="140,*">
|
||||
<TextBlock Grid.Column="0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Text="{x:Static resources:Localization.TotalRomsLabel}"
|
||||
FontWeight="Bold" />
|
||||
<TextBlock Grid.Column="1"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding TotalRoms, Mode=OneWay}" />
|
||||
</Grid>
|
||||
<Grid Grid.Row="12"
|
||||
ColumnSpacing="8"
|
||||
ColumnDefinitions="140,*">
|
||||
<TextBlock Grid.Column="0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Text="{x:Static resources:Localization.HaveRomsLabel}"
|
||||
FontWeight="Bold" />
|
||||
<TextBlock Grid.Column="1"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding HaveRoms, Mode=OneWay}" />
|
||||
</Grid>
|
||||
<Grid Grid.Row="13"
|
||||
ColumnSpacing="8"
|
||||
ColumnDefinitions="140,*">
|
||||
<TextBlock Grid.Column="0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Text="{x:Static resources:Localization.MissRomsLabel}"
|
||||
FontWeight="Bold" />
|
||||
<TextBlock Grid.Column="1"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding MissRoms, Mode=OneWay}" />
|
||||
</Grid>
|
||||
<StackPanel Grid.Row="14"
|
||||
Orientation="Horizontal"
|
||||
HorizontalAlignment="Right">
|
||||
<Button HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Command="{Binding SaveCommand, Mode=OneWay}"
|
||||
IsVisible="{Binding Modified, Mode=OneWay}">
|
||||
<TextBlock Text="{x:Static resources:Localization.SaveLabel}" />
|
||||
</Button>
|
||||
<Button HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Command="{Binding CancelCommand, Mode=OneWay}"
|
||||
IsVisible="{Binding Modified, Mode=OneWay}">
|
||||
<TextBlock Text="{x:Static resources:Localization.CancelLabel}" />
|
||||
</Button>
|
||||
<Button HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Command="{Binding CloseCommand, Mode=OneWay}"
|
||||
IsVisible="{Binding !Modified, Mode=OneWay}">
|
||||
<TextBlock Text="{x:Static resources:Localization.CloseLabel}" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -41,27 +41,27 @@
|
||||
<Design.DataContext>
|
||||
<vm:ExportDatViewModel />
|
||||
</Design.DataContext>
|
||||
<Border Padding="15">
|
||||
<Grid RowDefinitions="Auto,auto,Auto,Auto">
|
||||
<TextBlock Grid.Row="0"
|
||||
Text="{Binding StatusMessage, Mode=OneWay}"
|
||||
HorizontalAlignment="Center" />
|
||||
<ProgressBar Grid.Row="1"
|
||||
IsIndeterminate="True"
|
||||
HorizontalAlignment="Stretch"
|
||||
IsVisible="{Binding ProgressVisible, Mode=OneWay}" />
|
||||
<TextBlock Grid.Row="2"
|
||||
Text="{Binding ErrorMessage, Mode=OneWay}"
|
||||
HorizontalAlignment="Center"
|
||||
Foreground="Red"
|
||||
IsVisible="{Binding ErrorVisible, Mode=OneWay}" />
|
||||
<Button Grid.Row="3"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
IsEnabled="{Binding CanClose, Mode=OneWay}"
|
||||
Command="{Binding CloseCommand, Mode=OneWay}">
|
||||
<TextBlock Text="{x:Static resources:Localization.CloseLabel}" />
|
||||
</Button>
|
||||
</Grid>
|
||||
</Border>
|
||||
<Grid RowDefinitions="Auto,auto,Auto,Auto"
|
||||
Margin="16"
|
||||
RowSpacing="8">
|
||||
<TextBlock Grid.Row="0"
|
||||
Text="{Binding StatusMessage, Mode=OneWay}"
|
||||
HorizontalAlignment="Center" />
|
||||
<ProgressBar Grid.Row="1"
|
||||
IsIndeterminate="True"
|
||||
HorizontalAlignment="Stretch"
|
||||
IsVisible="{Binding ProgressVisible, Mode=OneWay}" />
|
||||
<TextBlock Grid.Row="2"
|
||||
Text="{Binding ErrorMessage, Mode=OneWay}"
|
||||
HorizontalAlignment="Center"
|
||||
Foreground="Red"
|
||||
IsVisible="{Binding ErrorVisible, Mode=OneWay}" />
|
||||
<Button Grid.Row="3"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
IsEnabled="{Binding CanClose, Mode=OneWay}"
|
||||
Command="{Binding CloseCommand, Mode=OneWay}">
|
||||
<TextBlock Text="{x:Static resources:Localization.CloseLabel}" />
|
||||
</Button>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -41,48 +41,51 @@
|
||||
<Design.DataContext>
|
||||
<vm:ExportRomsViewModel />
|
||||
</Design.DataContext>
|
||||
<Border Padding="15">
|
||||
<Grid RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,Auto,*,Auto">
|
||||
<StackPanel Grid.Row="0"
|
||||
Orientation="Horizontal"
|
||||
HorizontalAlignment="Stretch">
|
||||
<TextBlock Text="{x:Static resources:Localization.PathLabel}"
|
||||
FontWeight="Bold" />
|
||||
<TextBlock Text="{Binding FolderPath, Mode=OneWay}" />
|
||||
</StackPanel>
|
||||
<TextBlock Grid.Row="1"
|
||||
Text="{Binding StatusMessage, Mode=OneWay}"
|
||||
FontWeight="Bold"
|
||||
HorizontalAlignment="Center" />
|
||||
<ProgressBar Grid.Row="2"
|
||||
Minimum="{Binding ProgressMinimum, Mode=OneWay}"
|
||||
Maximum="{Binding ProgressMaximum, Mode=OneWay}"
|
||||
Value="{Binding ProgressValue, Mode=OneWay}"
|
||||
IsIndeterminate="{Binding ProgressIsIndeterminate, Mode=OneWay}"
|
||||
IsVisible="{Binding ProgressVisible, Mode=OneWay}" />
|
||||
<StackPanel Grid.Row="3"
|
||||
IsVisible="{Binding Progress2Visible, Mode=OneWay}">
|
||||
<TextBlock Text="{Binding Status2Message, Mode=OneWay}" />
|
||||
<ProgressBar Minimum="{Binding Progress2Minimum, Mode=OneWay}"
|
||||
Maximum="{Binding Progress2Maximum, Mode=OneWay}"
|
||||
Value="{Binding Progress2Value, Mode=OneWay}"
|
||||
IsIndeterminate="{Binding Progress2IsIndeterminate, Mode=OneWay}" />
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Row="4"
|
||||
IsVisible="{Binding Progress3Visible, Mode=OneWay}">
|
||||
<TextBlock Text="{Binding Status3Message, Mode=OneWay}" />
|
||||
<ProgressBar Minimum="{Binding Progress3Minimum, Mode=OneWay}"
|
||||
Maximum="{Binding Progress3Maximum, Mode=OneWay}"
|
||||
Value="{Binding Progress3Value, Mode=OneWay}"
|
||||
IsIndeterminate="{Binding Progress3IsIndeterminate, Mode=OneWay}" />
|
||||
</StackPanel>
|
||||
<Button Grid.Row="5"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
IsEnabled="{Binding CanClose, Mode=OneWay}"
|
||||
Command="{Binding CloseCommand, Mode=OneWay}">
|
||||
<TextBlock Text="{x:Static resources:Localization.CloseLabel}" />
|
||||
</Button>
|
||||
</Grid>
|
||||
</Border>
|
||||
<Grid RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,Auto,*,Auto"
|
||||
Margin="16"
|
||||
RowSpacing="8">
|
||||
<StackPanel Grid.Row="0"
|
||||
Spacing="8"
|
||||
Orientation="Horizontal"
|
||||
HorizontalAlignment="Stretch">
|
||||
<TextBlock Text="{x:Static resources:Localization.PathLabel}"
|
||||
FontWeight="Bold" />
|
||||
<TextBlock Text="{Binding FolderPath, Mode=OneWay}" />
|
||||
</StackPanel>
|
||||
<TextBlock Grid.Row="1"
|
||||
Text="{Binding StatusMessage, Mode=OneWay}"
|
||||
FontWeight="Bold"
|
||||
HorizontalAlignment="Center" />
|
||||
<ProgressBar Grid.Row="2"
|
||||
Minimum="{Binding ProgressMinimum, Mode=OneWay}"
|
||||
Maximum="{Binding ProgressMaximum, Mode=OneWay}"
|
||||
Value="{Binding ProgressValue, Mode=OneWay}"
|
||||
IsIndeterminate="{Binding ProgressIsIndeterminate, Mode=OneWay}"
|
||||
IsVisible="{Binding ProgressVisible, Mode=OneWay}" />
|
||||
<StackPanel Grid.Row="3"
|
||||
Spacing="8"
|
||||
IsVisible="{Binding Progress2Visible, Mode=OneWay}">
|
||||
<TextBlock Text="{Binding Status2Message, Mode=OneWay}" />
|
||||
<ProgressBar Minimum="{Binding Progress2Minimum, Mode=OneWay}"
|
||||
Maximum="{Binding Progress2Maximum, Mode=OneWay}"
|
||||
Value="{Binding Progress2Value, Mode=OneWay}"
|
||||
IsIndeterminate="{Binding Progress2IsIndeterminate, Mode=OneWay}" />
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Row="4"
|
||||
Spacing="8"
|
||||
IsVisible="{Binding Progress3Visible, Mode=OneWay}">
|
||||
<TextBlock Text="{Binding Status3Message, Mode=OneWay}" />
|
||||
<ProgressBar Minimum="{Binding Progress3Minimum, Mode=OneWay}"
|
||||
Maximum="{Binding Progress3Maximum, Mode=OneWay}"
|
||||
Value="{Binding Progress3Value, Mode=OneWay}"
|
||||
IsIndeterminate="{Binding Progress3IsIndeterminate, Mode=OneWay}" />
|
||||
</StackPanel>
|
||||
<Button Grid.Row="5"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
IsEnabled="{Binding CanClose, Mode=OneWay}"
|
||||
Command="{Binding CloseCommand, Mode=OneWay}">
|
||||
<TextBlock Text="{x:Static resources:Localization.CloseLabel}" />
|
||||
</Button>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -41,30 +41,30 @@
|
||||
<Design.DataContext>
|
||||
<vm:ImportDatViewModel />
|
||||
</Design.DataContext>
|
||||
<Border Padding="15">
|
||||
<Grid RowDefinitions="Auto,auto,Auto,Auto">
|
||||
<TextBlock Grid.Row="0"
|
||||
Text="{Binding StatusMessage, Mode=OneWay}"
|
||||
HorizontalAlignment="Center" />
|
||||
<ProgressBar Grid.Row="1"
|
||||
IsIndeterminate="{Binding IndeterminateProgress, Mode=OneWay}"
|
||||
Maximum="{Binding MaximumValue, Mode=OneWay}"
|
||||
Minimum="{Binding MinimumValue, Mode=OneWay}"
|
||||
Value="{Binding CurrentValue, Mode=OneWay}"
|
||||
HorizontalAlignment="Stretch"
|
||||
IsVisible="{Binding ProgressVisible, Mode=OneWay}" />
|
||||
<TextBlock Grid.Row="2"
|
||||
Text="{Binding ErrorMessage, Mode=OneWay}"
|
||||
HorizontalAlignment="Center"
|
||||
Foreground="Red"
|
||||
IsVisible="{Binding ErrorVisible, Mode=OneWay}" />
|
||||
<Button Grid.Row="3"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
IsEnabled="{Binding CanClose, Mode=OneWay}"
|
||||
Command="{Binding CloseCommand, Mode=OneWay}">
|
||||
<TextBlock Text="{x:Static resources:Localization.CloseLabel}" />
|
||||
</Button>
|
||||
</Grid>
|
||||
</Border>
|
||||
<Grid RowDefinitions="Auto,auto,Auto,Auto"
|
||||
Margin="16"
|
||||
RowSpacing="8">
|
||||
<TextBlock Grid.Row="0"
|
||||
Text="{Binding StatusMessage, Mode=OneWay}"
|
||||
HorizontalAlignment="Center" />
|
||||
<ProgressBar Grid.Row="1"
|
||||
IsIndeterminate="{Binding IndeterminateProgress, Mode=OneWay}"
|
||||
Maximum="{Binding MaximumValue, Mode=OneWay}"
|
||||
Minimum="{Binding MinimumValue, Mode=OneWay}"
|
||||
Value="{Binding CurrentValue, Mode=OneWay}"
|
||||
HorizontalAlignment="Stretch"
|
||||
IsVisible="{Binding ProgressVisible, Mode=OneWay}" />
|
||||
<TextBlock Grid.Row="2"
|
||||
Text="{Binding ErrorMessage, Mode=OneWay}"
|
||||
HorizontalAlignment="Center"
|
||||
Foreground="Red"
|
||||
IsVisible="{Binding ErrorVisible, Mode=OneWay}" />
|
||||
<Button Grid.Row="3"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
IsEnabled="{Binding CanClose, Mode=OneWay}"
|
||||
Command="{Binding CloseCommand, Mode=OneWay}">
|
||||
<TextBlock Text="{x:Static resources:Localization.CloseLabel}" />
|
||||
</Button>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -10,8 +10,7 @@
|
||||
Height="600"
|
||||
x:Class="RomRepoMgr.Views.ImportDatFolder"
|
||||
Title="{x:Static resources:Localization.ImportDatFolderTitle}"
|
||||
Icon="/Assets/avalonia-logo.ico"
|
||||
CanResize="False">
|
||||
Icon="/Assets/avalonia-logo.ico">
|
||||
<Design.DataContext>
|
||||
<vm:ImportDatFolderViewModel />
|
||||
</Design.DataContext>
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
Height="768"
|
||||
x:Class="RomRepoMgr.Views.ImportRomFolder"
|
||||
Icon="/Assets/avalonia-logo.ico"
|
||||
CanResize="False"
|
||||
Title="{x:Static resources:Localization.ImportRomFolderTitle}"
|
||||
WindowStartupLocation="CenterOwner">
|
||||
<Design.DataContext>
|
||||
|
||||
@@ -41,14 +41,14 @@
|
||||
<Design.DataContext>
|
||||
<vm:RemoveDatViewModel />
|
||||
</Design.DataContext>
|
||||
<Border Padding="15">
|
||||
<Grid RowDefinitions="Auto,auto">
|
||||
<TextBlock Grid.Row="0"
|
||||
Text="{Binding StatusMessage, Mode=OneWay}"
|
||||
HorizontalAlignment="Center" />
|
||||
<ProgressBar Grid.Row="1"
|
||||
IsIndeterminate="True"
|
||||
HorizontalAlignment="Stretch" />
|
||||
</Grid>
|
||||
</Border>
|
||||
<Grid RowDefinitions="Auto,auto"
|
||||
Margin="16"
|
||||
RowSpacing="8">
|
||||
<TextBlock Grid.Row="0"
|
||||
Text="{Binding StatusMessage, Mode=OneWay}"
|
||||
HorizontalAlignment="Center" />
|
||||
<ProgressBar Grid.Row="1"
|
||||
IsIndeterminate="True"
|
||||
HorizontalAlignment="Stretch" />
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -31,7 +31,7 @@
|
||||
xmlns:vm="clr-namespace:RomRepoMgr.ViewModels;assembly=RomRepoMgr"
|
||||
xmlns:resources="clr-namespace:RomRepoMgr.Resources"
|
||||
mc:Ignorable="d"
|
||||
Width="480"
|
||||
Width="540"
|
||||
Height="320"
|
||||
x:Class="RomRepoMgr.Views.SettingsDialog"
|
||||
Icon="/Assets/avalonia-logo.ico"
|
||||
@@ -40,129 +40,129 @@
|
||||
<Design.DataContext>
|
||||
<vm:SettingsViewModel />
|
||||
</Design.DataContext>
|
||||
<Border Padding="15">
|
||||
<Grid RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,Auto">
|
||||
<Grid Grid.Row="0"
|
||||
ColumnDefinitions="*,250,Auto">
|
||||
<TextBlock Grid.Column="0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Text="{x:Static resources:Localization.DatabaseFileLabel}"
|
||||
FontWeight="Bold"
|
||||
Padding="5" />
|
||||
<TextBox Grid.Column="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding DatabasePath, Mode=TwoWay}"
|
||||
IsReadOnly="True"
|
||||
Padding="5" />
|
||||
<Button Grid.Column="2"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Command="{Binding DatabaseCommand, Mode=OneWay}"
|
||||
Padding="5">
|
||||
<TextBlock Text="{x:Static resources:Localization.ChooseLabel}" />
|
||||
</Button>
|
||||
</Grid>
|
||||
<Grid Grid.Row="1"
|
||||
ColumnDefinitions="*,250,Auto">
|
||||
<TextBlock Grid.Column="0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Text="{x:Static resources:Localization.RepositoryFolderLabel}"
|
||||
FontWeight="Bold"
|
||||
Padding="5" />
|
||||
<TextBox Grid.Column="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding RepositoryPath, Mode=TwoWay}"
|
||||
IsReadOnly="True"
|
||||
Padding="5" />
|
||||
<Button Grid.Column="2"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Command="{Binding RepositoryCommand, Mode=OneWay}"
|
||||
Padding="5">
|
||||
<TextBlock Text="{x:Static resources:Localization.ChooseLabel}" />
|
||||
</Button>
|
||||
</Grid>
|
||||
<Grid Grid.Row="2"
|
||||
ColumnDefinitions="*,250,Auto">
|
||||
<TextBlock Grid.Column="0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Text="{x:Static resources:Localization.TemporaryFolderLabel}"
|
||||
FontWeight="Bold"
|
||||
Padding="5" />
|
||||
<TextBox Grid.Column="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding TemporaryPath, Mode=TwoWay}"
|
||||
IsReadOnly="True"
|
||||
Padding="5" />
|
||||
<Button Grid.Column="2"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Command="{Binding TemporaryCommand, Mode=OneWay}"
|
||||
Padding="5">
|
||||
<TextBlock Text="{x:Static resources:Localization.ChooseLabel}" />
|
||||
</Button>
|
||||
</Grid>
|
||||
<Grid Grid.Row="3"
|
||||
ColumnDefinitions="*,250,Auto">
|
||||
<TextBlock Grid.Column="0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Text="{x:Static resources:Localization.UnArPathLabel}"
|
||||
FontWeight="Bold"
|
||||
Padding="5" />
|
||||
<TextBox Grid.Column="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding UnArPath, Mode=TwoWay}"
|
||||
IsReadOnly="True"
|
||||
Padding="5" />
|
||||
<Button Grid.Column="2"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Command="{Binding UnArCommand, Mode=OneWay}"
|
||||
Padding="5">
|
||||
<TextBlock Text="{x:Static resources:Localization.ChooseLabel}" />
|
||||
</Button>
|
||||
</Grid>
|
||||
<TextBlock Grid.Row="4"
|
||||
HorizontalAlignment="Left"
|
||||
<Grid RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto"
|
||||
Margin="16"
|
||||
RowSpacing="8">
|
||||
<Grid Grid.Row="0"
|
||||
ColumnDefinitions="*,250,Auto"
|
||||
ColumnSpacing="8">
|
||||
<TextBlock Grid.Column="0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding UnArVersion, Mode=OneWay}"
|
||||
Text="{x:Static resources:Localization.DatabaseFileLabel}"
|
||||
FontWeight="Bold" />
|
||||
<Grid Grid.Row="5"
|
||||
ColumnDefinitions="Auto, *">
|
||||
<TextBlock Grid.Column="0"
|
||||
VerticalAlignment="Center"
|
||||
Text="{x:Static resources:Localization.CompressionType}"
|
||||
FontWeight="Bold"
|
||||
Padding="5" />
|
||||
<ComboBox Grid.Column="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
SelectedItem="{Binding Compression, Mode=TwoWay}"
|
||||
ItemsSource="{Binding CompressionTypes, Mode=OneWay}"
|
||||
Padding="5" />
|
||||
</Grid>
|
||||
<StackPanel Grid.Row="6"
|
||||
Orientation="Horizontal"
|
||||
HorizontalAlignment="Right">
|
||||
<Button HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Command="{Binding SaveCommand, Mode=OneWay}">
|
||||
<TextBlock Text="{x:Static resources:Localization.SaveLabel}" />
|
||||
</Button>
|
||||
<Button HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Command="{Binding CloseCommand, Mode=OneWay}">
|
||||
<TextBlock Text="{x:Static resources:Localization.CloseLabel}" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<TextBox Grid.Column="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding DatabasePath, Mode=TwoWay}"
|
||||
IsReadOnly="True" />
|
||||
<Button Grid.Column="2"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Command="{Binding DatabaseCommand, Mode=OneWay}">
|
||||
<TextBlock Text="{x:Static resources:Localization.ChooseLabel}" />
|
||||
</Button>
|
||||
</Grid>
|
||||
</Border>
|
||||
<Grid Grid.Row="1"
|
||||
ColumnDefinitions="*,250,Auto"
|
||||
ColumnSpacing="8">
|
||||
<TextBlock Grid.Column="0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Text="{x:Static resources:Localization.RepositoryFolderLabel}"
|
||||
FontWeight="Bold" />
|
||||
<TextBox Grid.Column="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding RepositoryPath, Mode=TwoWay}"
|
||||
IsReadOnly="True" />
|
||||
<Button Grid.Column="2"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Command="{Binding RepositoryCommand, Mode=OneWay}">
|
||||
<TextBlock Text="{x:Static resources:Localization.ChooseLabel}" />
|
||||
</Button>
|
||||
</Grid>
|
||||
<Grid Grid.Row="2"
|
||||
ColumnDefinitions="*,250,Auto"
|
||||
ColumnSpacing="8">
|
||||
<TextBlock Grid.Column="0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Text="{x:Static resources:Localization.TemporaryFolderLabel}"
|
||||
FontWeight="Bold" />
|
||||
<TextBox Grid.Column="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding TemporaryPath, Mode=TwoWay}"
|
||||
IsReadOnly="True" />
|
||||
<Button Grid.Column="2"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Command="{Binding TemporaryCommand, Mode=OneWay}">
|
||||
<TextBlock Text="{x:Static resources:Localization.ChooseLabel}" />
|
||||
</Button>
|
||||
</Grid>
|
||||
<CheckBox Grid.Row="3"
|
||||
IsChecked="{Binding UseInternalDecompressor, Mode=TwoWay}">
|
||||
<CheckBox.Content>
|
||||
<TextBlock Text="{x:Static resources:Localization.UseInternalDecompressorLabel}" />
|
||||
</CheckBox.Content>
|
||||
</CheckBox>
|
||||
<Grid Grid.Row="4"
|
||||
ColumnDefinitions="*,250,Auto"
|
||||
ColumnSpacing="8"
|
||||
IsVisible="{Binding !UseInternalDecompressor}">
|
||||
<TextBlock Grid.Column="0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Text="{x:Static resources:Localization.UnArPathLabel}"
|
||||
FontWeight="Bold" />
|
||||
<TextBox Grid.Column="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding UnArPath, Mode=TwoWay}"
|
||||
IsReadOnly="True" />
|
||||
<Button Grid.Column="2"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Command="{Binding UnArCommand, Mode=OneWay}">
|
||||
<TextBlock Text="{x:Static resources:Localization.ChooseLabel}" />
|
||||
</Button>
|
||||
</Grid>
|
||||
<TextBlock Grid.Row="5"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding UnArVersion, Mode=OneWay}"
|
||||
FontWeight="Bold"
|
||||
IsVisible="{Binding !UseInternalDecompressor}" />
|
||||
<Grid Grid.Row="6"
|
||||
ColumnDefinitions="Auto, *"
|
||||
ColumnSpacing="8">
|
||||
<TextBlock Grid.Column="0"
|
||||
VerticalAlignment="Center"
|
||||
Text="{x:Static resources:Localization.CompressionType}"
|
||||
FontWeight="Bold" />
|
||||
<ComboBox Grid.Column="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
SelectedItem="{Binding Compression, Mode=TwoWay}"
|
||||
ItemsSource="{Binding CompressionTypes, Mode=OneWay}" />
|
||||
</Grid>
|
||||
<StackPanel Grid.Row="7"
|
||||
Spacing="8"
|
||||
Orientation="Horizontal"
|
||||
HorizontalAlignment="Right">
|
||||
<Button HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Command="{Binding SaveCommand, Mode=OneWay}">
|
||||
<TextBlock Text="{x:Static resources:Localization.SaveLabel}" />
|
||||
</Button>
|
||||
<Button HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Command="{Binding CloseCommand, Mode=OneWay}">
|
||||
<TextBlock Text="{x:Static resources:Localization.CloseLabel}" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -11,8 +11,8 @@
|
||||
Title="ROM Repository Manager"
|
||||
SystemDecorations="BorderOnly"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
Width="250"
|
||||
Height="175">
|
||||
Width="320"
|
||||
Height="240">
|
||||
<Design.DataContext>
|
||||
<vm:SplashWindowViewModel />
|
||||
</Design.DataContext>
|
||||
@@ -20,12 +20,14 @@
|
||||
<StackPanel HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Top"
|
||||
Orientation="Vertical"
|
||||
Margin="5">
|
||||
Margin="16"
|
||||
Spacing="8">
|
||||
<TextBlock Text="{Binding LoadingText, Mode=OneWay}"
|
||||
FontWeight="Bold"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Top" />
|
||||
<StackPanel HorizontalAlignment="Left"
|
||||
Spacing="8"
|
||||
Orientation="Horizontal">
|
||||
<Image MaxWidth="24"
|
||||
MaxHeight="24"
|
||||
@@ -52,6 +54,7 @@
|
||||
VerticalAlignment="Center" />
|
||||
</StackPanel>
|
||||
<StackPanel HorizontalAlignment="Left"
|
||||
Spacing="8"
|
||||
Orientation="Horizontal">
|
||||
<Image MaxWidth="24"
|
||||
MaxHeight="24"
|
||||
@@ -78,6 +81,7 @@
|
||||
VerticalAlignment="Center" />
|
||||
</StackPanel>
|
||||
<StackPanel HorizontalAlignment="Left"
|
||||
Spacing="8"
|
||||
Orientation="Horizontal">
|
||||
<Image MaxWidth="24"
|
||||
MaxHeight="24"
|
||||
@@ -104,6 +108,7 @@
|
||||
VerticalAlignment="Center" />
|
||||
</StackPanel>
|
||||
<StackPanel HorizontalAlignment="Left"
|
||||
Spacing="8"
|
||||
Orientation="Horizontal">
|
||||
<Image MaxWidth="24"
|
||||
MaxHeight="24"
|
||||
@@ -130,6 +135,7 @@
|
||||
VerticalAlignment="Center" />
|
||||
</StackPanel>
|
||||
<StackPanel HorizontalAlignment="Left"
|
||||
Spacing="8"
|
||||
Orientation="Horizontal">
|
||||
<Image MaxWidth="24"
|
||||
MaxHeight="24"
|
||||
|
||||
@@ -33,138 +33,137 @@
|
||||
mc:Ignorable="d"
|
||||
x:Class="RomRepoMgr.Views.UpdateStats"
|
||||
Icon="/Assets/avalonia-logo.ico"
|
||||
CanResize="False"
|
||||
Title="{x:Static resources:Localization.UpdateStatsTitle}"
|
||||
WindowStartupLocation="CenterOwner">
|
||||
<Design.DataContext>
|
||||
<vm:UpdateStatsViewModel />
|
||||
</Design.DataContext>
|
||||
<Border Padding="15">
|
||||
<Grid RowDefinitions="Auto,Auto,*,Auto">
|
||||
<TextBlock Grid.Row="0"
|
||||
Text="{Binding StatusMessage, Mode=OneWay}"
|
||||
HorizontalAlignment="Center" />
|
||||
<ProgressBar Grid.Row="1"
|
||||
IsIndeterminate="{Binding IndeterminateProgress, Mode=OneWay}"
|
||||
Maximum="{Binding MaximumValue, Mode=OneWay}"
|
||||
Minimum="{Binding MinimumValue, Mode=OneWay}"
|
||||
Value="{Binding CurrentValue, Mode=OneWay}"
|
||||
HorizontalAlignment="Stretch"
|
||||
IsVisible="{Binding ProgressVisible, Mode=OneWay}" />
|
||||
<DataGrid Grid.Row="2"
|
||||
ItemsSource="{Binding RomSets, Mode=OneWay}"
|
||||
HorizontalScrollBarVisibility="Visible"
|
||||
SelectedItem="{Binding SelectedRomSet, Mode=TwoWay}"
|
||||
CanUserSortColumns="True"
|
||||
CanUserResizeColumns="True">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Binding="{Binding Name, Mode=OneWay}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{x:Static resources:Localization.RomSetNameLabel}" />
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding Version, Mode=OneWay}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{x:Static resources:Localization.RomSetVersionLabel}" />
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding Author, Mode=OneWay}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{x:Static resources:Localization.RomSetAuthorLabel}" />
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding Category, Mode=OneWay}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{x:Static resources:Localization.RomSetCategoryLabel}" />
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding Date, Mode=OneWay}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{x:Static resources:Localization.RomSetDateLabel}" />
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding Description, Mode=OneWay}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{x:Static resources:Localization.RomSetDescriptionLabel}" />
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding Comment, Mode=OneWay}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{x:Static resources:Localization.RomSetCommentLabel}" />
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding Homepage, Mode=OneWay}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{x:Static resources:Localization.HomepageLabel}" />
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding TotalMachines, Mode=OneWay}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{x:Static resources:Localization.RomSetTotalMachinesLabel}" />
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding CompleteMachines, Mode=OneWay}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{x:Static resources:Localization.RomSetCompleteMachinesLabel}" />
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding IncompleteMachines, Mode=OneWay}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{x:Static resources:Localization.RomSetIncompleteMachinesLabel}" />
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding TotalRoms, Mode=OneWay}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{x:Static resources:Localization.RomSetTotalRomsLabel}" />
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding HaveRoms, Mode=OneWay}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{x:Static resources:Localization.RomSetHaveRomsLabel}" />
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding MissRoms, Mode=OneWay}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{x:Static resources:Localization.RomSetMissRomsLabel}" />
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
<Button Grid.Row="3"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
IsEnabled="{Binding CanClose, Mode=OneWay}"
|
||||
Command="{Binding CloseCommand, Mode=OneWay}">
|
||||
<TextBlock Text="{x:Static resources:Localization.CloseLabel}" />
|
||||
</Button>
|
||||
</Grid>
|
||||
</Border>
|
||||
<Grid RowDefinitions="Auto,Auto,*,Auto"
|
||||
Margin="16"
|
||||
RowSpacing="8">
|
||||
<TextBlock Grid.Row="0"
|
||||
Text="{Binding StatusMessage, Mode=OneWay}"
|
||||
HorizontalAlignment="Center" />
|
||||
<ProgressBar Grid.Row="1"
|
||||
IsIndeterminate="{Binding IndeterminateProgress, Mode=OneWay}"
|
||||
Maximum="{Binding MaximumValue, Mode=OneWay}"
|
||||
Minimum="{Binding MinimumValue, Mode=OneWay}"
|
||||
Value="{Binding CurrentValue, Mode=OneWay}"
|
||||
HorizontalAlignment="Stretch"
|
||||
IsVisible="{Binding ProgressVisible, Mode=OneWay}" />
|
||||
<DataGrid Grid.Row="2"
|
||||
ItemsSource="{Binding RomSets, Mode=OneWay}"
|
||||
HorizontalScrollBarVisibility="Visible"
|
||||
SelectedItem="{Binding SelectedRomSet, Mode=TwoWay}"
|
||||
CanUserSortColumns="True"
|
||||
CanUserResizeColumns="True">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Binding="{Binding Name, Mode=OneWay}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{x:Static resources:Localization.RomSetNameLabel}" />
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding Version, Mode=OneWay}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{x:Static resources:Localization.RomSetVersionLabel}" />
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding Author, Mode=OneWay}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{x:Static resources:Localization.RomSetAuthorLabel}" />
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding Category, Mode=OneWay}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{x:Static resources:Localization.RomSetCategoryLabel}" />
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding Date, Mode=OneWay}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{x:Static resources:Localization.RomSetDateLabel}" />
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding Description, Mode=OneWay}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{x:Static resources:Localization.RomSetDescriptionLabel}" />
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding Comment, Mode=OneWay}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{x:Static resources:Localization.RomSetCommentLabel}" />
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding Homepage, Mode=OneWay}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{x:Static resources:Localization.HomepageLabel}" />
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding TotalMachines, Mode=OneWay}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{x:Static resources:Localization.RomSetTotalMachinesLabel}" />
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding CompleteMachines, Mode=OneWay}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{x:Static resources:Localization.RomSetCompleteMachinesLabel}" />
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding IncompleteMachines, Mode=OneWay}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{x:Static resources:Localization.RomSetIncompleteMachinesLabel}" />
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding TotalRoms, Mode=OneWay}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{x:Static resources:Localization.RomSetTotalRomsLabel}" />
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding HaveRoms, Mode=OneWay}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{x:Static resources:Localization.RomSetHaveRomsLabel}" />
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding MissRoms, Mode=OneWay}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{x:Static resources:Localization.RomSetMissRomsLabel}" />
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
<Button Grid.Row="3"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
IsEnabled="{Binding CanClose, Mode=OneWay}"
|
||||
Command="{Binding CloseCommand, Mode=OneWay}">
|
||||
<TextBlock Text="{x:Static resources:Localization.CloseLabel}" />
|
||||
</Button>
|
||||
</Grid>
|
||||
</Window>
|
||||
Reference in New Issue
Block a user