mirror of
https://github.com/claunia/romrepomgr.git
synced 2025-12-16 11:14:45 +00:00
Hide progress when ROM is imported (reduces RAM usage).
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Avalonia.Media;
|
||||
using ReactiveUI;
|
||||
using RomRepoMgr.Core.EventArgs;
|
||||
@@ -12,6 +11,7 @@ public class RomImporter : ReactiveObject
|
||||
double _maximum;
|
||||
double _minimum;
|
||||
double _progress;
|
||||
bool _progressVisible = true;
|
||||
Color _statusColor;
|
||||
string _statusMessage;
|
||||
public string Filename { get; internal init; }
|
||||
@@ -53,6 +53,12 @@ public class RomImporter : ReactiveObject
|
||||
set => this.RaiseAndSetIfChanged(ref _statusColor, value);
|
||||
}
|
||||
|
||||
public bool ProgressVisible
|
||||
{
|
||||
get => _progressVisible;
|
||||
set => this.RaiseAndSetIfChanged(ref _progressVisible, value);
|
||||
}
|
||||
|
||||
internal void OnErrorOccurred(object sender, ErrorEventArgs e)
|
||||
{
|
||||
StatusMessage = e.Message;
|
||||
@@ -88,21 +94,23 @@ public class RomImporter : ReactiveObject
|
||||
|
||||
internal void OnWorkFinished(object sender, MessageEventArgs e)
|
||||
{
|
||||
Indeterminate = false;
|
||||
Maximum = 1;
|
||||
Minimum = 0;
|
||||
Progress = 1;
|
||||
StatusMessage = e.Message;
|
||||
Running = false;
|
||||
Indeterminate = false;
|
||||
Maximum = 1;
|
||||
Minimum = 0;
|
||||
Progress = 1;
|
||||
StatusMessage = e.Message;
|
||||
Running = false;
|
||||
ProgressVisible = false;
|
||||
}
|
||||
|
||||
public void OnImportedRom(object sender, ImportedRomItemEventArgs e)
|
||||
{
|
||||
Indeterminate = false;
|
||||
Maximum = 1;
|
||||
Minimum = 0;
|
||||
Progress = 1;
|
||||
StatusMessage = e.Item.Status;
|
||||
Running = false;
|
||||
Indeterminate = false;
|
||||
Maximum = 1;
|
||||
Minimum = 0;
|
||||
Progress = 1;
|
||||
StatusMessage = e.Item.Status;
|
||||
Running = false;
|
||||
ProgressVisible = false;
|
||||
}
|
||||
}
|
||||
@@ -105,7 +105,8 @@
|
||||
<ProgressBar Minimum="{Binding Minimum, Mode=OneWay}"
|
||||
Maximum="{Binding Maximum, Mode=OneWay}"
|
||||
Value="{Binding Progress, Mode=OneWay}"
|
||||
IsIndeterminate="{Binding Indeterminate, Mode=OneWay}" />
|
||||
IsIndeterminate="{Binding Indeterminate, Mode=OneWay}"
|
||||
IsVisible="{Binding ProgressVisible, Mode=OneWay}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
||||
Reference in New Issue
Block a user