diff --git a/src/BreCalClient/HistoryDialog.xaml b/src/BreCalClient/HistoryDialog.xaml
index ba1dec8..aab9799 100644
--- a/src/BreCalClient/HistoryDialog.xaml
+++ b/src/BreCalClient/HistoryDialog.xaml
@@ -16,6 +16,17 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/BreCalClient/HistoryDialog.xaml.cs b/src/BreCalClient/HistoryDialog.xaml.cs
index b26325e..ce6cb2b 100644
--- a/src/BreCalClient/HistoryDialog.xaml.cs
+++ b/src/BreCalClient/HistoryDialog.xaml.cs
@@ -9,6 +9,7 @@ using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Printing;
using System.Windows;
+using System.Windows.Input;
namespace BreCalClient
{
@@ -45,6 +46,7 @@ namespace BreCalClient
private void Window_Loaded(object sender, RoutedEventArgs e)
{
+ Mouse.OverrideCursor = Cursors.Wait;
RefreshHistory();
}
@@ -53,6 +55,12 @@ namespace BreCalClient
this.Close();
}
+ private void checkboxMyOwnOnly_Checked(object sender, RoutedEventArgs e)
+ {
+ Mouse.OverrideCursor = Cursors.Wait;
+ RefreshHistory();
+ }
+
#endregion
#region private methods
@@ -60,6 +68,8 @@ namespace BreCalClient
private async void RefreshHistory()
{
List allHistories = new();
+ this.stackPanel.Children.Clear();
+
foreach (int shipcall_id in _shipcalls.Keys)
{
List shipcallHistory = await _staticApi.HistoryGetAsync(shipcall_id);
@@ -75,6 +85,7 @@ namespace BreCalClient
// create controls for all entries
foreach (History history in allHistories)
{
+ if (FilterShipcall(history.ShipcallId)) continue;
string shipname = "";
Ship? ship = this._shipcalls[history.ShipcallId].Ship;
if (ship != null)
@@ -94,10 +105,32 @@ namespace BreCalClient
hc.HistorySelected += (x) => { HistoryItemSelected?.Invoke(x); }; // bubble event
this.stackPanel.Children.Add(hc);
}
+
+ Mouse.OverrideCursor = null;
+ }
+
+ bool FilterShipcall(int shipcallId)
+ {
+ bool result = true;
+ if (shipcallId < 0) return result;
+ if(_shipcalls.TryGetValue(shipcallId, out ShipcallControlModel? scm))
+ {
+ if(this.checkboxMyOwnOnly.IsChecked ?? false)
+ {
+ foreach(ParticipantAssignment p in scm.AssignedParticipants.Values)
+ {
+ if (p.ParticipantId.Equals(App.Participant.Id)) return false;
+ }
+ }
+ else
+ {
+ return false;
+ }
+ }
+ return result;
}
#endregion
-
}
}
diff --git a/src/BreCalClient/MainWindow.xaml.cs b/src/BreCalClient/MainWindow.xaml.cs
index 5a05f24..f6349c0 100644
--- a/src/BreCalClient/MainWindow.xaml.cs
+++ b/src/BreCalClient/MainWindow.xaml.cs
@@ -22,6 +22,7 @@ using Newtonsoft.Json;
using Polly;
using System.Net.Http;
using System.Net;
+using System.Windows.Input;
namespace BreCalClient
@@ -160,6 +161,7 @@ namespace BreCalClient
{
if (_loginResult.Id > 0)
{
+ Mouse.OverrideCursor = Cursors.Wait;
this.busyIndicator.IsBusy = false;
this._userApi.Configuration.ApiKey["Authorization"] = _loginResult.Token;
this._shipcallApi.Configuration.ApiKey["Authorization"] = _loginResult.Token;
@@ -380,6 +382,7 @@ namespace BreCalClient
{
_refreshImmediately = true; // set flag to avoid timer loop termination
_tokenSource.Cancel(); // force timer loop end
+ Mouse.OverrideCursor = Cursors.Wait;
}
#endregion
@@ -492,7 +495,7 @@ namespace BreCalClient
}
this.FilterShipcalls();
- this.UpdateUI();
+ this.UpdateUI();
}
try
@@ -778,6 +781,7 @@ namespace BreCalClient
_uiUpdateRunning = 0;
}
+ Mouse.OverrideCursor = null;
}));
}