Additions and fixes for #178

This commit is contained in:
Michael J. Seiferling
2019-03-12 09:04:51 -06:00
parent 65458b4dc9
commit c362e511a8
6 changed files with 32 additions and 11 deletions
+10 -2
View File
@@ -30,6 +30,7 @@ Public Class frmMain
Private bMenuEnabled As Boolean = True
Private bLockdown As Boolean = True
Private bFirstRun As Boolean = False
Private bInitialLoad As Boolean = True
Private bProcessIsAdmin As Boolean = False
Private bLogToggle As Boolean = False
Private bShowToggle As Boolean = True
@@ -1748,10 +1749,11 @@ Public Class frmMain
Private Function VerifyAutoStartLinux(ByRef sErrorMessage As String) As Boolean
Dim oProcess As Process
Dim sDesktopFile As String = String.Empty
Dim sAutoStartFolder As String = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) & Path.DirectorySeparatorChar & ".config/autostart/"
'Check if the app is still properly installed
If File.Exists("/usr/share/applications/gbm.desktop") Then
If mgrPath.VerifyLinuxDesktopFileLocation(sDesktopFile) Then
If File.Exists(sAutoStartFolder & Path.DirectorySeparatorChar & "gbm.desktop") Then
Return True
Else
@@ -1763,7 +1765,7 @@ Public Class frmMain
Try
oProcess = New Process
oProcess.StartInfo.FileName = "/bin/ln"
oProcess.StartInfo.Arguments = "-s /usr/share/applications/gbm.desktop " & sAutoStartFolder
oProcess.StartInfo.Arguments = "-s " & sDesktopFile & " " & sAutoStartFolder
oProcess.StartInfo.UseShellExecute = False
oProcess.StartInfo.RedirectStandardOutput = True
oProcess.StartInfo.CreateNoWindow = True
@@ -1973,6 +1975,12 @@ Public Class frmMain
End Sub
Private Sub frmMain_Activated(sender As System.Object, e As System.EventArgs) Handles MyBase.Activated
If bInitialLoad Then
If oSettings.StartToTray And mgrCommon.IsUnix Then
Me.WindowState = FormWindowState.Minimized
End If
bInitialLoad = False
End If
txtLog.Select(txtLog.TextLength, 0)
txtLog.ScrollToCaret()
End Sub
+4 -4
View File
@@ -18,9 +18,10 @@ Public Class frmSettings
Private Sub HandleLinuxAutoStart(ByVal bToggle As Boolean)
Dim oProcess As Process
Dim sDesktopFile = String.Empty
Dim sAutoStartFolder As String = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) & Path.DirectorySeparatorChar & ".config/autostart/"
If bToggle Then
If bToggle And mgrPath.VerifyLinuxDesktopFileLocation(sDesktopFile) Then
'Create the autostart folder if it doesn't exist yet
If Not Directory.Exists(sAutoStartFolder) Then
Directory.CreateDirectory(sAutoStartFolder)
@@ -29,7 +30,7 @@ Public Class frmSettings
Try
oProcess = New Process
oProcess.StartInfo.FileName = "/bin/ln"
oProcess.StartInfo.Arguments = "-s /usr/share/applications/gbm.desktop " & sAutoStartFolder
oProcess.StartInfo.Arguments = "-s " & sDesktopFile & " " & sAutoStartFolder
oProcess.StartInfo.UseShellExecute = False
oProcess.StartInfo.RedirectStandardOutput = True
oProcess.StartInfo.CreateNoWindow = True
@@ -358,10 +359,9 @@ Public Class frmSettings
If mgrCommon.IsUnix Then
'Only enable this option on Linux if GBM was installed with an official method
If Not File.Exists("/usr/share/applications/gbm.desktop") Then
If Not mgrPath.VerifyLinuxDesktopFileLocation() Then
chkAutoStart.Enabled = False
End If
chkStartMinimized.Enabled = False
End If
'Handle Panels
+13
View File
@@ -652,4 +652,17 @@ Public Class mgrPath
Return True
End Function
Public Shared Function VerifyLinuxDesktopFileLocation(Optional ByRef sFoundPath As String = "") As Boolean
Dim sLocations As String() = New String() {"/usr/share/applications/gbm.desktop", "/usr/local/share/applications/gbm.desktop"}
For Each s As String In sLocations
If File.Exists(s) Then
sFoundPath = s
Return True
End If
Next
Return False
End Function
End Class
+1 -1
View File
@@ -3310,7 +3310,7 @@ Namespace My.Resources
End Property
'''<summary>
''' Looks up a localized string similar to GBM is set to start automatically, but the desktop link is missing. Automatic start has been disabled, please re-install GBM using a package manager..
''' Looks up a localized string similar to GBM is set to start automatically, but the desktop link is missing. Automatic start has been disabled, please re-install GBM using a package manager or the makefile..
'''</summary>
Friend ReadOnly Property frmMain_ErrorLinuxAutoStartLinkMissing() As String
Get
+1 -1
View File
@@ -2369,7 +2369,7 @@
<value>[PARAM] stores saved games in the Windows registry, accessing the registry requires elevated permissions. Please restart GBM as Administrator to restore this backup.</value>
</data>
<data name="frmMain_ErrorLinuxAutoStartLinkMissing" xml:space="preserve">
<value>GBM is set to start automatically, but the desktop link is missing. Automatic start has been disabled, please re-install GBM using a package manager.</value>
<value>GBM is set to start automatically, but the desktop link is missing. Automatic start has been disabled, please re-install GBM using a package manager or the makefile.</value>
</data>
<data name="mgrCommon_FolderSelection" xml:space="preserve">
<value>Current Folder</value>
+3 -3
View File
@@ -31,9 +31,9 @@ Windows:
Linux:
- You can now set GBM to automatically start on log-in via the "Startup" Settings.
- This requires that GBM be installed via a package manager, so any required files are in a known location. The option will be disabled otherwise.
- The "Start Minimized" option is still unavailable in Linux due to issues with Mono.
- You can now set GBM to automatically start on log-in via the "Startup" settings.
- This requires that GBM be installed via a package manager or the makefile, so any required files are in a known location. The option will be disabled otherwise.
- The "Start Minimized" option is now available in "Startup" settings.
- GBM now stores all Wine configuration data seperately from the core game configuration:
- The core configuration is no longer altered in any way when a game is detected running in Wine or Proton.
- The Wine configuration data is now automatically updated each time a game is detected, such as when running the game from a new prefix.