diff --git a/Client/Browser_Tools/BrowserJSObject.cs b/Client/Browser_Tools/BrowserJSObject.cs index 55c863a0..e5e4292f 100644 --- a/Client/Browser_Tools/BrowserJSObject.cs +++ b/Client/Browser_Tools/BrowserJSObject.cs @@ -124,7 +124,17 @@ namespace Active_Client.Browser_Tools return; //Invoke method if is needed or call the method in STD mode - mainForm.Close(); + + //Invoke method if is needed or call the method in STD mode + if (mainForm.InvokeRequired) + mainForm.Invoke((MethodInvoker)delegate () + { + mainForm.sendClose(); + }); + else + { + mainForm.sendClose(); + } } // Reload Broken Page @@ -320,7 +330,7 @@ namespace Active_Client.Browser_Tools if (drive.IsReady) drivelist.Add(new Drive() { - Name = ElaborateName(drive.VolumeLabel, drive.DriveType), + Name = ElaborateName(drive.VolumeLabel,drive.Name, drive.DriveType), Path = drive.RootDirectory.ToString(), Type = ElaborateType(drive.DriveType) }); @@ -328,7 +338,7 @@ namespace Active_Client.Browser_Tools drivelist.Add(new Drive() { - Name = ElaborateName("Desktop", DriveType.Unknown), + Name = ElaborateName("Desktop", "", DriveType.Unknown), Path = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\", Type = "SPFO" }); @@ -337,7 +347,7 @@ namespace Active_Client.Browser_Tools { drivelist.Add(new Drive() { - Name = ElaborateName("PartPrg", DriveType.Unknown), + Name = ElaborateName("PartPrg", "", DriveType.Unknown), Path = PART_PRG_FOLDER + "\\", Type = "SPFO" }); @@ -618,20 +628,27 @@ namespace Active_Client.Browser_Tools } // Private functions - private String ElaborateName(String name, DriveType type) + private String ElaborateName(String name, String letter, DriveType type) { + var retName = ""; + if (!String.IsNullOrWhiteSpace(name)) - return name; + retName = name; else { switch (type) { - case DriveType.Fixed: return "Hard_Disk"; - case DriveType.Removable: return "Usb_Disk"; - case DriveType.Network: return "Netword_Disk"; + case DriveType.Fixed: retName = "Hard_Disk";break; + case DriveType.Removable: retName = "Usb_Disk"; break; + case DriveType.Network: retName = "Netword_Disk"; break; + default: retName = "Undefined"; break; } - return "Undefined Drive"; } + + if (!String.IsNullOrWhiteSpace(letter)) + retName = retName + " (" + letter + ")"; + + return retName; } private String ElaborateType(DriveType type) diff --git a/Client/Program.cs b/Client/Program.cs index a0b5e958..2357b91b 100644 --- a/Client/Program.cs +++ b/Client/Program.cs @@ -188,7 +188,7 @@ namespace Active_Client e.Settings.CachePath = Constants.BROWSER_CACHE_FOLDER; e.Settings.LocalesDirPath = Constants.CEF_LOCALES_PATH; e.Settings.ResourcesDirPath = CfxRuntime.LibCefDirPath; - e.Settings.Locale = CultureInfo.InstalledUICulture.TwoLetterISOLanguageName ; + e.Settings.Locale = CultureInfo.CurrentUICulture.TwoLetterISOLanguageName ; } diff --git a/Client/View/MainForm.cs b/Client/View/MainForm.cs index d51d070c..97fd56fb 100644 --- a/Client/View/MainForm.cs +++ b/Client/View/MainForm.cs @@ -150,53 +150,49 @@ namespace Active_Client.View } + public void sendClose() + { + //Show Taskbar + NcWindow.ShowTaskBar(); + + //Close Virtual Keyboard Runtime + if (Config.ClientConfig.ShowVirtualKeyboard && Environment.OSVersion.Version.Major < 10) + NcWindow.closeVirtualKeyboard(); + + //Close the NC HMI && Stop Following Nc + if (Config.VendorHmiConfig.Enabled) + NcWindow.CloseNcWindow(false); + + //Close Server + if (Config.ClientConfig.Autorun) + { + Process[] proc = Process.GetProcessesByName("Active"); + foreach (Process p in proc) + { + p.Kill(); + p.WaitForExit(); + } + } + + if (Config.ProdSoftwareConfig.Enabled) + NcWindow.CloseProdWindow(false); + + //Close Chromium Runtime + try + { + CfxRuntime.Shutdown(); + Close(); + } + catch (Exception) + { + + } + } //Before closing the Window -> Remove the Browser (Increase the speed of closing window) private void MainForm_FormClosing(object sender, FormClosingEventArgs e) { - //Invoke method if is needed or call the method in STD mode - if (!IsDisposed) - { - //Show Taskbar - NcWindow.ShowTaskBar(); - - //Hide Window - Hide(); - - //Close Virtual Keyboard Runtime - if (Config.ClientConfig.ShowVirtualKeyboard && Environment.OSVersion.Version.Major < 10) - NcWindow.closeVirtualKeyboard(); - - //Close the NC HMI && Stop Following Nc - if (Config.VendorHmiConfig.Enabled) - NcWindow.CloseNcWindow(false); - - //Close Server - if (Config.ClientConfig.Autorun) - { - Process[] proc = Process.GetProcessesByName("Active"); - foreach(Process p in proc) - { - p.Kill(); - p.WaitForExit(); - } - } - - if (Config.ProdSoftwareConfig.Enabled) - NcWindow.CloseProdWindow(false); - - //Close Chromium Runtime - try - { - CfxRuntime.Shutdown(); - } - catch (Exception) - { - - } - } - - + } #endregion diff --git a/Client/View/NcWindow.cs b/Client/View/NcWindow.cs index 1e4a349f..0e5931bf 100644 --- a/Client/View/NcWindow.cs +++ b/Client/View/NcWindow.cs @@ -256,6 +256,10 @@ namespace Active_Client.View RemoveFrameBorder(ncprocess.MainWindowHandle); + //Maximize Window if is Osai + if (Config.VendorHmiConfig.Type == 3) + ShowWindow(ncprocess.MainWindowHandle, SW_SHOWMAXIMIZED); + return 0; } @@ -1404,8 +1408,16 @@ namespace Active_Client.View //Show Task Bar ShowTaskBar(); - //Exit from Application - Environment.Exit(0); + //Exit from Application + if (mainFrm.InvokeRequired) + mainFrm.Invoke((MethodInvoker)delegate () + { + mainFrm.sendClose(); + }); + else + { + mainFrm.sendClose(); + } } Thread.Sleep(1000); diff --git a/Libs/CMS_CORE_Library.dll b/Libs/CMS_CORE_Library.dll index 4ad1d2ab..65d3ae8e 100644 Binary files a/Libs/CMS_CORE_Library.dll and b/Libs/CMS_CORE_Library.dll differ diff --git a/Step.Utils/languages/IT.xml b/Step.Utils/languages/IT.xml index 5f31b696..05f13019 100644 --- a/Step.Utils/languages/IT.xml +++ b/Step.Utils/languages/IT.xml @@ -572,6 +572,7 @@ Data di creazione: Data di ult. mod: Preview non disponibile + Carica tutti i file nella cartella selezionata NC diff --git a/Step.Utils/languages/en.xml b/Step.Utils/languages/en.xml index a2f452bf..779cbb74 100644 --- a/Step.Utils/languages/en.xml +++ b/Step.Utils/languages/en.xml @@ -570,6 +570,7 @@ Creation Date: Last change Date: Preview not available + Upload all files in selected folder NC