Corrected progress bars when value is outside of int bounds.

This commit is contained in:
2017-06-20 07:28:16 +01:00
parent aca0225095
commit 7c0adfa198
4 changed files with 75 additions and 0 deletions

View File

@@ -1,3 +1,8 @@
* dlgAdd.xeto.cs:
* frmMain.xeto.cs:
* dlgMetadata.xeto.cs:
Corrected progress bars when value is outside of int bounds.
* dlgMetadata.xeto:
* dlgMetadata.xeto.cs:
* dlgOpticalDisc.xeto:

View File

@@ -588,6 +588,13 @@ namespace osrepodbmgr.Eto
lblProgress.Text = text;
if(maximum > 0)
{
if(current < int.MinValue || current > int.MaxValue ||
maximum < int.MinValue || maximum > int.MaxValue)
{
current /= 100;
maximum /= 100;
}
prgProgress.Indeterminate = false;
prgProgress.MinValue = 0;
prgProgress.MaxValue = (int)maximum;
@@ -610,6 +617,13 @@ namespace osrepodbmgr.Eto
lblProgress2.Text = text;
if(maximum > 0)
{
if(current < int.MinValue || current > int.MaxValue ||
maximum < int.MinValue || maximum > int.MaxValue)
{
current /= 100;
maximum /= 100;
}
prgProgress2.Indeterminate = false;
prgProgress2.MinValue = 0;
prgProgress2.MaxValue = (int)maximum;

View File

@@ -688,6 +688,13 @@ namespace osrepodbmgr.Eto
lblAddDisc1.Text = text;
if(maximum > 0)
{
if(current < int.MinValue || current > int.MaxValue ||
maximum < int.MinValue || maximum > int.MaxValue)
{
current /= 100;
maximum /= 100;
}
prgAddDisc1.Indeterminate = false;
prgAddDisc1.MinValue = 0;
prgAddDisc1.MaxValue = (int)maximum;
@@ -708,6 +715,13 @@ namespace osrepodbmgr.Eto
lblAddDisc2.Text = text;
if(maximum > 0)
{
if(current < int.MinValue || current > int.MaxValue ||
maximum < int.MinValue || maximum > int.MaxValue)
{
current /= 100;
maximum /= 100;
}
prgAddDisc2.Indeterminate = false;
prgAddDisc2.MinValue = 0;
prgAddDisc2.MaxValue = (int)maximum;
@@ -912,6 +926,13 @@ namespace osrepodbmgr.Eto
lblAddDisk1.Text = text;
if(maximum > 0)
{
if(current < int.MinValue || current > int.MaxValue ||
maximum < int.MinValue || maximum > int.MaxValue)
{
current /= 100;
maximum /= 100;
}
prgAddDisk1.Indeterminate = false;
prgAddDisk1.MinValue = 0;
prgAddDisk1.MaxValue = (int)maximum;
@@ -932,6 +953,13 @@ namespace osrepodbmgr.Eto
lblAddDisk2.Text = text;
if(maximum > 0)
{
if(current < int.MinValue || current > int.MaxValue ||
maximum < int.MinValue || maximum > int.MaxValue)
{
current /= 100;
maximum /= 100;
}
prgAddDisk2.Indeterminate = false;
prgAddDisk2.MinValue = 0;
prgAddDisk2.MaxValue = (int)maximum;

View File

@@ -295,6 +295,13 @@ namespace osrepodbmgr.Eto
lblProgress.Text = text;
if(maximum > 0)
{
if(current < int.MinValue || current > int.MaxValue ||
maximum < int.MinValue || maximum > int.MaxValue)
{
current /= 100;
maximum /= 100;
}
prgProgress.Indeterminate = false;
prgProgress.MinValue = 0;
prgProgress.MaxValue = (int)maximum;
@@ -317,6 +324,13 @@ namespace osrepodbmgr.Eto
lblProgress2.Text = text;
if(maximum > 0)
{
if(current < int.MinValue || current > int.MaxValue ||
maximum < int.MinValue || maximum > int.MaxValue)
{
current /= 100;
maximum /= 100;
}
prgProgress2.Indeterminate = false;
prgProgress2.MinValue = 0;
prgProgress2.MaxValue = (int)maximum;
@@ -858,6 +872,13 @@ namespace osrepodbmgr.Eto
lblProgressFiles1.Text = text;
if(maximum > 0)
{
if(current < int.MinValue || current > int.MaxValue ||
maximum < int.MinValue || maximum > int.MaxValue)
{
current /= 100;
maximum /= 100;
}
prgProgressFiles1.Indeterminate = false;
prgProgressFiles1.MinValue = 0;
prgProgressFiles1.MaxValue = (int)maximum;
@@ -880,6 +901,13 @@ namespace osrepodbmgr.Eto
lblProgressFiles2.Text = text;
if(maximum > 0)
{
if(current < int.MinValue || current > int.MaxValue ||
maximum < int.MinValue || maximum > int.MaxValue)
{
current /= 100;
maximum /= 100;
}
prgProgressFiles2.Indeterminate = false;
prgProgressFiles2.MinValue = 0;
prgProgressFiles2.MaxValue = (int)maximum;