11 Commits

Author SHA1 Message Date
MikeMaximus
8e82024c29 Merge pull request #95 from MikeMaximus/v103
Merge v103 into master
2017-08-02 12:29:11 -06:00
Michael J. Seiferling
89aa57e6d6 Final v103 changes 2017-08-02 12:27:19 -06:00
Michael J. Seiferling
44fdc4160e Fixed some long standing system tray bugs 2017-08-02 11:39:19 -06:00
MikeMaximus
b5859d6541 Cleaned up fix for issue #94 2017-07-15 10:54:15 -06:00
MikeMaximus
d3d6482bfd Fix for issue #94 2017-07-15 10:46:37 -06:00
MikeMaximus
9c8cbad7d5 Fix for issue #93 2017-07-13 13:57:28 -06:00
Michael J. Seiferling
e09e38a5c4 Updated .gitignore for Visual Studio 2017 2017-07-07 18:45:15 -06:00
Michael J. Seiferling
f245dee781 Updated .gitignore for Visual Studio 2017 2017-07-07 18:19:59 -06:00
Michael J. Seiferling
fd815f0c46 Fixed incorrect tray menu options 2017-07-06 09:17:14 -06:00
Michael J. Seiferling
708e9ce1fe Cleaned up filter function 2017-07-04 20:46:59 -06:00
MikeMaximus
a68d2b718f Fixed Windows Alt-Tab issue 2017-07-03 17:01:17 -06:00
9 changed files with 99 additions and 48 deletions
Vendored
+2
View File
@@ -186,3 +186,5 @@ FakesAssemblies/
GeneratedArtifacts/ GeneratedArtifacts/
_Pvt_Extensions/ _Pvt_Extensions/
ModelManifest.xml ModelManifest.xml
/.vs/slnx.sqlite
/.vs/VSWorkspaceState.json
+19 -11
View File
@@ -1032,14 +1032,20 @@ Public Class frmMain
'Toggle State with Tray Clicks 'Toggle State with Tray Clicks
If Not bShowToggle Then If Not bShowToggle Then
bShowToggle = True bShowToggle = True
Me.Visible = True
Me.WindowState = wState Me.WindowState = wState
Me.ShowInTaskbar = True Me.ShowInTaskbar = True
Me.Focus() Me.Focus()
Else Else
If Me.CanFocus Then
bShowToggle = False bShowToggle = False
wState = Me.WindowState wState = Me.WindowState
Me.WindowState = FormWindowState.Minimized Me.WindowState = FormWindowState.Minimized
Me.ShowInTaskbar = False Me.ShowInTaskbar = False
Me.Visible = False
Else
gMonTray.ShowBalloonTip(5000, App_NameLong, App_ErrorFocus, ToolTipIcon.Info)
End If
End If End If
End Sub End Sub
@@ -1130,7 +1136,7 @@ Public Class frmMain
End If End If
End Sub End Sub
Private Sub ToggleMenuEnable() Private Sub ToggleMenuEnable(Optional ByVal bGameDetected As Boolean = False)
If bMenuEnabled Then If bMenuEnabled Then
ToggleMenuItems(False, gMonFile) ToggleMenuItems(False, gMonFile)
ToggleMenuItems(False, gMonSetup) ToggleMenuItems(False, gMonSetup)
@@ -1142,6 +1148,11 @@ Public Class frmMain
gMonNotification.Enabled = False gMonNotification.Enabled = False
gMonTrayNotification.Enabled = False gMonTrayNotification.Enabled = False
gMonTraySettings.Enabled = False gMonTraySettings.Enabled = False
If Not bGameDetected Then
gMonTrayMon.Enabled = False
gMonTrayShow.Enabled = False
gMonTrayExit.Enabled = False
End If
bMenuEnabled = False bMenuEnabled = False
Else Else
ToggleMenuItems(True, gMonFile) ToggleMenuItems(True, gMonFile)
@@ -1154,6 +1165,9 @@ Public Class frmMain
gMonNotification.Enabled = True gMonNotification.Enabled = True
gMonTrayNotification.Enabled = True gMonTrayNotification.Enabled = True
gMonTraySettings.Enabled = True gMonTraySettings.Enabled = True
gMonTrayMon.Enabled = True
gMonTrayShow.Enabled = True
gMonTrayExit.Enabled = True
bMenuEnabled = True bMenuEnabled = True
End If End If
End Sub End Sub
@@ -1336,7 +1350,7 @@ Public Class frmMain
ToggleMenuText() ToggleMenuText()
End Sub End Sub
Private Sub PauseScan() Private Sub PauseScan(Optional ByVal bGameDetected As Boolean = False)
If eCurrentStatus = eStatus.Running Then If eCurrentStatus = eStatus.Running Then
StopSyncWatcher() StopSyncWatcher()
tmScanTimer.Stop() tmScanTimer.Stop()
@@ -1346,7 +1360,7 @@ Public Class frmMain
gMonTray.Icon = GBM_Tray_Detected gMonTray.Icon = GBM_Tray_Detected
End If End If
ToggleMenuText() ToggleMenuText()
ToggleMenuEnable() ToggleMenuEnable(bGameDetected)
End Sub End Sub
Private Sub ResumeScan() Private Sub ResumeScan()
@@ -1623,13 +1637,6 @@ Public Class frmMain
End If End If
End Sub 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 Private Sub btnCancelOperation_Click(sender As Object, e As EventArgs) Handles btnCancelOperation.Click
OperationCancel() OperationCancel()
End Sub End Sub
@@ -1658,6 +1665,7 @@ Public Class frmMain
wState = Me.WindowState wState = Me.WindowState
Me.WindowState = FormWindowState.Minimized Me.WindowState = FormWindowState.Minimized
Me.ShowInTaskbar = False Me.ShowInTaskbar = False
Me.Visible = False
End If End If
End If End If
Case CloseReason.TaskManagerClosing, CloseReason.WindowsShutDown Case CloseReason.TaskManagerClosing, CloseReason.WindowsShutDown
@@ -1679,7 +1687,7 @@ Public Class frmMain
Dim sErrorMessage As String = String.Empty Dim sErrorMessage As String = String.Empty
If oProcess.SearchRunningProcesses(hshScanList, bNeedsPath, iErrorCode, bProcessDebugMode) Then If oProcess.SearchRunningProcesses(hshScanList, bNeedsPath, iErrorCode, bProcessDebugMode) Then
PauseScan() PauseScan(True)
If bNeedsPath Then If bNeedsPath Then
bContinue = False bContinue = False
+34 -2
View File
@@ -322,8 +322,31 @@ Public Class mgrCommon
Return lSize Return lSize
End Function End Function
'Get available disk space on a drive 'Get available disk space on a drive (Unix)
Public Shared Function GetAvailableDiskSpace(ByVal sPath As String) As Long 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 oDrive As DriveInfo
Dim lAvailableSpace As Long = 0 Dim lAvailableSpace As Long = 0
Try Try
@@ -335,6 +358,15 @@ Public Class mgrCommon
Return lAvailableSpace Return lAvailableSpace
End Function 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 'Delete file based on OS type
Public Shared Sub DeleteFile(ByVal sPath As String, Optional ByVal bRecycle As Boolean = True) Public Shared Sub DeleteFile(ByVal sPath As String, Optional ByVal bRecycle As Boolean = True)
If File.Exists(sPath) Then If File.Exists(sPath) Then
+7 -6
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 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 sSQL As String = String.Empty
Dim iCounter As Integer = 0 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 Select Case eFilterType
Case frmFilter.eFilterType.NoFilter 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 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 If hshStringFilters.Count > 0 Then
sSQL &= " WHERE (" sSQL &= " WHERE ("
@@ -526,8 +527,8 @@ Public Class mgrMonitorList
End If End If
sSQL &= " ORDER BY Name Asc" sSQL &= " ORDER BY Name Asc"
Case frmFilter.eFilterType.AnyTag 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 (" sSQL &= " NATURAL JOIN gametags WHERE gametags.TagID IN ("
For Each oTag As clsTag In oTagFilters For Each oTag As clsTag In oTagFilters
sSQL &= "@TagID" & iCounter & "," sSQL &= "@TagID" & iCounter & ","
@@ -538,7 +539,7 @@ Public Class mgrMonitorList
sSQL = sSQL.TrimEnd(",") sSQL = sSQL.TrimEnd(",")
sSQL &= ") ORDER BY Name Asc" sSQL &= ") ORDER BY Name Asc"
Case frmFilter.eFilterType.AllTags 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 For Each oTag As clsTag In oTagFilters
sSQL &= "(SELECT MonitorID FROM gametags WHERE monitorlist.MonitorID = gametags.MonitorID And TagID = @TagID" & iCounter & ")" 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" sSQL &= " ORDER BY Name Asc"
Case frmFilter.eFilterType.NoTags 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 End Select
Return sSQL Return sSQL
+11 -2
View File
@@ -170,6 +170,15 @@ Public Class mgrSQLite
db.Close() db.Close()
End Sub 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) Private Sub BuildParams(ByRef command As SqliteCommand, ByRef hshParams As Hashtable)
For Each de As DictionaryEntry In hshParams For Each de As DictionaryEntry In hshParams
command.Parameters.AddWithValue(de.Key, de.Value) command.Parameters.AddWithValue(de.Key, de.Value)
@@ -189,7 +198,7 @@ Public Class mgrSQLite
command.ExecuteNonQuery() command.ExecuteNonQuery()
trans.Commit() trans.Commit()
Catch ex As Exception Catch ex As Exception
trans.Rollback() RollBack(trans)
mgrCommon.ShowMessage(mgrSQLite_ErrorQueryFailure, New String() {sSQL, ex.Message}, MsgBoxStyle.Exclamation) mgrCommon.ShowMessage(mgrSQLite_ErrorQueryFailure, New String() {sSQL, ex.Message}, MsgBoxStyle.Exclamation)
Return False Return False
Finally Finally
@@ -215,7 +224,7 @@ Public Class mgrSQLite
Next Next
trans.Commit() trans.Commit()
Catch ex As Exception Catch ex As Exception
trans.Rollback() RollBack(trans)
mgrCommon.ShowMessage(mgrSQLite_ErrorQueryFailure, New String() {sSQL, ex.Message}, MsgBoxStyle.Exclamation) mgrCommon.ShowMessage(mgrSQLite_ErrorQueryFailure, New String() {sSQL, ex.Message}, MsgBoxStyle.Exclamation)
Return False Return False
Finally Finally
+2 -2
View File
@@ -33,7 +33,7 @@ Imports System.Runtime.InteropServices
' by using the '*' as shown below: ' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")> ' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("1.0.2.*")> <Assembly: AssemblyVersion("1.0.3.*")>
<Assembly: AssemblyFileVersion("1.0.2.0")> <Assembly: AssemblyFileVersion("1.0.3.0")>
<Assembly: NeutralResourcesLanguageAttribute("en")> <Assembly: NeutralResourcesLanguageAttribute("en")>
+9
View File
@@ -78,6 +78,15 @@ Namespace My.Resources
End Get End Get
End Property 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> '''<summary>
''' Looks up a localized string similar to This function is currently not available on a Unix based operating system.. ''' Looks up a localized string similar to This function is currently not available on a Unix based operating system..
'''</summary> '''</summary>
+3
View File
@@ -1798,4 +1798,7 @@
<data name="mgrBackup_7zFatalError" xml:space="preserve"> <data name="mgrBackup_7zFatalError" xml:space="preserve">
<value>[PARAM] backup failed due to an error.</value> <value>[PARAM] backup failed due to an error.</value>
</data> </data>
<data name="App_ErrorFocus" xml:space="preserve">
<value>GBM is busy with an open window on your desktop.</value>
</data>
</root> </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/ http://mikemaximus.github.io/gbm-web/
gamebackupmonitor@gmail.com gamebackupmonitor@gmail.com
July 1, 2017 August 2, 2017
New in 1.02 New in 1.03
- (Windows) Upgraded SQLite to 3.19.3. - (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.
- (All) The SQLite version is displayed on the "About" screen. - (Windows) Fixed various issues and inconsistent behavior when using the system tray and menu.
- (All) Added the ability to detect command parameters. - (Linux) Free drive space is now checked correctly when performing a backup. GBM now requires "df" (Coreutils) on Linux.
- Use parameter detection for better detection of games running in emulators or interpreters like DOSBox. - (All) Error messages related to SQLite will now be displayed correctly, instead of forcing the application to exit.
- 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.
The entire version history of GBM releases is available at http://mikemaximus.github.io/gbm-web/versionhistory.html The entire version history of GBM releases is available at http://mikemaximus.github.io/gbm-web/versionhistory.html