From e7e2e86a8eba0cb4d7e9e32e6a43451f116872be Mon Sep 17 00:00:00 2001 From: MikeMaximus Date: Thu, 16 May 2019 15:49:58 -0600 Subject: [PATCH] Start-Up Wizard Improvements --- GBM/Forms/frmGameManager.vb | 1 + GBM/Forms/frmMain.vb | 14 ++++---------- GBM/Forms/frmStartUpWizard.Designer.vb | 14 +++++++++++++- GBM/Forms/frmStartUpWizard.vb | 22 +++++++++++++--------- GBM/Managers/mgrSettings.vb | 3 ++- GBM/My Project/Resources.Designer.vb | 11 ++++++++++- GBM/My Project/Resources.resx | 5 ++++- GBM/readme.txt | 4 ++++ 8 files changed, 51 insertions(+), 23 deletions(-) diff --git a/GBM/Forms/frmGameManager.vb b/GBM/Forms/frmGameManager.vb index 2072ae9..ff8fa94 100644 --- a/GBM/Forms/frmGameManager.vb +++ b/GBM/Forms/frmGameManager.vb @@ -1883,6 +1883,7 @@ Public Class frmGameManager btnDeleteBackup.Visible = False btnOpenBackup.Visible = False btnOpenRestorePath.Visible = False + btnImportBackup.Visible = False End If LoadBackupData() diff --git a/GBM/Forms/frmMain.vb b/GBM/Forms/frmMain.vb index db5fe46..0dd0190 100644 --- a/GBM/Forms/frmMain.vb +++ b/GBM/Forms/frmMain.vb @@ -1007,12 +1007,9 @@ Public Class frmMain Private Sub OpenStartupWizard() Dim frm As New frmStartUpWizard() - frm.Settings = oSettings - PauseScan() + frm.Settings = New mgrSettings frm.ShowDialog() - LoadAndVerify() bFirstRun = False - ResumeScan() End Sub Private Sub OpenWebSite() @@ -1715,8 +1712,8 @@ Public Class frmMain Private Sub VerifyGameDataPath() 'Important: This function cannot access mgrPath for settings, as that will trigger a database creation and destroy the reason for this function - Dim sSettingsRoot As String = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) & "/gbm" - Dim sDBLocation As String = sSettingsRoot & "/gbm.s3db" + Dim sSettingsRoot As String = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) & Path.DirectorySeparatorChar & "gbm" + Dim sDBLocation As String = sSettingsRoot & Path.DirectorySeparatorChar & "gbm.s3db" If Not Directory.Exists(sSettingsRoot) Then Try @@ -2166,6 +2163,7 @@ Public Class frmMain If bInitialLoad Then Try VerifyGameDataPath() + If bFirstRun Then OpenStartupWizard() LoadAndVerify() Catch ex As Exception If mgrCommon.ShowMessage(frmMain_ErrorInitFailure, ex.Message & vbCrLf & ex.StackTrace, MsgBoxStyle.YesNo) = MsgBoxResult.No Then @@ -2204,10 +2202,6 @@ Public Class frmMain CheckForNewBackups() End If - If bFirstRun And Not bShutdown Then - OpenStartupWizard() - End If - bInitialLoad = False Else txtLog.Select(txtLog.TextLength, 0) diff --git a/GBM/Forms/frmStartUpWizard.Designer.vb b/GBM/Forms/frmStartUpWizard.Designer.vb index 94dbc46..c54c4c9 100644 --- a/GBM/Forms/frmStartUpWizard.Designer.vb +++ b/GBM/Forms/frmStartUpWizard.Designer.vb @@ -49,6 +49,7 @@ Partial Class frmStartUpWizard Me.lblStep4Instructions = New System.Windows.Forms.Label() Me.btnNext = New System.Windows.Forms.Button() Me.btnBack = New System.Windows.Forms.Button() + Me.lblStep2Warning = New System.Windows.Forms.Label() Me.tabWizard.SuspendLayout() Me.tbPage1.SuspendLayout() Me.tbPage2.SuspendLayout() @@ -125,6 +126,7 @@ Partial Class frmStartUpWizard 'tbPage2 ' Me.tbPage2.BackColor = System.Drawing.SystemColors.Control + Me.tbPage2.Controls.Add(Me.lblStep2Warning) Me.tbPage2.Controls.Add(Me.chkCreateFolder) Me.tbPage2.Controls.Add(Me.lblStep2Title) Me.tbPage2.Controls.Add(Me.lblStep2Instructions) @@ -162,7 +164,7 @@ Partial Class frmStartUpWizard ' Me.lblStep2Instructions.Location = New System.Drawing.Point(14, 103) Me.lblStep2Instructions.Name = "lblStep2Instructions" - Me.lblStep2Instructions.Size = New System.Drawing.Size(335, 50) + Me.lblStep2Instructions.Size = New System.Drawing.Size(335, 44) Me.lblStep2Instructions.TabIndex = 6 Me.lblStep2Instructions.Text = "GBM will store all your backup files along with a manifest database (gbm.s3db) in" & " this location. Any existing GBM data in this folder will be automatically impo" & @@ -318,6 +320,15 @@ Partial Class frmStartUpWizard Me.btnBack.TabIndex = 1 Me.btnBack.Text = "&Back" Me.btnBack.UseVisualStyleBackColor = True + ' + 'lblStep2Warning + ' + Me.lblStep2Warning.Location = New System.Drawing.Point(14, 147) + Me.lblStep2Warning.Name = "lblStep2Warning" + Me.lblStep2Warning.Size = New System.Drawing.Size(335, 33) + Me.lblStep2Warning.TabIndex = 7 + Me.lblStep2Warning.Text = "You cannot return to this step after clicking Next. The Backup Location can be c" & + "hanged any time once Setup is complete." ' 'frmStartUpWizard ' @@ -371,4 +382,5 @@ Partial Class frmStartUpWizard Friend WithEvents lblStep4Instructions2 As System.Windows.Forms.Label Friend WithEvents lblStep1Instructions2 As System.Windows.Forms.Label Friend WithEvents llbManual As System.Windows.Forms.LinkLabel + Friend WithEvents lblStep2Warning As Label End Class diff --git a/GBM/Forms/frmStartUpWizard.vb b/GBM/Forms/frmStartUpWizard.vb index 633b305..9385f59 100644 --- a/GBM/Forms/frmStartUpWizard.vb +++ b/GBM/Forms/frmStartUpWizard.vb @@ -42,6 +42,7 @@ Public Class frmStartUpWizard chkCreateFolder.Text = frmStartUpWizard_chkCreateFolder lblStep2Title.Text = frmStartUpWizard_lblStep2Title lblStep2Instructions.Text = frmStartUpWizard_lblStep2Instructions + lblStep2Warning.Text = frmStartUpWizard_lblStep2Warning btnFolderBrowse.Text = frmStartUpWizard_btnFolderBrowse lblStep2Intro.Text = frmStartUpWizard_lblStep2Intro btnOpenWizard.Text = frmStartUpWizard_btnOpenWizard @@ -55,7 +56,8 @@ Public Class frmStartUpWizard lblStep4Instructions.Text = frmStartUpWizard_lblStep4Instructions llbManual.Links.Add(0, 26, App_URLManual) - LoadGameSettings() + txtBackupPath.Text = oSettings.BackupFolder + StepHandler() End Sub @@ -78,8 +80,6 @@ Public Class frmStartUpWizard btnNext.Enabled = True tabWizard.SelectTab(0) Case eSteps.Step2 - txtBackupPath.Text = oSettings.BackupFolder - chkCreateFolder.Checked = oSettings.CreateSubFolder btnBack.Enabled = True btnNext.Enabled = True tabWizard.SelectTab(1) @@ -141,18 +141,22 @@ Public Class frmStartUpWizard Return False End If - If Not Directory.Exists(strPath) Then - sErrorMessage = frmStartUpWizard_ErrorNoFolderExists - txtBackupPath.Focus() - Return False - End If - If Not Path.IsPathRooted(strPath) Then sErrorMessage = frmStartUpWizard_ErrorBadFolder txtBackupPath.Focus() Return False End If + If Not Directory.Exists(strPath) Then + Try + Directory.CreateDirectory(strPath) + Catch ex As Exception + sErrorMessage = frmStartUpWizard_ErrorNoFolderExists + txtBackupPath.Focus() + Return False + End Try + End If + Return True End Function diff --git a/GBM/Managers/mgrSettings.vb b/GBM/Managers/mgrSettings.vb index 42e623d..6e536a5 100644 --- a/GBM/Managers/mgrSettings.vb +++ b/GBM/Managers/mgrSettings.vb @@ -1,4 +1,5 @@ Imports System.IO +Imports GBM.My.Resources Public Class mgrSettings Private bStartWithWindows As Boolean = False @@ -18,7 +19,7 @@ Public Class mgrSettings Private iCompressionLevel As Integer = 5 Private s7zArguments As String = String.Empty Private s7zLocation As String = String.Empty - Private sBackupFolder As String = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments).TrimEnd(New Char() {"\", "/"}) + Private sBackupFolder As String = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) & Path.DirectorySeparatorChar & App_NameLong Private eSyncFields As clsGame.eOptionalSyncFields = clsGame.eOptionalSyncFields.None Private eMessages As eSuppressMessages = eSuppressMessages.None Private bAutoSaveLog As Boolean = False diff --git a/GBM/My Project/Resources.Designer.vb b/GBM/My Project/Resources.Designer.vb index 8f165b5..b3d86a0 100644 --- a/GBM/My Project/Resources.Designer.vb +++ b/GBM/My Project/Resources.Designer.vb @@ -5263,7 +5263,7 @@ Namespace My.Resources End Property ''' - ''' Looks up a localized string similar to The folder you selected does not exist or is not a valid folder.. + ''' Looks up a localized string similar to The selected backup location does not exist and could not be created.[BR][BR][PARAM]. ''' Friend ReadOnly Property frmStartUpWizard_ErrorNoFolderExists() As String Get @@ -5343,6 +5343,15 @@ Namespace My.Resources End Get End Property + ''' + ''' Looks up a localized string similar to You cannot return to this step after clicking Next. The Backup Location can be changed any time once Setup is complete.. + ''' + Friend ReadOnly Property frmStartUpWizard_lblStep2Warning() As String + Get + Return ResourceManager.GetString("frmStartUpWizard_lblStep2Warning", resourceCulture) + End Get + End Property + ''' ''' Looks up a localized string similar to Before you can start monitoring for games, they need to be configured so GBM knows what to look for and how to handle them. You can download pre-made configurations from the official list or add them all yourself using the tools below. You can also skip this step for now!. ''' diff --git a/GBM/My Project/Resources.resx b/GBM/My Project/Resources.resx index cf5c9bf..5f46d49 100644 --- a/GBM/My Project/Resources.resx +++ b/GBM/My Project/Resources.resx @@ -1136,7 +1136,7 @@ You must select a backup path to continue. - The folder you selected does not exist or is not a valid folder. + The selected backup location does not exist and could not be created.[BR][BR][PARAM] Existing data was detected in the backup folder and has been imported. @@ -2392,4 +2392,7 @@ Unlimited + + You cannot return to this step after clicking Next. The Backup Location can be changed any time once Setup is complete. + \ No newline at end of file diff --git a/GBM/readme.txt b/GBM/readme.txt index fd4b7de..54d4b59 100644 --- a/GBM/readme.txt +++ b/GBM/readme.txt @@ -16,5 +16,9 @@ All Platforms: - GBM now always filters out NTFS reserved characters and allows a maximum file name length of 255. - This will prevent various problems when using a backup drive with a non-standard file system in Linux or Windows. - These rules will be applied to new backup files or folders, existing backups not be modified. +- Made improvements to the Start-Up Wizard. + - The default backup location now includes a "Game Backup Monitor" sub-folder. + - The wizard will now automatically create the backup location if it doesn't exist. + - You can no longer attempt to Import Backup Files during the Start-Up Wizard. The entire version history of GBM releases is available at http://mikemaximus.github.io/gbm-web/versionhistory.html \ No newline at end of file