diff --git a/MP-TAB-SERV/Components/OdlMan.razor b/MP-TAB-SERV/Components/OdlMan.razor index 4d059695..ed325869 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 8fd6a164..24bb6308 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 { @@ -161,7 +162,7 @@ namespace MP_TAB_SERV.Components protected override void OnInitialized() { - baseLang = SMServ.GetConf("baseLang"); + //baseLang = SMServ.GetConf("baseLang"); } protected override void OnParametersSet() @@ -183,7 +184,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 @@ -218,7 +227,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/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)) {