Changes for issue #150 - Pass 1
This commit is contained in:
@@ -416,7 +416,7 @@ Public Class frmAddWizard
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
sNewPath = mgrCommon.OpenFileBrowser("Wizard_Process_Path", frmAddWizard_ChooseProcess, "exe",
|
sNewPath = mgrCommon.OpenFileBrowser("Wizard_Process_Path", frmAddWizard_ChooseProcess, "exe",
|
||||||
frmAddWizard_Executable, sDefaultFolder, False, False)
|
frmAddWizard_Executable, sDefaultFolder, False)
|
||||||
|
|
||||||
If sNewPath <> String.Empty Then txtProcessPath.Text = sNewPath
|
If sNewPath <> String.Empty Then txtProcessPath.Text = sNewPath
|
||||||
End Sub
|
End Sub
|
||||||
|
|||||||
Generated
+13
-1
@@ -104,6 +104,7 @@ Partial Class frmGameManager
|
|||||||
Me.cmsDeleteAll = New System.Windows.Forms.ToolStripMenuItem()
|
Me.cmsDeleteAll = New System.Windows.Forms.ToolStripMenuItem()
|
||||||
Me.btnProcesses = New System.Windows.Forms.Button()
|
Me.btnProcesses = New System.Windows.Forms.Button()
|
||||||
Me.ttFullPath = New System.Windows.Forms.ToolTip(Me.components)
|
Me.ttFullPath = New System.Windows.Forms.ToolTip(Me.components)
|
||||||
|
Me.btnImportBackup = New System.Windows.Forms.Button()
|
||||||
Me.grpConfig.SuspendLayout()
|
Me.grpConfig.SuspendLayout()
|
||||||
CType(Me.nudLimit, System.ComponentModel.ISupportInitialize).BeginInit()
|
CType(Me.nudLimit, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||||
Me.grpExtra.SuspendLayout()
|
Me.grpExtra.SuspendLayout()
|
||||||
@@ -573,6 +574,7 @@ Partial Class frmGameManager
|
|||||||
'grpStats
|
'grpStats
|
||||||
'
|
'
|
||||||
Me.grpStats.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
Me.grpStats.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||||
|
Me.grpStats.Controls.Add(Me.btnImportBackup)
|
||||||
Me.grpStats.Controls.Add(Me.cboRemoteBackup)
|
Me.grpStats.Controls.Add(Me.cboRemoteBackup)
|
||||||
Me.grpStats.Controls.Add(Me.lblRestorePathData)
|
Me.grpStats.Controls.Add(Me.lblRestorePathData)
|
||||||
Me.grpStats.Controls.Add(Me.lblBackupFileData)
|
Me.grpStats.Controls.Add(Me.lblBackupFileData)
|
||||||
@@ -665,7 +667,7 @@ Partial Class frmGameManager
|
|||||||
Me.btnDeleteBackup.Location = New System.Drawing.Point(129, 125)
|
Me.btnDeleteBackup.Location = New System.Drawing.Point(129, 125)
|
||||||
Me.btnDeleteBackup.Name = "btnDeleteBackup"
|
Me.btnDeleteBackup.Name = "btnDeleteBackup"
|
||||||
Me.btnDeleteBackup.Size = New System.Drawing.Size(114, 23)
|
Me.btnDeleteBackup.Size = New System.Drawing.Size(114, 23)
|
||||||
Me.btnDeleteBackup.TabIndex = 8
|
Me.btnDeleteBackup.TabIndex = 9
|
||||||
Me.btnDeleteBackup.Text = "&Delete Backup"
|
Me.btnDeleteBackup.Text = "&Delete Backup"
|
||||||
Me.btnDeleteBackup.UseVisualStyleBackColor = True
|
Me.btnDeleteBackup.UseVisualStyleBackColor = True
|
||||||
'
|
'
|
||||||
@@ -899,6 +901,15 @@ Partial Class frmGameManager
|
|||||||
Me.ttFullPath.InitialDelay = 300
|
Me.ttFullPath.InitialDelay = 300
|
||||||
Me.ttFullPath.ReshowDelay = 60
|
Me.ttFullPath.ReshowDelay = 60
|
||||||
'
|
'
|
||||||
|
'btnImportBackup
|
||||||
|
'
|
||||||
|
Me.btnImportBackup.Location = New System.Drawing.Point(9, 125)
|
||||||
|
Me.btnImportBackup.Name = "btnImportBackup"
|
||||||
|
Me.btnImportBackup.Size = New System.Drawing.Size(114, 23)
|
||||||
|
Me.btnImportBackup.TabIndex = 8
|
||||||
|
Me.btnImportBackup.Text = "Import B&ackup Files"
|
||||||
|
Me.btnImportBackup.UseVisualStyleBackColor = True
|
||||||
|
'
|
||||||
'frmGameManager
|
'frmGameManager
|
||||||
'
|
'
|
||||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||||
@@ -1030,4 +1041,5 @@ Partial Class frmGameManager
|
|||||||
Friend WithEvents btnGameID As Button
|
Friend WithEvents btnGameID As Button
|
||||||
Friend WithEvents btnProcesses As Button
|
Friend WithEvents btnProcesses As Button
|
||||||
Friend WithEvents ttFullPath As ToolTip
|
Friend WithEvents ttFullPath As ToolTip
|
||||||
|
Friend WithEvents btnImportBackup As Button
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -14,8 +14,10 @@ Public Class frmGameManager
|
|||||||
Private bDisableExternalFunctions As Boolean = False
|
Private bDisableExternalFunctions As Boolean = False
|
||||||
Private bTriggerBackup As Boolean = False
|
Private bTriggerBackup As Boolean = False
|
||||||
Private bTriggerRestore As Boolean = False
|
Private bTriggerRestore As Boolean = False
|
||||||
|
Private bTriggerImportBackup As Boolean = False
|
||||||
Private oBackupList As New List(Of clsGame)
|
Private oBackupList As New List(Of clsGame)
|
||||||
Private oRestoreList As New Hashtable
|
Private oRestoreList As New Hashtable
|
||||||
|
Private oImportBackupList As New Hashtable
|
||||||
Private oGameData As OrderedDictionary
|
Private oGameData As OrderedDictionary
|
||||||
Private oLocalBackupData As SortedList
|
Private oLocalBackupData As SortedList
|
||||||
Private oRemoteBackupData As SortedList
|
Private oRemoteBackupData As SortedList
|
||||||
@@ -121,6 +123,15 @@ Public Class frmGameManager
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Property TriggerImportBackup As Boolean
|
||||||
|
Get
|
||||||
|
Return bTriggerImportBackup
|
||||||
|
End Get
|
||||||
|
Set(value As Boolean)
|
||||||
|
bTriggerImportBackup = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
Property BackupList As List(Of clsGame)
|
Property BackupList As List(Of clsGame)
|
||||||
Get
|
Get
|
||||||
Return oBackupList
|
Return oBackupList
|
||||||
@@ -139,6 +150,15 @@ Public Class frmGameManager
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Property ImportBackupList As Hashtable
|
||||||
|
Get
|
||||||
|
Return oImportBackupList
|
||||||
|
End Get
|
||||||
|
Set(value As Hashtable)
|
||||||
|
oImportBackupList = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
Private Property IsDirty As Boolean
|
Private Property IsDirty As Boolean
|
||||||
Get
|
Get
|
||||||
Return bIsDirty
|
Return bIsDirty
|
||||||
@@ -344,7 +364,7 @@ Public Class frmGameManager
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
sNewPath = mgrCommon.OpenFileBrowser("GM_Process", frmGameManager_ChooseExe, "exe",
|
sNewPath = mgrCommon.OpenFileBrowser("GM_Process", frmGameManager_ChooseExe, "exe",
|
||||||
frmGameManager_Executable, sDefaultFolder, False, False)
|
frmGameManager_Executable, sDefaultFolder, False)
|
||||||
|
|
||||||
If sNewPath <> String.Empty Then
|
If sNewPath <> String.Empty Then
|
||||||
txtAppPath.Text = Path.GetDirectoryName(sNewPath)
|
txtAppPath.Text = Path.GetDirectoryName(sNewPath)
|
||||||
@@ -402,10 +422,10 @@ Public Class frmGameManager
|
|||||||
'Unix Handler
|
'Unix Handler
|
||||||
If Not mgrCommon.IsUnix Then
|
If Not mgrCommon.IsUnix Then
|
||||||
sNewPath = mgrCommon.OpenFileBrowser("GM_Icon", frmGameManager_ChooseCustomIcon, "ico",
|
sNewPath = mgrCommon.OpenFileBrowser("GM_Icon", frmGameManager_ChooseCustomIcon, "ico",
|
||||||
frmGameManager_Icon, sDefaultFolder, False, False)
|
frmGameManager_Icon, sDefaultFolder, False)
|
||||||
Else
|
Else
|
||||||
sNewPath = mgrCommon.OpenFileBrowser("GM_Icon", frmGameManager_ChooseCustomIcon, "png",
|
sNewPath = mgrCommon.OpenFileBrowser("GM_Icon", frmGameManager_ChooseCustomIcon, "png",
|
||||||
"PNG", sDefaultFolder, False, False)
|
"PNG", sDefaultFolder, False)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If sNewPath <> String.Empty Then
|
If sNewPath <> String.Empty Then
|
||||||
@@ -1524,6 +1544,31 @@ Public Class frmGameManager
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub TriggerSelectedImportBackup()
|
||||||
|
Dim sDefaultFolder As String = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)
|
||||||
|
Dim oBackup As New mgrBackup
|
||||||
|
Dim sFile As String
|
||||||
|
Dim sFiles As String()
|
||||||
|
|
||||||
|
ImportBackupList.Clear()
|
||||||
|
|
||||||
|
sFiles = mgrCommon.OpenMultiFileBrowser("GM_ImportBackup", frmGameManager_Choose7zImport, "7z",
|
||||||
|
frmGameManager_7zBackup, sDefaultFolder, True)
|
||||||
|
|
||||||
|
If sFiles.Length > 0 Then
|
||||||
|
For Each sFile In sFiles
|
||||||
|
If Not ImportBackupList.Contains(sFile) Then
|
||||||
|
ImportBackupList.Add(sFile, oCurrentGame)
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
|
If mgrCommon.ShowMessage(frmGameManager_ConfirmBackupImport, oCurrentGame.CroppedName, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
|
||||||
|
Me.TriggerImportBackup = True
|
||||||
|
Me.Close()
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
Private Sub TriggerSelectedBackup(Optional ByVal bPrompt As Boolean = True)
|
Private Sub TriggerSelectedBackup(Optional ByVal bPrompt As Boolean = True)
|
||||||
Dim oData As KeyValuePair(Of String, String)
|
Dim oData As KeyValuePair(Of String, String)
|
||||||
Dim sMsg As String = String.Empty
|
Dim sMsg As String = String.Empty
|
||||||
@@ -1722,6 +1767,7 @@ Public Class frmGameManager
|
|||||||
lblComments.Text = frmGameManager_lblComments
|
lblComments.Text = frmGameManager_lblComments
|
||||||
chkRegEx.Text = frmGameManager_chkRegEx
|
chkRegEx.Text = frmGameManager_chkRegEx
|
||||||
btnGameID.Text = frmGameManager_btnGameID
|
btnGameID.Text = frmGameManager_btnGameID
|
||||||
|
btnImportBackup.Text = frmGameManager_btnImportBackup
|
||||||
|
|
||||||
'Init Filter Timer
|
'Init Filter Timer
|
||||||
tmFilterTimer = New Timer()
|
tmFilterTimer = New Timer()
|
||||||
@@ -1875,6 +1921,10 @@ Public Class frmGameManager
|
|||||||
UpdateBuilderButtonLabel(txtExclude.Text, frmGameManager_ExcludeShortcut, btnExclude, (sExclude <> txtExclude.Text))
|
UpdateBuilderButtonLabel(txtExclude.Text, frmGameManager_ExcludeShortcut, btnExclude, (sExclude <> txtExclude.Text))
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub btnImportBackup_Click(sender As Object, e As EventArgs) Handles btnImportBackup.Click
|
||||||
|
TriggerSelectedImportBackup()
|
||||||
|
End Sub
|
||||||
|
|
||||||
Private Sub chkFolderSave_CheckedChanged(sender As Object, e As EventArgs) Handles chkFolderSave.CheckedChanged
|
Private Sub chkFolderSave_CheckedChanged(sender As Object, e As EventArgs) Handles chkFolderSave.CheckedChanged
|
||||||
FolderSaveModeChange()
|
FolderSaveModeChange()
|
||||||
End Sub
|
End Sub
|
||||||
@@ -1947,5 +1997,4 @@ Public Class frmGameManager
|
|||||||
Private Sub chkMonitorOnly_CheckedChanged(sender As Object, e As EventArgs) Handles chkMonitorOnly.CheckedChanged
|
Private Sub chkMonitorOnly_CheckedChanged(sender As Object, e As EventArgs) Handles chkMonitorOnly.CheckedChanged
|
||||||
MonitorOnlyModeChange()
|
MonitorOnlyModeChange()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -258,6 +258,12 @@ Public Class frmMain
|
|||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub RunImportBackup(ByVal oImportBackupList As Hashtable)
|
||||||
|
PauseScan()
|
||||||
|
oBackup.ImportBackupFiles(oImportBackupList)
|
||||||
|
ResumeScan()
|
||||||
|
End Sub
|
||||||
|
|
||||||
Private Function DoMultiGameCheck() As Boolean
|
Private Function DoMultiGameCheck() As Boolean
|
||||||
Dim oResult As DialogResult
|
Dim oResult As DialogResult
|
||||||
|
|
||||||
@@ -889,6 +895,11 @@ Public Class frmMain
|
|||||||
If frm.TriggerRestore Then
|
If frm.TriggerRestore Then
|
||||||
RunRestore(frm.RestoreList)
|
RunRestore(frm.RestoreList)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
'Handle import backup trigger
|
||||||
|
If frm.TriggerImportBackup Then
|
||||||
|
RunImportBackup(frm.ImportBackupList)
|
||||||
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub OpenSettings()
|
Private Sub OpenSettings()
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ Public Class frmProcessManager
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
sNewPath = mgrCommon.OpenFileBrowser("PM_Process", frmProcessManager_ChooseProcess, "exe",
|
sNewPath = mgrCommon.OpenFileBrowser("PM_Process", frmProcessManager_ChooseProcess, "exe",
|
||||||
frmProcessManager_Executable, sDefaultFolder, False, True)
|
frmProcessManager_Executable, sDefaultFolder, True)
|
||||||
|
|
||||||
If sNewPath <> String.Empty Then
|
If sNewPath <> String.Empty Then
|
||||||
txtPath.Text = sNewPath
|
txtPath.Text = sNewPath
|
||||||
|
|||||||
+57
-10
@@ -42,7 +42,7 @@ Public Class mgrBackup
|
|||||||
'Create manifest item
|
'Create manifest item
|
||||||
oItem.MonitorID = oGameInfo.ID
|
oItem.MonitorID = oGameInfo.ID
|
||||||
'Keep the path relative to the manifest location
|
'Keep the path relative to the manifest location
|
||||||
oItem.FileName = sBackupFile.Replace(Path.GetDirectoryName(mgrPath.RemoteDatabaseLocation) & Path.DirectorySeparatorChar, "")
|
oItem.FileName = sBackupFile.Replace(Settings.BackupFolder & Path.DirectorySeparatorChar, String.Empty)
|
||||||
oItem.DateUpdated = dTimeStamp
|
oItem.DateUpdated = dTimeStamp
|
||||||
oItem.UpdatedBy = My.Computer.Name
|
oItem.UpdatedBy = My.Computer.Name
|
||||||
oItem.CheckSum = sCheckSum
|
oItem.CheckSum = sCheckSum
|
||||||
@@ -196,6 +196,60 @@ Public Class mgrBackup
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Function BuildFileTimeStamp(ByVal dDate As Date) As String
|
||||||
|
Return " " & dDate.Month & "-" & dDate.Day & "-" & dDate.Year & "-" & dDate.Hour & "-" & dDate.Minute & "-" & dDate.Second
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Private Function HandleSubFolder(ByVal oGame As clsGame, ByVal sPath As String) As Boolean
|
||||||
|
Try
|
||||||
|
If Not Directory.Exists(sPath) Then
|
||||||
|
Directory.CreateDirectory(sPath)
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrBackup_ErrorSubFolderCreate, New String() {oGame.Name, ex.Message}), False, ToolTipIcon.Error, True)
|
||||||
|
Return False
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Return True
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Sub ImportBackupFiles(ByVal hshImportList As Hashtable)
|
||||||
|
Dim oGame As clsGame
|
||||||
|
Dim bContinue As Boolean = True
|
||||||
|
Dim sFileToImport As String
|
||||||
|
Dim sBackupFile As String
|
||||||
|
Dim oBackup As clsBackup
|
||||||
|
|
||||||
|
For Each de As DictionaryEntry In hshImportList
|
||||||
|
sFileToImport = CStr(de.Key)
|
||||||
|
oGame = DirectCast(de.Value, clsGame)
|
||||||
|
If File.Exists(sFileToImport) Then
|
||||||
|
|
||||||
|
sBackupFile = oSettings.BackupFolder
|
||||||
|
If oSettings.CreateSubFolder Then
|
||||||
|
sBackupFile = sBackupFile & Path.DirectorySeparatorChar & GetFileName(oGame)
|
||||||
|
bContinue = HandleSubFolder(oGame, sBackupFile)
|
||||||
|
End If
|
||||||
|
|
||||||
|
If bContinue Then
|
||||||
|
oBackup = New clsBackup
|
||||||
|
oBackup.MonitorID = oGame.ID
|
||||||
|
oBackup.DateUpdated = File.GetLastWriteTime(sFileToImport)
|
||||||
|
oBackup.UpdatedBy = mgrBackup_ImportedFile
|
||||||
|
sBackupFile = sBackupFile & Path.DirectorySeparatorChar & GetFileName(oGame) & BuildFileTimeStamp(oBackup.DateUpdated) & ".7z"
|
||||||
|
oBackup.FileName = sBackupFile.Replace(Settings.BackupFolder & Path.DirectorySeparatorChar, String.Empty)
|
||||||
|
If mgrCommon.CopyFile(sFileToImport, sBackupFile, False) Then
|
||||||
|
oBackup.CheckSum = mgrHash.Generate_SHA256_Hash(sBackupFile)
|
||||||
|
mgrManifest.DoManifestAdd(oBackup, mgrSQLite.Database.Remote)
|
||||||
|
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrBackup_ImportSuccess, New String() {sFileToImport, oGame.Name}), False, ToolTipIcon.Error, True)
|
||||||
|
Else
|
||||||
|
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrBackup_ErrorImportBackupCopy, sFileToImport), False, ToolTipIcon.Error, True)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
End Sub
|
||||||
|
|
||||||
Public Sub DoBackup(ByVal oBackupList As List(Of clsGame))
|
Public Sub DoBackup(ByVal oBackupList As List(Of clsGame))
|
||||||
Dim oGame As clsGame
|
Dim oGame As clsGame
|
||||||
Dim bDoBackup As Boolean
|
Dim bDoBackup As Boolean
|
||||||
@@ -213,7 +267,7 @@ Public Class mgrBackup
|
|||||||
sBackupFile = oSettings.BackupFolder
|
sBackupFile = oSettings.BackupFolder
|
||||||
sSavePath = String.Empty
|
sSavePath = String.Empty
|
||||||
dTimeStamp = Date.Now
|
dTimeStamp = Date.Now
|
||||||
sTimeStamp = " " & dTimeStamp.Month & "-" & dTimeStamp.Day & "-" & dTimeStamp.Year & "-" & dTimeStamp.Hour & "-" & dTimeStamp.Minute & "-" & dTimeStamp.Second
|
sTimeStamp = BuildFileTimeStamp(dTimeStamp)
|
||||||
sHash = String.Empty
|
sHash = String.Empty
|
||||||
bDoBackup = True
|
bDoBackup = True
|
||||||
bBackupCompleted = False
|
bBackupCompleted = False
|
||||||
@@ -222,14 +276,7 @@ Public Class mgrBackup
|
|||||||
|
|
||||||
If oSettings.CreateSubFolder Then
|
If oSettings.CreateSubFolder Then
|
||||||
sBackupFile = sBackupFile & Path.DirectorySeparatorChar & GetFileName(oGame)
|
sBackupFile = sBackupFile & Path.DirectorySeparatorChar & GetFileName(oGame)
|
||||||
Try
|
bDoBackup = HandleSubFolder(oGame, sBackupFile)
|
||||||
If Not Directory.Exists(sBackupFile) Then
|
|
||||||
Directory.CreateDirectory(sBackupFile)
|
|
||||||
End If
|
|
||||||
Catch ex As Exception
|
|
||||||
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrBackup_ErrorSubFolderCreate, New String() {oGame.Name, ex.Message}), False, ToolTipIcon.Error, True)
|
|
||||||
bDoBackup = False
|
|
||||||
End Try
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If oGame.AppendTimeStamp Then
|
If oGame.AppendTimeStamp Then
|
||||||
|
|||||||
+47
-13
@@ -144,9 +144,9 @@ Public Class mgrCommon
|
|||||||
Return String.Empty
|
Return String.Empty
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Shared Function OpenFileBrowser(ByVal sName As String, ByVal sTitle As String, ByVal sExtension As String, ByVal sFileType As String, ByVal sDefaultFolder As String,
|
Private Shared Function BuildFileBrowser(ByVal sName As String, ByVal sTitle As String, ByVal sExtension As String, ByVal sFileType As String, ByVal sDefaultFolder As String,
|
||||||
ByVal bMulti As Boolean, Optional ByVal bSavedPath As Boolean = True) As String
|
ByVal bMulti As Boolean, ByRef fbBrowser As OpenFileDialog, Optional ByVal bSavedPath As Boolean = True) As Boolean
|
||||||
Dim fbBrowser As New OpenFileDialog
|
|
||||||
Dim oSavedPath As New clsSavedPath
|
Dim oSavedPath As New clsSavedPath
|
||||||
|
|
||||||
fbBrowser.Title = sTitle
|
fbBrowser.Title = sTitle
|
||||||
@@ -171,21 +171,40 @@ Public Class mgrCommon
|
|||||||
mgrSavedPath.AddUpdatePath(oSavedPath)
|
mgrSavedPath.AddUpdatePath(oSavedPath)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If bMulti Then
|
Return True
|
||||||
Dim sFileNames As String = String.Empty
|
End If
|
||||||
For Each sFileName As String In fbBrowser.FileNames
|
|
||||||
sFileNames &= sFileName & "|"
|
Return False
|
||||||
Next
|
End Function
|
||||||
sFileNames = sFileNames.TrimEnd("|")
|
|
||||||
Return sFileNames
|
Public Shared Function OpenFileBrowser(ByVal sName As String, ByVal sTitle As String, ByVal sExtension As String, ByVal sFileType As String, ByVal sDefaultFolder As String,
|
||||||
Else
|
Optional ByVal bSavedPath As Boolean = True) As String
|
||||||
Return fbBrowser.FileName
|
Dim fbBrowser As New OpenFileDialog
|
||||||
End If
|
Dim bResult As Boolean
|
||||||
|
|
||||||
|
bResult = BuildFileBrowser(sName, sTitle, sExtension, sFileType, sDefaultFolder, False, fbBrowser, bSavedPath)
|
||||||
|
|
||||||
|
If bResult Then
|
||||||
|
Return fbBrowser.FileName
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Return String.Empty
|
Return String.Empty
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Public Shared Function OpenMultiFileBrowser(ByVal sName As String, ByVal sTitle As String, ByVal sExtension As String, ByVal sFileType As String, ByVal sDefaultFolder As String,
|
||||||
|
Optional ByVal bSavedPath As Boolean = True) As String()
|
||||||
|
Dim fbBrowser As New OpenFileDialog
|
||||||
|
Dim bResult As Boolean
|
||||||
|
|
||||||
|
bResult = BuildFileBrowser(sName, sTitle, sExtension, sFileType, sDefaultFolder, True, fbBrowser, bSavedPath)
|
||||||
|
|
||||||
|
If bResult Then
|
||||||
|
Return fbBrowser.FileNames
|
||||||
|
End If
|
||||||
|
|
||||||
|
Return New String() {}
|
||||||
|
End Function
|
||||||
|
|
||||||
Public Shared Function OpenFolderBrowser(ByVal sName As String, ByVal sTitle As String, ByVal sDefaultFolder As String, ByVal bEnableNewFolder As Boolean,
|
Public Shared Function OpenFolderBrowser(ByVal sName As String, ByVal sTitle As String, ByVal sDefaultFolder As String, ByVal bEnableNewFolder As Boolean,
|
||||||
Optional ByVal bSavedPath As Boolean = True) As String
|
Optional ByVal bSavedPath As Boolean = True) As String
|
||||||
Dim fbBrowser As New FolderBrowserDialog
|
Dim fbBrowser As New FolderBrowserDialog
|
||||||
@@ -415,6 +434,21 @@ Public Class mgrCommon
|
|||||||
End If
|
End If
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
'Copy a file
|
||||||
|
Public Shared Function CopyFile(ByVal sSourcePath As String, ByVal sDestinationPath As String, ByVal bOverWrite As Boolean) As Boolean
|
||||||
|
Try
|
||||||
|
If File.Exists(sSourcePath) Then
|
||||||
|
File.Copy(sSourcePath, sDestinationPath, bOverWrite)
|
||||||
|
Else
|
||||||
|
Return False
|
||||||
|
End If
|
||||||
|
Catch
|
||||||
|
Return False
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Return True
|
||||||
|
End Function
|
||||||
|
|
||||||
'Delete file based on OS type
|
'Delete file based on OS type
|
||||||
Public Shared Sub DeleteFile(ByVal sPath As String, Optional ByVal bRecycle As Boolean = True)
|
Public Shared Sub DeleteFile(ByVal sPath As String, Optional ByVal bRecycle As Boolean = True)
|
||||||
If File.Exists(sPath) Then
|
If File.Exists(sPath) Then
|
||||||
|
|||||||
Generated
+64
-1
@@ -1410,6 +1410,15 @@ Namespace My.Resources
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
'''<summary>
|
||||||
|
''' Looks up a localized string similar to 7-Zip.
|
||||||
|
'''</summary>
|
||||||
|
Friend ReadOnly Property frmGameManager_7zBackup() As String
|
||||||
|
Get
|
||||||
|
Return ResourceManager.GetString("frmGameManager_7zBackup", resourceCulture)
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
'''<summary>
|
'''<summary>
|
||||||
''' Looks up a localized string similar to [PARAM] ([PARAM]).
|
''' Looks up a localized string similar to [PARAM] ([PARAM]).
|
||||||
'''</summary>
|
'''</summary>
|
||||||
@@ -1554,6 +1563,15 @@ Namespace My.Resources
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
'''<summary>
|
||||||
|
''' Looks up a localized string similar to Import B&ackup Files.
|
||||||
|
'''</summary>
|
||||||
|
Friend ReadOnly Property frmGameManager_btnImportBackup() As String
|
||||||
|
Get
|
||||||
|
Return ResourceManager.GetString("frmGameManager_btnImportBackup", resourceCulture)
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
'''<summary>
|
'''<summary>
|
||||||
''' Looks up a localized string similar to In&clude Items....
|
''' Looks up a localized string similar to In&clude Items....
|
||||||
'''</summary>
|
'''</summary>
|
||||||
@@ -1689,6 +1707,15 @@ Namespace My.Resources
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
'''<summary>
|
||||||
|
''' Looks up a localized string similar to Choose compatible backup file(s).
|
||||||
|
'''</summary>
|
||||||
|
Friend ReadOnly Property frmGameManager_Choose7zImport() As String
|
||||||
|
Get
|
||||||
|
Return ResourceManager.GetString("frmGameManager_Choose7zImport", resourceCulture)
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
'''<summary>
|
'''<summary>
|
||||||
''' Looks up a localized string similar to Choose a custom icon for the game.
|
''' Looks up a localized string similar to Choose a custom icon for the game.
|
||||||
'''</summary>
|
'''</summary>
|
||||||
@@ -1824,6 +1851,15 @@ Namespace My.Resources
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
'''<summary>
|
||||||
|
''' Looks up a localized string similar to Are you sure you want to import the selected file(s) for [PARAM]. This will close the form..
|
||||||
|
'''</summary>
|
||||||
|
Friend ReadOnly Property frmGameManager_ConfirmBackupImport() As String
|
||||||
|
Get
|
||||||
|
Return ResourceManager.GetString("frmGameManager_ConfirmBackupImport", resourceCulture)
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
'''<summary>
|
'''<summary>
|
||||||
''' Looks up a localized string similar to Are you sure you want to delete [PARAM]? This cannot be undone.[BR][BR]This will not delete any backup files that already exist for this game..
|
''' Looks up a localized string similar to Are you sure you want to delete [PARAM]? This cannot be undone.[BR][BR]This will not delete any backup files that already exist for this game..
|
||||||
'''</summary>
|
'''</summary>
|
||||||
@@ -5727,6 +5763,15 @@ Namespace My.Resources
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
'''<summary>
|
||||||
|
''' Looks up a localized string similar to Failed to import [PARAM], the file could not be copied..
|
||||||
|
'''</summary>
|
||||||
|
Friend ReadOnly Property mgrBackup_ErrorImportBackupCopy() As String
|
||||||
|
Get
|
||||||
|
Return ResourceManager.GetString("mgrBackup_ErrorImportBackupCopy", resourceCulture)
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
'''<summary>
|
'''<summary>
|
||||||
''' Looks up a localized string similar to Backup aborted by user due to manifest conflict..
|
''' Looks up a localized string similar to Backup aborted by user due to manifest conflict..
|
||||||
'''</summary>
|
'''</summary>
|
||||||
@@ -5773,7 +5818,7 @@ Namespace My.Resources
|
|||||||
End Property
|
End Property
|
||||||
|
|
||||||
'''<summary>
|
'''<summary>
|
||||||
''' Looks up a localized string similar to Backup aborted. A failure occured while creating a backup sub-folder for [PARAM].[BR][PARAM].
|
''' Looks up a localized string similar to A failure occured while creating a backup sub-folder for [PARAM].[BR][PARAM].
|
||||||
'''</summary>
|
'''</summary>
|
||||||
Friend ReadOnly Property mgrBackup_ErrorSubFolderCreate() As String
|
Friend ReadOnly Property mgrBackup_ErrorSubFolderCreate() As String
|
||||||
Get
|
Get
|
||||||
@@ -5790,6 +5835,24 @@ Namespace My.Resources
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
'''<summary>
|
||||||
|
''' Looks up a localized string similar to Imported Backup.
|
||||||
|
'''</summary>
|
||||||
|
Friend ReadOnly Property mgrBackup_ImportedFile() As String
|
||||||
|
Get
|
||||||
|
Return ResourceManager.GetString("mgrBackup_ImportedFile", resourceCulture)
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
'''<summary>
|
||||||
|
''' Looks up a localized string similar to Imported backup file [PARAM] for [PARAM]..
|
||||||
|
'''</summary>
|
||||||
|
Friend ReadOnly Property mgrBackup_ImportSuccess() As String
|
||||||
|
Get
|
||||||
|
Return ResourceManager.GetString("mgrBackup_ImportSuccess", resourceCulture)
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
'''<summary>
|
'''<summary>
|
||||||
''' Looks up a localized string similar to Available Disk Space: [PARAM].
|
''' Looks up a localized string similar to Available Disk Space: [PARAM].
|
||||||
'''</summary>
|
'''</summary>
|
||||||
|
|||||||
@@ -1307,7 +1307,7 @@
|
|||||||
<value>[PARAM] backup aborted by user due to overwrite.</value>
|
<value>[PARAM] backup aborted by user due to overwrite.</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="mgrBackup_ErrorSubFolderCreate" xml:space="preserve">
|
<data name="mgrBackup_ErrorSubFolderCreate" xml:space="preserve">
|
||||||
<value>Backup aborted. A failure occured while creating a backup sub-folder for [PARAM].[BR][PARAM]</value>
|
<value>A failure occured while creating a backup sub-folder for [PARAM].[BR][PARAM]</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="mgrBackup_GenerateHash" xml:space="preserve">
|
<data name="mgrBackup_GenerateHash" xml:space="preserve">
|
||||||
<value>Generating SHA-256 hash for [PARAM] backup file.</value>
|
<value>Generating SHA-256 hash for [PARAM] backup file.</value>
|
||||||
@@ -2224,4 +2224,25 @@
|
|||||||
<data name="frmSettings_chkShowResolvedPaths" xml:space="preserve">
|
<data name="frmSettings_chkShowResolvedPaths" xml:space="preserve">
|
||||||
<value>Show resolved save paths</value>
|
<value>Show resolved save paths</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="frmGameManager_7zBackup" xml:space="preserve">
|
||||||
|
<value>7-Zip</value>
|
||||||
|
</data>
|
||||||
|
<data name="frmGameManager_btnImportBackup" xml:space="preserve">
|
||||||
|
<value>Import B&ackup Files</value>
|
||||||
|
</data>
|
||||||
|
<data name="frmGameManager_Choose7zImport" xml:space="preserve">
|
||||||
|
<value>Choose compatible backup file(s)</value>
|
||||||
|
</data>
|
||||||
|
<data name="frmGameManager_ConfirmBackupImport" xml:space="preserve">
|
||||||
|
<value>Are you sure you want to import the selected file(s) for [PARAM]. This will close the form.</value>
|
||||||
|
</data>
|
||||||
|
<data name="mgrBackup_ErrorImportBackupCopy" xml:space="preserve">
|
||||||
|
<value>Failed to import [PARAM], the file could not be copied.</value>
|
||||||
|
</data>
|
||||||
|
<data name="mgrBackup_ImportedFile" xml:space="preserve">
|
||||||
|
<value>Imported Backup</value>
|
||||||
|
</data>
|
||||||
|
<data name="mgrBackup_ImportSuccess" xml:space="preserve">
|
||||||
|
<value>Imported backup file [PARAM] for [PARAM].</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
Reference in New Issue
Block a user