Cleaned up GBM initilization

This commit is contained in:
Michael J. Seiferling
2019-03-12 10:05:16 -06:00
parent c362e511a8
commit c3cd8dce3a
3 changed files with 43 additions and 43 deletions
+39 -41
View File
@@ -1974,17 +1974,6 @@ Public Class frmMain
RestartAsAdmin()
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
Private Sub Main_FormClosing(sender As System.Object, e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
'Unix Handler
If mgrCommon.IsUnix And Not bShutdown Then
@@ -2171,19 +2160,41 @@ Public Class frmMain
oProcess.StartTime = Now : oProcess.EndTime = Now
End Sub
Private Sub Main_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
Private Sub frmMain_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
SetForm()
End Sub
Private Sub frmMain_Activated(sender As System.Object, e As System.EventArgs) Handles MyBase.Activated
'Init
Try
SetForm()
VerifyGameDataPath()
LoadAndVerify()
If Not bInitFail Then
If bInitialLoad Then
Try
VerifyGameDataPath()
LoadAndVerify()
Catch ex As Exception
If mgrCommon.ShowMessage(frmMain_ErrorInitFailure, ex.Message & vbCrLf & ex.StackTrace, MsgBoxStyle.YesNo) = MsgBoxResult.No Then
bInitFail = True
End If
End Try
If bInitFail Then
bShutdown = True
Me.Close()
Else
VerifyCustomPathVariables()
If oSettings.StartToTray And Not mgrCommon.IsUnix Then
bShowToggle = False
Me.Visible = False
Me.ShowInTaskbar = False
'Windows and Linux require different settings for the system tray
If mgrCommon.IsUnix Then
Me.MinimizeBox = True
If oSettings.StartToTray Then
Me.WindowState = FormWindowState.Minimized
End If
Else
Me.gMonTray.Visible = True
If oSettings.StartToTray Then
bShowToggle = False
Me.Visible = False
Me.ShowInTaskbar = False
End If
End If
If oSettings.MonitorOnStartup Then
@@ -2194,29 +2205,16 @@ Public Class frmMain
HandleScan()
CheckForNewBackups()
'Unix Handler
If mgrCommon.IsUnix Then
Me.MinimizeBox = True
Else
Me.gMonTray.Visible = True
End If
End If
Catch ex As Exception
If mgrCommon.ShowMessage(frmMain_ErrorInitFailure, ex.Message & vbCrLf & ex.StackTrace, MsgBoxStyle.YesNo) = MsgBoxResult.No Then
bInitFail = True
If bFirstRun And Not bShutdown Then
OpenStartupWizard()
End If
End Try
End Sub
Private Sub frmMain_Shown(sender As Object, e As EventArgs) Handles MyBase.Shown
If bInitFail Then
bShutdown = True
Me.Close()
End If
If bFirstRun And Not bShutdown Then
OpenStartupWizard()
bInitialLoad = False
Else
txtLog.Select(txtLog.TextLength, 0)
txtLog.ScrollToCaret()
End If
End Sub
+1 -1
View File
@@ -632,7 +632,7 @@ Public Class mgrPath
Sleep(5000)
iTotalWait += 5000
If iTotalWait >= iTimeOut Then
oDialogResult = mgrCommon.ShowMessage(mgrPath_ConfirmBackupLocation, sBackupPath, MsgBoxStyle.YesNoCancel)
oDialogResult = mgrCommon.ShowPriorityMessage(mgrPath_ConfirmBackupLocation, sBackupPath, MsgBoxStyle.YesNoCancel)
If oDialogResult = MsgBoxResult.Yes Then
dBrowser = New FolderBrowserDialog
dBrowser.SelectedPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)
+3 -1
View File
@@ -23,7 +23,8 @@ All Platforms:
- The disk space check prior to backups can now be disabled in the "Backup and Restore" settings.
- Added "Operating System" field to game configurations:
- "Windows" and "Linux" are the only valid choices at this time and only Linux users are allowed to change this field.
- Re-designed how GBM initilizes on startup.
Windows:
- Updated SQLite to 3.27.2
@@ -40,5 +41,6 @@ Linux:
- This data can be viewed and manually modified on the Game Manager.
- Fixed the handling of Wine/Proton games when multiple configurations are detected.
- Fixed a crash when using "Backup Only" and "New Backups Pending" filters on the Game Manager.
- The Mono and GBM process will now exit cleanly if a critical failure occurs during startup.
The entire version history of GBM releases is available at http://mikemaximus.github.io/gbm-web/versionhistory.html