diff --git a/Source/NETworkManager.Localization/Resources/Strings.Designer.cs b/Source/NETworkManager.Localization/Resources/Strings.Designer.cs
index 73e5ed99da..ee9c686dee 100644
--- a/Source/NETworkManager.Localization/Resources/Strings.Designer.cs
+++ b/Source/NETworkManager.Localization/Resources/Strings.Designer.cs
@@ -2553,6 +2553,15 @@ public static string EnableEncryptionDots {
}
}
+ ///
+ /// Looks up a localized string similar to Enable session log.
+ ///
+ public static string EnableSessionLog {
+ get {
+ return ResourceManager.GetString("EnableSessionLog", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Encryption.
///
@@ -6443,6 +6452,24 @@ public static string Service {
}
}
+ ///
+ /// Looks up a localized string similar to Session log file name.
+ ///
+ public static string SessionLogFileName {
+ get {
+ return ResourceManager.GetString("SessionLogFileName", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Session log path.
+ ///
+ public static string SessionLogPath {
+ get {
+ return ResourceManager.GetString("SessionLogPath", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Set Master Password.
///
diff --git a/Source/NETworkManager.Localization/Resources/Strings.resx b/Source/NETworkManager.Localization/Resources/Strings.resx
index 8499b0e24d..825db83901 100644
--- a/Source/NETworkManager.Localization/Resources/Strings.resx
+++ b/Source/NETworkManager.Localization/Resources/Strings.resx
@@ -2851,4 +2851,13 @@ URL: https://github.com/BornToBeRoot/NETworkManager/tree/master/Documentation
Window
+
+ Enable session log
+
+
+ Session log file name
+
+
+ Session log path
+
\ No newline at end of file
diff --git a/Source/NETworkManager.Models/PuTTY/PuTTY.cs b/Source/NETworkManager.Models/PuTTY/PuTTY.cs
index ab9fa5c0b0..bde3331398 100644
--- a/Source/NETworkManager.Models/PuTTY/PuTTY.cs
+++ b/Source/NETworkManager.Models/PuTTY/PuTTY.cs
@@ -34,6 +34,10 @@ public static string BuildCommandLine(PuTTYSessionInfo profileInfo)
if (!string.IsNullOrEmpty(profileInfo.Username))
command += $" -l {profileInfo.Username}";
+ // Session log
+ if (profileInfo.EnableSessionLog)
+ command += $" -sessionlog {'"'}{ profileInfo.SessionLogFullName}{'"'}";
+
// Additional commands
if (!string.IsNullOrEmpty(profileInfo.AdditionalCommandLine))
command += $" {profileInfo.AdditionalCommandLine}";
diff --git a/Source/NETworkManager.Models/PuTTY/PuTTYSessionInfo.cs b/Source/NETworkManager.Models/PuTTY/PuTTYSessionInfo.cs
index 07e99a895a..56a810a460 100644
--- a/Source/NETworkManager.Models/PuTTY/PuTTYSessionInfo.cs
+++ b/Source/NETworkManager.Models/PuTTY/PuTTYSessionInfo.cs
@@ -2,16 +2,59 @@
namespace NETworkManager.Models.PuTTY
{
+ ///
+ /// Stores informations about a putty session.
+ ///
public class PuTTYSessionInfo
{
+ ///
+ /// Full path to the PuTTY.exe on the filesystem.
+ ///
public string ApplicationFilePath { get; set; }
+
+ ///
+ /// Mode (SSH, Telnet, etc.), which is used to establish the connection.
+ ///
public ConnectionMode Mode { get; set; }
+
+ ///
+ /// Hostname or SerialLine. Depends on the .
+ ///
public string HostOrSerialLine { get; set; }
+
+ ///
+ /// Port or Baud. Depends on the .
+ ///
public int PortOrBaud { get; set; }
- public string Profile { get; set; }
+
+ ///
+ /// Username for login.
+ ///
public string Username { get; set; }
+
+ ///
+ /// PuTTY profile to use.
+ ///
+ public string Profile { get; set; }
+
+ ///
+ /// Enables session log.
+ ///
+ public bool EnableSessionLog { get; set; }
+
+ ///
+ /// Path and filename of the session log file (e.g. "C:\..\PuTTY.log").
+ ///
+ public string SessionLogFullName { get; set; }
+
+ ///
+ /// Additional command line argument. Everything putty can handle.
+ ///
public string AdditionalCommandLine { get; set; }
+ ///
+ /// Initializes a new instance of the class.
+ ///
public PuTTYSessionInfo()
{
diff --git a/Source/NETworkManager.Profiles/Application/PuTTY.cs b/Source/NETworkManager.Profiles/Application/PuTTY.cs
index cbd3d2b33e..ae1fabb2e8 100644
--- a/Source/NETworkManager.Profiles/Application/PuTTY.cs
+++ b/Source/NETworkManager.Profiles/Application/PuTTY.cs
@@ -1,5 +1,7 @@
using NETworkManager.Models.PuTTY;
using NETworkManager.Settings;
+using System.IO;
+using System;
namespace NETworkManager.Profiles.Application
{
@@ -14,6 +16,8 @@ public static PuTTYSessionInfo CreateSessionInfo(ProfileInfo profileInfo)
PortOrBaud = profileInfo.PuTTY_OverridePortOrBaud ? profileInfo.PuTTY_PortOrBaud : Settings.Application.PuTTY.GetPortOrBaudByConnectionMode(profileInfo.PuTTY_ConnectionMode),
Username = profileInfo.PuTTY_OverrideUsername ? profileInfo.PuTTY_Username : SettingsManager.Current.PuTTY_Username,
Profile = profileInfo.PuTTY_OverrideProfile ? profileInfo.PuTTY_Profile : SettingsManager.Current.PuTTY_Profile,
+ EnableSessionLog = profileInfo.PuTTY_OverrideEnableSessionLog ? profileInfo.PuTTY_EnableSessionLog : SettingsManager.Current.PuTTY_EnableSessionLog,
+ SessionLogFullName = Environment.ExpandEnvironmentVariables(Path.Combine(SettingsManager.Current.PuTTY_SessionLogPath, profileInfo.PuTTY_OverrideSessionLogFileName ? profileInfo.PuTTY_SessionLogFileName : SettingsManager.Current.PuTTY_SessionLogFileName)),
AdditionalCommandLine = profileInfo.PuTTY_OverrideAdditionalCommandLine ? profileInfo.PuTTY_AdditionalCommandLine : SettingsManager.Current.PuTTY_AdditionalCommandLine
};
diff --git a/Source/NETworkManager.Profiles/NETworkManager.Profiles.csproj b/Source/NETworkManager.Profiles/NETworkManager.Profiles.csproj
index ac3eae60fa..25da5ce5e3 100644
--- a/Source/NETworkManager.Profiles/NETworkManager.Profiles.csproj
+++ b/Source/NETworkManager.Profiles/NETworkManager.Profiles.csproj
@@ -21,6 +21,7 @@
DEBUG;TRACE
prompt
4
+ bin\Debug\NETworkManager.Profiles.xml
pdbonly
diff --git a/Source/NETworkManager.Profiles/ProfileInfo.cs b/Source/NETworkManager.Profiles/ProfileInfo.cs
index 91722e385a..0bd465baab 100644
--- a/Source/NETworkManager.Profiles/ProfileInfo.cs
+++ b/Source/NETworkManager.Profiles/ProfileInfo.cs
@@ -124,8 +124,13 @@ public class ProfileInfo
public string PuTTY_Username { get; set; }
public bool PuTTY_OverrideProfile { get; set; }
public string PuTTY_Profile { get; set; }
+ public bool PuTTY_OverrideEnableSessionLog { get; set; }
+ public bool PuTTY_EnableSessionLog { get; set; }
+ public bool PuTTY_OverrideSessionLogFileName { get; set; }
+ public string PuTTY_SessionLogFileName { get; set; } = GlobalStaticConfiguration.PuTTY_SessionLogFileName;
public bool PuTTY_OverrideAdditionalCommandLine { get; set; }
public string PuTTY_AdditionalCommandLine { get; set; }
+
public bool TigerVNC_Enabled { get; set; }
public bool TigerVNC_InheritHost { get; set; } = true;
@@ -149,6 +154,9 @@ public class ProfileInfo
public bool Whois_InheritHost { get; set; } = true;
public string Whois_Domain { get; set; }
+ ///
+ /// Initializes a new instance of the class.
+ ///
public ProfileInfo()
{
diff --git a/Source/NETworkManager.Profiles/ProfileManager.cs b/Source/NETworkManager.Profiles/ProfileManager.cs
index 27e29cefa1..dcd610df94 100644
--- a/Source/NETworkManager.Profiles/ProfileManager.cs
+++ b/Source/NETworkManager.Profiles/ProfileManager.cs
@@ -10,9 +10,6 @@
namespace NETworkManager.Profiles
{
- ///
- ///
- ///
public static class ProfileManager
{
#region Variables
@@ -36,24 +33,12 @@ public static class ProfileManager
///
public static string ProfilesEncryptionIdentifier => ".encrypted";
- ///
- ///
- ///
public static string TagIdentifier => "tag=";
- ///
- ///
- ///
public static ObservableCollection ProfileFiles { get; set; } = new ObservableCollection();
- ///
- ///
- ///
private static ProfileFileInfo _profileFileInfo;
- ///
- ///
- ///
public static ProfileFileInfo LoadedProfileFile
{
get => _profileFileInfo;
@@ -66,25 +51,12 @@ public static ProfileFileInfo LoadedProfileFile
}
}
- ///
- ///
- ///
public static ObservableCollection Profiles { get; set; } = new ObservableCollection();
-
- ///
- ///
- ///
+
public static bool ProfilesChanged { get; set; }
- ///
- ///
- ///
public static event EventHandler OnProfileFileChangedEvent;
- ///
- ///
- ///
- ///
private static void ProfileFileChanged(ProfileFileInfo profileFileInfo)
{
OnProfileFileChangedEvent?.Invoke(null, new ProfileFileInfoArgs(profileFileInfo));
@@ -118,10 +90,6 @@ public static string GetPortableProfilesLocation()
return Path.Combine(Path.GetDirectoryName(AssemblyManager.Current.Location) ?? throw new InvalidOperationException(), ProfilesFolderName);
}
- ///
- ///
- ///
- ///
public static string GetProfilesLocation()
{
return ConfigurationManager.Current.IsPortable ? GetPortableProfilesLocation() : GetProfilesLocationNotPortable();
diff --git a/Source/NETworkManager.Settings/GlobalStaticConfiguration.cs b/Source/NETworkManager.Settings/GlobalStaticConfiguration.cs
index 78cc1b8f1f..47350c86f3 100644
--- a/Source/NETworkManager.Settings/GlobalStaticConfiguration.cs
+++ b/Source/NETworkManager.Settings/GlobalStaticConfiguration.cs
@@ -118,6 +118,8 @@ public static class GlobalStaticConfiguration
// Application: PuTTY
public static PuTTY.ConnectionMode PuTTY_DefaultConnectionMode => PuTTY.ConnectionMode.SSH;
+ public static string PuTTY_SessionLogPath => Path.Combine("%LocalAppData%", AssemblyManager.Current.Name, "PuTTY_LogFiles");
+ public static string PuTTY_SessionLogFileName => "&H_&Y-&M-&D_&T.log";
public static int PuTTY_SSHPort => 22;
public static string PuTTY_SerialLine => "COM1";
public static int PuTTY_TelnetPort => 23;
diff --git a/Source/NETworkManager.Settings/SettingsInfo.cs b/Source/NETworkManager.Settings/SettingsInfo.cs
index 3084ded5f5..5e8e356a8d 100644
--- a/Source/NETworkManager.Settings/SettingsInfo.cs
+++ b/Source/NETworkManager.Settings/SettingsInfo.cs
@@ -2589,6 +2589,51 @@ public string PuTTY_Profile
}
}
+ private bool _puTTY_EnableSessionLog;
+ public bool PuTTY_EnableSessionLog
+ {
+ get => _puTTY_EnableSessionLog;
+ set
+ {
+ if (value == _puTTY_EnableSessionLog)
+ return;
+
+ _puTTY_EnableSessionLog = value;
+ OnPropertyChanged();
+ SettingsChanged = true;
+ }
+ }
+
+ private string _puTTY_SessionLogPath = GlobalStaticConfiguration.PuTTY_SessionLogPath;
+ public string PuTTY_SessionLogPath
+ {
+ get => _puTTY_SessionLogPath;
+ set
+ {
+ if (value == _puTTY_SessionLogPath)
+ return;
+
+ _puTTY_SessionLogPath = value;
+ OnPropertyChanged();
+ SettingsChanged = true;
+ }
+ }
+
+ private string _puTTY_SessionLogFileName = GlobalStaticConfiguration.PuTTY_SessionLogFileName;
+ public string PuTTY_SessionLogFileName
+ {
+ get => _puTTY_SessionLogFileName;
+ set
+ {
+ if (value == _puTTY_SessionLogFileName)
+ return;
+
+ _puTTY_SessionLogFileName = value;
+ OnPropertyChanged();
+ SettingsChanged = true;
+ }
+ }
+
private string _puTTY_AdditionalCommandLine;
public string PuTTY_AdditionalCommandLine
{
diff --git a/Source/NETworkManager.Utilities/DirectoryCreator.cs b/Source/NETworkManager.Utilities/DirectoryCreator.cs
new file mode 100644
index 0000000000..0ab5d43a56
--- /dev/null
+++ b/Source/NETworkManager.Utilities/DirectoryCreator.cs
@@ -0,0 +1,21 @@
+using System;
+using System.IO;
+
+
+namespace NETworkManager.Utilities
+{
+ ///
+ /// Contains methods to create a directory with sub directories.
+ ///
+ public static class DirectoryCreator
+ {
+ ///
+ /// Create a directory with subdirectories and resolve environment variables.
+ ///
+ /// Path like "%AppDataLocal%\Folder1".
+ public static void CreateWithEnvironmentVariables(string path)
+ {
+ Directory.CreateDirectory(Environment.ExpandEnvironmentVariables(path));
+ }
+ }
+}
diff --git a/Source/NETworkManager.Utilities/NETworkManager.Utilities.csproj b/Source/NETworkManager.Utilities/NETworkManager.Utilities.csproj
index fc3f3d1c2f..0847626fb1 100644
--- a/Source/NETworkManager.Utilities/NETworkManager.Utilities.csproj
+++ b/Source/NETworkManager.Utilities/NETworkManager.Utilities.csproj
@@ -52,6 +52,7 @@
+
diff --git a/Source/NETworkManager/Controls/PuTTYControl.xaml b/Source/NETworkManager/Controls/PuTTYControl.xaml
index 66cc2c59f6..d0bfbc3d93 100644
--- a/Source/NETworkManager/Controls/PuTTYControl.xaml
+++ b/Source/NETworkManager/Controls/PuTTYControl.xaml
@@ -6,7 +6,7 @@
xmlns:converters="clr-namespace:NETworkManager.Converters;assembly=NETworkManager.Converters"
xmlns:windowsForms="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
xmlns:localization="clr-namespace:NETworkManager.Localization.Resources;assembly=NETworkManager.Localization"
- xmlns:networkManagerControls="clr-namespace:NETworkManager.Controls"
+ xmlns:networkManagerControls="clr-namespace:NETworkManager.Controls;assembly=NETworkManager"
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
mah:DialogParticipation.Register="{Binding}"
mc:Ignorable="d" Loaded="UserControl_Loaded" d:DataContext="{d:DesignInstance networkManagerControls:PuTTYControl}">
diff --git a/Source/NETworkManager/Controls/PuTTYControl.xaml.cs b/Source/NETworkManager/Controls/PuTTYControl.xaml.cs
index ccb684ae46..a929e0dcdf 100644
--- a/Source/NETworkManager/Controls/PuTTYControl.xaml.cs
+++ b/Source/NETworkManager/Controls/PuTTYControl.xaml.cs
@@ -122,6 +122,9 @@ private async void Connect()
{
IsConnecting = true;
+ // Create log path
+ DirectoryCreator.CreateWithEnvironmentVariables(SettingsManager.Current.PuTTY_SessionLogPath);
+
var info = new ProcessStartInfo
{
FileName = _sessionInfo.ApplicationFilePath,
diff --git a/Source/NETworkManager/Controls/RemoteDesktopControl.xaml b/Source/NETworkManager/Controls/RemoteDesktopControl.xaml
index beae7450c5..7fafd5357c 100644
--- a/Source/NETworkManager/Controls/RemoteDesktopControl.xaml
+++ b/Source/NETworkManager/Controls/RemoteDesktopControl.xaml
@@ -7,7 +7,7 @@
xmlns:converters="clr-namespace:NETworkManager.Converters;assembly=NETworkManager.Converters"
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:localization="clr-namespace:NETworkManager.Localization.Resources;assembly=NETworkManager.Localization"
- xmlns:networkManagerControls="clr-namespace:NETworkManager.Controls"
+ xmlns:networkManagerControls="clr-namespace:NETworkManager.Controls;assembly=NETworkManager"
mc:Ignorable="d" Loaded="UserControl_Loaded" d:DataContext="{d:DesignInstance networkManagerControls:RemoteDesktopControl}">
diff --git a/Source/NETworkManager/Controls/TightVNCControl.xaml b/Source/NETworkManager/Controls/TightVNCControl.xaml
index 5a5664a18d..2348f9cc46 100644
--- a/Source/NETworkManager/Controls/TightVNCControl.xaml
+++ b/Source/NETworkManager/Controls/TightVNCControl.xaml
@@ -6,7 +6,7 @@
xmlns:converters="clr-namespace:NETworkManager.Converters;assembly=NETworkManager.Converters"
xmlns:windowsForms="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
xmlns:localization="clr-namespace:NETworkManager.Localization.Resources;assembly=NETworkManager.Localization"
- xmlns:networkManagerControls="clr-namespace:NETworkManager.Controls"
+ xmlns:networkManagerControls="clr-namespace:NETworkManager.Controls;assembly=NETworkManager"
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
mah:DialogParticipation.Register="{Binding}"
mc:Ignorable="d" Loaded="UserControl_Loaded" d:DataContext="{d:DesignInstance networkManagerControls:TigerVNCControl}">
diff --git a/Source/NETworkManager/Controls/WebConsoleControl.xaml b/Source/NETworkManager/Controls/WebConsoleControl.xaml
index 144608c3d9..be03df2973 100644
--- a/Source/NETworkManager/Controls/WebConsoleControl.xaml
+++ b/Source/NETworkManager/Controls/WebConsoleControl.xaml
@@ -3,7 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:networkManagerControls="clr-namespace:NETworkManager.Controls"
+ xmlns:networkManagerControls="clr-namespace:NETworkManager.Controls;assembly=NETworkManager"
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:localization="clr-namespace:NETworkManager.Localization.Resources;assembly=NETworkManager.Localization"
xmlns:converters="clr-namespace:NETworkManager.Converters;assembly=NETworkManager.Converters"
diff --git a/Source/NETworkManager/ProfileDialogManager.cs b/Source/NETworkManager/ProfileDialogManager.cs
index 0db0cb7b36..603bf3f464 100644
--- a/Source/NETworkManager/ProfileDialogManager.cs
+++ b/Source/NETworkManager/ProfileDialogManager.cs
@@ -156,7 +156,7 @@ public static async void ShowEditGroupDialog(IProfileManager viewModel, IDialogC
public static void AddProfile(ProfileViewModel instance)
{
- ProfileManager.AddProfile(new ProfileInfo
+ ProfileManager.AddProfile(new ProfileInfo
{
Name = instance.Name?.Trim(),
Host = instance.Host?.Trim(),
@@ -267,6 +267,10 @@ public static void AddProfile(ProfileViewModel instance)
PuTTY_Username = instance.PuTTY_Username?.Trim(),
PuTTY_OverrideProfile = instance.PuTTY_OverrideProfile,
PuTTY_Profile = instance.PuTTY_Profile?.Trim(),
+ PuTTY_OverrideEnableSessionLog = instance.PuTTY_OverrideEnableSessionLog,
+ PuTTY_EnableSessionLog = instance.PuTTY_EnableSessionLog,
+ PuTTY_OverrideSessionLogFileName = instance.PuTTY_OverrideSessionLogFileName,
+ PuTTY_SessionLogFileName = instance.PuTTY_SessionLogFileName,
PuTTY_OverrideAdditionalCommandLine = instance.PuTTY_OverrideAdditionalCommandLine,
PuTTY_AdditionalCommandLine = instance.PuTTY_AdditionalCommandLine?.Trim(),
diff --git a/Source/NETworkManager/ViewModels/PingHostViewModel.cs b/Source/NETworkManager/ViewModels/PingHostViewModel.cs
index 03ecd496dd..2416a06bc2 100644
--- a/Source/NETworkManager/ViewModels/PingHostViewModel.cs
+++ b/Source/NETworkManager/ViewModels/PingHostViewModel.cs
@@ -13,7 +13,6 @@
using System.Windows;
using NETworkManager.Profiles;
using System.Windows.Threading;
-using NETworkManager.Settings;
using NETworkManager.Models;
namespace NETworkManager.ViewModels
diff --git a/Source/NETworkManager/ViewModels/ProfileViewModel.cs b/Source/NETworkManager/ViewModels/ProfileViewModel.cs
index d97ff76efb..76a5d424e4 100644
--- a/Source/NETworkManager/ViewModels/ProfileViewModel.cs
+++ b/Source/NETworkManager/ViewModels/ProfileViewModel.cs
@@ -22,7 +22,7 @@ public class ProfileViewModel : ViewModelBase
#region Variables
private readonly bool _isLoading;
public ICollectionView ProfileViews { get; }
-
+
#region General
private string _name;
public string Name
@@ -1649,6 +1649,62 @@ public string PuTTY_Profile
}
}
+ private bool _puTTY_OverrideEnableSessionLog;
+ public bool PuTTY_OverrideEnableSessionLog
+ {
+ get => _puTTY_OverrideEnableSessionLog;
+ set
+ {
+ if (value == _puTTY_OverrideEnableSessionLog)
+ return;
+
+ _puTTY_OverrideEnableSessionLog = value;
+ OnPropertyChanged();
+ }
+ }
+
+ private bool _puTTY_EnableSessionLog;
+ public bool PuTTY_EnableSessionLog
+ {
+ get => _puTTY_EnableSessionLog;
+ set
+ {
+ if (value == _puTTY_EnableSessionLog)
+ return;
+
+ _puTTY_EnableSessionLog = value;
+ OnPropertyChanged();
+ }
+ }
+
+ private bool _puTTY_OverrideSessionLogFileName;
+ public bool PuTTY_OverrideSessionLogFileName
+ {
+ get => _puTTY_OverrideSessionLogFileName;
+ set
+ {
+ if (value == _puTTY_OverrideSessionLogFileName)
+ return;
+
+ _puTTY_OverrideSessionLogFileName = value;
+ OnPropertyChanged();
+ }
+ }
+
+ private string _puTTY_SessionLogFileName;
+ public string PuTTY_SessionLogFileName
+ {
+ get => _puTTY_SessionLogFileName;
+ set
+ {
+ if (value == _puTTY_SessionLogFileName)
+ return;
+
+ _puTTY_SessionLogFileName = value;
+ OnPropertyChanged();
+ }
+ }
+
private bool _puTTY_OverrideAdditionalCommandLine;
public bool PuTTY_OverrideAdditionalCommandLine
{
@@ -2105,6 +2161,10 @@ public ProfileViewModel(Action saveCommand, Action SettingsManager.Current.PuTTY_ProfileHistory.Add(x));
}
-
+
private void StartDelayedSearch()
{
if (!IsSearching)
diff --git a/Source/NETworkManager/ViewModels/PuTTYSettingsViewModel.cs b/Source/NETworkManager/ViewModels/PuTTYSettingsViewModel.cs
index 781eaa95a7..1e99fd9de8 100644
--- a/Source/NETworkManager/ViewModels/PuTTYSettingsViewModel.cs
+++ b/Source/NETworkManager/ViewModels/PuTTYSettingsViewModel.cs
@@ -6,7 +6,6 @@
using System.IO;
using System.Windows.Input;
using NETworkManager.Models.PuTTY;
-using NETworkManager.Settings;
namespace NETworkManager.ViewModels
{
@@ -151,41 +150,93 @@ public string Username
OnPropertyChanged();
}
}
+
+ private string _profile;
+ public string Profile
+ {
+ get => _profile;
+ set
+ {
+ if (value == _profile)
+ return;
- private string _additionalCommandLine;
- public string AdditionalCommandLine
+ if (!_isLoading)
+ SettingsManager.Current.PuTTY_Profile = value;
+
+ _profile = value;
+ OnPropertyChanged();
+ }
+ }
+
+ private bool _enableSessionLog;
+ public bool EnableSessionLog
{
- get => _additionalCommandLine;
+ get => _enableSessionLog;
set
{
- if (value == _additionalCommandLine)
+ if (value == _enableSessionLog)
return;
if (!_isLoading)
- SettingsManager.Current.PuTTY_AdditionalCommandLine = value;
+ SettingsManager.Current.PuTTY_EnableSessionLog = value;
- _additionalCommandLine = value;
+ _enableSessionLog = value;
OnPropertyChanged();
}
}
- private string _profile;
- public string Profile
+ private string _sessionLogPath;
+ public string SessionLogPath
{
- get => _profile;
+ get => _sessionLogPath;
set
{
- if (value == _profile)
+ if (value == _sessionLogPath)
return;
if (!_isLoading)
- SettingsManager.Current.PuTTY_Profile = value;
+ SettingsManager.Current.PuTTY_SessionLogPath = value;
- _profile = value;
+ _sessionLogPath = value;
OnPropertyChanged();
}
}
+ private string _sessionLogFileName;
+ public string SessionLogFileName
+ {
+ get => _sessionLogFileName;
+ set
+ {
+ if (value == _sessionLogFileName)
+ return;
+
+ if (!_isLoading)
+ SettingsManager.Current.PuTTY_SessionLogFileName = value;
+
+ _sessionLogFileName = value;
+ OnPropertyChanged();
+ }
+ }
+
+ private string _additionalCommandLine;
+ public string AdditionalCommandLine
+ {
+ get => _additionalCommandLine;
+ set
+ {
+ if (value == _additionalCommandLine)
+ return;
+
+ if (!_isLoading)
+ SettingsManager.Current.PuTTY_AdditionalCommandLine = value;
+
+ _additionalCommandLine = value;
+ OnPropertyChanged();
+ }
+ }
+
+
private string _serialLine;
public string SerialLine
{
@@ -310,6 +361,9 @@ private void LoadSettings()
IsConfigured = File.Exists(ApplicationFilePath);
Username = SettingsManager.Current.PuTTY_Username;
Profile = SettingsManager.Current.PuTTY_Profile;
+ EnableSessionLog = SettingsManager.Current.PuTTY_EnableSessionLog;
+ SessionLogPath = SettingsManager.Current.PuTTY_SessionLogPath;
+ SessionLogFileName = SettingsManager.Current.PuTTY_SessionLogFileName;
AdditionalCommandLine = SettingsManager.Current.PuTTY_AdditionalCommandLine;
SerialLine = SettingsManager.Current.PuTTY_SerialLine;
SSHPort = SettingsManager.Current.PuTTY_SSHPort;
diff --git a/Source/NETworkManager/ViewModels/TigerVNCHostViewModel.cs b/Source/NETworkManager/ViewModels/TigerVNCHostViewModel.cs
index 8ba6f39f79..54c93704ec 100644
--- a/Source/NETworkManager/ViewModels/TigerVNCHostViewModel.cs
+++ b/Source/NETworkManager/ViewModels/TigerVNCHostViewModel.cs
@@ -16,7 +16,6 @@
using NETworkManager.Models.TigerVNC;
using NETworkManager.Profiles;
using System.Windows.Threading;
-using NETworkManager.Settings;
using NETworkManager.Models;
using NETworkManager.Models.EventSystem;
diff --git a/Source/NETworkManager/Views/IPScannerSettingsView.xaml b/Source/NETworkManager/Views/IPScannerSettingsView.xaml
index dc8db8cbfc..6b228a49e7 100644
--- a/Source/NETworkManager/Views/IPScannerSettingsView.xaml
+++ b/Source/NETworkManager/Views/IPScannerSettingsView.xaml
@@ -7,7 +7,7 @@
xmlns:validators="clr-namespace:NETworkManager.Validators;assembly=NETworkManager.Validators"
xmlns:viewModels="clr-namespace:NETworkManager.ViewModels"
xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
- xmlns:utilities="clr-namespace:NETworkManager.Utilities"
+ xmlns:utilities="clr-namespace:NETworkManager.Utilities;assembly=NETworkManager.Utilities"
xmlns:localization="clr-namespace:NETworkManager.Localization.Resources;assembly=NETworkManager.Localization"
xmlns:dialogs="clr-namespace:MahApps.Metro.Controls.Dialogs;assembly=MahApps.Metro"
dialogs:DialogParticipation.Register="{Binding}"
diff --git a/Source/NETworkManager/Views/ProfileDialog.xaml b/Source/NETworkManager/Views/ProfileDialog.xaml
index af0726f77f..2c5ce40a3c 100644
--- a/Source/NETworkManager/Views/ProfileDialog.xaml
+++ b/Source/NETworkManager/Views/ProfileDialog.xaml
@@ -1063,6 +1063,10 @@
+
+
+
+
@@ -1143,7 +1147,7 @@
-
+
@@ -1153,7 +1157,7 @@
-
+
@@ -1183,8 +1187,20 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1667,6 +1683,16 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/Source/NETworkManager/Views/PuTTYSettingsView.xaml b/Source/NETworkManager/Views/PuTTYSettingsView.xaml
index d9b0e41fd6..b0ee523b77 100644
--- a/Source/NETworkManager/Views/PuTTYSettingsView.xaml
+++ b/Source/NETworkManager/Views/PuTTYSettingsView.xaml
@@ -41,6 +41,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+