From c5b9886d1457493178941661eb9d7afcfc0a0240 Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Tue, 7 Nov 2023 17:05:36 +0100 Subject: [PATCH] ok gestione lingua in oreferenze --- MP-TAB-SERV/Components/OdlMan.razor | 2 +- MP-TAB-SERV/Components/OdlMan.razor.cs | 23 +++++--- MP-TAB-SERV/Components/SelTempoMSMC.razor | 4 +- MP-TAB-SERV/Components/SelTempoMSMC.razor.cs | 15 ++++-- .../Components/TechSheet_ST_ObjView.razor.cs | 12 ++++- MP-TAB-SERV/MP-TAB-SERV.csproj | 2 +- MP-TAB-SERV/Pages/User.razor | 54 +++++++++++++++---- MP-TAB-SERV/Resources/ChangeLog.html | 2 +- MP-TAB-SERV/Resources/VersNum.txt | 2 +- MP-TAB-SERV/Resources/manifest.xml | 2 +- 10 files changed, 89 insertions(+), 29 deletions(-) diff --git a/MP-TAB-SERV/Components/OdlMan.razor b/MP-TAB-SERV/Components/OdlMan.razor index a591e081..47e4844f 100644 --- a/MP-TAB-SERV/Components/OdlMan.razor +++ b/MP-TAB-SERV/Components/OdlMan.razor @@ -129,7 +129,7 @@ } -
+
@@ -16,7 +16,7 @@ } else { -
+
@labelTempoIN
diff --git a/MP-TAB-SERV/Components/SelTempoMSMC.razor.cs b/MP-TAB-SERV/Components/SelTempoMSMC.razor.cs index c1efc09e..09532abd 100644 --- a/MP-TAB-SERV/Components/SelTempoMSMC.razor.cs +++ b/MP-TAB-SERV/Components/SelTempoMSMC.razor.cs @@ -1,5 +1,6 @@ using global::Microsoft.AspNetCore.Components; using MP.Data.Services; +using MP_TAB_SERV.Pages; namespace MP_TAB_SERV.Components { @@ -159,7 +160,7 @@ namespace MP_TAB_SERV.Components protected override void OnInitialized() { - baseLang = SMServ.GetConf("baseLang"); + //baseLang = SMServ.GetConf("baseLang"); } protected override void OnParametersSet() @@ -181,7 +182,15 @@ namespace MP_TAB_SERV.Components #region Private Fields - private string baseLang = "IT"; + private string _baseLang { get; set; } = "IT"; + private string baseLang + { + get => _baseLang; + set + { + MsgServ.UserPrefGet("Lang"); + } + } #endregion Private Fields @@ -216,7 +225,7 @@ namespace MP_TAB_SERV.Components { get { - string answ = tcMode == "ms" ? $"--> {TempoMS.TotalMinutes:N0}:{TempoMS:ss} (min:sec)" : $"--> {TempoMC:0.000} (min.cent)"; + string answ = tcMode == "mc" ? $"--> {TempoMS.TotalMinutes:N0}:{TempoMS:ss} (min:sec)" : $"--> {TempoMC:0.000} (min.cent)"; return answ; } } diff --git a/MP-TAB-SERV/Components/TechSheet_ST_ObjView.razor.cs b/MP-TAB-SERV/Components/TechSheet_ST_ObjView.razor.cs index 9c7624bf..92c92b35 100644 --- a/MP-TAB-SERV/Components/TechSheet_ST_ObjView.razor.cs +++ b/MP-TAB-SERV/Components/TechSheet_ST_ObjView.razor.cs @@ -91,7 +91,7 @@ namespace MP_TAB_SERV.Components protected override void OnInitialized() { imgBasePath = Environment.CurrentDirectory; - baseLang = SMServ.GetConf("baseLang"); + //baseLang = SMServ.GetConf("baseLang"); enableForceParamSchedaTecnica = SMServ.GetConfBool("enableForceParamSchedaTecnica"); } @@ -117,7 +117,15 @@ namespace MP_TAB_SERV.Components #region Private Fields - private string baseLang = "IT"; + private string _baseLang { get; set; } = "IT"; + private string baseLang + { + get => _baseLang; + set + { + MServ.UserPrefGet("Lang"); + } + } private bool enableForceParamSchedaTecnica = false; private bool hasDeroga = false; private string imgBasePath = ""; diff --git a/MP-TAB-SERV/MP-TAB-SERV.csproj b/MP-TAB-SERV/MP-TAB-SERV.csproj index 2447ad39..972a0e06 100644 --- a/MP-TAB-SERV/MP-TAB-SERV.csproj +++ b/MP-TAB-SERV/MP-TAB-SERV.csproj @@ -3,7 +3,7 @@ net6.0 enable - 6.16.2311.711 + 6.16.2311.716 enable MP_TAB_SERV diff --git a/MP-TAB-SERV/Pages/User.razor b/MP-TAB-SERV/Pages/User.razor index 9926fb98..18b5399d 100644 --- a/MP-TAB-SERV/Pages/User.razor +++ b/MP-TAB-SERV/Pages/User.razor @@ -43,15 +43,27 @@
+
+ Preferenze +
  • Modalità di inserimento del tempo ciclo
    -
    - - +
    +
    + + +
  • +
  • +
    Lingua
    + +
@@ -80,19 +92,24 @@ await Task.Delay(1); tcModIns = tcMode; } + protected async Task setLang(string lang) + { + await Task.Delay(1); + langIns = lang; + } protected string btnMsStyle { get { string answ = ""; - if(tcModIns == "ms") + if (tcModIns == "ms") { answ = "btn-primary"; } else { - answ = "btn-secondary"; + answ = "btn-outline-secondary"; } return answ; } @@ -102,13 +119,13 @@ get { string answ = ""; - if(tcModIns == "mc") + if (tcModIns == "mc") { answ = "btn-primary"; } else { - answ = "btn-secondary"; + answ = "btn-outline-secondary"; } return answ; } @@ -121,13 +138,27 @@ get => _tcModIns; set { - if(_tcModIns != value) + if (_tcModIns != value) { _tcModIns = value; MsgServ.UserPrefSave("TcMode", value); } } } + protected string _langIns { get; set; } = ""; + + protected string langIns + { + get => _langIns; + set + { + if (_langIns != value) + { + _langIns = value; + MsgServ.UserPrefSave("Lang", value); + } + } + } public int Height { get; set; } = 0; public int Width { get; set; } = 0; @@ -151,10 +182,15 @@ protected async override Task OnInitializedAsync() { var tcPrefItem = MsgServ.UserPrefGet("TcMode"); - if(tcPrefItem != null) + if (tcPrefItem != null) { tcModIns = tcPrefItem; } + var langPrefItem = MsgServ.UserPrefGet("Lang"); + if (langPrefItem != null) + { + langIns = langPrefItem; + } await Task.Delay(1); if (string.IsNullOrEmpty(currIpv4)) { diff --git a/MP-TAB-SERV/Resources/ChangeLog.html b/MP-TAB-SERV/Resources/ChangeLog.html index 8d5cf9ca..8c31ce1a 100644 --- a/MP-TAB-SERV/Resources/ChangeLog.html +++ b/MP-TAB-SERV/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

Versione: 6.16.2311.711

+

Versione: 6.16.2311.716


Note di rilascio:
  • diff --git a/MP-TAB-SERV/Resources/VersNum.txt b/MP-TAB-SERV/Resources/VersNum.txt index 665d4358..b980696d 100644 --- a/MP-TAB-SERV/Resources/VersNum.txt +++ b/MP-TAB-SERV/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2311.711 +6.16.2311.716 diff --git a/MP-TAB-SERV/Resources/manifest.xml b/MP-TAB-SERV/Resources/manifest.xml index e62f83c9..b295e334 100644 --- a/MP-TAB-SERV/Resources/manifest.xml +++ b/MP-TAB-SERV/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2311.711 + 6.16.2311.716 https://nexus.steamware.net/repository/SWS/MP-TAB-SERV/stable/LAST/MP-TAB-SERV.zip https://nexus.steamware.net/repository/SWS/MP-TAB-SERV/stable/LAST/ChangeLog.html false