Added protection against empty syncs, fiddled with upgrade again

This commit is contained in:
MikeMaximus
2018-03-16 11:04:54 -06:00
parent 907e3e309a
commit 1d57bc0cc4
4 changed files with 33 additions and 4 deletions
+8
View File
@@ -517,6 +517,14 @@ Public Class mgrMonitorList
hshCompareTo = ReadList(eListTypes.FullList, mgrSQLite.Database.Local) hshCompareTo = ReadList(eListTypes.FullList, mgrSQLite.Database.Local)
End If End If
'Sync Wipe Protection
If hshCompareFrom.Count = 0 And hshCompareTo.Count > 0 Then
If mgrCommon.ShowMessage(mgrMonitorList_WarningSyncProtection, MsgBoxStyle.YesNo) = MsgBoxResult.No Then
RaiseEvent UpdateLog(mgrMonitorList_ErrorSyncCancel, False, ToolTipIcon.Warning, True)
Exit Sub
End If
End If
hshSyncItems = hshCompareFrom.Clone hshSyncItems = hshCompareFrom.Clone
For Each oFromItem In hshCompareFrom.Values For Each oFromItem In hshCompareFrom.Values
+1 -4
View File
@@ -828,12 +828,9 @@ Public Class mgrSQLite
"DROP TABLE monitorlist; ALTER TABLE monitorlist_new RENAME TO monitorlist;" "DROP TABLE monitorlist; ALTER TABLE monitorlist_new RENAME TO monitorlist;"
'We need to push the local game list against the remote database in case they had syncing disabled 'We need to push the local game list against the remote database in case they had syncing disabled
Dim hshMonitorList As Hashtable = mgrMonitorList.ReadList(mgrMonitorList.eListTypes.FullList, mgrSQLite.Database.Local)
Dim oSettings As New mgrSettings Dim oSettings As New mgrSettings
oSettings.LoadSettings() oSettings.LoadSettings()
mgrMonitorList.DoListAddUpdateSync(hshMonitorList, Database.Remote, oSettings.SyncFields) mgrMonitorList.SyncMonitorLists(oSettings.SyncFields)
mgrTags.SyncTags(True)
mgrGameTags.SyncGameTags(True)
sSQL &= "CREATE TABLE manifest_new (ManifestID TEXT NOT NULL PRIMARY KEY, MonitorID TEXT NOT NULL, FileName TEXT NOT NULL, " & sSQL &= "CREATE TABLE manifest_new (ManifestID TEXT NOT NULL PRIMARY KEY, MonitorID TEXT NOT NULL, FileName TEXT NOT NULL, " &
"DateUpdated TEXT NOT NULL, UpdatedBy TEXT NOT NULL, CheckSum TEXT);" "DateUpdated TEXT NOT NULL, UpdatedBy TEXT NOT NULL, CheckSum TEXT);"
+18
View File
@@ -5844,6 +5844,15 @@ Namespace My.Resources
End Get End Get
End Property End Property
'''<summary>
''' Looks up a localized string similar to The sync was aborted by the user..
'''</summary>
Friend ReadOnly Property mgrMonitorList_ErrorSyncCancel() As String
Get
Return ResourceManager.GetString("mgrMonitorList_ErrorSyncCancel", resourceCulture)
End Get
End Property
'''<summary> '''<summary>
''' Looks up a localized string similar to Export Complete. [PARAM] item(s) have been exported.. ''' Looks up a localized string similar to Export Complete. [PARAM] item(s) have been exported..
'''</summary> '''</summary>
@@ -5925,6 +5934,15 @@ Namespace My.Resources
End Get End Get
End Property End Property
'''<summary>
''' Looks up a localized string similar to The database GBM is attempting to sync with appears to be empty, syncing with this database will delete all data. Do you still want to sync with this database? (Not Recommended).
'''</summary>
Friend ReadOnly Property mgrMonitorList_WarningSyncProtection() As String
Get
Return ResourceManager.GetString("mgrMonitorList_WarningSyncProtection", resourceCulture)
End Get
End Property
'''<summary> '''<summary>
''' Looks up a localized string similar to There&apos;s no response from:[BR][PARAM][BR]Either the server is not responding or the URL is invalid.. ''' Looks up a localized string similar to There&apos;s no response from:[BR][PARAM][BR]Either the server is not responding or the URL is invalid..
'''</summary> '''</summary>
+6
View File
@@ -2167,4 +2167,10 @@
<data name="frmSettings_chkUseGameID" xml:space="preserve"> <data name="frmSettings_chkUseGameID" xml:space="preserve">
<value>Use Game ID for folder and file names</value> <value>Use Game ID for folder and file names</value>
</data> </data>
<data name="mgrMonitorList_ErrorSyncCancel" xml:space="preserve">
<value>The sync was aborted by the user.</value>
</data>
<data name="mgrMonitorList_WarningSyncProtection" xml:space="preserve">
<value>The database GBM is attempting to sync with appears to be empty, syncing with this database will delete all data. Do you still want to sync with this database? (Not Recommended)</value>
</data>
</root> </root>