Merge pull request #48 from HojouFotytu/develop
force loading local default settings on first run
This commit is contained in:
commit
d161c11a3a
|
@ -559,6 +559,7 @@ namespace Core.Main
|
||||||
|
|
||||||
SettingsFiles.CheckPresets(this.PTMagicConfiguration, this.Log, true);
|
SettingsFiles.CheckPresets(this.PTMagicConfiguration, this.Log, true);
|
||||||
|
|
||||||
|
EnforceSettingsReapply = true;
|
||||||
this.StartPTMagicIntervalTimer();
|
this.StartPTMagicIntervalTimer();
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
@ -903,7 +904,7 @@ namespace Core.Main
|
||||||
|
|
||||||
FileInfo generalSettingsFile = new FileInfo(Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar + "settings.general.json");
|
FileInfo generalSettingsFile = new FileInfo(Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar + "settings.general.json");
|
||||||
FileInfo analyzerSettingsFile = new FileInfo(Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar + "settings.analyzer.json");
|
FileInfo analyzerSettingsFile = new FileInfo(Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar + "settings.analyzer.json");
|
||||||
if (generalSettingsFile.LastWriteTime > this.LastSettingFileCheck || analyzerSettingsFile.LastWriteTime > this.LastSettingFileCheck)
|
if (generalSettingsFile.LastWriteTime > this.LastSettingFileCheck || analyzerSettingsFile.LastWriteTime > this.LastSettingFileCheck || EnforceSettingsReapply)
|
||||||
{
|
{
|
||||||
Log.DoLogInfo("Detected configuration changes. Reloading settings...");
|
Log.DoLogInfo("Detected configuration changes. Reloading settings...");
|
||||||
|
|
||||||
|
|
|
@ -90,7 +90,6 @@ namespace Core.ProfitTrailer
|
||||||
fileLines.Insert(0, "# ####################################");
|
fileLines.Insert(0, "# ####################################");
|
||||||
fileLines.Insert(0, "# PTMagic_LastChanged = " + DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToShortTimeString());
|
fileLines.Insert(0, "# PTMagic_LastChanged = " + DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToShortTimeString());
|
||||||
fileLines.Insert(0, "# PTMagic_ActiveSetting = " + SystemHelper.StripBadCode(ptmagicInstance.DefaultSettingName, Constants.WhiteListProperties));
|
fileLines.Insert(0, "# PTMagic_ActiveSetting = " + SystemHelper.StripBadCode(ptmagicInstance.DefaultSettingName, Constants.WhiteListProperties));
|
||||||
fileLines.Insert(0, "# ####### PTMagic Current Setting ########");
|
|
||||||
fileLines.Insert(0, "# ####################################");
|
fileLines.Insert(0, "# ####################################");
|
||||||
|
|
||||||
ptmagicInstance.GetType().GetProperty(fileType + "Lines").SetValue(ptmagicInstance, fileLines);
|
ptmagicInstance.GetType().GetProperty(fileType + "Lines").SetValue(ptmagicInstance, fileLines);
|
||||||
|
|
|
@ -7,7 +7,7 @@ using Core.Helper;
|
||||||
using Core.Main.DataObjects.PTMagicData;
|
using Core.Main.DataObjects.PTMagicData;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
|
||||||
[assembly: AssemblyVersion("2.1.0")]
|
[assembly: AssemblyVersion("2.1.1")]
|
||||||
[assembly: AssemblyProduct("PT Magic")]
|
[assembly: AssemblyProduct("PT Magic")]
|
||||||
|
|
||||||
namespace PTMagic
|
namespace PTMagic
|
||||||
|
|
Loading…
Reference in New Issue