diff --git a/GBM/Forms/frmMain.vb b/GBM/Forms/frmMain.vb index 52fac50..8b7b4d6 100644 --- a/GBM/Forms/frmMain.vb +++ b/GBM/Forms/frmMain.vb @@ -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 diff --git a/GBM/Managers/mgrPath.vb b/GBM/Managers/mgrPath.vb index 8348e2b..8dbee84 100644 --- a/GBM/Managers/mgrPath.vb +++ b/GBM/Managers/mgrPath.vb @@ -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) diff --git a/GBM/readme.txt b/GBM/readme.txt index b579295..e26833f 100644 --- a/GBM/readme.txt +++ b/GBM/readme.txt @@ -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 \ No newline at end of file