Merge branch 'feature/win_client_changes_sprint_1' of ssh://lager/mnt/ext/git/git_brcal into feature/win_client_changes_sprint_1
This commit is contained in:
commit
e7614a085c
@ -4,6 +4,9 @@
|
|||||||
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
|
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
|
||||||
<section name="BreCalClient.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
|
<section name="BreCalClient.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
|
||||||
</sectionGroup>
|
</sectionGroup>
|
||||||
|
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
|
||||||
|
<section name="BreCalClient.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||||
|
</sectionGroup>
|
||||||
</configSections>
|
</configSections>
|
||||||
<applicationSettings>
|
<applicationSettings>
|
||||||
<BreCalClient.Properties.Settings>
|
<BreCalClient.Properties.Settings>
|
||||||
@ -21,4 +24,11 @@
|
|||||||
</setting>
|
</setting>
|
||||||
</BreCalClient.Properties.Settings>
|
</BreCalClient.Properties.Settings>
|
||||||
</applicationSettings>
|
</applicationSettings>
|
||||||
|
<userSettings>
|
||||||
|
<BreCalClient.Properties.Settings>
|
||||||
|
<setting name="FilterCriteria" serializeAs="String">
|
||||||
|
<value />
|
||||||
|
</setting>
|
||||||
|
</BreCalClient.Properties.Settings>
|
||||||
|
</userSettings>
|
||||||
</configuration>
|
</configuration>
|
||||||
@ -7,7 +7,7 @@
|
|||||||
<UseWPF>true</UseWPF>
|
<UseWPF>true</UseWPF>
|
||||||
<SignAssembly>True</SignAssembly>
|
<SignAssembly>True</SignAssembly>
|
||||||
<StartupObject>BreCalClient.App</StartupObject>
|
<StartupObject>BreCalClient.App</StartupObject>
|
||||||
<AssemblyOriginatorKeyFile>E:\gitlager\git_brcal\misc\brecal.snk</AssemblyOriginatorKeyFile>
|
<AssemblyOriginatorKeyFile>..\..\misc\brecal.snk</AssemblyOriginatorKeyFile>
|
||||||
<AssemblyVersion>0.6.0.0</AssemblyVersion>
|
<AssemblyVersion>0.6.0.0</AssemblyVersion>
|
||||||
<FileVersion>0.6.0.0</FileVersion>
|
<FileVersion>0.6.0.0</FileVersion>
|
||||||
<Title>Bremen calling client</Title>
|
<Title>Bremen calling client</Title>
|
||||||
|
|||||||
@ -85,7 +85,7 @@ namespace BreCalClient
|
|||||||
labelVersion.Text = "V. " + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
|
labelVersion.Text = "V. " + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
|
||||||
if (!string.IsNullOrEmpty(Properties.Settings.Default.APP_TITLE))
|
if (!string.IsNullOrEmpty(Properties.Settings.Default.APP_TITLE))
|
||||||
this.Title = Properties.Settings.Default.APP_TITLE;
|
this.Title = Properties.Settings.Default.APP_TITLE;
|
||||||
searchFilterControl.SearchFilterChanged += SearchFilterControl_SearchFilterChanged;
|
searchFilterControl.SearchFilterChanged += SearchFilterControl_SearchFilterChanged;
|
||||||
searchFilterControl.LogoImageClicked += () =>
|
searchFilterControl.LogoImageClicked += () =>
|
||||||
{
|
{
|
||||||
Process.Start("explorer", Properties.Settings.Default.LOGO_IMAGE_URL);
|
Process.Start("explorer", Properties.Settings.Default.LOGO_IMAGE_URL);
|
||||||
@ -95,6 +95,9 @@ namespace BreCalClient
|
|||||||
|
|
||||||
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
||||||
{
|
{
|
||||||
|
// serialize filter settings
|
||||||
|
Properties.Settings.Default.FilterCriteria = this.searchFilterControl.SearchFilter.Serialize();
|
||||||
|
Properties.Settings.Default.Save();
|
||||||
_tokenSource.Cancel();
|
_tokenSource.Cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -119,7 +122,7 @@ namespace BreCalClient
|
|||||||
this.busyIndicator.IsBusy = false;
|
this.busyIndicator.IsBusy = false;
|
||||||
this._api.Configuration.ApiKey["Authorization"] = _loginResult.Token;
|
this._api.Configuration.ApiKey["Authorization"] = _loginResult.Token;
|
||||||
this.LoadStaticLists();
|
this.LoadStaticLists();
|
||||||
this.labelUsername.Text = $"{_loginResult.FirstName} {_loginResult.LastName}";
|
this.labelUsername.Text = $"{_loginResult.FirstName} {_loginResult.LastName}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
labelGeneralStatus.Text = $"Connection {ConnectionStatus.SUCCESSFUL}";
|
labelGeneralStatus.Text = $"Connection {ConnectionStatus.SUCCESSFUL}";
|
||||||
@ -253,7 +256,14 @@ namespace BreCalClient
|
|||||||
agencies.Add(participant);
|
agencies.Add(participant);
|
||||||
}
|
}
|
||||||
this.searchFilterControl.SetAgencies(agencies);
|
this.searchFilterControl.SetAgencies(agencies);
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(Properties.Settings.Default.FilterCriteria))
|
||||||
|
{
|
||||||
|
SearchFilterModel? sfm = SearchFilterModel.Deserialize(Properties.Settings.Default.FilterCriteria);
|
||||||
|
if (sfm != null)
|
||||||
|
this.searchFilterControl.SetFilterFromModel(sfm);
|
||||||
|
}
|
||||||
|
|
||||||
_ = Task.Run(() => RefreshShipcalls());
|
_ = Task.Run(() => RefreshShipcalls());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
14
src/BreCalClient/Properties/Settings.Designer.cs
generated
14
src/BreCalClient/Properties/Settings.Designer.cs
generated
@ -12,7 +12,7 @@ namespace BreCalClient.Properties {
|
|||||||
|
|
||||||
|
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.5.0.0")]
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.6.0.0")]
|
||||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||||
|
|
||||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||||
@ -58,5 +58,17 @@ namespace BreCalClient.Properties {
|
|||||||
return ((string)(this["LOGO_IMAGE_URL"]));
|
return ((string)(this["LOGO_IMAGE_URL"]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
||||||
|
public string FilterCriteria {
|
||||||
|
get {
|
||||||
|
return ((string)(this["FilterCriteria"]));
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
this["FilterCriteria"] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,5 +14,8 @@
|
|||||||
<Setting Name="LOGO_IMAGE_URL" Type="System.String" Scope="Application">
|
<Setting Name="LOGO_IMAGE_URL" Type="System.String" Scope="Application">
|
||||||
<Value Profile="(Default)">https://www.textbausteine.net/</Value>
|
<Value Profile="(Default)">https://www.textbausteine.net/</Value>
|
||||||
</Setting>
|
</Setting>
|
||||||
|
<Setting Name="FilterCriteria" Type="System.String" Scope="User">
|
||||||
|
<Value Profile="(Default)" />
|
||||||
|
</Setting>
|
||||||
</Settings>
|
</Settings>
|
||||||
</SettingsFile>
|
</SettingsFile>
|
||||||
@ -79,6 +79,40 @@ namespace BreCalClient
|
|||||||
this.upDownShiplengthTo.Value = null;
|
this.upDownShiplengthTo.Value = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
internal void SetFilterFromModel(SearchFilterModel sfm)
|
||||||
|
{
|
||||||
|
this.ClearFilters();
|
||||||
|
|
||||||
|
if(sfm.Berths != null)
|
||||||
|
{
|
||||||
|
foreach(Berth berth in this.comboBoxBerths.ItemsSource)
|
||||||
|
{
|
||||||
|
if (sfm.Berths.Contains(berth.Id)) this.comboBoxBerths.SelectedItems.Add(berth);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(sfm.Agencies != null)
|
||||||
|
{
|
||||||
|
foreach(Participant p in this.comboBoxAgencies.ItemsSource)
|
||||||
|
{
|
||||||
|
if(sfm.Agencies.Contains(p.Id)) this.comboBoxAgencies.SelectedItems.Add(p);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(sfm.Categories != null)
|
||||||
|
{
|
||||||
|
foreach(int category in sfm.Categories)
|
||||||
|
this.comboBoxCategories.SelectedItems.Add((Extensions.TypeEnum)category);
|
||||||
|
}
|
||||||
|
if (sfm.SearchString != null) this.textBoxSearch.Text = sfm.SearchString;
|
||||||
|
this.upDownShiplengthFrom.Value = sfm.ShipLengthFrom;
|
||||||
|
this.upDownShiplengthTo.Value = sfm.ShipLengthTo;
|
||||||
|
this.datePickerETAFrom.SelectedDate = sfm.EtaFrom;
|
||||||
|
this.datePickerETATo.SelectedDate = sfm.EtaTo;
|
||||||
|
|
||||||
|
this._model = sfm;
|
||||||
|
SearchFilterChanged?.Invoke();
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region event handler
|
#region event handler
|
||||||
@ -94,13 +128,14 @@ namespace BreCalClient
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void datePickerETAFrom_SelectedDateChanged(object sender, SelectionChangedEventArgs e)
|
private void datePickerETAFrom_SelectedDateChanged(object sender, SelectionChangedEventArgs e)
|
||||||
{
|
{
|
||||||
|
this._model.EtaFrom = this.datePickerETAFrom.SelectedDate;
|
||||||
SearchFilterChanged?.Invoke();
|
SearchFilterChanged?.Invoke();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void datePickerETATo_SelectedDateChanged(object sender, SelectionChangedEventArgs e)
|
private void datePickerETATo_SelectedDateChanged(object sender, SelectionChangedEventArgs e)
|
||||||
{
|
{
|
||||||
//_model.EtaTo = datePickerETATo.SelectedDate;
|
this._model.EtaTo = datePickerETATo.SelectedDate;
|
||||||
SearchFilterChanged?.Invoke();
|
SearchFilterChanged?.Invoke();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -115,11 +150,13 @@ namespace BreCalClient
|
|||||||
|
|
||||||
private void upDownShiplengthFrom_ValueChanged(object sender, System.Windows.RoutedPropertyChangedEventArgs<object> e)
|
private void upDownShiplengthFrom_ValueChanged(object sender, System.Windows.RoutedPropertyChangedEventArgs<object> e)
|
||||||
{
|
{
|
||||||
|
this._model.ShipLengthFrom = this.upDownShiplengthFrom.Value;
|
||||||
SearchFilterChanged?.Invoke();
|
SearchFilterChanged?.Invoke();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void upDownShiplengthTo_ValueChanged(object sender, System.Windows.RoutedPropertyChangedEventArgs<object> e)
|
private void upDownShiplengthTo_ValueChanged(object sender, System.Windows.RoutedPropertyChangedEventArgs<object> e)
|
||||||
{
|
{
|
||||||
|
this._model.ShipLengthTo = this.upDownShiplengthTo.Value;
|
||||||
SearchFilterChanged?.Invoke();
|
SearchFilterChanged?.Invoke();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -147,12 +184,13 @@ namespace BreCalClient
|
|||||||
|
|
||||||
private void textBoxSearch_PreviewTextInput(object sender, TextCompositionEventArgs e)
|
private void textBoxSearch_PreviewTextInput(object sender, TextCompositionEventArgs e)
|
||||||
{
|
{
|
||||||
this.SearchFilter.SearchString = e.Text;
|
this.SearchFilter.SearchString = this.textBoxSearch.Text + e.Text;
|
||||||
SearchFilterChanged?.Invoke();
|
SearchFilterChanged?.Invoke();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void textBoxSearch_TextChanged(object sender, TextChangedEventArgs e)
|
private void textBoxSearch_TextChanged(object sender, TextChangedEventArgs e)
|
||||||
{
|
{
|
||||||
|
this.SearchFilter.SearchString = this.textBoxSearch.Text;
|
||||||
SearchFilterChanged?.Invoke();
|
SearchFilterChanged?.Invoke();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -5,6 +5,7 @@
|
|||||||
using BreCalClient.misc.Model;
|
using BreCalClient.misc.Model;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace BreCalClient
|
namespace BreCalClient
|
||||||
{
|
{
|
||||||
@ -30,7 +31,17 @@ namespace BreCalClient
|
|||||||
|
|
||||||
public double? ShipLengthTo { get; set; }
|
public double? ShipLengthTo { get; set; }
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
public static SearchFilterModel? Deserialize(string json)
|
||||||
|
{
|
||||||
|
return (SearchFilterModel?) JsonConvert.DeserializeObject(json, typeof(SearchFilterModel));
|
||||||
|
}
|
||||||
|
|
||||||
|
public string Serialize()
|
||||||
|
{
|
||||||
|
return JsonConvert.SerializeObject(this, Formatting.Indented);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user