\r
_config.Sounds.Volume = (int)numericUpDownSoundVolume.Value;\r
foreach (var name in Config.NotificationNames)\r
- _config.Sounds[name] = _soundSettings[name];\r
+ _config.Sounds[name] = MakePathRooted(_soundSettings[name]);\r
}\r
\r
private bool ValidatePorts(out int listen, out int outbound, out int server)\r
{\r
_config.Log.On = checkBoxOutput.Checked;\r
_config.Log.MaterialLogInterval = (int)numericUpDownMaterialLogInterval.Value;\r
- _config.Log.OutputDir = textBoxOutput.Text;\r
+ _config.Log.OutputDir = MakePathRooted(textBoxOutput.Text);\r
_main.ApplyLogSetting();\r
}\r
\r
private void ApplyDebugSettings()\r
{\r
_config.DebugLogging = checkBoxDebugLog.Checked;\r
- _config.DebugLogFile = textBoxDebugLog.Text;\r
+ _config.DebugLogFile = MakePathRooted(textBoxDebugLog.Text);\r
_main.ApplyDebugLogSetting();\r
}\r
\r
+ private string MakePathRooted(string path)\r
+ {\r
+ try\r
+ {\r
+ return string.IsNullOrWhiteSpace(path)\r
+ ? ""\r
+ : Path.IsPathRooted(path)\r
+ ? path\r
+ : Path.Combine(Config.BaseDir, path);\r
+ }\r
+ catch (ArgumentException)\r
+ {\r
+ return "";\r
+ }\r
+ }\r
+\r
private void textBoxSoundFile_TextChanged(object sender, EventArgs e)\r
{\r
_soundSettings[(string)listBoxSoundFile.SelectedItem] = textBoxSoundFile.Text;\r