From 7871b6e012bd75344216fd6aa57f96a7b50b0def Mon Sep 17 00:00:00 2001 From: "Michael J. Seiferling" Date: Sun, 6 Dec 2015 20:41:24 -0600 Subject: [PATCH] Updates for issue 20 and minor UI fixes --- GBM/Classes/clsGame.vb | 2 +- GBM/Forms/frmGameManager.Designer.vb | 65 ++++++++++++++++----------- GBM/Forms/frmGameManager.vb | 62 +++++++++++++++++++++++-- GBM/Forms/frmMain.vb | 6 +-- GBM/Forms/frmSettings.vb | 5 +++ GBM/Game Backup Monitor.vbproj | 2 + GBM/My Project/Resources.Designer.vb | 20 +++++++++ GBM/My Project/Resources.resx | 6 +++ GBM/Resources/Lock.png | Bin 0 -> 630 bytes GBM/Resources/Unlock.png | Bin 0 -> 637 bytes 10 files changed, 134 insertions(+), 34 deletions(-) create mode 100644 GBM/Resources/Lock.png create mode 100644 GBM/Resources/Unlock.png diff --git a/GBM/Classes/clsGame.vb b/GBM/Classes/clsGame.vb index 693e915..8edd73e 100644 --- a/GBM/Classes/clsGame.vb +++ b/GBM/Classes/clsGame.vb @@ -37,7 +37,7 @@ ReadOnly Property CroppedName As String Get If Name.Length > 40 Then - Return sGameName.Substring(0, 41) & "..." + Return sGameName.Substring(0, 41).Trim & "..." Else Return sGameName End If diff --git a/GBM/Forms/frmGameManager.Designer.vb b/GBM/Forms/frmGameManager.Designer.vb index 0654670..cb557f7 100644 --- a/GBM/Forms/frmGameManager.Designer.vb +++ b/GBM/Forms/frmGameManager.Designer.vb @@ -60,6 +60,9 @@ Partial Class frmGameManager Me.lblHours = New System.Windows.Forms.Label() Me.btnTags = New System.Windows.Forms.Button() Me.grpStats = New System.Windows.Forms.GroupBox() + Me.btnRestorePathLock = New System.Windows.Forms.Button() + Me.Label2 = New System.Windows.Forms.Label() + Me.txtRestorePath = New System.Windows.Forms.TextBox() Me.btnOpenRestorePath = New System.Windows.Forms.Button() Me.btnOpenBackupFile = New System.Windows.Forms.Button() Me.txtFileSize = New System.Windows.Forms.TextBox() @@ -81,8 +84,6 @@ Partial Class frmGameManager Me.optBackupData = New System.Windows.Forms.RadioButton() Me.optPendingRestores = New System.Windows.Forms.RadioButton() Me.optAllGames = New System.Windows.Forms.RadioButton() - Me.txtRestorePath = New System.Windows.Forms.TextBox() - Me.Label2 = New System.Windows.Forms.Label() Me.grpConfig.SuspendLayout() Me.grpExtra.SuspendLayout() CType(Me.pbIcon, System.ComponentModel.ISupportInitialize).BeginInit() @@ -459,6 +460,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.btnRestorePathLock) Me.grpStats.Controls.Add(Me.Label2) Me.grpStats.Controls.Add(Me.txtRestorePath) Me.grpStats.Controls.Add(Me.btnOpenRestorePath) @@ -478,12 +480,38 @@ Partial Class frmGameManager Me.grpStats.TabStop = False Me.grpStats.Text = "Backup Information" ' + 'btnRestorePathLock + ' + Me.btnRestorePathLock.Image = Global.GBM.My.Resources.Resources.Lock + Me.btnRestorePathLock.Location = New System.Drawing.Point(495, 97) + Me.btnRestorePathLock.Name = "btnRestorePathLock" + Me.btnRestorePathLock.Size = New System.Drawing.Size(33, 23) + Me.btnRestorePathLock.TabIndex = 9 + Me.btnRestorePathLock.UseVisualStyleBackColor = True + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(6, 102) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(72, 13) + Me.Label2.TabIndex = 3 + Me.Label2.Text = "Restore Path:" + ' + 'txtRestorePath + ' + Me.txtRestorePath.Location = New System.Drawing.Point(96, 99) + Me.txtRestorePath.Name = "txtRestorePath" + Me.txtRestorePath.ReadOnly = True + Me.txtRestorePath.Size = New System.Drawing.Size(396, 20) + Me.txtRestorePath.TabIndex = 8 + ' 'btnOpenRestorePath ' Me.btnOpenRestorePath.Location = New System.Drawing.Point(339, 125) Me.btnOpenRestorePath.Name = "btnOpenRestorePath" Me.btnOpenRestorePath.Size = New System.Drawing.Size(114, 23) - Me.btnOpenRestorePath.TabIndex = 9 + Me.btnOpenRestorePath.TabIndex = 12 Me.btnOpenRestorePath.Text = "O&pen Restore Path" Me.btnOpenRestorePath.UseVisualStyleBackColor = True ' @@ -492,7 +520,7 @@ Partial Class frmGameManager Me.btnOpenBackupFile.Location = New System.Drawing.Point(216, 125) Me.btnOpenBackupFile.Name = "btnOpenBackupFile" Me.btnOpenBackupFile.Size = New System.Drawing.Size(114, 23) - Me.btnOpenBackupFile.TabIndex = 8 + Me.btnOpenBackupFile.TabIndex = 11 Me.btnOpenBackupFile.Text = "&Open Backup File" Me.btnOpenBackupFile.UseVisualStyleBackColor = True ' @@ -502,7 +530,7 @@ Partial Class frmGameManager Me.txtFileSize.Name = "txtFileSize" Me.txtFileSize.ReadOnly = True Me.txtFileSize.Size = New System.Drawing.Size(432, 20) - Me.txtFileSize.TabIndex = 6 + Me.txtFileSize.TabIndex = 7 Me.txtFileSize.TabStop = False ' 'btnDeleteBackup @@ -510,7 +538,7 @@ Partial Class frmGameManager Me.btnDeleteBackup.Location = New System.Drawing.Point(96, 125) Me.btnDeleteBackup.Name = "btnDeleteBackup" Me.btnDeleteBackup.Size = New System.Drawing.Size(114, 23) - Me.btnDeleteBackup.TabIndex = 7 + Me.btnDeleteBackup.TabIndex = 10 Me.btnDeleteBackup.Text = "&Delete Backup" Me.btnDeleteBackup.UseVisualStyleBackColor = True ' @@ -529,7 +557,7 @@ Partial Class frmGameManager Me.lblSync.Location = New System.Drawing.Point(6, 130) Me.lblSync.Name = "lblSync" Me.lblSync.Size = New System.Drawing.Size(62, 13) - Me.lblSync.TabIndex = 3 + Me.lblSync.TabIndex = 4 Me.lblSync.Text = "Up to Date!" Me.lblSync.Visible = False ' @@ -539,7 +567,7 @@ Partial Class frmGameManager Me.txtCurrentBackup.Name = "txtCurrentBackup" Me.txtCurrentBackup.ReadOnly = True Me.txtCurrentBackup.Size = New System.Drawing.Size(432, 20) - Me.txtCurrentBackup.TabIndex = 4 + Me.txtCurrentBackup.TabIndex = 5 Me.txtCurrentBackup.TabStop = False ' 'lblCurrentBackup @@ -557,7 +585,7 @@ Partial Class frmGameManager Me.txtLocalBackup.Name = "txtLocalBackup" Me.txtLocalBackup.ReadOnly = True Me.txtLocalBackup.Size = New System.Drawing.Size(432, 20) - Me.txtLocalBackup.TabIndex = 5 + Me.txtLocalBackup.TabIndex = 6 Me.txtLocalBackup.TabStop = False ' 'lblLastBackup @@ -686,24 +714,6 @@ Partial Class frmGameManager Me.optAllGames.Text = "All" Me.optAllGames.UseVisualStyleBackColor = True ' - 'txtRestorePath - ' - Me.txtRestorePath.Location = New System.Drawing.Point(96, 99) - Me.txtRestorePath.Name = "txtRestorePath" - Me.txtRestorePath.ReadOnly = True - Me.txtRestorePath.Size = New System.Drawing.Size(432, 20) - Me.txtRestorePath.TabIndex = 10 - Me.txtRestorePath.TabStop = False - ' - 'Label2 - ' - Me.Label2.AutoSize = True - Me.Label2.Location = New System.Drawing.Point(6, 102) - Me.Label2.Name = "Label2" - Me.Label2.Size = New System.Drawing.Size(72, 13) - Me.Label2.TabIndex = 11 - Me.Label2.Text = "Restore Path:" - ' 'frmGameManager ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) @@ -807,4 +817,5 @@ Partial Class frmGameManager Friend WithEvents btnExclude As System.Windows.Forms.Button Friend WithEvents Label2 As Label Friend WithEvents txtRestorePath As TextBox + Friend WithEvents btnRestorePathLock As Button End Class diff --git a/GBM/Forms/frmGameManager.vb b/GBM/Forms/frmGameManager.vb index 4fea81f..e1ac2a1 100644 --- a/GBM/Forms/frmGameManager.vb +++ b/GBM/Forms/frmGameManager.vb @@ -539,6 +539,7 @@ Public Class frmGameManager txtFileSize.Text = "Backup file was not found!" End If txtRestorePath.Text = CurrentBackupItem.RestorePath + btnRestorePathLock.Enabled = True Else txtCurrentBackup.Text = "Never" txtFileSize.Text = String.Empty @@ -547,6 +548,7 @@ Public Class frmGameManager btnOpenRestorePath.Enabled = False btnRestore.Enabled = False btnDeleteBackup.Enabled = False + btnRestorePathLock.Enabled = False End If If oLocalBackupData.Contains(oApp.Name) Then @@ -595,8 +597,8 @@ Public Class frmGameManager oDir = New DirectoryInfo(sSubDir) If oDir.GetDirectories.Length > 0 Or oDir.GetFiles.Length > 0 Then 'Confirm - If MsgBox("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?", _ + If MsgBox("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?", MsgBoxStyle.YesNo, "Game Backup Monitor") = MsgBoxResult.Yes Then If Directory.Exists(sSubDir) Then Directory.Delete(sSubDir, True) End If @@ -705,6 +707,9 @@ Public Class frmGameManager AddHandler DirectCast(ctl, NumericUpDown).ValueChanged, AddressOf DirtyCheck_ValueChanged End If Next + + 'Exemptions + RemoveHandler txtRestorePath.TextChanged, AddressOf DirtyCheck_ValueChanged End Sub Private Sub AssignDirtyHandlersMisc() @@ -758,6 +763,9 @@ Public Class frmGameManager lblTags.Visible = False btnInclude.Text = "In&clude Items..." btnExclude.Text = "E&xclude Items..." + txtRestorePath.ReadOnly = True + btnRestorePathLock.Image = My.Resources.Lock + btnRestorePathLock.Enabled = False Case eModes.Edit grpFilter.Enabled = False lstGames.Enabled = False @@ -793,6 +801,8 @@ Public Class frmGameManager btnBackup.Enabled = True btnTags.Enabled = True lblTags.Visible = True + txtRestorePath.ReadOnly = True + btnRestorePathLock.Image = My.Resources.Lock Case eModes.ViewTemp grpFilter.Enabled = True lstGames.Enabled = True @@ -810,6 +820,8 @@ Public Class frmGameManager lblTags.Visible = False btnInclude.Text = "In&clude Items..." btnExclude.Text = "E&xclude Items..." + txtRestorePath.ReadOnly = True + btnRestorePathLock.Image = My.Resources.Lock Case eModes.Disabled grpFilter.Enabled = True lstGames.Enabled = True @@ -834,6 +846,9 @@ Public Class frmGameManager lblTags.Visible = False btnInclude.Text = "In&clude Items..." btnExclude.Text = "E&xclude Items..." + txtRestorePath.ReadOnly = True + btnRestorePathLock.Image = My.Resources.Lock + btnRestorePathLock.Enabled = False Case eModes.MultiSelect lstGames.Enabled = True WipeControls(grpConfig.Controls) @@ -857,6 +872,9 @@ Public Class frmGameManager btnMarkAsRestored.Enabled = True btnTags.Enabled = True lblTags.Visible = False + txtRestorePath.ReadOnly = True + btnRestorePathLock.Image = My.Resources.Lock + btnRestorePathLock.Enabled = False End Select IsLoading = False @@ -1163,6 +1181,40 @@ Public Class frmGameManager End If End Sub + Private Sub HandleRestorePathOverride() + Dim bUnlock As Boolean = False + + If txtRestorePath.ReadOnly Then + If CurrentBackupItem.RestorePath = txtSavePath.Text Then + If MsgBox("No problems were detected with the current Restore Path, it's highly recommend you do NOT change it." & + vbCrLf & vbCrLf & "Do you still want to unlock the field for editing?", + MsgBoxStyle.YesNo, "Game Backup Monitor") = MsgBoxResult.Yes Then + bUnlock = True + End If + Else + bUnlock = True + End If + + If bUnlock Then + txtRestorePath.ReadOnly = False + btnRestorePathLock.Image = My.Resources.Unlock + MsgBox("You may now edit the Restore Path." & vbCrLf & vbCrLf & "Click the Lock button to save your changes.", MsgBoxStyle.Information, "Game Backup Monitor") + End If + Else + txtRestorePath.ReadOnly = True + btnRestorePathLock.Image = My.Resources.Lock + If CurrentBackupItem.RestorePath <> txtRestorePath.Text Then + If Path.IsPathRooted(txtRestorePath.Text) Then + CurrentBackupItem.AbsolutePath = True + CurrentBackupItem.RestorePath = txtRestorePath.Text + Else + CurrentBackupItem.RestorePath = txtRestorePath.Text + End If + mgrManifest.DoManifestUpdate(CurrentBackupItem, mgrSQLite.Database.Remote) + End If + End If + End Sub + Private Sub frmGameManager_Load(sender As Object, e As EventArgs) Handles MyBase.Load If DisableExternalFunctions Then @@ -1297,7 +1349,11 @@ Public Class frmGameManager UpdateBuilderButtonLabel(txtFileType.Text, "In&clude", btnInclude, False) End If Else - btnInclude.Enabled = True + btnInclude.Enabled = True End If End Sub + + Private Sub btnTogglePathLock_Click(sender As Object, e As EventArgs) Handles btnRestorePathLock.Click + HandleRestorePathOverride() + End Sub End Class \ No newline at end of file diff --git a/GBM/Forms/frmMain.vb b/GBM/Forms/frmMain.vb index 8668ae7..dbe6bc5 100644 --- a/GBM/Forms/frmMain.vb +++ b/GBM/Forms/frmMain.vb @@ -493,19 +493,19 @@ Public Class frmMain 'Set Details If sFileName = String.Empty Then - lblStatus1.Text = "Path Not Available" + lblStatus1.Text = "N/A" Else lblStatus1.Text = sFileName End If If sCompanyName = String.Empty Then - lblStatus2.Text = "No Company Set" + lblStatus2.Text = "N/A" Else lblStatus2.Text = sCompanyName End If If sFileVersion = String.Empty Then - lblStatus3.Text = "No Version Set" + lblStatus3.Text = "N/A" Else lblStatus3.Text = sFileVersion End If diff --git a/GBM/Forms/frmSettings.vb b/GBM/Forms/frmSettings.vb index 28ec0d0..4686676 100644 --- a/GBM/Forms/frmSettings.vb +++ b/GBM/Forms/frmSettings.vb @@ -108,6 +108,8 @@ chkTimeTracking.Checked = oSettings.TimeTracking chkSupressBackup.Checked = oSettings.SupressBackup nudSupressBackupThreshold.Value = oSettings.SupressBackupThreshold + + nudSupressBackupThreshold.Enabled = chkSupressBackup.Checked End Sub Private Sub btnSave_Click(sender As System.Object, e As System.EventArgs) Handles btnSave.Click @@ -139,4 +141,7 @@ End If End Sub + Private Sub chkSupressBackup_CheckedChanged(sender As Object, e As EventArgs) Handles chkSupressBackup.CheckedChanged + nudSupressBackupThreshold.Enabled = chkSupressBackup.Checked + End Sub End Class \ No newline at end of file diff --git a/GBM/Game Backup Monitor.vbproj b/GBM/Game Backup Monitor.vbproj index 166084c..a8e8770 100644 --- a/GBM/Game Backup Monitor.vbproj +++ b/GBM/Game Backup Monitor.vbproj @@ -328,7 +328,9 @@ + + PreserveNewest diff --git a/GBM/My Project/Resources.Designer.vb b/GBM/My Project/Resources.Designer.vb index 490697a..ea98961 100644 --- a/GBM/My Project/Resources.Designer.vb +++ b/GBM/My Project/Resources.Designer.vb @@ -110,6 +110,16 @@ Namespace My.Resources End Get End Property + ''' + ''' Looks up a localized resource of type System.Drawing.Bitmap. + ''' + Friend ReadOnly Property Lock() As System.Drawing.Bitmap + Get + Dim obj As Object = ResourceManager.GetObject("Lock", resourceCulture) + Return CType(obj,System.Drawing.Bitmap) + End Get + End Property + ''' ''' Looks up a localized resource of type System.Drawing.Bitmap. ''' @@ -150,6 +160,16 @@ Namespace My.Resources End Get End Property + ''' + ''' Looks up a localized resource of type System.Drawing.Bitmap. + ''' + Friend ReadOnly Property Unlock() As System.Drawing.Bitmap + Get + Dim obj As Object = ResourceManager.GetObject("Unlock", resourceCulture) + Return CType(obj,System.Drawing.Bitmap) + End Get + End Property + ''' ''' Looks up a localized resource of type System.Drawing.Bitmap. ''' diff --git a/GBM/My Project/Resources.resx b/GBM/My Project/Resources.resx index 89d95ce..3269a52 100644 --- a/GBM/My Project/Resources.resx +++ b/GBM/My Project/Resources.resx @@ -133,6 +133,9 @@ ..\Resources\GBM_Tray_Stopped.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\Lock.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\Ready.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -145,6 +148,9 @@ ..\Resources\Unknown.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\Unlock.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\User.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a diff --git a/GBM/Resources/Lock.png b/GBM/Resources/Lock.png new file mode 100644 index 0000000000000000000000000000000000000000..d106f545abf12e42930a9945fc0bb4d93c5fee41 GIT binary patch literal 630 zcmV-+0*U>JP)?vm3wyV>d%HV3W3hMS;7%)E_0OBh_ul_z2H5TRH1~N+ zPtVMrnx2_G(QdC1)VvrQpTOe6B4r0I4R&>QPHLP(DTy!);|+UrXyxaRsgz-;q3hS$ z1L{??`!bogj^oU8jo&2#gb>dSW6x20!y34p&Aw|s&vyc9K`>g*<$e!dz0%*5J~s9G z&1xi~Q2_r3VAR>$m--2nHPe6FO^Lz`SR5T$(=mWs*k>RcUT4B}a zx{iMWo_$@&^d0EE@n`NMI`;QnoLsrrrKDs4K#WOidFfoWSitzN^*e<%bL{?^Bb(cX z`1srM@$T-P@9B=cN=ZpdNf0prKtmH_DyVv7S*89*rw`9>>!9QW$|Ya1il7GB{PF<+ z(0ld*RQ=Xu6e+(Psum0Djt>J>FrN67K@CgqClY<=Bv{%=v=FE{KH36O%7CUtNhyuP z7KsHrU{Ib10ElCOu;R4>EXM0t!h) zK~y-)t&%%z6G0G$|J{3-*w~I_ps+)UL`6E>#!X=PVVgU-uZmHw-k3Wu{kLeOt=5eeEZML0x|Kv`r)56 z08l3dp9^TJg17IsW@ie8MF67FY(6vNw)nV+;fio}+Bgwhg1c1xs@zkC);(>rprvo84pVV8;#!IRw_M|?V!L1inC0Uxwwko%GNh-aXp1-saIPA{@3Jsv@ zfn*HScWd{~6~!1}{nPhT`J+cZr!vzr;G6_PfRON7N*QHIc%FwwduR6M=@VbZT4>o^ z_EcXgwiQ+pfcs%X)IDOffS0N8Z_u&^i)KD?e21F&3ZA^{pXKp5TSwqzsht00000NkvXXu0mjf2a^;F literal 0 HcmV?d00001