diff --git a/Source/NETworkManager.Models/Generated Files/WinRTEventHelpers.cs b/Source/NETworkManager.Models/Generated Files/WinRTEventHelpers.cs index 6f031cd306..6b71188b00 100644 --- a/Source/NETworkManager.Models/Generated Files/WinRTEventHelpers.cs +++ b/Source/NETworkManager.Models/Generated Files/WinRTEventHelpers.cs @@ -1,6 +1,6 @@ //------------------------------------------------------------------------------ // -// This file was generated by cswinrt.exe version 1.6.4.220527.1 +// This file was generated by cswinrt.exe version 2.0.0.220816.1 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. diff --git a/Source/NETworkManager.Profiles/Application/PowerShell.cs b/Source/NETworkManager.Profiles/Application/PowerShell.cs index 47be397fc6..43737de38c 100644 --- a/Source/NETworkManager.Profiles/Application/PowerShell.cs +++ b/Source/NETworkManager.Profiles/Application/PowerShell.cs @@ -13,7 +13,7 @@ public static PowerShellSessionInfo CreateSessionInfo(ProfileInfo profile) return new PowerShellSessionInfo { EnableRemoteConsole = profile.PowerShell_EnableRemoteConsole, - Host = profile.Host, + Host = profile.PowerShell_Host, AdditionalCommandLine = profile.PowerShell_OverrideAdditionalCommandLine ? profile.PowerShell_AdditionalCommandLine : (group.PowerShell_OverrideAdditionalCommandLine ? group.PowerShell_AdditionalCommandLine : SettingsManager.Current.PowerShell_AdditionalCommandLine), ExecutionPolicy = profile.PowerShell_OverrideExecutionPolicy ? profile.PowerShell_ExecutionPolicy : (group.PowerShell_OverrideExecutionPolicy ? group.PowerShell_ExecutionPolicy : SettingsManager.Current.PowerShell_ExecutionPolicy) diff --git a/Source/NETworkManager.Profiles/Application/RemoteDesktop.cs b/Source/NETworkManager.Profiles/Application/RemoteDesktop.cs index 1ed23375b5..5934392926 100644 --- a/Source/NETworkManager.Profiles/Application/RemoteDesktop.cs +++ b/Source/NETworkManager.Profiles/Application/RemoteDesktop.cs @@ -64,7 +64,7 @@ public static RemoteDesktopSessionInfo CreateSessionInfo(ProfileInfo profile) GroupInfo group = ProfileManager.GetGroup(profile.Group); // Override hostname - info.Hostname = profile.Host; + info.Hostname = profile.RemoteDesktop_Host; // Network if (profile.RemoteDesktop_OverridePort) diff --git a/Source/NETworkManager/Controls/DragablzTabHostWindow.xaml b/Source/NETworkManager/Controls/DragablzTabHostWindow.xaml index 43fae80ce3..562c040b6a 100644 --- a/Source/NETworkManager/Controls/DragablzTabHostWindow.xaml +++ b/Source/NETworkManager/Controls/DragablzTabHostWindow.xaml @@ -162,6 +162,16 @@ + + + + + + + + + + diff --git a/Source/NETworkManager/Controls/DragablzTabHostWindow.xaml.cs b/Source/NETworkManager/Controls/DragablzTabHostWindow.xaml.cs index 425281fb30..0d4c8194bb 100644 --- a/Source/NETworkManager/Controls/DragablzTabHostWindow.xaml.cs +++ b/Source/NETworkManager/Controls/DragablzTabHostWindow.xaml.cs @@ -187,6 +187,14 @@ private async void RemoteDesktop_SendCtrlAltDelAction(object view) #endregion #region PowerShell Commands + private bool PowerShell_Disconnected_CanExecute(object view) + { + if (view is PowerShellControl control) + return !control.IsConnected; + + return false; + } + public ICommand PowerShell_ReconnectCommand => new RelayCommand(PowerShell_ReconnectAction); private void PowerShell_ReconnectAction(object view) @@ -198,17 +206,16 @@ private void PowerShell_ReconnectAction(object view) } } - #endregion + public ICommand PowerShell_ResizeWindowCommand => new RelayCommand(PowerShell_ResizeWindowAction, PowerShell_Disconnected_CanExecute); - #region PuTTY Commands - private bool PuTTY_Disconnected_CanExecute(object view) + private void PowerShell_ResizeWindowAction(object view) { - if (view is PuTTYControl control) - return !control.IsConnected; - - return false; + if (view is PowerShellControl control) + control.ResizeEmbeddedWindow(); } + #endregion + #region PuTTY Commands private bool PuTTY_Connected_CanExecute(object view) { if (view is PuTTYControl control) diff --git a/Source/NETworkManager/Controls/PowerShellControl.xaml.cs b/Source/NETworkManager/Controls/PowerShellControl.xaml.cs index dc379d3e1a..13597d375c 100644 --- a/Source/NETworkManager/Controls/PowerShellControl.xaml.cs +++ b/Source/NETworkManager/Controls/PowerShellControl.xaml.cs @@ -146,18 +146,6 @@ private async Task Connect() while ((DateTime.Now - startTime).TotalSeconds < 10) { - // Fix for netcore3.1 https://stackoverflow.com/questions/60342879/process-mainwindowhandle-is-non-zero-in-net-framework-but-zero-in-net-core-unl - /* - try - { - _process = Process.GetProcessById(_process.Id); - } - catch - { - break; // Process has exited - } - */ - _process.Refresh(); if (_process.HasExited) @@ -221,7 +209,7 @@ private void Process_Exited(object sender, EventArgs e) IsConnected = false; } - private void ResizeEmbeddedWindow() + public void ResizeEmbeddedWindow() { if (IsConnected) NativeMethods.SetWindowPos(_process.MainWindowHandle, IntPtr.Zero, 0, 0, WindowHost.ClientSize.Width, WindowHost.ClientSize.Height, NativeMethods.SWP_NOZORDER | NativeMethods.SWP_NOACTIVATE); diff --git a/Source/NETworkManager/Generated Files/WinRTEventHelpers.cs b/Source/NETworkManager/Generated Files/WinRTEventHelpers.cs index 6f031cd306..6b71188b00 100644 --- a/Source/NETworkManager/Generated Files/WinRTEventHelpers.cs +++ b/Source/NETworkManager/Generated Files/WinRTEventHelpers.cs @@ -1,6 +1,6 @@ //------------------------------------------------------------------------------ // -// This file was generated by cswinrt.exe version 1.6.4.220527.1 +// This file was generated by cswinrt.exe version 2.0.0.220816.1 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. diff --git a/Source/NETworkManager/ViewModels/PowerShellHostViewModel.cs b/Source/NETworkManager/ViewModels/PowerShellHostViewModel.cs index 43219e2734..657b03c559 100644 --- a/Source/NETworkManager/ViewModels/PowerShellHostViewModel.cs +++ b/Source/NETworkManager/ViewModels/PowerShellHostViewModel.cs @@ -233,6 +233,14 @@ private void CloseItemAction(ItemActionCallbackArgs args) ((args.DragablzItem.Content as DragablzTabItem)?.View as PowerShellControl)?.CloseTab(); } + private bool PowerShell_Connected_CanExecute(object view) + { + if (view is PowerShellControl control) + return control.IsConnected; + + return false; + } + public ICommand PowerShell_ReconnectCommand => new RelayCommand(PowerShell_ReconnectAction); private void PowerShell_ReconnectAction(object view) @@ -244,6 +252,14 @@ private void PowerShell_ReconnectAction(object view) } } + public ICommand PowerShell_ResizeWindowCommand => new RelayCommand(PowerShell_ResizeWindowAction, PowerShell_Connected_CanExecute); + + private void PowerShell_ResizeWindowAction(object view) + { + if (view is PowerShellControl control) + control.ResizeEmbeddedWindow(); + } + public ICommand ConnectCommand => new RelayCommand(p => ConnectAction(), Connect_CanExecute); private bool Connect_CanExecute(object obj) => IsConfigured; diff --git a/Source/NETworkManager/ViewModels/PuTTYHostViewModel.cs b/Source/NETworkManager/ViewModels/PuTTYHostViewModel.cs index c5a3120076..aa6e14307b 100644 --- a/Source/NETworkManager/ViewModels/PuTTYHostViewModel.cs +++ b/Source/NETworkManager/ViewModels/PuTTYHostViewModel.cs @@ -238,14 +238,6 @@ private void CloseItemAction(ItemActionCallbackArgs args) ((args.DragablzItem.Content as DragablzTabItem)?.View as PuTTYControl)?.CloseTab(); } - private bool PuTTY_Disconnected_CanExecute(object view) - { - if (view is PuTTYControl control) - return !control.IsConnected; - - return false; - } - private bool PuTTY_Connected_CanExecute(object view) { if (view is PuTTYControl control) diff --git a/Source/NETworkManager/Views/PowerShellHostView.xaml b/Source/NETworkManager/Views/PowerShellHostView.xaml index 8cbfdc7095..7ce10e766e 100644 --- a/Source/NETworkManager/Views/PowerShellHostView.xaml +++ b/Source/NETworkManager/Views/PowerShellHostView.xaml @@ -84,6 +84,16 @@ + + + + + + + + + + diff --git a/docs/Changelog/next-release.md b/docs/Changelog/next-release.md index c88392ae40..d7dbf50c00 100644 --- a/docs/Changelog/next-release.md +++ b/docs/Changelog/next-release.md @@ -22,17 +22,21 @@ permalink: /Changelog/next-release ## Improvements - Profiles - Migration dialog improved [#1393](https://github.com/BornToBeRoot/NETworkManager/pull/1393){:target="_blank"} - - Select app when creating a profile (#1466)(https://github.com/BornToBeRoot/NETworkManager/pull/1466){:target="_blank"} + - Select app when creating a profile [#1466](https://github.com/BornToBeRoot/NETworkManager/pull/1466){:target="_blank"} - Port Scanner - Generate Port list at first run [#1464](https://github.com/BornToBeRoot/NETworkManager/pull/1464){:target="_blank"} - DNS Lookup - Generate DNS server list at first run [#1464](https://github.com/BornToBeRoot/NETworkManager/pull/1464){:target="_blank"} +- PowerShell + - Resize PowerShell window [#1505](https://github.com/BornToBeRoot/NETworkManager/pull/1505){:target="_blank"} ## Bugfixes -- Dashboard / Status Window +- Dashboard & Status Window - Detect local ipv6 address fixed [#1423](https://github.com/BornToBeRoot/NETworkManager/pull/1423){:target="_blank"} -- IP Scanner / OUI Lookup +- IP Scanner & OUI Lookup - Use ieee.org instead of linuxnet.ca to generate the oui.txt [#1463](https://github.com/BornToBeRoot/NETworkManager/pull/1463){:target="_blank"} +- Remote Desktop & PuTTY + - Override host doesn't set the correct hostname [#1505](https://github.com/BornToBeRoot/NETworkManager/pull/1505){:target="_blank"} - Profiles - Fixed some rare cases where the profile file was overwritten [#1449](https://github.com/BornToBeRoot/NETworkManager/pull/1449){:target="_blank"} - Header in add group dialog fixed [#1461](https://github.com/BornToBeRoot/NETworkManager/pull/1461){:target="_blank"}