Skip to content

Commit 70bcd6b

Browse files
committed
Add hidden setting to allow multiple instances. closes #396
1 parent e336354 commit 70bcd6b

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

CompactGUI/Application.xaml.vb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ Class Application
1111

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

14-
If Not mutex.WaitOne(0, False) Then
14+
SettingsHandler.InitialiseSettings()
15+
16+
17+
If Not SettingsHandler.AppSettings.AllowMultiInstance AndAlso Not mutex.WaitOne(0, False) Then
1518

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

2932
Application.Current.Shutdown()
30-
Else
33+
ElseIf Not SettingsHandler.AppSettings.AllowMultiInstance Then
3134

3235
ProcessNextInstanceMessage()
3336
End If

CompactGUI/Models/SetttingsHandler.vb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ Public Class Settings : Inherits ObservableObject
105105
Public Property WindowWidth As Decimal = 500
106106
Public Property WindowHeight As Decimal = 800
107107

108+
Public Property AllowMultiInstance As Boolean = False
109+
108110
'TODO: Add local saving of per-folder skip list
109111
Public Sub Save()
110112
SettingsHandler.WriteToFile()

0 commit comments

Comments
 (0)