Changes for issue #150 - Pass 1
This commit is contained in:
@@ -416,7 +416,7 @@ Public Class frmAddWizard
|
||||
End If
|
||||
|
||||
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
|
||||
End Sub
|
||||
|
||||
Generated
+13
-1
@@ -104,6 +104,7 @@ Partial Class frmGameManager
|
||||
Me.cmsDeleteAll = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.btnProcesses = New System.Windows.Forms.Button()
|
||||
Me.ttFullPath = New System.Windows.Forms.ToolTip(Me.components)
|
||||
Me.btnImportBackup = New System.Windows.Forms.Button()
|
||||
Me.grpConfig.SuspendLayout()
|
||||
CType(Me.nudLimit, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.grpExtra.SuspendLayout()
|
||||
@@ -573,6 +574,7 @@ Partial Class frmGameManager
|
||||
'grpStats
|
||||
'
|
||||
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.lblRestorePathData)
|
||||
Me.grpStats.Controls.Add(Me.lblBackupFileData)
|
||||
@@ -665,7 +667,7 @@ Partial Class frmGameManager
|
||||
Me.btnDeleteBackup.Location = New System.Drawing.Point(129, 125)
|
||||
Me.btnDeleteBackup.Name = "btnDeleteBackup"
|
||||
Me.btnDeleteBackup.Size = New System.Drawing.Size(114, 23)
|
||||
Me.btnDeleteBackup.TabIndex = 8
|
||||
Me.btnDeleteBackup.TabIndex = 9
|
||||
Me.btnDeleteBackup.Text = "&Delete Backup"
|
||||
Me.btnDeleteBackup.UseVisualStyleBackColor = True
|
||||
'
|
||||
@@ -899,6 +901,15 @@ Partial Class frmGameManager
|
||||
Me.ttFullPath.InitialDelay = 300
|
||||
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
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||
@@ -1030,4 +1041,5 @@ Partial Class frmGameManager
|
||||
Friend WithEvents btnGameID As Button
|
||||
Friend WithEvents btnProcesses As Button
|
||||
Friend WithEvents ttFullPath As ToolTip
|
||||
Friend WithEvents btnImportBackup As Button
|
||||
End Class
|
||||
|
||||
@@ -14,8 +14,10 @@ Public Class frmGameManager
|
||||
Private bDisableExternalFunctions As Boolean = False
|
||||
Private bTriggerBackup As Boolean = False
|
||||
Private bTriggerRestore As Boolean = False
|
||||
Private bTriggerImportBackup As Boolean = False
|
||||
Private oBackupList As New List(Of clsGame)
|
||||
Private oRestoreList As New Hashtable
|
||||
Private oImportBackupList As New Hashtable
|
||||
Private oGameData As OrderedDictionary
|
||||
Private oLocalBackupData As SortedList
|
||||
Private oRemoteBackupData As SortedList
|
||||
@@ -121,6 +123,15 @@ Public Class frmGameManager
|
||||
End Set
|
||||
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)
|
||||
Get
|
||||
Return oBackupList
|
||||
@@ -139,6 +150,15 @@ Public Class frmGameManager
|
||||
End Set
|
||||
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
|
||||
Get
|
||||
Return bIsDirty
|
||||
@@ -344,7 +364,7 @@ Public Class frmGameManager
|
||||
End If
|
||||
|
||||
sNewPath = mgrCommon.OpenFileBrowser("GM_Process", frmGameManager_ChooseExe, "exe",
|
||||
frmGameManager_Executable, sDefaultFolder, False, False)
|
||||
frmGameManager_Executable, sDefaultFolder, False)
|
||||
|
||||
If sNewPath <> String.Empty Then
|
||||
txtAppPath.Text = Path.GetDirectoryName(sNewPath)
|
||||
@@ -402,10 +422,10 @@ Public Class frmGameManager
|
||||
'Unix Handler
|
||||
If Not mgrCommon.IsUnix Then
|
||||
sNewPath = mgrCommon.OpenFileBrowser("GM_Icon", frmGameManager_ChooseCustomIcon, "ico",
|
||||
frmGameManager_Icon, sDefaultFolder, False, False)
|
||||
frmGameManager_Icon, sDefaultFolder, False)
|
||||
Else
|
||||
sNewPath = mgrCommon.OpenFileBrowser("GM_Icon", frmGameManager_ChooseCustomIcon, "png",
|
||||
"PNG", sDefaultFolder, False, False)
|
||||
"PNG", sDefaultFolder, False)
|
||||
End If
|
||||
|
||||
If sNewPath <> String.Empty Then
|
||||
@@ -1524,6 +1544,31 @@ Public Class frmGameManager
|
||||
End If
|
||||
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)
|
||||
Dim oData As KeyValuePair(Of String, String)
|
||||
Dim sMsg As String = String.Empty
|
||||
@@ -1722,6 +1767,7 @@ Public Class frmGameManager
|
||||
lblComments.Text = frmGameManager_lblComments
|
||||
chkRegEx.Text = frmGameManager_chkRegEx
|
||||
btnGameID.Text = frmGameManager_btnGameID
|
||||
btnImportBackup.Text = frmGameManager_btnImportBackup
|
||||
|
||||
'Init Filter Timer
|
||||
tmFilterTimer = New Timer()
|
||||
@@ -1875,6 +1921,10 @@ Public Class frmGameManager
|
||||
UpdateBuilderButtonLabel(txtExclude.Text, frmGameManager_ExcludeShortcut, btnExclude, (sExclude <> txtExclude.Text))
|
||||
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
|
||||
FolderSaveModeChange()
|
||||
End Sub
|
||||
@@ -1947,5 +1997,4 @@ Public Class frmGameManager
|
||||
Private Sub chkMonitorOnly_CheckedChanged(sender As Object, e As EventArgs) Handles chkMonitorOnly.CheckedChanged
|
||||
MonitorOnlyModeChange()
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -258,6 +258,12 @@ Public Class frmMain
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub RunImportBackup(ByVal oImportBackupList As Hashtable)
|
||||
PauseScan()
|
||||
oBackup.ImportBackupFiles(oImportBackupList)
|
||||
ResumeScan()
|
||||
End Sub
|
||||
|
||||
Private Function DoMultiGameCheck() As Boolean
|
||||
Dim oResult As DialogResult
|
||||
|
||||
@@ -889,6 +895,11 @@ Public Class frmMain
|
||||
If frm.TriggerRestore Then
|
||||
RunRestore(frm.RestoreList)
|
||||
End If
|
||||
|
||||
'Handle import backup trigger
|
||||
If frm.TriggerImportBackup Then
|
||||
RunImportBackup(frm.ImportBackupList)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OpenSettings()
|
||||
|
||||
@@ -56,7 +56,7 @@ Public Class frmProcessManager
|
||||
End If
|
||||
|
||||
sNewPath = mgrCommon.OpenFileBrowser("PM_Process", frmProcessManager_ChooseProcess, "exe",
|
||||
frmProcessManager_Executable, sDefaultFolder, False, True)
|
||||
frmProcessManager_Executable, sDefaultFolder, True)
|
||||
|
||||
If sNewPath <> String.Empty Then
|
||||
txtPath.Text = sNewPath
|
||||
|
||||
Reference in New Issue
Block a user