@@ -19,7 +19,7 @@ internal WatForm(WatApplication application) {
1919 application . CurrentWorldState . Update +=
2020 async worldState => OnWorldStateUpdate ( worldState . Fissures , await application . SolNodes ) ;
2121
22- application . AlertsUpdate += OnAlertsUpdate ;
22+ application . Settings . AlertsUpdate += OnAlertsUpdate ;
2323
2424 fissures . ImageRepository = application . ImageRepository ;
2525
@@ -34,7 +34,7 @@ private void ToggleWindowVisibility() {
3434
3535 private void OnWorldStateUpdate ( IReadOnlyCollection < Fissure > fissureList , JObject solNodes ) {
3636 fissures . Update ( fissureList , solNodes ) ;
37- OnAlertsUpdate ( Application . AlertCollection ) ;
37+ OnAlertsUpdate ( Application . Settings . Alerts ) ;
3838 }
3939
4040 private void OnAlertsUpdate ( AlertCollection alertsCollection ) {
@@ -44,18 +44,21 @@ private void OnAlertsUpdate(AlertCollection alertsCollection) {
4444 }
4545
4646 private void alerts_Click ( object sender , EventArgs e ) {
47- var alertCollection = Application . AlertCollection . Clone ( ) ;
47+ var alertCollection = Application . Settings . Alerts . Clone ( ) ;
4848
4949 using ( var form = new AlertsForm ( Application . CurrentWorldState , alertCollection ) ) {
5050 if ( form . ShowDialog ( this ) == DialogResult . OK ) {
51- Application . AlertCollection = alertCollection ;
51+ Application . Settings . Alerts = alertCollection ;
52+ Application . Settings . Save ( ) ;
5253 }
5354 }
5455 }
5556
5657 private async void options_Click ( object sender , EventArgs e ) {
57- using ( var form = new OptionsForm ( await FissureControl . CreateTestControl ( Application . ImageRepository ) ) ) {
58- form . ShowDialog ( this ) ;
58+ using ( var form = new OptionsForm ( Application . Settings , await FissureControl . CreateTestControl ( Application . ImageRepository ) ) ) {
59+ if ( form . ShowDialog ( this ) == DialogResult . OK ) {
60+ Application . Settings . Save ( ) ;
61+ }
5962 }
6063 }
6164
0 commit comments