Added common message box function

This commit is contained in:
Michael J. Seiferling
2015-12-18 12:16:09 -06:00
parent 50cb987e9a
commit 8930f6d6cc
17 changed files with 114 additions and 108 deletions
+8 -8
View File
@@ -202,15 +202,15 @@ Public Class frmAddWizard
Next Next
If hshDupeCheck.Contains(sNewGame) Then If hshDupeCheck.Contains(sNewGame) Then
MsgBox("A game with this exact name and process already exists.", MsgBoxStyle.Exclamation, "Game Backup Monitor") mgrCommon.ShowMessage("A game with this exact name and process already exists.", MsgBoxStyle.Exclamation)
Else Else
mgrMonitorList.DoListAdd(oGameToSave) mgrMonitorList.DoListAdd(oGameToSave)
If MsgBox(oGameToSave.Name & " has been saved." & vbCrLf & vbCrLf & If mgrCommon.ShowMessage(oGameToSave.Name & " has been saved." & vbCrLf & vbCrLf &
"Would you like to add tags for " & oGameToSave.Name & "?", MsgBoxStyle.YesNo, "Game Backup Monitor") = MsgBoxResult.Yes Then "Would you like to add tags for " & oGameToSave.Name & "?", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
OpenTags(oGameToSave) OpenTags(oGameToSave)
End If End If
Me.Close() Me.Close()
End If End If
End Sub End Sub
Private Sub ValidateBack() Private Sub ValidateBack()
@@ -286,7 +286,7 @@ Public Class frmAddWizard
DoSave() DoSave()
End Select End Select
If bError Then MsgBox(sErrorMessage, MsgBoxStyle.Exclamation, "Game Backup Monitor") If bError Then mgrCommon.ShowMessage(sErrorMessage, MsgBoxStyle.Exclamation)
StepHandler() StepHandler()
End Sub End Sub
@@ -330,14 +330,14 @@ Public Class frmAddWizard
ReadShortcut(sTemp) ReadShortcut(sTemp)
File.Delete(sTemp) File.Delete(sTemp)
Catch e2 As Exception Catch e2 As Exception
MsgBox("An error occured working with the shortcut file." & vbCrLf & vbCrLf & e2.Message, MsgBoxStyle.Critical, "Game Backup Monitor") mgrCommon.ShowMessage("An error occured working with the shortcut file." & vbCrLf & vbCrLf & e2.Message, MsgBoxStyle.Critical)
End Try End Try
Else Else
MsgBox("An error occured reading the shortcut file." & vbCrLf & vbCrLf & e1.Message, MsgBoxStyle.Critical, "Game Backup Monitor") mgrCommon.ShowMessage("An error occured reading the shortcut file." & vbCrLf & vbCrLf & e1.Message, MsgBoxStyle.Critical)
End If End If
End Try End Try
Else Else
MsgBox("This file is not a shorcut.") mgrCommon.ShowMessage("This file is not a shorcut.", MsgBoxStyle.Information)
End If End If
End Sub End Sub
+2 -2
View File
@@ -135,9 +135,9 @@ Public Class frmFileFolderSearch
If FoundItem = "Cancel" Then FoundItem = String.Empty If FoundItem = "Cancel" Then FoundItem = String.Empty
If oDrives.Count > iCurrentDrive And FoundItem = String.Empty Then If oDrives.Count > iCurrentDrive And FoundItem = String.Empty Then
oResult = MsgBox("The location was not found on the " & oSearchDrive.Root.ToString & _ oResult = mgrCommon.ShowMessage("The location was not found on the " & oSearchDrive.Root.ToString & _
" drive. Do you wish to search the " & oDrives(iCurrentDrive).RootDirectory.ToString & _ " drive. Do you wish to search the " & oDrives(iCurrentDrive).RootDirectory.ToString & _
" drive?", MsgBoxStyle.YesNo, "Game Backup Monitor") " drive?", MsgBoxStyle.YesNo)
If oResult = MsgBoxResult.Yes Then If oResult = MsgBoxResult.Yes Then
Search(oDrives(iCurrentDrive)) Search(oDrives(iCurrentDrive))
Else Else
+21 -21
View File
@@ -349,7 +349,7 @@ Public Class frmGameManager
Private Function HandleDirty() As MsgBoxResult Private Function HandleDirty() As MsgBoxResult
Dim oResult As MsgBoxResult Dim oResult As MsgBoxResult
oResult = MsgBox("There are unsaved changes on this form. Do you want to save?", MsgBoxStyle.YesNoCancel, "Game Backup Monitor") oResult = mgrCommon.ShowMessage("There are unsaved changes on this form. Do you want to save?", MsgBoxStyle.YesNoCancel)
Select Case oResult Select Case oResult
Case MsgBoxResult.Yes Case MsgBoxResult.Yes
@@ -393,7 +393,7 @@ Public Class frmGameManager
If File.Exists(sFileName) Then If File.Exists(sFileName) Then
Process.Start("explorer.exe", "/select," & sFileName) Process.Start("explorer.exe", "/select," & sFileName)
Else Else
MsgBox("The backup file does not exist.", MsgBoxStyle.Exclamation, "Game Backup Monitor") mgrCommon.ShowMessage("The backup file does not exist.", MsgBoxStyle.Exclamation)
End If End If
End Sub End Sub
@@ -482,7 +482,7 @@ Public Class frmGameManager
If Directory.Exists(sPath) Then If Directory.Exists(sPath) Then
Process.Start("explorer.exe", sPath) Process.Start("explorer.exe", sPath)
Else Else
MsgBox("The restore path does not exist.", MsgBoxStyle.Exclamation, "Game Backup Monitor") mgrCommon.ShowMessage("The restore path does not exist.", MsgBoxStyle.Exclamation)
End If End If
End Sub End Sub
@@ -583,8 +583,8 @@ Public Class frmGameManager
Dim oDir As DirectoryInfo Dim oDir As DirectoryInfo
Dim sSubDir As String Dim sSubDir As String
If MsgBox("This will delete the backup file and all records of this backup. This cannot be undone. " & vbCrLf & vbCrLf & "Do you want to remove the data for " _ If mgrCommon.ShowMessage("This will delete the backup file and all records of this backup. This cannot be undone. " & vbCrLf & vbCrLf & "Do you want to remove the data for " _
& CurrentBackupItem.Name & "?", MsgBoxStyle.YesNo, "Game Backup Monitor") = MsgBoxResult.Yes Then & CurrentBackupItem.Name & "?", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
mgrManifest.DoManifestDelete(CurrentBackupItem, mgrSQLite.Database.Local) mgrManifest.DoManifestDelete(CurrentBackupItem, mgrSQLite.Database.Local)
mgrManifest.DoManifestDelete(CurrentBackupItem, mgrSQLite.Database.Remote) mgrManifest.DoManifestDelete(CurrentBackupItem, mgrSQLite.Database.Remote)
@@ -601,9 +601,9 @@ Public Class frmGameManager
oDir = New DirectoryInfo(sSubDir) oDir = New DirectoryInfo(sSubDir)
If oDir.GetDirectories.Length > 0 Or oDir.GetFiles.Length > 0 Then If oDir.GetDirectories.Length > 0 Or oDir.GetFiles.Length > 0 Then
'Confirm 'Confirm
If MsgBox("The backup folder " & sSubDir & " still contains " & oDir.GetDirectories.Length & " directories and " & If mgrCommon.ShowMessage("The backup folder " & sSubDir & " still contains " & oDir.GetDirectories.Length & " directories and " &
oDir.GetFiles.Length & " files." & vbCrLf & vbCrLf & "Do you want to delete the contents and remove the sub-folder for this game?", oDir.GetFiles.Length & " files." & vbCrLf & vbCrLf & "Do you want to delete the contents and remove the sub-folder for this game?",
MsgBoxStyle.YesNo, "Game Backup Monitor") = MsgBoxResult.Yes Then MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
If Directory.Exists(sSubDir) Then Directory.Delete(sSubDir, True) If Directory.Exists(sSubDir) Then Directory.Delete(sSubDir, True)
End If End If
Else Else
@@ -982,7 +982,7 @@ Public Class frmGameManager
Next Next
sChanges = vbCrLf & vbCrLf & "Monitor this game: " & mgrCommon.BooleanYesNo(oApp.Enabled) & vbCrLf & "Monitor only (No backup): " & mgrCommon.BooleanYesNo(oApp.MonitorOnly) sChanges = vbCrLf & vbCrLf & "Monitor this game: " & mgrCommon.BooleanYesNo(oApp.Enabled) & vbCrLf & "Monitor only (No backup): " & mgrCommon.BooleanYesNo(oApp.MonitorOnly)
If MsgBox("Are you sure you want to save the following changes to " & sMonitorIDs.Count & " selected games?" & sChanges, MsgBoxStyle.YesNo, "Game Backup Monitor") = MsgBoxResult.Yes Then If mgrCommon.ShowMessage("Are you sure you want to save the following changes to " & sMonitorIDs.Count & " selected games?" & sChanges, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
bSuccess = True bSuccess = True
mgrMonitorList.DoListUpdateMulti(sMonitorIDs, oApp) mgrMonitorList.DoListUpdateMulti(sMonitorIDs, oApp)
eCurrentMode = eModes.Disabled eCurrentMode = eModes.Disabled
@@ -1008,7 +1008,7 @@ Public Class frmGameManager
oData = lstGames.SelectedItems(0) oData = lstGames.SelectedItems(0)
oApp = DirectCast(AppData(oData.Key), clsGame) oApp = DirectCast(AppData(oData.Key), clsGame)
If MsgBox("Are you sure you want to delete " & oApp.Name & "? This cannot be undone." & vbCrLf & vbCrLf & "This will not delete any backup files that already exist for this game.", MsgBoxStyle.YesNo, "Game Backup Monitor") = MsgBoxResult.Yes Then If mgrCommon.ShowMessage("Are you sure you want to delete " & oApp.Name & "? This cannot be undone." & vbCrLf & vbCrLf & "This will not delete any backup files that already exist for this game.", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
mgrMonitorList.DoListDelete(oApp.ID) mgrMonitorList.DoListDelete(oApp.ID)
LoadData() LoadData()
eCurrentMode = eModes.Disabled eCurrentMode = eModes.Disabled
@@ -1022,7 +1022,7 @@ Public Class frmGameManager
sMonitorIDs.Add(oApp.ID) sMonitorIDs.Add(oApp.ID)
Next Next
If MsgBox("Are you sure you want to delete the " & sMonitorIDs.Count & " selected games? This cannot be undone.", MsgBoxStyle.YesNo, "Game Backup Monitor") = MsgBoxResult.Yes Then If mgrCommon.ShowMessage("Are you sure you want to delete the " & sMonitorIDs.Count & " selected games? This cannot be undone.", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
mgrMonitorList.DoListDeleteMulti(sMonitorIDs) mgrMonitorList.DoListDeleteMulti(sMonitorIDs)
LoadData() LoadData()
eCurrentMode = eModes.Disabled eCurrentMode = eModes.Disabled
@@ -1044,25 +1044,25 @@ Public Class frmGameManager
Private Function CoreValidatation(ByVal oApp As clsGame) As Boolean Private Function CoreValidatation(ByVal oApp As clsGame) As Boolean
If txtName.Text = String.Empty Then If txtName.Text = String.Empty Then
MsgBox("You must enter a valid application name.", MsgBoxStyle.Exclamation, "Game Backup Monitor") mgrCommon.ShowMessage("You must enter a valid application name.", MsgBoxStyle.Exclamation)
txtName.Focus() txtName.Focus()
Return False Return False
End If End If
If txtProcess.Text = String.Empty Then If txtProcess.Text = String.Empty Then
MsgBox("You must enter a valid process name.", MsgBoxStyle.Exclamation, "Game Backup Monitor") mgrCommon.ShowMessage("You must enter a valid process name.", MsgBoxStyle.Exclamation)
txtProcess.Focus() txtProcess.Focus()
Return False Return False
End If End If
If chkFolderSave.Checked = False And txtFileType.Text = String.Empty Then If chkFolderSave.Checked = False And txtFileType.Text = String.Empty Then
MsgBox("You must choose items to include in the backup, or choose to save the entire folder.", MsgBoxStyle.Exclamation, "Game Backup Monitor") mgrCommon.ShowMessage("You must choose items to include in the backup, or choose to save the entire folder.", MsgBoxStyle.Exclamation)
btnInclude.Focus() btnInclude.Focus()
Return False Return False
End If End If
If mgrMonitorList.DoDuplicateListCheck(oApp.Name, oApp.ProcessName, , oApp.ID) Then If mgrMonitorList.DoDuplicateListCheck(oApp.Name, oApp.ProcessName, , oApp.ID) Then
MsgBox("A game with this exact name and process already exists.", MsgBoxStyle.Exclamation, "Game Backup Monitor") mgrCommon.ShowMessage("A game with this exact name and process already exists.", MsgBoxStyle.Exclamation)
txtName.Focus() txtName.Focus()
Return False Return False
End If End If
@@ -1085,7 +1085,7 @@ Public Class frmGameManager
Next Next
If oMarkList.Count = 1 Then If oMarkList.Count = 1 Then
If MsgBox("Do you want to mark " & oMarkList(0).Name & " as restored? This cannot be undone.", MsgBoxStyle.YesNo, "Game Backup Monitor") = MsgBoxResult.Yes Then If mgrCommon.ShowMessage("Do you want to mark " & oMarkList(0).Name & " as restored? This cannot be undone.", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
bWasUpdated = True bWasUpdated = True
If mgrManifest.DoManifestCheck(oMarkList(0).Name, mgrSQLite.Database.Local) Then If mgrManifest.DoManifestCheck(oMarkList(0).Name, mgrSQLite.Database.Local) Then
mgrManifest.DoManifestUpdate(oMarkList(0), mgrSQLite.Database.Local) mgrManifest.DoManifestUpdate(oMarkList(0), mgrSQLite.Database.Local)
@@ -1094,7 +1094,7 @@ Public Class frmGameManager
End If End If
End If End If
ElseIf oMarkList.Count > 1 Then ElseIf oMarkList.Count > 1 Then
If MsgBox("Do you want to mark " & oMarkList.Count & " games as restored? This cannot be undone.", MsgBoxStyle.YesNo, "Game Backup Monitor") = MsgBoxResult.Yes Then If mgrCommon.ShowMessage("Do you want to mark " & oMarkList.Count & " games as restored? This cannot be undone.", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
bWasUpdated = True bWasUpdated = True
For Each oGameBackup In oMarkList For Each oGameBackup In oMarkList
If mgrManifest.DoManifestCheck(oGameBackup.Name, mgrSQLite.Database.Local) Then If mgrManifest.DoManifestCheck(oGameBackup.Name, mgrSQLite.Database.Local) Then
@@ -1105,7 +1105,7 @@ Public Class frmGameManager
Next Next
End If End If
Else Else
MsgBox("The selected game(s) have no backup data.", MsgBoxStyle.Information, "Game Backup Monitor") mgrCommon.ShowMessage("The selected game(s) have no backup data.", MsgBoxStyle.Information)
End If End If
'Don't bother updating unless we actually did something 'Don't bother updating unless we actually did something
@@ -1144,7 +1144,7 @@ Public Class frmGameManager
sMsg = "Are you sure you want to run a backup for " & BackupList.Count & " games? This will close the form." sMsg = "Are you sure you want to run a backup for " & BackupList.Count & " games? This will close the form."
End If End If
If MsgBox(sMsg, MsgBoxStyle.YesNo, "Game Backup Monitor") = MsgBoxResult.Yes Then If mgrCommon.ShowMessage(sMsg, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
TriggerBackup = True TriggerBackup = True
Me.Close() Me.Close()
End If End If
@@ -1179,12 +1179,12 @@ Public Class frmGameManager
bDoRestore = True bDoRestore = True
sMsg = "Are you sure you want to restore the backups for " & RestoreList.Count & " games? This will close the form." sMsg = "Are you sure you want to restore the backups for " & RestoreList.Count & " games? This will close the form."
Else Else
MsgBox("The selected game(s) have no backup data.", MsgBoxStyle.Information, "Game Backup Monitor") mgrCommon.ShowMessage("The selected game(s) have no backup data.", MsgBoxStyle.Information)
End If End If
'We need this check in case a bunch of games with no backups are multi-selected 'We need this check in case a bunch of games with no backups are multi-selected
If bDoRestore Then If bDoRestore Then
If MsgBox(sMsg, MsgBoxStyle.YesNo, "Game Backup Monitor") = MsgBoxResult.Yes Then If mgrCommon.ShowMessage(sMsg, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
TriggerRestore = True TriggerRestore = True
Me.Close() Me.Close()
End If End If
@@ -1218,7 +1218,7 @@ Public Class frmGameManager
Private Sub ImportOfficialGameList() Private Sub ImportOfficialGameList()
If MsgBox("Would you like to choose games to import from the official game list?" & vbCrLf & vbCrLf & "This require an active internet connection.", MsgBoxStyle.YesNo, "Game Backup Monitor") = MsgBoxResult.Yes Then If mgrCommon.ShowMessage("Would you like to choose games to import from the official game list?" & vbCrLf & vbCrLf & "This require an active internet connection.", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
If mgrMonitorList.DoImport(mgrPath.OfficialImportURL) Then If mgrMonitorList.DoImport(mgrPath.OfficialImportURL) Then
LoadData() LoadData()
End If End If
+1 -1
View File
@@ -72,7 +72,7 @@ Public Class frmIncludeExclude
Catch uaex As UnauthorizedAccessException Catch uaex As UnauthorizedAccessException
'Do Nothing 'Do Nothing
Catch ex As Exception Catch ex As Exception
MsgBox("An unexpected error occured while reading the file system: " & vbCrLf & vbCrLf & ex.Message, MsgBoxStyle.Critical, "Game Backup Monitor") mgrCommon.ShowMessage("An unexpected error occured while reading the file system: " & vbCrLf & vbCrLf & ex.Message, MsgBoxStyle.Critical)
Finally Finally
treFiles.EndUpdate() treFiles.EndUpdate()
Cursor.Current = Cursors.Default Cursor.Current = Cursors.Default
+22 -22
View File
@@ -281,7 +281,7 @@ Public Class frmMain
If oSettings.DisableConfirmation Then If oSettings.DisableConfirmation Then
bDoBackup = True bDoBackup = True
Else Else
If MsgBox("Do you wish to backup data from " & oProcess.GameInfo.Name & "?", MsgBoxStyle.YesNo, "Game Backup Monitor") = MsgBoxResult.Yes Then If mgrCommon.ShowMessage("Do you wish to backup data from " & oProcess.GameInfo.Name & "?", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
bDoBackup = True bDoBackup = True
Else Else
bDoBackup = False bDoBackup = False
@@ -550,10 +550,10 @@ Public Class frmMain
'Functions handling the opening of other windows 'Functions handling the opening of other windows
Private Sub OpenAbout() Private Sub OpenAbout()
MsgBox("Game Backup Monitor" & vbCrLf & sVersion & vbCrLf & sRevision & vbCrLf & Chr(169) & sConstCopyright & vbCrLf & vbCrLf & mgrCommon.ShowMessage("Game Backup Monitor" & vbCrLf & sVersion & vbCrLf & sRevision & vbCrLf & Chr(169) & sConstCopyright & vbCrLf & vbCrLf &
"This program comes with ABSOLUTELY NO WARRANTY." & vbCrLf & "This program comes with ABSOLUTELY NO WARRANTY." & vbCrLf &
"This is free software, and you are welcome to redistribute it under certain conditions." & vbCrLf & vbCrLf & "This is free software, and you are welcome to redistribute it under certain conditions." & vbCrLf & vbCrLf &
"See gpl-3.0.html in the program folder for details.", MsgBoxStyle.Information, "Game Backup Monitor") "See gpl-3.0.html in the program folder for details.", MsgBoxStyle.Information)
End Sub End Sub
Private Sub OpenTags() Private Sub OpenTags()
@@ -702,7 +702,7 @@ Public Class frmMain
'The application cannot continue if this fails 'The application cannot continue if this fails
If Not oBackup.CheckForUtilities(mgrPath.Utility7zLocation) Then 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") mgrCommon.ShowMessage("7-Zip was not found in the Game Backup Monitor utilities folder. The application cannot continue.", MsgBoxStyle.Critical)
bShutdown = True bShutdown = True
Me.Close() Me.Close()
End If End If
@@ -783,9 +783,9 @@ Public Class frmMain
Dim sGame As String = oProcess.GameInfo.Name Dim sGame As String = oProcess.GameInfo.Name
If bProcessIsAdmin Then If bProcessIsAdmin Then
MsgBox(sGame & " is running as Administrator and GBM is not." & mgrCommon.ShowMessage(sGame & " is running as Administrator and GBM is not." &
vbCrLf & "You cannot cancel monitoring at this time." _ vbCrLf & "You cannot cancel monitoring at this time." _
& vbCrLf & vbCrLf & "Run GBM as Administrator to prevent this issue.", MsgBoxStyle.Exclamation, "Game Backup Monitor") & vbCrLf & vbCrLf & "Run GBM as Administrator to prevent this issue.", MsgBoxStyle.Exclamation)
RestartAsAdmin() RestartAsAdmin()
Exit Sub Exit Sub
End If End If
@@ -794,7 +794,7 @@ Public Class frmMain
sGame = "the unknown game" sGame = "the unknown game"
End If End If
If MsgBox("Do you wish to cancel the monitoring of " & sGame & "?" & vbCrLf & vbCrLf & "Warning: When monitoring is cancelled, session time is NOT saved.", MsgBoxStyle.YesNo, "Game Backup Monitor") = MsgBoxResult.Yes Then If mgrCommon.ShowMessage("Do you wish to cancel the monitoring of " & sGame & "?" & vbCrLf & vbCrLf & "Warning: When monitoring is cancelled, session time is NOT saved.", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
UpdateLog("Monitoring of " & sGame & " was cancelled.", False) UpdateLog("Monitoring of " & sGame & " was cancelled.", False)
SetLastAction("Monitoring of " & oProcess.GameInfo.CroppedName & " was cancelled") SetLastAction("Monitoring of " & oProcess.GameInfo.CroppedName & " was cancelled")
@@ -816,7 +816,7 @@ Public Class frmMain
Dim bClose As Boolean = False Dim bClose As Boolean = False
If bPrompt Then If bPrompt Then
If MsgBox("Are you sure you want to exit? Your games will no longer be monitored.", MsgBoxStyle.YesNo, "Game Backup Monitor") = MsgBoxResult.Yes Then If mgrCommon.ShowMessage("Are you sure you want to exit? Your games will no longer be monitored.", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
bClose = True bClose = True
End If End If
Else Else
@@ -1038,7 +1038,7 @@ Public Class frmMain
Private Sub VerifyCustomPathVariables() Private Sub VerifyCustomPathVariables()
Dim sGames As String = String.Empty Dim sGames As String = String.Empty
If Not mgrPath.VerifyCustomVariables(hshScanList, sGames) Then If Not mgrPath.VerifyCustomVariables(hshScanList, sGames) Then
MsgBox("The following monitored game(s) contain a custom path variable that is not set." & vbCrLf & sGames & vbCrLf & vbCrLf & "You will encounter backup/restore errors with these games until the variables are set.", MsgBoxStyle.Critical, "Game Backup Monitor") mgrCommon.ShowMessage("The following monitored game(s) contain a custom path variable that is not set." & vbCrLf & sGames & vbCrLf & vbCrLf & "You will encounter backup/restore errors with these games until the variables are set.", MsgBoxStyle.Exclamation)
End If End If
End Sub End Sub
@@ -1066,7 +1066,7 @@ Public Class frmMain
Try Try
IO.Directory.CreateDirectory(sSettingsRoot) IO.Directory.CreateDirectory(sSettingsRoot)
Catch ex As Exception Catch ex As Exception
MsgBox("An error occured creating application settings folder. The application cannot proceed." & vbCrLf & vbCrLf & ex.Message, MsgBoxStyle.Critical, "Game Backup Monitor") mgrCommon.ShowMessage("An error occured creating application settings folder. The application cannot proceed." & vbCrLf & vbCrLf & ex.Message, MsgBoxStyle.Critical)
bShutdown = True bShutdown = True
Me.Close() Me.Close()
End Try End Try
@@ -1082,9 +1082,9 @@ Public Class frmMain
If Not oDatabase.CheckDBVer(iDBVer) Then If Not oDatabase.CheckDBVer(iDBVer) Then
Select Case iDB Select Case iDB
Case mgrSQLite.Database.Local Case mgrSQLite.Database.Local
MsgBox("Your local GBM data (Version " & iDBVer & ") is too new for your version of GBM (Version " & mgrCommon.AppVersion & ")." & vbCrLf & vbCrLf & "Please upgrade GBM or restore the settings file appropriate for your version. The application cannot proceed.", MsgBoxStyle.Critical, "Game Backup Monitor") mgrCommon.ShowMessage("Your local GBM data (Version " & iDBVer & ") is too new for your version of GBM (Version " & mgrCommon.AppVersion & ")." & vbCrLf & vbCrLf & "Please upgrade GBM or restore the settings file appropriate for your version. The application cannot proceed.", MsgBoxStyle.Critical)
Case mgrSQLite.Database.Remote Case mgrSQLite.Database.Remote
MsgBox("The GBM data (Version " & iDBVer & ") in your backup folder is too new for your version of GBM (Version " & mgrCommon.AppVersion & ")." & vbCrLf & vbCrLf & "All computers sharing a backup folder must use the same version of GBM. The application cannot proceed.", MsgBoxStyle.Critical, "Game Backup Monitor") mgrCommon.ShowMessage("The GBM data (Version " & iDBVer & ") in your backup folder is too new for your version of GBM (Version " & mgrCommon.AppVersion & ")." & vbCrLf & vbCrLf & "All computers sharing a backup folder must use the same version of GBM. The application cannot proceed.", MsgBoxStyle.Critical)
End Select End Select
bShutdown = True bShutdown = True
@@ -1133,9 +1133,9 @@ Public Class frmMain
'Functions to handle other features 'Functions to handle other features
Private Sub RestartAsAdmin() Private Sub RestartAsAdmin()
If mgrCommon.IsElevated Then If mgrCommon.IsElevated Then
MsgBox("Game Backup Monitor is already running as Administrator.", MsgBoxStyle.Information, "Game Backup Monitor") mgrCommon.ShowMessage("Game Backup Monitor is already running as Administrator.", MsgBoxStyle.Information)
Else Else
If MsgBox("Do you want to restart Game Backup Monitor as Administrator?", MsgBoxStyle.YesNo, "Game Backup Monitor") = MsgBoxResult.Yes Then If mgrCommon.ShowMessage("Do you want to restart Game Backup Monitor as Administrator?", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
mgrCommon.RestartAsAdmin() mgrCommon.RestartAsAdmin()
bShutdown = True bShutdown = True
ShutdownApp(False) ShutdownApp(False)
@@ -1148,10 +1148,10 @@ Public Class frmMain
PauseScan() PauseScan()
If MsgBox("This tool removes orphaned backup information from the local manifest based on the current backup folder. Data can become orphaned when backups are deleted by various computers that share the same backup folder on a cloud or network." & vbCrLf & vbCrLf & If mgrCommon.ShowMessage("This tool removes orphaned backup information from the local manifest based on the current backup folder. Data can become orphaned when backups are deleted by various computers that share the same backup folder on a cloud or network." & vbCrLf & vbCrLf &
"When alternating between different backup folders you should NOT use this tool." & vbCrLf & vbCrLf & "When alternating between different backup folders you should NOT use this tool." & vbCrLf & vbCrLf &
"Do you wish to proceed?", MsgBoxStyle.YesNo _ "Do you wish to proceed?", MsgBoxStyle.YesNo _
, "Game Backup Monitor") = MsgBoxResult.Yes Then ) = MsgBoxResult.Yes Then
slItems = mgrRestore.SyncLocalManifest() slItems = mgrRestore.SyncLocalManifest()
@@ -1159,9 +1159,9 @@ Public Class frmMain
For Each oItem As clsBackup In slItems.Values For Each oItem As clsBackup In slItems.Values
UpdateLog(oItem.Name & " entry was removed from local manfiest.", False) UpdateLog(oItem.Name & " entry was removed from local manfiest.", False)
Next Next
MsgBox(slItems.Count & " entries were removed from the local manifest.") mgrCommon.ShowMessage(slItems.Count & " entries were removed from the local manifest.", MsgBoxStyle.Information)
Else Else
MsgBox("The local manifest is clean.") mgrCommon.ShowMessage("The local manifest is clean.", MsgBoxStyle.Information)
End If End If
End If End If
@@ -1175,9 +1175,9 @@ Public Class frmMain
PauseScan() PauseScan()
If MsgBox("This will rebuild all databases and shrink them to an optimal size." & vbCrLf & If mgrCommon.ShowMessage("This will rebuild all databases and shrink them to an optimal size." & vbCrLf &
"This should only be used if your gbm.s3db files are becoming very large." & vbCrLf & vbCrLf & "This should only be used if your gbm.s3db files are becoming very large." & vbCrLf & vbCrLf &
"Do you wish to continue?", MsgBoxStyle.YesNo, "Game Backup Monitor") = MsgBoxResult.Yes Then "Do you wish to continue?", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
oLocalDatabase = New mgrSQLite(mgrSQLite.Database.Local) oLocalDatabase = New mgrSQLite(mgrSQLite.Database.Local)
oRemoteDatabase = New mgrSQLite(mgrSQLite.Database.Remote) oRemoteDatabase = New mgrSQLite(mgrSQLite.Database.Remote)
@@ -1326,7 +1326,7 @@ Public Class frmMain
If oProcess.Duplicate Then If oProcess.Duplicate Then
sErrorMessage = "Multiple possible games have been detected running as Administrator and GBM is not, GBM cannot detect the path to identify your game or save your backup." & vbCrLf & vbCrLf & sErrorMessage = "Multiple possible games have been detected running as Administrator and GBM is not, GBM cannot detect the path to identify your game or save your backup." & vbCrLf & vbCrLf &
"Please run GBM as Administrator to properly detect and backup this game." "Please run GBM as Administrator to properly detect and backup this game."
MsgBox(sErrorMessage, MsgBoxStyle.Critical, "Game Backup Monitor") mgrCommon.ShowMessage(sErrorMessage, MsgBoxStyle.Exclamation)
bAskForRestart = True bAskForRestart = True
Else Else
If Not CheckForSavedPath() Then If Not CheckForSavedPath() Then
@@ -1346,7 +1346,7 @@ Public Class frmMain
If oProcess.Duplicate Then If oProcess.Duplicate Then
sErrorMessage = "Multiple possible 64-bit games have been detected, GBM cannot detect the path to identify your game or save your backup." & vbCrLf & vbCrLf & sErrorMessage = "Multiple possible 64-bit games have been detected, GBM cannot detect the path to identify your game or save your backup." & vbCrLf & vbCrLf &
"Please install the 64-bit version of GBM to detect and backup this game properly." "Please install the 64-bit version of GBM to detect and backup this game properly."
MsgBox(sErrorMessage, MsgBoxStyle.Critical, "Game Backup Monitor") mgrCommon.ShowMessage(sErrorMessage, MsgBoxStyle.Exclamation)
Else Else
If Not CheckForSavedPath() Then If Not CheckForSavedPath() Then
sErrorMessage = oProcess.GameInfo.Name & " is a 64-bit game, GBM cannot detect the required information to save your backup." sErrorMessage = oProcess.GameInfo.Name & " is a 64-bit game, GBM cannot detect the required information to save your backup."
+1 -1
View File
@@ -75,7 +75,7 @@
End If End If
oSettings.BackupFolder = txtBackupFolder.Text oSettings.BackupFolder = txtBackupFolder.Text
Else Else
MsgBox("The backup folder does not exist. Please choose a valid backup folder.", MsgBoxStyle.Exclamation, "Game Backup Monitor") mgrCommon.ShowMessage("The backup folder does not exist. Please choose a valid backup folder.", MsgBoxStyle.Exclamation)
Return False Return False
End If End If
+4 -4
View File
@@ -40,7 +40,7 @@ Public Class frmStartUpWizard
'Make sure database is the latest version 'Make sure database is the latest version
oDatabase.DatabaseUpgrade() oDatabase.DatabaseUpgrade()
mgrMonitorList.SyncMonitorLists(False) mgrMonitorList.SyncMonitorLists(False)
MsgBox("Existing data was detected in the backup folder and has been imported.", MsgBoxStyle.Information, "Game Backup Monitor") mgrCommon.ShowMessage("Existing data was detected in the backup folder and has been imported.", MsgBoxStyle.Information)
End If End If
End Sub End Sub
@@ -48,7 +48,7 @@ Public Class frmStartUpWizard
Select Case eCurrentStep Select Case eCurrentStep
Case eSteps.Step1 Case eSteps.Step1
btnBack.Enabled = False btnBack.Enabled = False
btnNext.Enabled = True btnNext.Enabled = True
tabWizard.SelectTab(0) tabWizard.SelectTab(0)
Case eSteps.Step2 Case eSteps.Step2
txtBackupPath.Text = oSettings.BackupFolder txtBackupPath.Text = oSettings.BackupFolder
@@ -71,7 +71,7 @@ Public Class frmStartUpWizard
End Sub End Sub
Private Sub DownloadSettings() Private Sub DownloadSettings()
If MsgBox("Would you like to choose games to import from the official game list?" & vbCrLf & vbCrLf & "This require an active internet connection.", MsgBoxStyle.YesNo, "Game Backup Monitor") = MsgBoxResult.Yes Then If mgrCommon.ShowMessage("Would you like to choose games to import from the official game list?" & vbCrLf & vbCrLf & "This require an active internet connection.", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
If mgrMonitorList.DoImport(mgrPath.OfficialImportURL) Then If mgrMonitorList.DoImport(mgrPath.OfficialImportURL) Then
oGameData = mgrMonitorList.ReadList(mgrMonitorList.eListTypes.FullList) oGameData = mgrMonitorList.ReadList(mgrMonitorList.eListTypes.FullList)
If oSettings.Sync Then mgrMonitorList.SyncMonitorLists() If oSettings.Sync Then mgrMonitorList.SyncMonitorLists()
@@ -165,7 +165,7 @@ Public Class frmStartUpWizard
Me.Close() Me.Close()
End Select End Select
If bError Then MsgBox(sErrorMessage, MsgBoxStyle.Exclamation, "Game Backup Monitor") If bError Then mgrCommon.ShowMessage(sErrorMessage, MsgBoxStyle.Exclamation)
StepHandler() StepHandler()
End Sub End Sub
+5 -5
View File
@@ -50,7 +50,7 @@
Private Function HandleDirty() As MsgBoxResult Private Function HandleDirty() As MsgBoxResult
Dim oResult As MsgBoxResult Dim oResult As MsgBoxResult
oResult = MsgBox("There are unsaved changes on this form. Do you want to save?", MsgBoxStyle.YesNoCancel, "Game Backup Monitor") oResult = mgrCommon.ShowMessage("There are unsaved changes on this form. Do you want to save?", MsgBoxStyle.YesNoCancel)
Select Case oResult Select Case oResult
Case MsgBoxResult.Yes Case MsgBoxResult.Yes
@@ -204,7 +204,7 @@
Case eModes.Add Case eModes.Add
If CoreValidatation(oTag) Then If CoreValidatation(oTag) Then
bSuccess = True bSuccess = True
mgrTags.DoTagAdd(oTag) mgrTags.DoTagAdd(oTag)
eCurrentMode = eModes.View eCurrentMode = eModes.View
End If End If
Case eModes.Edit Case eModes.Edit
@@ -229,7 +229,7 @@
If lstTags.SelectedItems.Count > 0 Then If lstTags.SelectedItems.Count > 0 Then
oTag = DirectCast(TagData(lstTags.SelectedItems(0).ToString), clsTag) oTag = DirectCast(TagData(lstTags.SelectedItems(0).ToString), clsTag)
If MsgBox("Are you sure you want to delete " & oTag.Name & "? This cannot be undone." & vbCrLf & vbCrLf & "All games using this tag will have it removed.", MsgBoxStyle.YesNo, "Game Backup Monitor") = MsgBoxResult.Yes Then If mgrCommon.ShowMessage("Are you sure you want to delete " & oTag.Name & "? This cannot be undone." & vbCrLf & vbCrLf & "All games using this tag will have it removed.", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
mgrTags.DoTagDelete(oTag.ID) mgrTags.DoTagDelete(oTag.ID)
LoadData() LoadData()
eCurrentMode = eModes.Disabled eCurrentMode = eModes.Disabled
@@ -248,13 +248,13 @@
Private Function CoreValidatation(ByVal oTag As clsTag) As Boolean Private Function CoreValidatation(ByVal oTag As clsTag) As Boolean
If txtName.Text = String.Empty Then If txtName.Text = String.Empty Then
MsgBox("You must enter a valid tag name.", MsgBoxStyle.Exclamation, "Game Backup Monitor") mgrCommon.ShowMessage("You must enter a valid tag name.", MsgBoxStyle.Exclamation)
txtName.Focus() txtName.Focus()
Return False Return False
End If End If
If mgrTags.DoCheckDuplicate(oTag.Name, oTag.ID) Then If mgrTags.DoCheckDuplicate(oTag.Name, oTag.ID) Then
MsgBox("A tag with this name already exists.", MsgBoxStyle.Exclamation, "Game Backup Monitor") mgrCommon.ShowMessage("A tag with this name already exists.", MsgBoxStyle.Exclamation)
txtName.Focus() txtName.Focus()
Return False Return False
End If End If
+5 -5
View File
@@ -67,7 +67,7 @@ Public Class frmVariableManager
Private Function HandleDirty() As MsgBoxResult Private Function HandleDirty() As MsgBoxResult
Dim oResult As MsgBoxResult Dim oResult As MsgBoxResult
oResult = MsgBox("There are unsaved changes on this form. Do you want to save?", MsgBoxStyle.YesNoCancel, "Game Backup Monitor") oResult = mgrCommon.ShowMessage("There are unsaved changes on this form. Do you want to save?", MsgBoxStyle.YesNoCancel)
Select Case oResult Select Case oResult
Case MsgBoxResult.Yes Case MsgBoxResult.Yes
@@ -251,7 +251,7 @@ Public Class frmVariableManager
If lstVariables.SelectedItems.Count > 0 Then If lstVariables.SelectedItems.Count > 0 Then
oCustomVariable = DirectCast(VariableData(lstVariables.SelectedItems(0).ToString), clsPathVariable) oCustomVariable = DirectCast(VariableData(lstVariables.SelectedItems(0).ToString), clsPathVariable)
If MsgBox("Are you sure you want to delete " & oCustomVariable.Name & "? This cannot be undone.", MsgBoxStyle.YesNo, "Game Backup Monitor") = MsgBoxResult.Yes Then If mgrCommon.ShowMessage("Are you sure you want to delete " & oCustomVariable.Name & "? This cannot be undone.", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
mgrVariables.DoVariableDelete(oCustomVariable.ID) mgrVariables.DoVariableDelete(oCustomVariable.ID)
mgrVariables.DoPathUpdate(oCurrentVariable.FormattedName, oCurrentVariable.Path) mgrVariables.DoPathUpdate(oCurrentVariable.FormattedName, oCurrentVariable.Path)
LoadData() LoadData()
@@ -271,19 +271,19 @@ Public Class frmVariableManager
Private Function CoreValidatation(ByVal oCustomVariable As clsPathVariable) As Boolean Private Function CoreValidatation(ByVal oCustomVariable As clsPathVariable) As Boolean
If txtName.Text = String.Empty Then If txtName.Text = String.Empty Then
MsgBox("You must enter a valid path name.", MsgBoxStyle.Exclamation, "Game Backup Monitor") mgrCommon.ShowMessage("You must enter a valid path name.", MsgBoxStyle.Exclamation)
txtName.Focus() txtName.Focus()
Return False Return False
End If End If
If txtPath.Text = String.Empty Then If txtPath.Text = String.Empty Then
MsgBox("You must enter a valid path.", MsgBoxStyle.Exclamation, "Game Backup Monitor") mgrCommon.ShowMessage("You must enter a valid path.", MsgBoxStyle.Exclamation)
txtPath.Focus() txtPath.Focus()
Return False Return False
End If End If
If mgrVariables.DoCheckDuplicate(oCustomVariable.Name, oCustomVariable.ID) Then If mgrVariables.DoCheckDuplicate(oCustomVariable.Name, oCustomVariable.ID) Then
MsgBox("An custom variable with this name already exists.", MsgBoxStyle.Exclamation, "Game Backup Monitor") mgrCommon.ShowMessage("An custom variable with this name already exists.", MsgBoxStyle.Exclamation)
txtName.Focus() txtName.Focus()
Return False Return False
End If End If
+2 -2
View File
@@ -109,7 +109,7 @@ Public Class mgrBackup
RaiseEvent UpdateBackupInfo(oGame) RaiseEvent UpdateBackupInfo(oGame)
If mgrRestore.CheckManifest(oGame.Name) Then If mgrRestore.CheckManifest(oGame.Name) Then
If MsgBox("The manifest shows the backup folder contains a backup for " & oGame.Name & " that has not been restored on this computer." & vbCrLf & vbCrLf & "Do you want to overwrite this file anyway?", MsgBoxStyle.YesNo, "Game Backup Monitor") = MsgBoxResult.No Then If mgrCommon.ShowMessage("The manifest shows the backup folder contains a backup for " & oGame.Name & " that has not been restored on this computer." & vbCrLf & vbCrLf & "Do you want to overwrite this file anyway?", MsgBoxStyle.YesNo) = MsgBoxResult.No Then
RaiseEvent UpdateLog("Backup aborted by user due to manifest conflict.", False, ToolTipIcon.Error, True) RaiseEvent UpdateLog("Backup aborted by user due to manifest conflict.", False, ToolTipIcon.Error, True)
bDoBackup = False bDoBackup = False
End If End If
@@ -134,7 +134,7 @@ Public Class mgrBackup
End If End If
If oSettings.ShowOverwriteWarning And File.Exists(sBackupFile) Then If oSettings.ShowOverwriteWarning And File.Exists(sBackupFile) Then
If MsgBox("A file with the same name already exists in the backup folder." & vbCrLf & vbCrLf & "Do you want to overwrite this file?", MsgBoxStyle.YesNo, "Game Backup Monitor") = MsgBoxResult.No Then If mgrCommon.ShowMessage("A file with the same name already exists in the backup folder." & vbCrLf & vbCrLf & "Do you want to overwrite this file?", MsgBoxStyle.YesNo) = MsgBoxResult.No Then
RaiseEvent UpdateLog(oGame.Name & " backup aborted by user due to overwrite.", False, ToolTipIcon.Error, True) RaiseEvent UpdateLog(oGame.Name & " backup aborted by user due to overwrite.", False, ToolTipIcon.Error, True)
bDoBackup = False bDoBackup = False
End If End If
+6
View File
@@ -125,4 +125,10 @@ Public Class mgrCommon
oProcess.Start() oProcess.Start()
End Sub End Sub
Public Shared Function ShowMessage(ByVal sMsg As String, ByVal oType As MsgBoxStyle) As MsgBoxResult
Dim oResult As MsgBoxResult
oResult = MsgBox(sMsg, oType, "Game Backup Monitor")
Return oResult
End Function
End Class End Class
+10 -10
View File
@@ -23,9 +23,9 @@ Public Class mgrMonitorList
'If the remote database actually contains a list, then ask what to do 'If the remote database actually contains a list, then ask what to do
If iGameCount > 0 Then If iGameCount > 0 Then
If MsgBox("GBM data already exists in the backup folder." & vbCrLf & vbCrLf & _ If mgrCommon.ShowMessage("GBM data already exists in the backup folder." & vbCrLf & vbCrLf & _
"Do you want to make your local game list the new master game list in this folder? (Recommended)" & vbCrLf & vbCrLf & _ "Do you want to make your local game list the new master game list in this folder? (Recommended)" & vbCrLf & vbCrLf & _
"Choosing No will sync your local game list to the current master game list in this folder.", MsgBoxStyle.YesNo, "Game Backup Monitor") = MsgBoxResult.Yes Then "Choosing No will sync your local game list to the current master game list in this folder.", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
mgrMonitorList.SyncMonitorLists() mgrMonitorList.SyncMonitorLists()
Else Else
mgrMonitorList.SyncMonitorLists(False) mgrMonitorList.SyncMonitorLists(False)
@@ -45,7 +45,7 @@ Public Class mgrMonitorList
Dim oStringFilters As New Hashtable Dim oStringFilters As New Hashtable
Dim eCurrentFilter As frmFilter.eFilterType = frmFilter.eFilterType.NoFilter Dim eCurrentFilter As frmFilter.eFilterType = frmFilter.eFilterType.NoFilter
If MsgBox("Would you like to apply a filter to your export?", MsgBoxStyle.YesNo, "Game Backup Monitor") = MsgBoxResult.Yes Then If mgrCommon.ShowMessage("Would you like to apply a filter to your export?", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
Dim frm As New frmFilter Dim frm As New frmFilter
frm.ShowDialog() frm.ShowDialog()
oTagFilters = frm.TagFilters oTagFilters = frm.TagFilters
@@ -56,9 +56,9 @@ Public Class mgrMonitorList
oList = ReadListForExport(oTagFilters, oStringFilters, eCurrentFilter) oList = ReadListForExport(oTagFilters, oStringFilters, eCurrentFilter)
bSuccess = mgrXML.SerializeAndExport(oList, sLocation) bSuccess = mgrXML.SerializeAndExport(oList, sLocation)
If bSuccess Then If bSuccess Then
MsgBox("Export Complete. " & oList.Count & " item(s) have been exported.", MsgBoxStyle.Information, "Game Backup Monitor") mgrCommon.ShowMessage("Export Complete. " & oList.Count & " item(s) have been exported.", MsgBoxStyle.Information)
End If End If
End Sub End Sub
@@ -157,7 +157,7 @@ Public Class mgrMonitorList
If bToRemote Then If bToRemote Then
DoListAddUpdateSync(hshSyncItems, mgrSQLite.Database.Remote) DoListAddUpdateSync(hshSyncItems, mgrSQLite.Database.Remote)
Else Else
DoListAddUpdateSync(hshSyncItems, mgrSQLite.Database.Local) DoListAddUpdateSync(hshSyncItems, mgrSQLite.Database.Local)
End If End If
@@ -233,10 +233,10 @@ Public Class mgrMonitorList
mgrTags.DoTagAddImport(frm.ImportData) mgrTags.DoTagAddImport(frm.ImportData)
Cursor.Current = Cursors.Default Cursor.Current = Cursors.Default
MsgBox("Import Complete.", MsgBoxStyle.Information, "Game Backup Monitor") mgrCommon.ShowMessage("Import Complete.", MsgBoxStyle.Information)
End If End If
Else Else
MsgBox("This list does not contain any new games to import.", MsgBoxStyle.Information, "Game Backup Monitor") mgrCommon.ShowMessage("This list does not contain any new games to import.", MsgBoxStyle.Information)
End If End If
Application.DoEvents() Application.DoEvents()
@@ -249,7 +249,7 @@ Public Class mgrMonitorList
ImportMonitorList(sPath, True) ImportMonitorList(sPath, True)
Return True Return True
Else Else
MsgBox("There's no response from:" & vbCrLf & vbCrLf & sPath & vbCrLf & vbCrLf & "Either the server is not responding or the URL is invalid.") mgrCommon.ShowMessage("There's no response from:" & vbCrLf & vbCrLf & sPath & vbCrLf & vbCrLf & "Either the server is not responding or the URL is invalid.", MsgBoxStyle.Exclamation)
Return False Return False
End If End If
Else Else
@@ -257,7 +257,7 @@ Public Class mgrMonitorList
ImportMonitorList(sPath) ImportMonitorList(sPath)
Return True Return True
Else Else
MsgBox("The file:" & vbCrLf & sPath & vbCrLf & "cannot be found.") mgrCommon.ShowMessage("The file:" & vbCrLf & sPath & vbCrLf & "cannot be found.", MsgBoxStyle.Exclamation)
Return False Return False
End If End If
End If End If
+6 -6
View File
@@ -347,7 +347,7 @@ Public Class mgrPath
If bNoAuto Then If bNoAuto Then
sMessage = sSearchReason & vbCrLf & vbCrLf & "Do you wish to manually set the game path? (Path will be saved)" sMessage = sSearchReason & vbCrLf & vbCrLf & "Do you wish to manually set the game path? (Path will be saved)"
If MsgBox(sMessage, MsgBoxStyle.YesNo, "Game Backup Monitor") = MsgBoxResult.Yes Then If mgrCommon.ShowMessage(sMessage, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
sFolder = SetManualgamePath() sFolder = SetManualgamePath()
End If End If
@@ -356,14 +356,14 @@ Public Class mgrPath
sMessage = sSearchReason & vbCrLf & vbCrLf & "Do you wish to automatically search for the game path? (Path will be saved)" sMessage = sSearchReason & vbCrLf & vbCrLf & "Do you wish to automatically search for the game path? (Path will be saved)"
If MsgBox(sMessage, MsgBoxStyle.YesNo, "Game Backup Monitor") = MsgBoxResult.Yes Then If mgrCommon.ShowMessage(sMessage, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
frmFind.ShowDialog() frmFind.ShowDialog()
If frmFind.FoundItem <> String.Empty Then If frmFind.FoundItem <> String.Empty Then
sFolder = IO.Path.GetDirectoryName(frmFind.FoundItem) sFolder = IO.Path.GetDirectoryName(frmFind.FoundItem)
sMessage = sGameName & " was located in the following folder:" & vbCrLf & vbCrLf & _ sMessage = sGameName & " was located in the following folder:" & vbCrLf & vbCrLf & _
sFolder & vbCrLf & vbCrLf & "Is this correct?" sFolder & vbCrLf & vbCrLf & "Is this correct?"
If MsgBox(sMessage, MsgBoxStyle.YesNo, "Game Backup Monitor") = MsgBoxResult.Yes Then If mgrCommon.ShowMessage(sMessage, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
Return sFolder Return sFolder
Else Else
sFolder = String.Empty sFolder = String.Empty
@@ -379,7 +379,7 @@ Public Class mgrPath
sMessage = "Do you wish to manually set the game path? (Path will be saved)" sMessage = "Do you wish to manually set the game path? (Path will be saved)"
End If End If
If MsgBox(sMessage, MsgBoxStyle.YesNo, "Game Backup Monitor") = MsgBoxResult.Yes Then If mgrCommon.ShowMessage(sMessage, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
sFolder = SetManualgamePath() sFolder = SetManualgamePath()
End If End If
End If End If
@@ -391,9 +391,9 @@ Public Class mgrPath
Dim dBrowser As FolderBrowserDialog Dim dBrowser As FolderBrowserDialog
If Not Directory.Exists(sBackupPath) Then If Not Directory.Exists(sBackupPath) Then
If MsgBox("The backup location " & sBackupPath & " is not available." & vbCrLf & _ If mgrCommon.ShowMessage("The backup location " & sBackupPath & " is not available." & vbCrLf & _
"It may be on an external or network drive that isn't connected." & vbCrLf & vbCrLf & _ "It may be on an external or network drive that isn't connected." & vbCrLf & vbCrLf & _
"Do you want to select another backup location and continue?", MsgBoxStyle.YesNo, "Game Backup Monitor") = MsgBoxResult.Yes Then "Do you want to select another backup location and continue?", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
dBrowser = New FolderBrowserDialog dBrowser = New FolderBrowserDialog
dBrowser.SelectedPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) dBrowser.SelectedPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)
If dBrowser.ShowDialog = DialogResult.OK Then If dBrowser.ShowDialog = DialogResult.OK Then
+7 -7
View File
@@ -31,15 +31,15 @@ Public Class mgrRestore
Dim oResult As MsgBoxResult Dim oResult As MsgBoxResult
If oCheckBackup.RestorePath <> oCheckGame.Path Then If oCheckBackup.RestorePath <> oCheckGame.Path Then
oResult = MsgBox("The restore path for " & oCheckBackup.CroppedName & " does not match it's current save path." & vbCrLf & vbCrLf & _ oResult = mgrCommon.ShowMessage("The restore path for " & oCheckBackup.CroppedName & " does not match it's current save path." & vbCrLf & vbCrLf & _
"Do you want to restore to the current save path instead? (Recommended)", MsgBoxStyle.YesNoCancel, "Game Backup Monitor") "Do you want to restore to the current save path instead? (Recommended)", MsgBoxStyle.YesNoCancel)
If oResult = MsgBoxResult.Yes Then If oResult = MsgBoxResult.Yes Then
If Path.IsPathRooted(oCheckGame.Path) Then If Path.IsPathRooted(oCheckGame.Path) Then
oCheckBackup.AbsolutePath = True oCheckBackup.AbsolutePath = True
oCheckBackup.RestorePath = oCheckGame.Path oCheckBackup.RestorePath = oCheckGame.Path
Else Else
oCheckBackup.RestorePath = oCheckGame.Path oCheckBackup.RestorePath = oCheckGame.Path
End If End If
ElseIf oResult = MsgBoxResult.Cancel Then ElseIf oResult = MsgBoxResult.Cancel Then
Return False Return False
End If End If
@@ -198,8 +198,8 @@ Public Class mgrRestore
'Check if restore location exists, prompt to create if it doesn't. 'Check if restore location exists, prompt to create if it doesn't.
If Not Directory.Exists(sExtractPath) Then If Not Directory.Exists(sExtractPath) Then
If MsgBox("The restore path " & sExtractPath & " does not exist." & vbCrLf & vbCrLf & _ If mgrCommon.ShowMessage("The restore path " & sExtractPath & " does not exist." & vbCrLf & vbCrLf & _
"Do you want to create the folder and continue?", MsgBoxStyle.YesNo, "Game Backup Monitor") = MsgBoxResult.Yes Then "Do you want to create the folder and continue?", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
Try Try
Directory.CreateDirectory(sExtractPath) Directory.CreateDirectory(sExtractPath)
Catch ex As Exception Catch ex As Exception
@@ -218,8 +218,8 @@ Public Class mgrRestore
sHash = mgrHash.Generate_SHA256_Hash(sBackupFile) sHash = mgrHash.Generate_SHA256_Hash(sBackupFile)
If sHash <> oBackupInfo.CheckSum Then If sHash <> oBackupInfo.CheckSum Then
RaiseEvent UpdateLog("The backup file for " & oBackupInfo.Name & " has failed the file integrity check.", False, ToolTipIcon.Info, True) RaiseEvent UpdateLog("The backup file for " & oBackupInfo.Name & " has failed the file integrity check.", False, ToolTipIcon.Info, True)
If MsgBox("The backup file for " & oBackupInfo.Name & " has failed the file intergity check. It may be corrupted, not exist or been modified by another application." & vbCrLf & vbCrLf & _ If mgrCommon.ShowMessage("The backup file for " & oBackupInfo.Name & " has failed the file intergity check. It may be corrupted, not exist or been modified by another application." & vbCrLf & vbCrLf & _
"Do you still want to restore this backup? (Not Recommended)", MsgBoxStyle.YesNo, "Game Backup Monitor") = MsgBoxResult.No Then "Do you still want to restore this backup? (Not Recommended)", MsgBoxStyle.YesNo) = MsgBoxResult.No Then
RaiseEvent UpdateLog("Restored Aborted by user due to a failed file integrity check.", False, ToolTipIcon.Info, True) RaiseEvent UpdateLog("Restored Aborted by user due to a failed file integrity check.", False, ToolTipIcon.Info, True)
bDoRestore = False bDoRestore = False
End If End If
+9 -9
View File
@@ -39,7 +39,7 @@ Public Class mgrSQLite
File.Copy(mgrPath.RemoteDatabaseLocation, sNewFile, False) File.Copy(mgrPath.RemoteDatabaseLocation, sNewFile, False)
End Select End Select
Catch ex As Exception Catch ex As Exception
MsgBox("An error occured creating a backup of the database file at " & sNewFile & vbCrLf & vbCrLf & ex.Message) mgrCommon.ShowMessage("An error occured creating a backup of the database file at " & sNewFile & vbCrLf & vbCrLf & ex.Message, MsgBoxStyle.Exclamation)
End Try End Try
End Sub End Sub
@@ -99,7 +99,7 @@ Public Class mgrSQLite
RunParamQuery(sSql, New Hashtable) RunParamQuery(sSql, New Hashtable)
Return True Return True
Catch e As Exception Catch e As Exception
MsgBox("An error has occured attempting to create the local application database: " & vbCrLf & vbCrLf & e.Message) mgrCommon.ShowMessage("An error has occured attempting to create the local application database: " & vbCrLf & vbCrLf & e.Message, MsgBoxStyle.Critical)
Return False Return False
End Try End Try
End Function End Function
@@ -133,7 +133,7 @@ Public Class mgrSQLite
RunParamQuery(sSql, New Hashtable) RunParamQuery(sSql, New Hashtable)
Return True Return True
Catch e As Exception Catch e As Exception
MsgBox("An error has occured attempting to create the remote application database: " & vbCrLf & vbCrLf & e.Message) mgrCommon.ShowMessage("An error has occured attempting to create the remote application database: " & vbCrLf & vbCrLf & e.Message, MsgBoxStyle.Critical)
Return False Return False
End Try End Try
End Function End Function
@@ -180,12 +180,12 @@ Public Class mgrSQLite
BuildParams(command, hshParams) BuildParams(command, hshParams)
trans = db.BeginTransaction() trans = db.BeginTransaction()
Try Try
command.ExecuteNonQuery() command.ExecuteNonQuery()
trans.Commit() trans.Commit()
Catch e As Exception Catch e As Exception
trans.Rollback() trans.Rollback()
MsgBox("An error has occured attempting run the query." & vbCrLf & vbCrLf & sSQL & vbCrLf & vbCrLf & e.Message) mgrCommon.ShowMessage("An error has occured attempting run the query." & vbCrLf & vbCrLf & sSQL & vbCrLf & vbCrLf & e.Message, MsgBoxStyle.Exclamation)
Return False Return False
Finally Finally
command.Dispose() command.Dispose()
@@ -211,7 +211,7 @@ Public Class mgrSQLite
trans.Commit() trans.Commit()
Catch e As Exception Catch e As Exception
trans.Rollback() trans.Rollback()
MsgBox("An error has occured attempting run the query." & vbCrLf & vbCrLf & sSQL & vbCrLf & vbCrLf & e.Message) mgrCommon.ShowMessage("An error has occured attempting run the query." & vbCrLf & vbCrLf & sSQL & vbCrLf & vbCrLf & e.Message, MsgBoxStyle.Exclamation)
Return False Return False
Finally Finally
command.Dispose() command.Dispose()
@@ -234,7 +234,7 @@ Public Class mgrSQLite
adapter = New SQLiteDataAdapter(command) adapter = New SQLiteDataAdapter(command)
adapter.Fill(oData) adapter.Fill(oData)
Catch e As Exception Catch e As Exception
MsgBox("An error has occured attempting run the query." & vbCrLf & vbCrLf & sSQL & vbCrLf & vbCrLf & e.Message) mgrCommon.ShowMessage("An error has occured attempting run the query." & vbCrLf & vbCrLf & sSQL & vbCrLf & vbCrLf & e.Message, MsgBoxStyle.Exclamation)
Finally Finally
command.Dispose() command.Dispose()
Disconnect() Disconnect()
@@ -396,7 +396,7 @@ Public Class mgrSQLite
RunParamQuery(sSQL, New Hashtable) RunParamQuery(sSQL, New Hashtable)
'Upgrade IDs to GUIDs 'Upgrade IDs to GUIDs
UpgradeToGUID("monitorlist", "MonitorID") UpgradeToGUID("monitorlist", "MonitorID")
UpgradeToGUID("manifest", "ManifestID") UpgradeToGUID("manifest", "ManifestID")
'Run a compact due to the large operations 'Run a compact due to the large operations
@@ -524,7 +524,7 @@ Public Class mgrSQLite
Try Try
command.ExecuteNonQuery() command.ExecuteNonQuery()
Catch e As Exception Catch e As Exception
MsgBox("An error has occured attempting run the query." & vbCrLf & vbCrLf & sSQL & vbCrLf & vbCrLf & e.Message) mgrCommon.ShowMessage("An error has occured attempting run the query." & vbCrLf & vbCrLf & sSQL & vbCrLf & vbCrLf & e.Message, MsgBoxStyle.Exclamation)
Finally Finally
command.Dispose() command.Dispose()
Disconnect() Disconnect()
+3 -3
View File
@@ -60,7 +60,7 @@ Public Class mgrXML
oList = oSerializer.Deserialize(oReader) oList = oSerializer.Deserialize(oReader)
oReader.Close() oReader.Close()
Catch ex As Exception Catch ex As Exception
MsgBox("The XML file cannot be read, it may be an invalid format or corrupted." & vbCrLf & vbCrLf & ex.Message, MsgBoxStyle.Exclamation, "Game Backup Monitor") mgrCommon.ShowMessage("The XML file cannot be read, it may be an invalid format or corrupted." & vbCrLf & vbCrLf & ex.Message, MsgBoxStyle.Exclamation)
End Try End Try
Return oList Return oList
@@ -75,10 +75,10 @@ Public Class mgrXML
oWriter = New StreamWriter(sLocation) oWriter = New StreamWriter(sLocation)
oSerializer.Serialize(oWriter.BaseStream, oList) oSerializer.Serialize(oWriter.BaseStream, oList)
oWriter.Flush() oWriter.Flush()
oWriter.Close() oWriter.Close()
Return True Return True
Catch ex As Exception Catch ex As Exception
MsgBox("An error occured exporting the XML data." & vbCrLf & vbCrLf & ex.Message, MsgBoxStyle.Exclamation, "Game Backup Monitor") mgrCommon.ShowMessage("An error occured exporting the XML data." & vbCrLf & vbCrLf & ex.Message, MsgBoxStyle.Exclamation)
Return False Return False
End Try End Try
End Function End Function
+2 -2
View File
@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' by using the '*' as shown below: ' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")> ' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("0.95.*")> <Assembly: AssemblyVersion("0.96.*")>
<Assembly: AssemblyFileVersion("0.95.0.0")> <Assembly: AssemblyFileVersion("0.96.0.0")>