diff --git a/FSI.BT.Tools/App.xaml.cs b/FSI.BT.Tools/App.xaml.cs index b34617d..fd200ab 100644 --- a/FSI.BT.Tools/App.xaml.cs +++ b/FSI.BT.Tools/App.xaml.cs @@ -1,8 +1,10 @@ -using Config.Net; +using AutoUpdaterDotNET; +using Config.Net; using Config.Net.Stores; using Hardcodet.Wpf.TaskbarNotification; using NHotkey; using NHotkey.Wpf; +using System; using System.IO; using System.IO.Compression; using System.Reflection; @@ -21,11 +23,13 @@ namespace FSI.BT.Tools public void Application_Startup(object sender, StartupEventArgs e) - { + { Global.Log.Info("Anwendung wurde gestartet!"); ExtractEmbeddedZip("FSI.BT.Tools.ExtTools.kalk.zip", Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + "\\ExtTools\\"); + ExtractEmbeddedZip("FSI.BT.Tools.ExtTools.AudioSwitch.zip", Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + "\\ExtTools\\"); + ExtractEmbeddedZip("FSI.BT.Tools.ExtTools.SmartSystemMenu_v2.21.2.zip", Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + "\\ExtTools\\"); // App-Settings JsonConfigStore _store = new(System.IO.Path.Combine(Directory.GetCurrentDirectory(), "config.json"), true); @@ -55,6 +59,7 @@ namespace FSI.BT.Tools Data = Global.AppSettings.IbaDirSync }; Global.Iba.Init(); + } private void ShowRadialMenu(object sender, HotkeyEventArgs e) diff --git a/FSI.BT.Tools/Commands/CmdCommand.cs b/FSI.BT.Tools/Commands/CmdCommand.cs index 5fb03b5..c74fb21 100644 --- a/FSI.BT.Tools/Commands/CmdCommand.cs +++ b/FSI.BT.Tools/Commands/CmdCommand.cs @@ -101,14 +101,24 @@ namespace FSI.BT.Tools.Commands CloseAtLostFocus = true, InputData = Global.AppSettings.Rdps, Exe = GetExeByCmdName("Rdp").ExePath, + FrmTitle = "Remotedesktopverbindungen", }; frmRdpMain.Show(); break; + case "WebRadio": + //Lib.Guis.WebRadio.FrmMain frmWebRadio = new() + //{ + // CloseAtLostFocus = false, + // InputData = Global.AppSettings.WebRadioUrls, + //}; + //frmWebRadio.Show(); + break; + default: foreach (ICmd cmd in cmds) { - if (String.Equals(parameter.ToString(), cmd.Cmd)) + if (String.Equals(parameter.ToString(), cmd.Cmd)) selectedCmd = cmd; } break; @@ -123,6 +133,9 @@ namespace FSI.BT.Tools.Commands public override bool CanExecute(object parameter) { + if (parameter == null) + return false; + var cmds = Global.AppSettings.Cmds.ToList(); ICmd selectedCmd = null; @@ -152,6 +165,9 @@ namespace FSI.BT.Tools.Commands case "Rdp.Mgt": return Global.AppSettings.Rdps != null; + case "WebRadio": + return false;// Global.AppSettings.WebRadioUrls != null; + default: foreach (ICmd cmd in cmds) { @@ -199,10 +215,17 @@ namespace FSI.BT.Tools.Commands } else { + var selectedFileExePath = string.Empty; + if (File.Exists(Environment.ExpandEnvironmentVariables(selectedFile.ExePath.Trim()))) + selectedFileExePath = Environment.ExpandEnvironmentVariables(selectedFile.ExePath.Trim()); + if (File.Exists(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), selectedFile.ExePath.Trim()))) + selectedFileExePath = Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), selectedFile.ExePath.Trim()); + + var abc = Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), selectedFileExePath.Trim()); Process process = new(); - process.StartInfo.FileName = Environment.ExpandEnvironmentVariables(selectedFile.ExePath); - process.StartInfo.WorkingDirectory = selectedFile.Path ?? Path.GetDirectoryName(Environment.ExpandEnvironmentVariables(selectedFile.ExePath)); - process.StartInfo.Arguments = selectedFile.Arguments; + process.StartInfo.FileName = selectedFileExePath; + process.StartInfo.WorkingDirectory = selectedFile.Path ?? Path.GetDirectoryName(selectedFileExePath); + process.StartInfo.Arguments = selectedFile.Arguments ?? string.Empty; try { @@ -247,9 +270,7 @@ namespace FSI.BT.Tools.Commands foreach (var cmd in Global.AppSettings.Cmds) { if (string.Equals(cmd.Cmd, cmdName, StringComparison.InvariantCultureIgnoreCase)) - { return GetApp(cmd.Exe); - } } return null; @@ -313,9 +334,8 @@ namespace FSI.BT.Tools.Commands { IntPtr handle = p.MainWindowHandle; if (IsIconic(handle)) - { ShowWindow(handle, 9); - } + SetForegroundWindow(handle); break; } diff --git a/FSI.BT.Tools/ExtTools/AudioSwitch.zip b/FSI.BT.Tools/ExtTools/AudioSwitch.zip new file mode 100644 index 0000000..a4926ef Binary files /dev/null and b/FSI.BT.Tools/ExtTools/AudioSwitch.zip differ diff --git a/FSI.BT.Tools/ExtTools/SmartSystemMenu_v2.21.2.zip b/FSI.BT.Tools/ExtTools/SmartSystemMenu_v2.21.2.zip new file mode 100644 index 0000000..68ec318 Binary files /dev/null and b/FSI.BT.Tools/ExtTools/SmartSystemMenu_v2.21.2.zip differ diff --git a/FSI.BT.Tools/FSI.BT.Tools.csproj b/FSI.BT.Tools/FSI.BT.Tools.csproj index 9fc8407..3bc5906 100644 --- a/FSI.BT.Tools/FSI.BT.Tools.csproj +++ b/FSI.BT.Tools/FSI.BT.Tools.csproj @@ -22,7 +22,9 @@ + + @@ -72,7 +74,9 @@ + + @@ -147,6 +151,9 @@ Always + + Always + Always diff --git a/FSI.BT.Tools/FrmRadialMenu.xaml.cs b/FSI.BT.Tools/FrmRadialMenu.xaml.cs index 06b6269..e824496 100644 --- a/FSI.BT.Tools/FrmRadialMenu.xaml.cs +++ b/FSI.BT.Tools/FrmRadialMenu.xaml.cs @@ -1,5 +1,6 @@ using AutoCompleteTextBox.Editors; using FSI.BT.Tools.Commands; +using FSI.BT.Tools.RadialMenu; using System; using System.Collections; using System.Collections.Generic; @@ -23,7 +24,8 @@ namespace FSI.BT.Tools public partial class FrmRadialMenu : Window//, INotifyPropertyChanged { private CmdCommand _cmd; - + private MainViewModel _radialMenu; + public FrmRadialMenu() { InitializeComponent(); @@ -33,7 +35,11 @@ namespace FSI.BT.Tools { cmds.Add(cmd.Cmd); } - DataContext = new RadialMenu.MainViewModel(this, cmds); + cmds = cmds.Distinct().ToList(); // Duplikate entfernen + cmds.Sort(); // Liste sortieren + + _radialMenu = new RadialMenu.MainViewModel(this, cmds); + DataContext = _radialMenu; tbversion.Text = "v" + Assembly.GetExecutingAssembly().GetName().Version.Major + "." + Assembly.GetExecutingAssembly().GetName().Version.Minor + "b"; _cmd = new(); @@ -61,20 +67,17 @@ namespace FSI.BT.Tools private void tbCmd_KeyDown(object sender, KeyEventArgs e) { + if (_cmd.CanExecute(tbCmd.Text)) + tbCmd.Background = new SolidColorBrush(Colors.Green); + else + tbCmd.Background = new SolidColorBrush(Colors.White); + if (e.Key == Key.Enter && _cmd.CanExecute(tbCmd.Text)) { _cmd.Execute(tbCmd.Text); } } - - private void tbCmd_TextChanged(object sender, TextChangedEventArgs e) - { - if (_cmd.CanExecute(((TextBox)sender).Text)) - ((TextBox)sender).Background = new SolidColorBrush(Colors.Green); - else - ((TextBox)sender).Background = new SolidColorBrush(Colors.White); - } - + private void btnMute_Click(object sender, RoutedEventArgs e) { Lib.Audio.AudioManager.SetMasterVolumeMute(!Lib.Audio.AudioManager.GetMasterVolumeMute()); diff --git a/FSI.BT.Tools/LatestUpdateInfo.xml b/FSI.BT.Tools/LatestUpdateInfo.xml new file mode 100644 index 0000000..d2bb884 --- /dev/null +++ b/FSI.BT.Tools/LatestUpdateInfo.xml @@ -0,0 +1,6 @@ + + + 2.0.0.0 + https://github.com/G-Stas/Volumey/releases/download/v1.5.3.0/Volumey_1.5.3.0_x64.zip + false + \ No newline at end of file diff --git a/FSI.BT.Tools/RadialMenu/MainViewModel.cs b/FSI.BT.Tools/RadialMenu/MainViewModel.cs index 8bf50fe..035096e 100644 --- a/FSI.BT.Tools/RadialMenu/MainViewModel.cs +++ b/FSI.BT.Tools/RadialMenu/MainViewModel.cs @@ -17,13 +17,12 @@ namespace FSI.BT.Tools.RadialMenu Cmds = new(); - if (cmds != null) + if (cmds != null) { foreach (string cmd in cmds) Cmds.Add(cmd); } - - Cmds.Add("Rdp.Mgt"); + Provider = new(ref _cmds); } diff --git a/FSI.BT.Tools/Settings/IAppSettings.cs b/FSI.BT.Tools/Settings/IAppSettings.cs index f602083..8ee37ac 100644 --- a/FSI.BT.Tools/Settings/IAppSettings.cs +++ b/FSI.BT.Tools/Settings/IAppSettings.cs @@ -21,6 +21,7 @@ namespace FSI.BT.Tools.Settings IEnumerable TxtToClip { get; } IEnumerable Rdps { get; } + //IEnumerable WebRadioUrls { get; } Lib.Guis.SieTiaWinCCMsgMgt.IInterface WinCC { get; set; } diff --git a/FSI.BT.Tools/config.json b/FSI.BT.Tools/config.json index 6f1158c..4e4d31c 100644 --- a/FSI.BT.Tools/config.json +++ b/FSI.BT.Tools/config.json @@ -327,13 +327,13 @@ ] }, { - "Cmd": "Pl3Pls", + "Cmd": "Pl3.Pls", "Urls": [ "http://10.10.202.10/SKPL3Web/index.asp" ] }, { - "Cmd": "Pl3Lst", + "Cmd": "Pl3.Lst", "Urls": [ "http://desiaugetwf.fondium.org/web/Seiten/Leistungsdaten_FuG.aspx?Fkt=PL3" ] @@ -368,6 +368,9 @@ { "Cmd": "Epl.PdfMgt" }, + { + "Cmd": "WebRadio" + }, { "Cmd": "Calc", "Exe": [ @@ -383,6 +386,22 @@ "ExePath": "C:\\Program Files (x86)\\iba\\ibaPDA\\Client\\ibaPda.exe" } ] + }, + { + "Cmd": "Trilium", + "Exe": [ + { + "ExePath": "c:\\Users\\maier_s\\OneDrive - Fondium Group GmbH\\Documents\\Apps\\trilium-windows-x64\\trilium-portable.bat" + } + ] + }, + { + "Cmd": "SmartSystemMenu", + "Exe": [ + { + "ExePath": "ExtTools\\SmartSystemMenu_v2.21.2\\SmartSystemMenu.exe" + } + ] } ], "Folders": [ @@ -457,7 +476,37 @@ "Plant": "PL1", "SubPlant": "Alg", "Description": "Programmier PC", - "Host": "10.10.200.28" + "Host": "DESIAUGETC8-028" + }, + { + "Plant": "PL2", + "SubPlant": "Alg", + "Description": "Programmier PC", + "Host": "DESIAUGETD5-029" + }, + { + "Plant": "PL2", + "SubPlant": "FA", + "Description": "Programmier PC (HWS)", + "Host": "DESIAUGETD5-030" + }, + { + "Plant": "PL2", + "SubPlant": "ENS", + "Description": "Programmier PC", + "Host": "DESIAUGETD5-020" + }, + { + "Plant": "Alg", + "SubPlant": "Alg", + "Description": "IBA PC PL1", + "Host": "DESIAUGETC7-046" + }, + { + "Plant": "Alg", + "SubPlant": "Alg", + "Description": "IBA PC PL2", + "Host": "DESIAUGETC7-047" }, { "Plant": "Alg", @@ -466,6 +515,12 @@ "Host": "10.10.199.92" } ], + "WebRadioUrls": [ + { + "Name": "Rock Antenne 80ger", + "Url": "http://stream.rockantenne.de/70er-rock/stream/mp3" + } + ], "WinCC": { "AutoStart": false, "UpdateIntervall": 10,