Update for issue #33

This commit is contained in:
Michael J. Seiferling
2016-02-06 09:28:39 -06:00
parent 5947b7d0b2
commit abbc6a4a70
5 changed files with 25 additions and 12 deletions
+2 -9
View File
@@ -518,8 +518,7 @@ Public Class frmGameManager
Private Sub GetBackupInfo(ByVal oApp As clsGame)
Dim oBackupInfo As clsBackup
Dim sFileName As String
Dim oFileInfo As FileInfo
Dim dFileSize As Double
If oRemoteBackupData.Contains(oApp.Name) Then
CurrentBackupItem = DirectCast(oRemoteBackupData(oApp.Name), clsBackup)
@@ -532,13 +531,7 @@ Public Class frmGameManager
btnDeleteBackup.Enabled = True
If File.Exists(sFileName) Then
oFileInfo = New FileInfo(sFileName)
dFileSize = oFileInfo.Length
If dFileSize > 1048576 Then
txtFileSize.Text = mgrCommon.FormatString(App_MB, Math.Round(dFileSize / 1048576, 2).ToString)
Else
txtFileSize.Text = mgrCommon.FormatString(App_KB, Math.Round(dFileSize / 1024, 2).ToString)
End If
txtFileSize.Text = mgrCommon.GetFileSize(sFileName)
Else
txtFileSize.Text = frmGameManager_ErrorNoBackupExists
End If
+1 -1
View File
@@ -186,7 +186,7 @@ Public Class mgrBackup
prs7z.WaitForExit()
If Not CancelOperation Then
If prs7z.ExitCode = 0 Then
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrBackup_BackupComplete, oGame.Name), False, ToolTipIcon.Info, True)
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrBackup_BackupComplete, New String() {oGame.Name, mgrCommon.GetFileSize(sBackupFile)}), False, ToolTipIcon.Info, True)
bBackupCompleted = True
Else
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrBackup_BackupWarnings, oGame.Name), True, ToolTipIcon.Warning, True)
+20
View File
@@ -142,6 +142,26 @@ Public Class mgrCommon
End Try
End Sub
'Get a file size
Public Shared Function GetFileSize(ByVal sFile As String) As String
Dim oFileInfo As FileInfo
Dim dFileSize As Double
Try
oFileInfo = New FileInfo(sFile)
dFileSize = oFileInfo.Length
If dFileSize > 1048576 Then
Return FormatString(App_MB, Math.Round(dFileSize / 1048576, 2).ToString)
Else
Return FormatString(App_KB, Math.Round(dFileSize / 1024, 2).ToString)
End If
Catch ex As Exception
Return String.Empty
End Try
End Function
'Handles no extra parameters
Public Shared Function ShowMessage(ByVal sMsg As String, ByVal oType As MsgBoxStyle) As MsgBoxResult
Dim oResult As MsgBoxResult
+1 -1
View File
@@ -3737,7 +3737,7 @@ Namespace My.Resources
End Property
'''<summary>
''' Looks up a localized string similar to [PARAM] backup completed..
''' Looks up a localized string similar to [PARAM] backup ([PARAM]) completed. .
'''</summary>
Friend ReadOnly Property mgrBackup_BackupComplete() As String
Get
+1 -1
View File
@@ -1313,7 +1313,7 @@
<value>[PARAM] backup failed</value>
</data>
<data name="mgrBackup_BackupComplete" xml:space="preserve">
<value>[PARAM] backup completed.</value>
<value>[PARAM] backup ([PARAM]) completed. </value>
</data>
<data name="mgrBackup_BackupInProgress" xml:space="preserve">
<value>Backup of [PARAM] in progress...</value>