Merge pull request #95 from MikeMaximus/v103

Merge v103 into master
This commit is contained in:
MikeMaximus
2017-08-02 12:29:11 -06:00
committed by GitHub
9 changed files with 97 additions and 49 deletions
Vendored
+2
View File
@@ -186,3 +186,5 @@ FakesAssemblies/
GeneratedArtifacts/
_Pvt_Extensions/
ModelManifest.xml
/.vs/slnx.sqlite
/.vs/VSWorkspaceState.json
+16 -11
View File
@@ -1037,11 +1037,15 @@ Public Class frmMain
Me.ShowInTaskbar = True
Me.Focus()
Else
If Me.CanFocus Then
bShowToggle = False
wState = Me.WindowState
Me.WindowState = FormWindowState.Minimized
Me.ShowInTaskbar = False
Me.Visible = False
Else
gMonTray.ShowBalloonTip(5000, App_NameLong, App_ErrorFocus, ToolTipIcon.Info)
End If
End If
End Sub
@@ -1132,7 +1136,7 @@ Public Class frmMain
End If
End Sub
Private Sub ToggleMenuEnable()
Private Sub ToggleMenuEnable(Optional ByVal bGameDetected As Boolean = False)
If bMenuEnabled Then
ToggleMenuItems(False, gMonFile)
ToggleMenuItems(False, gMonSetup)
@@ -1144,6 +1148,11 @@ Public Class frmMain
gMonNotification.Enabled = False
gMonTrayNotification.Enabled = False
gMonTraySettings.Enabled = False
If Not bGameDetected Then
gMonTrayMon.Enabled = False
gMonTrayShow.Enabled = False
gMonTrayExit.Enabled = False
End If
bMenuEnabled = False
Else
ToggleMenuItems(True, gMonFile)
@@ -1156,6 +1165,9 @@ Public Class frmMain
gMonNotification.Enabled = True
gMonTrayNotification.Enabled = True
gMonTraySettings.Enabled = True
gMonTrayMon.Enabled = True
gMonTrayShow.Enabled = True
gMonTrayExit.Enabled = True
bMenuEnabled = True
End If
End Sub
@@ -1338,7 +1350,7 @@ Public Class frmMain
ToggleMenuText()
End Sub
Private Sub PauseScan()
Private Sub PauseScan(Optional ByVal bGameDetected As Boolean = False)
If eCurrentStatus = eStatus.Running Then
StopSyncWatcher()
tmScanTimer.Stop()
@@ -1348,7 +1360,7 @@ Public Class frmMain
gMonTray.Icon = GBM_Tray_Detected
End If
ToggleMenuText()
ToggleMenuEnable()
ToggleMenuEnable(bGameDetected)
End Sub
Private Sub ResumeScan()
@@ -1625,13 +1637,6 @@ Public Class frmMain
End If
End Sub
Private Sub gMonTray_BalloonTipClicked(sender As System.Object, e As System.EventArgs) Handles gMonTray.BalloonTipClicked
bShowToggle = True
Me.Visible = True
Me.ShowInTaskbar = True
Me.Focus()
End Sub
Private Sub btnCancelOperation_Click(sender As Object, e As EventArgs) Handles btnCancelOperation.Click
OperationCancel()
End Sub
@@ -1682,7 +1687,7 @@ Public Class frmMain
Dim sErrorMessage As String = String.Empty
If oProcess.SearchRunningProcesses(hshScanList, bNeedsPath, iErrorCode, bProcessDebugMode) Then
PauseScan()
PauseScan(True)
If bNeedsPath Then
bContinue = False
+34 -2
View File
@@ -322,8 +322,31 @@ Public Class mgrCommon
Return lSize
End Function
'Get available disk space on a drive
Public Shared Function GetAvailableDiskSpace(ByVal sPath As String) As Long
'Get available disk space on a drive (Unix)
Private Shared Function GetAvailableDiskSpaceUnix(ByVal sPath As String) As Long
Dim prsdf As Process
Dim sOutput As String
Dim sAvailableSpace As String
Try
prsdf = New Process
prsdf.StartInfo.FileName = "/bin/df"
prsdf.StartInfo.Arguments = sPath
prsdf.StartInfo.UseShellExecute = False
prsdf.StartInfo.RedirectStandardOutput = True
prsdf.StartInfo.CreateNoWindow = True
prsdf.Start()
sOutput = prsdf.StandardOutput.ReadToEnd
'Parse df output to grab "Available" value
sAvailableSpace = sOutput.Split(vbLf)(1).Split(New Char() {" "}, StringSplitOptions.RemoveEmptyEntries)(3)
'Return value in bytes
Return CLng(sAvailableSpace) * 1024
Catch
Return 0
End Try
End Function
'Get available disk space on a drive (Windows)
Private Shared Function GetAvailableDiskSpaceWindows(ByVal sPath As String) As Long
Dim oDrive As DriveInfo
Dim lAvailableSpace As Long = 0
Try
@@ -335,6 +358,15 @@ Public Class mgrCommon
Return lAvailableSpace
End Function
'Get available disk space on a drive
Public Shared Function GetAvailableDiskSpace(ByVal sPath As String) As Long
If IsUnix() Then
Return GetAvailableDiskSpaceUnix(sPath)
Else
Return GetAvailableDiskSpaceWindows(sPath)
End If
End Function
'Delete file based on OS type
Public Shared Sub DeleteFile(ByVal sPath As String, Optional ByVal bRecycle As Boolean = True)
If File.Exists(sPath) Then
+6 -5
View File
@@ -499,12 +499,13 @@ Public Class mgrMonitorList
Private Shared Function BuildFilterQuery(ByVal oTagFilters As List(Of clsTag), ByVal hshStringFilters As Hashtable, eFilterType As frmFilter.eFilterType, ByRef hshParams As Hashtable) As String
Dim sSQL As String = String.Empty
Dim iCounter As Integer = 0
Dim sBaseSelect As String = "MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly, BackupLimit, CleanFolder, Parameter FROM monitorlist"
Select Case eFilterType
Case frmFilter.eFilterType.NoFilter
sSQL = "SELECT MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly, BackupLimit, CleanFolder, Parameter FROM monitorlist ORDER BY Name Asc"
sSQL = "SELECT " & sBaseSelect & " ORDER BY Name Asc"
Case frmFilter.eFilterType.FieldAnd, frmFilter.eFilterType.FieldOr
sSQL = "SELECT MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly, BackupLimit, CleanFolder, Parameter FROM monitorlist"
sSQL = "SELECT " & sBaseSelect
If hshStringFilters.Count > 0 Then
sSQL &= " WHERE ("
@@ -526,7 +527,7 @@ Public Class mgrMonitorList
End If
sSQL &= " ORDER BY Name Asc"
Case frmFilter.eFilterType.AnyTag
sSQL = "SELECT DISTINCT MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly, BackupLimit, CleanFolder, Parameter FROM monitorlist "
sSQL = "SELECT DISTINCT " & sBaseSelect
sSQL &= " NATURAL JOIN gametags WHERE gametags.TagID IN ("
For Each oTag As clsTag In oTagFilters
@@ -538,7 +539,7 @@ Public Class mgrMonitorList
sSQL = sSQL.TrimEnd(",")
sSQL &= ") ORDER BY Name Asc"
Case frmFilter.eFilterType.AllTags
sSQL = "SELECT MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly, BackupLimit, CleanFolder, Parameter FROM monitorlist WHERE MonitorID IN "
sSQL = "SELECT " & sBaseSelect & " WHERE MonitorID IN "
For Each oTag As clsTag In oTagFilters
sSQL &= "(SELECT MonitorID FROM gametags WHERE monitorlist.MonitorID = gametags.MonitorID And TagID = @TagID" & iCounter & ")"
@@ -551,7 +552,7 @@ Public Class mgrMonitorList
sSQL &= " ORDER BY Name Asc"
Case frmFilter.eFilterType.NoTags
sSQL = "SELECT MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly, BackupLimit, CleanFolder, Parameter FROM monitorlist WHERE MonitorID NOT IN (SELECT MonitorID FROM gametags) ORDER BY Name Asc"
sSQL = "SELECT " & sBaseSelect & " WHERE MonitorID NOT IN (SELECT MonitorID FROM gametags) ORDER BY Name Asc"
End Select
Return sSQL
+11 -2
View File
@@ -170,6 +170,15 @@ Public Class mgrSQLite
db.Close()
End Sub
Private Sub RollBack(ByRef trans As SqliteTransaction)
Try
trans.Rollback()
Catch
'SQLite may or may not perform an auto-rollback when certain failures occur, such as disk full or out of memory.
'Multiple rollbacks will cause an exception, therefore lets just do nothing when that happens.
End Try
End Sub
Private Sub BuildParams(ByRef command As SqliteCommand, ByRef hshParams As Hashtable)
For Each de As DictionaryEntry In hshParams
command.Parameters.AddWithValue(de.Key, de.Value)
@@ -189,7 +198,7 @@ Public Class mgrSQLite
command.ExecuteNonQuery()
trans.Commit()
Catch ex As Exception
trans.Rollback()
RollBack(trans)
mgrCommon.ShowMessage(mgrSQLite_ErrorQueryFailure, New String() {sSQL, ex.Message}, MsgBoxStyle.Exclamation)
Return False
Finally
@@ -215,7 +224,7 @@ Public Class mgrSQLite
Next
trans.Commit()
Catch ex As Exception
trans.Rollback()
RollBack(trans)
mgrCommon.ShowMessage(mgrSQLite_ErrorQueryFailure, New String() {sSQL, ex.Message}, MsgBoxStyle.Exclamation)
Return False
Finally
+2 -2
View File
@@ -33,7 +33,7 @@ Imports System.Runtime.InteropServices
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("1.0.2.*")>
<Assembly: AssemblyFileVersion("1.0.2.0")>
<Assembly: AssemblyVersion("1.0.3.*")>
<Assembly: AssemblyFileVersion("1.0.3.0")>
<Assembly: NeutralResourcesLanguageAttribute("en")>
+9
View File
@@ -78,6 +78,15 @@ Namespace My.Resources
End Get
End Property
'''<summary>
''' Looks up a localized string similar to GBM is busy with an open window on your desktop..
'''</summary>
Friend ReadOnly Property App_ErrorFocus() As String
Get
Return ResourceManager.GetString("App_ErrorFocus", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to This function is currently not available on a Unix based operating system..
'''</summary>
+3
View File
@@ -1798,4 +1798,7 @@
<data name="mgrBackup_7zFatalError" xml:space="preserve">
<value>[PARAM] backup failed due to an error.</value>
</data>
<data name="App_ErrorFocus" xml:space="preserve">
<value>GBM is busy with an open window on your desktop.</value>
</data>
</root>
+7 -20
View File
@@ -1,27 +1,14 @@
Game Backup Monitor v1.02 Readme
Game Backup Monitor v1.03 Readme
http://mikemaximus.github.io/gbm-web/
gamebackupmonitor@gmail.com
July 1, 2017
August 2, 2017
New in 1.02
New in 1.03
- (Windows) Upgraded SQLite to 3.19.3.
- (All) The SQLite version is displayed on the "About" screen.
- (All) Added the ability to detect command parameters.
- Use parameter detection for better detection of games running in emulators or interpreters like DOSBox.
- This is an advanced optional feature and is not available in the "Add Game Wizard", please read the manual (http://mikemaximus.github.io/gbm-web/manual.html) for more details.
- (Linux) Please note that Wine detection is still handled automatically by GBM and only requires a Windows process name. But this feature does work with Wine if you need to detect parameters!
- (All) Added the ability to resize and maximize the main program window.
- The log is now displayed by default and resizes with the window.
- The "Show/Hide Log" button has been removed due to technical issues with this change.
- The minimum window size will let you easily hide the log as in past versions.
- (All) The last browse location in various dialogs is now saved, such as when using the Import/Export feature.
- (All) Available disk space is checked before attempting a backup. The log now displays available disk space and save folder size.
- (Linux) Using the keyboard to navigate the game list in the Game Manager now works correctly.
- (All) Tags can now be added to a new game configuration before saving on the Game Manager.
- (All) Fixed various issues when adding new game configurations while using filters on the Game Manager.
- (All) Added better handling of 7-Zip warnings and errors.
- (Linux) GBM now requires the "readlink" utility to properly handle Wine games. However bash, ls and grep are no longer required.
- (Windows) You can no longer Alt-Tab to GBM while it's minimized to the system tray. This was an unintentional change in v1.02 and caused various bugs.
- (Windows) Fixed various issues and inconsistent behavior when using the system tray and menu.
- (Linux) Free drive space is now checked correctly when performing a backup. GBM now requires "df" (Coreutils) on Linux.
- (All) Error messages related to SQLite will now be displayed correctly, instead of forcing the application to exit.
The entire version history of GBM releases is available at http://mikemaximus.github.io/gbm-web/versionhistory.html