public void tray_settings(object sender, EventArgs e) { if (_settingsOpen) { try { _settingsWindow.Focus(); } catch (Exception) { //ignore } return; } using (_settingsWindow = new frmSettings()) { _settingsOpen = true; _settingsWindow.actionManager = _actions; var tempConfig = _config.Clone(); _settingsWindow.config = _config; var dlgResult = _settingsWindow.ShowDialog(); if (dlgResult == DialogResult.OK) { _config = _settingsWindow.config; if (_settingsWindow.startWithWindows) { if (!Autostart.IsAutoStartEnabled()) { Autostart.SetAutoStart(); } } else { if (Autostart.IsAutoStartEnabled()) { Autostart.UnSetAutoStart(); } } _config.Save(_configPath); _actions.LoadConfig(_config); } else { _config = tempConfig; _synapticsHelper.Config = tempConfig; _actions.LoadConfig(_config); } _settingsWindow.Close(); _settingsOpen = false; } }
private void applyConfig() { actionManager.LoadConfig(config); }