Skip to content

Commit

Permalink
Add hidden setting to allow multiple instances. closes #396
Browse files Browse the repository at this point in the history
  • Loading branch information
Iridium-IO committed Feb 29, 2024
1 parent e336354 commit 70bcd6b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 5 additions & 2 deletions CompactGUI/Application.xaml.vb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ Class Application

Private Async Sub Application_Startup(sender As Object, e As StartupEventArgs)

If Not mutex.WaitOne(0, False) Then
SettingsHandler.InitialiseSettings()


If Not SettingsHandler.AppSettings.AllowMultiInstance AndAlso Not mutex.WaitOne(0, False) Then

If e.Args.Length <> 0 AndAlso e.Args(0) = "-tray" Then
MessageBox.Show("An instance of CompactGUI is already running")
Expand All @@ -27,7 +30,7 @@ Class Application
End Using

Application.Current.Shutdown()
Else
ElseIf Not SettingsHandler.AppSettings.AllowMultiInstance Then

ProcessNextInstanceMessage()
End If
Expand Down
2 changes: 2 additions & 0 deletions CompactGUI/Models/SetttingsHandler.vb
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ Public Class Settings : Inherits ObservableObject
Public Property WindowWidth As Decimal = 500
Public Property WindowHeight As Decimal = 800

Public Property AllowMultiInstance As Boolean = False

'TODO: Add local saving of per-folder skip list
Public Sub Save()
SettingsHandler.WriteToFile()
Expand Down

0 comments on commit 70bcd6b

Please sign in to comment.