mirror of
https://github.com/stuff-by-3-random-dudes/UWUVCI-AIO-WPF
synced 2024-11-21 18:43:02 +00:00
Added some motion on the screen if the ETA hits 0 so the user knows it didn't freeze
This commit is contained in:
parent
c9e35070cf
commit
504fcad235
1 changed files with 22 additions and 5 deletions
|
@ -13,6 +13,7 @@ namespace UWUVCI_AIO_WPF.UI.Windows
|
|||
MainViewModel mvm;
|
||||
DispatcherTimer timer = new DispatcherTimer();
|
||||
private TimeSpan remainingTime;
|
||||
private int motion = 1;
|
||||
public DownloadWait(string doing, string msg, MainViewModel mvm)
|
||||
{
|
||||
try
|
||||
|
@ -98,17 +99,33 @@ namespace UWUVCI_AIO_WPF.UI.Windows
|
|||
// Check if remainingTime has been initialized (i.e., not zero)
|
||||
if (remainingTime != TimeSpan.Zero)
|
||||
{
|
||||
msgT.Text += $"\nEstimated time remaining: {remainingTime.Minutes} minutes {remainingTime.Seconds} seconds";
|
||||
|
||||
if (remainingTime.TotalSeconds > 0)
|
||||
{
|
||||
msgT.Text += $"Estimated time remaining: {remainingTime.Minutes} minutes {remainingTime.Seconds} seconds";
|
||||
remainingTime = remainingTime.Add(TimeSpan.FromSeconds(-1));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
msgT.Text += $"Completing download, eta not available";
|
||||
|
||||
if (mvm.Progress < 70)
|
||||
if (motion == 6)
|
||||
motion = 1;
|
||||
|
||||
for (var i = 0; i < motion; i++)
|
||||
msgT.Text += ".";
|
||||
|
||||
|
||||
motion++;
|
||||
}
|
||||
if (mvm.Progress < 95)
|
||||
mvm.Progress += 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
mvm.Progress += 1;
|
||||
if (mvm.Progress < 75)
|
||||
{
|
||||
mvm.Progress += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(mvm.Progress == 100)
|
||||
|
|
Loading…
Reference in a new issue