Reworked notifications
This commit is contained in:
+11
-9
@@ -599,7 +599,7 @@ Public Class frmMain
|
|||||||
frm.Settings = oSettings
|
frm.Settings = oSettings
|
||||||
PauseScan()
|
PauseScan()
|
||||||
frm.ShowDialog()
|
frm.ShowDialog()
|
||||||
LoadSettings()
|
LoadAndVerify()
|
||||||
bFirstRun = False
|
bFirstRun = False
|
||||||
ResumeScan()
|
ResumeScan()
|
||||||
End Sub
|
End Sub
|
||||||
@@ -670,7 +670,14 @@ Public Class frmMain
|
|||||||
oRemoteDatabase.DatabaseUpgrade()
|
oRemoteDatabase.DatabaseUpgrade()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub LoadSettings()
|
Private Sub LoadAndVerify()
|
||||||
|
|
||||||
|
'The application cannot continue if this fails
|
||||||
|
If Not oBackup.CheckForUtilities(mgrPath.Utility7zLocation) Then
|
||||||
|
MsgBox("7-Zip was not found in the Game Backup Monitor utilities folder. The application cannot continue.", MsgBoxStyle.Critical, "Game Backup Monitor")
|
||||||
|
bShutdown = True
|
||||||
|
Me.Close()
|
||||||
|
End If
|
||||||
|
|
||||||
'Local Database Check
|
'Local Database Check
|
||||||
VerifyDBVersion(mgrSQLite.Database.Local)
|
VerifyDBVersion(mgrSQLite.Database.Local)
|
||||||
@@ -700,15 +707,10 @@ Public Class frmMain
|
|||||||
'Load Game Settings
|
'Load Game Settings
|
||||||
LoadGameSettings()
|
LoadGameSettings()
|
||||||
|
|
||||||
'Check for utilities
|
|
||||||
If Not oBackup.CheckForUtilities(mgrPath.Utility7zLocation) Then
|
|
||||||
UpdateLog("The correct version of 7-Zip was not found! Please re-install GBM, you may experience an application crash if a backup or restore is performed.", True, ToolTipIcon.Error)
|
|
||||||
End If
|
|
||||||
|
|
||||||
'Verify the "Start with Windows" setting
|
'Verify the "Start with Windows" setting
|
||||||
If oSettings.StartWithWindows Then
|
If oSettings.StartWithWindows Then
|
||||||
If Not VerifyStartWithWindows() Then
|
If Not VerifyStartWithWindows() Then
|
||||||
UpdateLog("GBM is running from a new location, the Windows startup entry has been updated.", True, ToolTipIcon.Info)
|
UpdateLog("GBM is running from a new location, the Windows startup entry has been updated.", False, ToolTipIcon.Info)
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -1376,7 +1378,7 @@ Public Class frmMain
|
|||||||
Private Sub Main_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
|
Private Sub Main_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
|
||||||
SetForm()
|
SetForm()
|
||||||
VerifyGameDataPath()
|
VerifyGameDataPath()
|
||||||
LoadSettings()
|
LoadAndVerify()
|
||||||
VerifyCustomPathVariables()
|
VerifyCustomPathVariables()
|
||||||
|
|
||||||
If oSettings.StartToTray Then
|
If oSettings.StartToTray Then
|
||||||
|
|||||||
@@ -173,11 +173,11 @@ Public Class mgrBackup
|
|||||||
prs7z.StartInfo.RedirectStandardOutput = True
|
prs7z.StartInfo.RedirectStandardOutput = True
|
||||||
prs7z.StartInfo.CreateNoWindow = True
|
prs7z.StartInfo.CreateNoWindow = True
|
||||||
prs7z.Start()
|
prs7z.Start()
|
||||||
RaiseEvent UpdateLog("Backup of " & sSavePath & " in progress...", True, ToolTipIcon.Info, True)
|
RaiseEvent UpdateLog("Backup of " & sSavePath & " in progress...", False, ToolTipIcon.Info, True)
|
||||||
While Not prs7z.StandardOutput.EndOfStream
|
While Not prs7z.StandardOutput.EndOfStream
|
||||||
If CancelOperation Then
|
If CancelOperation Then
|
||||||
prs7z.Kill()
|
prs7z.Kill()
|
||||||
RaiseEvent UpdateLog("Backup Aborted by user. The backup file for " & oGame.Name & " will be unusable.", False, ToolTipIcon.Error, True)
|
RaiseEvent UpdateLog("Backup Aborted. The backup file for " & oGame.Name & " will be unusable.", True, ToolTipIcon.Error, True)
|
||||||
Exit While
|
Exit While
|
||||||
End If
|
End If
|
||||||
RaiseEvent UpdateLog(prs7z.StandardOutput.ReadLine, False, ToolTipIcon.Info, False)
|
RaiseEvent UpdateLog(prs7z.StandardOutput.ReadLine, False, ToolTipIcon.Info, False)
|
||||||
@@ -188,13 +188,13 @@ Public Class mgrBackup
|
|||||||
RaiseEvent UpdateLog(oGame.Name & " backup completed.", False, ToolTipIcon.Info, True)
|
RaiseEvent UpdateLog(oGame.Name & " backup completed.", False, ToolTipIcon.Info, True)
|
||||||
bBackupCompleted = True
|
bBackupCompleted = True
|
||||||
Else
|
Else
|
||||||
RaiseEvent UpdateLog(oGame.Name & " backup operation finished with warnings or errors.", False, ToolTipIcon.Error, True)
|
RaiseEvent UpdateLog(oGame.Name & " backup finished with warnings or errors.", True, ToolTipIcon.Warning, True)
|
||||||
bBackupCompleted = False
|
bBackupCompleted = False
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
prs7z.Dispose()
|
prs7z.Dispose()
|
||||||
Else
|
Else
|
||||||
RaiseEvent UpdateLog("Backup Aborted. The path " & sSavePath & " for " & oGame.Name & " does not exist.", False, ToolTipIcon.Error, True)
|
RaiseEvent UpdateLog("Backup Aborted. The saved game path for " & oGame.Name & " does not exist.", True, ToolTipIcon.Error, True)
|
||||||
bBackupCompleted = False
|
bBackupCompleted = False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -206,7 +206,7 @@ Public Class mgrBackup
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If Not DoManifestUpdate(oGame, sBackupFile, dTimeStamp, sHash) Then
|
If Not DoManifestUpdate(oGame, sBackupFile, dTimeStamp, sHash) Then
|
||||||
RaiseEvent UpdateLog("The manifest update for " & oGame.Name & " failed.", False, ToolTipIcon.Error, True)
|
RaiseEvent UpdateLog("The manifest update for " & oGame.Name & " failed.", True, ToolTipIcon.Error, True)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'Write the process path if we have it
|
'Write the process path if we have it
|
||||||
@@ -215,7 +215,7 @@ Public Class mgrBackup
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
RaiseEvent UpdateLog("An unexpected error occured during the backup process of " & oGame.Name & vbCrLf & ex.Message, False, ToolTipIcon.Error, True)
|
RaiseEvent UpdateLog("An unexpected error occured during the backup of " & oGame.Name & vbCrLf & ex.Message, False, ToolTipIcon.Error, True)
|
||||||
End Try
|
End Try
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|||||||
@@ -208,11 +208,11 @@ Public Class mgrRestore
|
|||||||
prs7z.StartInfo.RedirectStandardOutput = True
|
prs7z.StartInfo.RedirectStandardOutput = True
|
||||||
prs7z.StartInfo.CreateNoWindow = True
|
prs7z.StartInfo.CreateNoWindow = True
|
||||||
prs7z.Start()
|
prs7z.Start()
|
||||||
RaiseEvent UpdateLog("Restore to " & sExtractPath & " in progress...", True, ToolTipIcon.Info, True)
|
RaiseEvent UpdateLog("Restore to " & sExtractPath & " in progress...", False, ToolTipIcon.Info, True)
|
||||||
While Not prs7z.StandardOutput.EndOfStream
|
While Not prs7z.StandardOutput.EndOfStream
|
||||||
If CancelOperation Then
|
If CancelOperation Then
|
||||||
prs7z.Kill()
|
prs7z.Kill()
|
||||||
RaiseEvent UpdateLog("Restored Aborted by user. The save games for " & oBackupInfo.Name & " will be damaged or invalid.", False, ToolTipIcon.Error, True)
|
RaiseEvent UpdateLog("Restored Aborted. The saved games for " & oBackupInfo.Name & " may now be invalid.", True, ToolTipIcon.Error, True)
|
||||||
Exit While
|
Exit While
|
||||||
End If
|
End If
|
||||||
RaiseEvent UpdateLog(prs7z.StandardOutput.ReadLine, False, ToolTipIcon.Info, False)
|
RaiseEvent UpdateLog(prs7z.StandardOutput.ReadLine, False, ToolTipIcon.Info, False)
|
||||||
@@ -220,16 +220,16 @@ Public Class mgrRestore
|
|||||||
prs7z.WaitForExit()
|
prs7z.WaitForExit()
|
||||||
If Not CancelOperation Then
|
If Not CancelOperation Then
|
||||||
If prs7z.ExitCode = 0 Then
|
If prs7z.ExitCode = 0 Then
|
||||||
RaiseEvent UpdateLog(oBackupInfo.Name & " backup restored.", True, ToolTipIcon.Info, True)
|
RaiseEvent UpdateLog(oBackupInfo.Name & " backup restored.", False, ToolTipIcon.Info, True)
|
||||||
bRestoreCompleted = True
|
bRestoreCompleted = True
|
||||||
Else
|
Else
|
||||||
RaiseEvent UpdateLog(oBackupInfo.Name & " restore operation finished with warnings or errors.", False, ToolTipIcon.Info, True)
|
RaiseEvent UpdateLog(oBackupInfo.Name & " restore finished with warnings or errors.", True, ToolTipIcon.Warning, True)
|
||||||
bRestoreCompleted = False
|
bRestoreCompleted = False
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
prs7z.Dispose()
|
prs7z.Dispose()
|
||||||
Else
|
Else
|
||||||
RaiseEvent UpdateLog("Restore Aborted. The backup file could not be found. Ensure the backup location is available.", False, ToolTipIcon.Error, True)
|
RaiseEvent UpdateLog("Restore Aborted. The backup file could not be found.", True, ToolTipIcon.Error, True)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If bRestoreCompleted Then
|
If bRestoreCompleted Then
|
||||||
|
|||||||
Reference in New Issue
Block a user