Update for issue #33
This commit is contained in:
@@ -518,8 +518,7 @@ Public Class frmGameManager
|
|||||||
Private Sub GetBackupInfo(ByVal oApp As clsGame)
|
Private Sub GetBackupInfo(ByVal oApp As clsGame)
|
||||||
Dim oBackupInfo As clsBackup
|
Dim oBackupInfo As clsBackup
|
||||||
Dim sFileName As String
|
Dim sFileName As String
|
||||||
Dim oFileInfo As FileInfo
|
|
||||||
Dim dFileSize As Double
|
|
||||||
|
|
||||||
If oRemoteBackupData.Contains(oApp.Name) Then
|
If oRemoteBackupData.Contains(oApp.Name) Then
|
||||||
CurrentBackupItem = DirectCast(oRemoteBackupData(oApp.Name), clsBackup)
|
CurrentBackupItem = DirectCast(oRemoteBackupData(oApp.Name), clsBackup)
|
||||||
@@ -532,13 +531,7 @@ Public Class frmGameManager
|
|||||||
btnDeleteBackup.Enabled = True
|
btnDeleteBackup.Enabled = True
|
||||||
|
|
||||||
If File.Exists(sFileName) Then
|
If File.Exists(sFileName) Then
|
||||||
oFileInfo = New FileInfo(sFileName)
|
txtFileSize.Text = mgrCommon.GetFileSize(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
|
|
||||||
Else
|
Else
|
||||||
txtFileSize.Text = frmGameManager_ErrorNoBackupExists
|
txtFileSize.Text = frmGameManager_ErrorNoBackupExists
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -186,7 +186,7 @@ Public Class mgrBackup
|
|||||||
prs7z.WaitForExit()
|
prs7z.WaitForExit()
|
||||||
If Not CancelOperation Then
|
If Not CancelOperation Then
|
||||||
If prs7z.ExitCode = 0 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
|
bBackupCompleted = True
|
||||||
Else
|
Else
|
||||||
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrBackup_BackupWarnings, oGame.Name), True, ToolTipIcon.Warning, True)
|
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrBackup_BackupWarnings, oGame.Name), True, ToolTipIcon.Warning, True)
|
||||||
|
|||||||
@@ -142,6 +142,26 @@ Public Class mgrCommon
|
|||||||
End Try
|
End Try
|
||||||
End Sub
|
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
|
'Handles no extra parameters
|
||||||
Public Shared Function ShowMessage(ByVal sMsg As String, ByVal oType As MsgBoxStyle) As MsgBoxResult
|
Public Shared Function ShowMessage(ByVal sMsg As String, ByVal oType As MsgBoxStyle) As MsgBoxResult
|
||||||
Dim oResult As MsgBoxResult
|
Dim oResult As MsgBoxResult
|
||||||
|
|||||||
Generated
+1
-1
@@ -3737,7 +3737,7 @@ Namespace My.Resources
|
|||||||
End Property
|
End Property
|
||||||
|
|
||||||
'''<summary>
|
'''<summary>
|
||||||
''' Looks up a localized string similar to [PARAM] backup completed..
|
''' Looks up a localized string similar to [PARAM] backup ([PARAM]) completed. .
|
||||||
'''</summary>
|
'''</summary>
|
||||||
Friend ReadOnly Property mgrBackup_BackupComplete() As String
|
Friend ReadOnly Property mgrBackup_BackupComplete() As String
|
||||||
Get
|
Get
|
||||||
|
|||||||
@@ -1313,7 +1313,7 @@
|
|||||||
<value>[PARAM] backup failed</value>
|
<value>[PARAM] backup failed</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="mgrBackup_BackupComplete" xml:space="preserve">
|
<data name="mgrBackup_BackupComplete" xml:space="preserve">
|
||||||
<value>[PARAM] backup completed.</value>
|
<value>[PARAM] backup ([PARAM]) completed. </value>
|
||||||
</data>
|
</data>
|
||||||
<data name="mgrBackup_BackupInProgress" xml:space="preserve">
|
<data name="mgrBackup_BackupInProgress" xml:space="preserve">
|
||||||
<value>Backup of [PARAM] in progress...</value>
|
<value>Backup of [PARAM] in progress...</value>
|
||||||
|
|||||||
Reference in New Issue
Block a user