From d54140e39726c93bce99b143f6b055b941c6f946 Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Mon, 22 Apr 2024 09:18:54 +0200 Subject: [PATCH] Fixed a bug where complete shiplist was selectable instead of only non-deleted ships after closing the shiplist editor --- src/BreCalClient/EditShipcallControl.xaml.cs | 2 +- src/BreCalClient/MainWindow.xaml.cs | 16 +++++++++++----- src/BreCalClient/ShipListDialog.xaml.cs | 2 +- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/BreCalClient/EditShipcallControl.xaml.cs b/src/BreCalClient/EditShipcallControl.xaml.cs index 86ce4ef..7f0acf1 100644 --- a/src/BreCalClient/EditShipcallControl.xaml.cs +++ b/src/BreCalClient/EditShipcallControl.xaml.cs @@ -396,7 +396,7 @@ namespace BreCalClient // reload combobox this.comboBoxShip.ItemsSource = null; - this.comboBoxShip.ItemsSource = BreCalLists.AllShips; + this.comboBoxShip.ItemsSource = BreCalLists.Ships; } #endregion diff --git a/src/BreCalClient/MainWindow.xaml.cs b/src/BreCalClient/MainWindow.xaml.cs index 505c582..5a05f24 100644 --- a/src/BreCalClient/MainWindow.xaml.cs +++ b/src/BreCalClient/MainWindow.xaml.cs @@ -269,9 +269,13 @@ namespace BreCalClient // if this was an arrival, create the matching departure call and open it if (esc.ShipcallModel.Shipcall?.Type == ShipcallType.Arrival) { - ShipcallControlModel scmOut = new(); - scmOut.Shipcall = new(); - scmOut.Shipcall.Type = ShipcallType.Departure; + ShipcallControlModel scmOut = new() + { + Shipcall = new() + { + Type = ShipcallType.Departure + } + }; scmOut.Shipcall.ShipId = esc.ShipcallModel.Shipcall.ShipId; scmOut.Ship = esc.ShipcallModel.Ship; DateTime eta = esc.ShipcallModel.Shipcall?.Eta ?? DateTime.Now; @@ -292,8 +296,10 @@ namespace BreCalClient private void buttonInfo_Click(object sender, RoutedEventArgs e) { - AboutDialog ad = new(); - ad.LoginResult = this._loginResult; + AboutDialog ad = new() + { + LoginResult = this._loginResult + }; ad.ChangePasswordRequested += async (oldPw, newPw) => { if (_loginResult != null) diff --git a/src/BreCalClient/ShipListDialog.xaml.cs b/src/BreCalClient/ShipListDialog.xaml.cs index 5d862ab..c04b396 100644 --- a/src/BreCalClient/ShipListDialog.xaml.cs +++ b/src/BreCalClient/ShipListDialog.xaml.cs @@ -90,7 +90,7 @@ namespace BreCalClient private async void DataGridShips_CreateRequested() { - ShipModel shipModel = new ShipModel(new Ship()); + ShipModel shipModel = new(new Ship()); EditShipDialog esd = new() { Ship = shipModel.Ship