Skip to content

Commit

Permalink
Don't try to monitor the program settings file when it doesn't exist, f…
Browse files Browse the repository at this point in the history
…ixes #83
  • Loading branch information
maxim-zhao committed Jan 4, 2024
1 parent bb0e332 commit bdc17db
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions SidWiz/SidWizPlusGUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1000,12 +1000,15 @@ private void Initialize(object sender, EventArgs e)
HighDpiHelper.AdjustControlImagesDpiScale(this);
var settingsPath = GetSettingsPath();
LoadProgramSettings(settingsPath);
_settingsWatcher = new FileSystemWatcher
if (File.Exists(settingsPath))
{
Path = Path.GetDirectoryName(settingsPath),
Filter = Path.GetFileName(settingsPath)
};
_settingsWatcher.Changed += (o, args) => LoadProgramSettings(settingsPath);
_settingsWatcher = new FileSystemWatcher
{
Path = Path.GetDirectoryName(settingsPath),
Filter = Path.GetFileName(settingsPath)
};
_settingsWatcher.Changed += (o, args) => LoadProgramSettings(settingsPath);
}

ProgramSettingsGrid.BeginInvoke(new Action(() => { ProgramSettingsGrid.SelectedObject = _programSettings; }));

Expand Down

0 comments on commit bdc17db

Please sign in to comment.