From 481ca5194a2036b33e55dfe27ed612c173de1ddf Mon Sep 17 00:00:00 2001 From: Faryan Rezagholi Date: Mon, 18 Feb 2019 12:57:34 +0100 Subject: [PATCH] reapplied changes from old PR --- .../AbstractConnectionInfoDataTests.cs | 9 + .../ConfigWindowGeneralTests.cs | 1 + .../Connections/SqlConnectionsLoader.cs | 1 + .../Config/Connections/SqlConnectionsSaver.cs | 6 +- ...vConnectionsDeserializerMremotengFormat.cs | 14 + ...CsvConnectionsSerializerMremotengFormat.cs | 2 + .../MsSql/LocalConnectionPropertiesModel.cs | 5 + .../Xml/XmlConnectionNodeSerializer27.cs | 4 + .../Xml/XmlConnectionsDeserializer.cs | 5 +- .../Connection/AbstractConnectionRecord.cs | 10 + mRemoteV1/Connection/ConnectionInfo.cs | 3 +- .../Connection/ConnectionInfoInheritance.cs | 9 +- mRemoteV1/Container/ContainerInfo.cs | 30 +- mRemoteV1/Properties/Resources.Designer.cs | 25 +- mRemoteV1/Properties/Resources.resx | 3 + mRemoteV1/Properties/Settings.Designer.cs | 24 + mRemoteV1/Properties/Settings.settings | 1402 +++++++++-------- mRemoteV1/Resources/Images/star.png | Bin 0 -> 670 bytes .../Resources/Language/Language.Designer.cs | 18 + mRemoteV1/Resources/Language/Language.de.resx | 6 + mRemoteV1/Resources/Language/Language.resx | 6 + mRemoteV1/Tree/ConnectionTreeModel.cs | 5 + mRemoteV1/UI/Window/ConfigWindow.cs | 5 +- .../Window/ConnectionTreeWindow.Designer.cs | 16 +- mRemoteV1/UI/Window/ConnectionTreeWindow.cs | 36 +- mRemoteV1/app.config | 6 + mRemoteV1/mRemoteV1.csproj | 17 +- 27 files changed, 943 insertions(+), 725 deletions(-) create mode 100644 mRemoteV1/Resources/Images/star.png diff --git a/mRemoteNGTests/Connection/AbstractConnectionInfoDataTests.cs b/mRemoteNGTests/Connection/AbstractConnectionInfoDataTests.cs index 950134060..fcab18666 100644 --- a/mRemoteNGTests/Connection/AbstractConnectionInfoDataTests.cs +++ b/mRemoteNGTests/Connection/AbstractConnectionInfoDataTests.cs @@ -405,6 +405,15 @@ namespace mRemoteNGTests.Connection [Test] public void UserFieldNotifiesOnValueChange() + { + var wasCalled = false; + _testAbstractConnectionInfoData.PropertyChanged += (sender, args) => wasCalled = true; + _testAbstractConnectionInfoData.Favorite = true; + Assert.That(wasCalled, Is.True); + } + + [Test] + public void FavoriteNotifiesOnValueChange() { var wasCalled = false; _testAbstractConnectionInfoData.PropertyChanged += (sender, args) => wasCalled = true; diff --git a/mRemoteNGTests/UI/Window/ConfigWindowTests/ConfigWindowGeneralTests.cs b/mRemoteNGTests/UI/Window/ConfigWindowTests/ConfigWindowGeneralTests.cs index 2519479b1..70ca48923 100644 --- a/mRemoteNGTests/UI/Window/ConfigWindowTests/ConfigWindowGeneralTests.cs +++ b/mRemoteNGTests/UI/Window/ConfigWindowTests/ConfigWindowGeneralTests.cs @@ -114,6 +114,7 @@ namespace mRemoteNGTests.UI.Window.ConfigWindowTests nameof(ConnectionInfo.PostExtApp), nameof(ConnectionInfo.MacAddress), nameof(ConnectionInfo.UserField), + nameof(ConnectionInfo.Favorite), }; if (!isContainer) diff --git a/mRemoteV1/Config/Connections/SqlConnectionsLoader.cs b/mRemoteV1/Config/Connections/SqlConnectionsLoader.cs index 424fde058..ecab5b284 100644 --- a/mRemoteV1/Config/Connections/SqlConnectionsLoader.cs +++ b/mRemoteV1/Config/Connections/SqlConnectionsLoader.cs @@ -86,6 +86,7 @@ namespace mRemoteNG.Config.Connections .ForEach(x => { x.Connection.PleaseConnect = x.LocalProperties.Connected; + x.Connection.Favorite = x.LocalProperties.Favorite; if (x.Connection is ContainerInfo container) container.IsExpanded = x.LocalProperties.Expanded; }); diff --git a/mRemoteV1/Config/Connections/SqlConnectionsSaver.cs b/mRemoteV1/Config/Connections/SqlConnectionsSaver.cs index 69e3caf88..94ed8cbef 100644 --- a/mRemoteV1/Config/Connections/SqlConnectionsSaver.cs +++ b/mRemoteV1/Config/Connections/SqlConnectionsSaver.cs @@ -94,7 +94,8 @@ namespace mRemoteNG.Config.Connections private bool PropertyIsLocalOnly(string property) { return property == nameof(ConnectionInfo.OpenConnections) || - property == nameof(ContainerInfo.IsExpanded); + property == nameof(ContainerInfo.IsExpanded) || + property == nameof(ContainerInfo.Favorite); } private void UpdateLocalConnectionProperties(ContainerInfo rootNode) @@ -103,7 +104,8 @@ namespace mRemoteNG.Config.Connections { ConnectionId = info.ConstantID, Connected = info.OpenConnections.Count > 0, - Expanded = info is ContainerInfo c && c.IsExpanded + Expanded = info is ContainerInfo c && c.IsExpanded, + Favorite = info.Favorite, }); var serializedProperties = _localPropertiesSerializer.Serialize(a); diff --git a/mRemoteV1/Config/Serializers/ConnectionSerializers/Csv/CsvConnectionsDeserializerMremotengFormat.cs b/mRemoteV1/Config/Serializers/ConnectionSerializers/Csv/CsvConnectionsDeserializerMremotengFormat.cs index afc18bd7f..93b2e385b 100644 --- a/mRemoteV1/Config/Serializers/ConnectionSerializers/Csv/CsvConnectionsDeserializerMremotengFormat.cs +++ b/mRemoteV1/Config/Serializers/ConnectionSerializers/Csv/CsvConnectionsDeserializerMremotengFormat.cs @@ -354,6 +354,13 @@ namespace mRemoteNG.Config.Serializers.Csv connectionRecord.RDGatewayUseConnectionCredentials = value; } + if (headers.Contains("Favorite")) + { + bool value; + if (bool.TryParse(connectionCsv[headers.IndexOf("Favorite")], out value)) + connectionRecord.Favorite = value; + } + #region Inheritance if (headers.Contains("InheritCacheBitmaps")) @@ -594,6 +601,13 @@ namespace mRemoteNG.Config.Serializers.Csv connectionRecord.Inheritance.UserField = value; } + if (headers.Contains("InheritFavorite")) + { + bool value; + if (bool.TryParse(connectionCsv[headers.IndexOf("InheritFavorite")], out value)) + connectionRecord.Inheritance.Favorite = value; + } + if (headers.Contains("InheritExtApp")) { bool value; diff --git a/mRemoteV1/Config/Serializers/ConnectionSerializers/Csv/CsvConnectionsSerializerMremotengFormat.cs b/mRemoteV1/Config/Serializers/ConnectionSerializers/Csv/CsvConnectionsSerializerMremotengFormat.cs index 62e3afc53..ab99f6eaf 100644 --- a/mRemoteV1/Config/Serializers/ConnectionSerializers/Csv/CsvConnectionsSerializerMremotengFormat.cs +++ b/mRemoteV1/Config/Serializers/ConnectionSerializers/Csv/CsvConnectionsSerializerMremotengFormat.cs @@ -129,6 +129,7 @@ namespace mRemoteNG.Config.Serializers.Csv .Append(FormatForCsv(con.PostExtApp)) .Append(FormatForCsv(con.MacAddress)) .Append(FormatForCsv(con.UserField)) + .Append(FormatForCsv(con.Favorite)) .Append(FormatForCsv(con.ExtApp)) .Append(FormatForCsv(con.VNCCompression)) .Append(FormatForCsv(con.VNCEncoding)) @@ -186,6 +187,7 @@ namespace mRemoteNG.Config.Serializers.Csv .Append(FormatForCsv(con.Inheritance.PostExtApp)) .Append(FormatForCsv(con.Inheritance.MacAddress)) .Append(FormatForCsv(con.Inheritance.UserField)) + .Append(FormatForCsv(con.Inheritance.Favorite)) .Append(FormatForCsv(con.Inheritance.ExtApp)) .Append(FormatForCsv(con.Inheritance.VNCCompression)) .Append(FormatForCsv(con.Inheritance.VNCEncoding)) diff --git a/mRemoteV1/Config/Serializers/ConnectionSerializers/MsSql/LocalConnectionPropertiesModel.cs b/mRemoteV1/Config/Serializers/ConnectionSerializers/MsSql/LocalConnectionPropertiesModel.cs index 696c60703..510275fb2 100644 --- a/mRemoteV1/Config/Serializers/ConnectionSerializers/MsSql/LocalConnectionPropertiesModel.cs +++ b/mRemoteV1/Config/Serializers/ConnectionSerializers/MsSql/LocalConnectionPropertiesModel.cs @@ -16,5 +16,10 @@ /// Indicates whether this container is expanded in the tree /// public bool Expanded { get; set; } + + /// + /// Indicates whether this container is expanded in the tree + /// + public bool Favorite { get; set; } } } \ No newline at end of file diff --git a/mRemoteV1/Config/Serializers/ConnectionSerializers/Xml/XmlConnectionNodeSerializer27.cs b/mRemoteV1/Config/Serializers/ConnectionSerializers/Xml/XmlConnectionNodeSerializer27.cs index 3eb4086df..ef8ef893b 100644 --- a/mRemoteV1/Config/Serializers/ConnectionSerializers/Xml/XmlConnectionNodeSerializer27.cs +++ b/mRemoteV1/Config/Serializers/ConnectionSerializers/Xml/XmlConnectionNodeSerializer27.cs @@ -114,6 +114,7 @@ namespace mRemoteNG.Config.Serializers.Xml element.Add(new XAttribute("PostExtApp", connectionInfo.PostExtApp)); element.Add(new XAttribute("MacAddress", connectionInfo.MacAddress)); element.Add(new XAttribute("UserField", connectionInfo.UserField)); + element.Add(new XAttribute("Favorite", connectionInfo.Favorite)); element.Add(new XAttribute("ExtApp", connectionInfo.ExtApp)); element.Add(new XAttribute("VNCCompression", connectionInfo.VNCCompression)); element.Add(new XAttribute("VNCEncoding", connectionInfo.VNCEncoding)); @@ -243,6 +244,8 @@ namespace mRemoteNG.Config.Serializers.Xml connectionInfo.Inheritance.MacAddress.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritUserField", connectionInfo.Inheritance.UserField.ToString().ToLowerInvariant())); + element.Add(new XAttribute("InheritFavorite", + connectionInfo.Inheritance.Favorite.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritExtApp", connectionInfo.Inheritance.ExtApp.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritVNCCompression", @@ -323,6 +326,7 @@ namespace mRemoteNG.Config.Serializers.Xml element.Add(new XAttribute("InheritPostExtApp", falseString)); element.Add(new XAttribute("InheritMacAddress", falseString)); element.Add(new XAttribute("InheritUserField", falseString)); + element.Add(new XAttribute("InheritFavorite", falseString)); element.Add(new XAttribute("InheritExtApp", falseString)); element.Add(new XAttribute("InheritVNCCompression", falseString)); element.Add(new XAttribute("InheritVNCEncoding", falseString)); diff --git a/mRemoteV1/Config/Serializers/ConnectionSerializers/Xml/XmlConnectionsDeserializer.cs b/mRemoteV1/Config/Serializers/ConnectionSerializers/Xml/XmlConnectionsDeserializer.cs index 916f1e4c0..d475f3e5b 100644 --- a/mRemoteV1/Config/Serializers/ConnectionSerializers/Xml/XmlConnectionsDeserializer.cs +++ b/mRemoteV1/Config/Serializers/ConnectionSerializers/Xml/XmlConnectionsDeserializer.cs @@ -536,8 +536,9 @@ namespace mRemoteNG.Config.Serializers.Xml if (_confVersion >= 2.7) { connectionInfo.RedirectClipboard = xmlnode.GetAttributeAsBool("RedirectClipboard"); - connectionInfo.Inheritance.RedirectClipboard = - xmlnode.GetAttributeAsBool("InheritRedirectClipboard"); + connectionInfo.Inheritance.RedirectClipboard = xmlnode.GetAttributeAsBool("InheritRedirectClipboard"); + connectionInfo.Favorite = xmlnode.GetAttributeAsBool("Favorite"); + connectionInfo.Inheritance.Favorite = xmlnode.GetAttributeAsBool("InheritFavorite"); } } catch (Exception ex) diff --git a/mRemoteV1/Connection/AbstractConnectionRecord.cs b/mRemoteV1/Connection/AbstractConnectionRecord.cs index a28b31484..fc4e17038 100644 --- a/mRemoteV1/Connection/AbstractConnectionRecord.cs +++ b/mRemoteV1/Connection/AbstractConnectionRecord.cs @@ -68,6 +68,7 @@ namespace mRemoteNG.Connection private string _postExtApp; private string _macAddress; private string _userField; + private bool _favorite; private ProtocolVNC.Compression _vncCompression; private ProtocolVNC.Encoding _vncEncoding; @@ -565,6 +566,15 @@ namespace mRemoteNG.Connection set => SetField(ref _userField, value, "UserField"); } + [LocalizedAttributes.LocalizedCategory("strCategoryMiscellaneous", 7), + LocalizedAttributes.LocalizedDisplayName("strPropertyNameFavorite"), + LocalizedAttributes.LocalizedDescription("strPropertyDescriptionFavorite"), + TypeConverter(typeof(MiscTools.YesNoTypeConverter))] + public virtual bool Favorite + { + get => GetPropertyValue("Favorite", _favorite); + set => SetField(ref _favorite, value, "Favorite"); + } #endregion #region VNC diff --git a/mRemoteV1/Connection/ConnectionInfo.cs b/mRemoteV1/Connection/ConnectionInfo.cs index 2e1e38ae8..a8b27741b 100644 --- a/mRemoteV1/Connection/ConnectionInfo.cs +++ b/mRemoteV1/Connection/ConnectionInfo.cs @@ -1,4 +1,4 @@ -using mRemoteNG.App; +using mRemoteNG.App; using mRemoteNG.Connection.Protocol; using mRemoteNG.Connection.Protocol.Http; using mRemoteNG.Connection.Protocol.ICA; @@ -361,6 +361,7 @@ namespace mRemoteNG.Connection PostExtApp = Settings.Default.ConDefaultPostExtApp; MacAddress = Settings.Default.ConDefaultMacAddress; UserField = Settings.Default.ConDefaultUserField; + Favorite = Settings.Default.ConDefaultFavorite; } private void SetVncDefaults() diff --git a/mRemoteV1/Connection/ConnectionInfoInheritance.cs b/mRemoteV1/Connection/ConnectionInfoInheritance.cs index fc7dc811d..e73aa5907 100644 --- a/mRemoteV1/Connection/ConnectionInfoInheritance.cs +++ b/mRemoteV1/Connection/ConnectionInfoInheritance.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Reflection; @@ -321,10 +321,15 @@ namespace mRemoteNG.Connection TypeConverter(typeof(MiscTools.YesNoTypeConverter))] public bool UserField { get; set; } + [LocalizedAttributes.LocalizedCategory("strCategoryMiscellaneous", 8), + LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameFavorite"), + LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionFavorite"), + TypeConverter(typeof(MiscTools.YesNoTypeConverter))] + public bool Favorite { get; set; } #endregion #region VNC - [LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 9), + [LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 9), LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameCompression"), LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionCompression"), TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool VNCCompression {get; set;} diff --git a/mRemoteV1/Container/ContainerInfo.cs b/mRemoteV1/Container/ContainerInfo.cs index 69c9c1dda..6795c2d3d 100644 --- a/mRemoteV1/Container/ContainerInfo.cs +++ b/mRemoteV1/Container/ContainerInfo.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.Specialized; using System.ComponentModel; @@ -249,6 +249,34 @@ namespace mRemoteNG.Container return childList; } + public IEnumerable GetRecursiveFavoriteChildList() + { + var childList = new List(); + foreach (var child in Children) + { + if (child.Favorite && child.GetTreeNodeType() == TreeNodeType.Connection) + childList.Add(child); + var childContainer = child as ContainerInfo; + if (childContainer != null) + childList.AddRange(GetRecursiveFavoritChildList(childContainer)); + } + return childList; + } + + private IEnumerable GetRecursiveFavoritChildList(ContainerInfo container) + { + var childList = new List(); + foreach (var child in container.Children) + { + if (child.Favorite && child.GetTreeNodeType() == TreeNodeType.Connection) + childList.Add(child); + var childContainer = child as ContainerInfo; + if (childContainer != null) + childList.AddRange(GetRecursiveFavoritChildList(childContainer)); + } + return childList; + } + protected virtual void SubscribeToChildEvents(ConnectionInfo child) { child.PropertyChanged += RaisePropertyChangedEvent; diff --git a/mRemoteV1/Properties/Resources.Designer.cs b/mRemoteV1/Properties/Resources.Designer.cs index edab3f50f..2d25a7a4f 100644 --- a/mRemoteV1/Properties/Resources.Designer.cs +++ b/mRemoteV1/Properties/Resources.Designer.cs @@ -882,14 +882,13 @@ namespace mRemoteNG { /// /// Looks up a localized string similar to <Application xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'> - /// <VisualElements - /// BackgroundColor='#343A40' - /// ShowNameOnSquare150x150Logo='on' - /// ForegroundText='light' - /// Square150x150Logo='VisualElements_150.png' - /// Square70x70Logo='VisualElements_70.png'/> - ///</Application> - ///. + /// <VisualElements + /// BackgroundColor='#343A40' + /// ShowNameOnSquare150x150Logo='on' + /// ForegroundText='light' + /// Square150x150Logo='VisualElements_150.png' + /// Square70x70Logo='VisualElements_70.png' /> + ///</Application>. /// internal static string mRemoteNG_VisualElementsManifest { get { @@ -1337,6 +1336,16 @@ namespace mRemoteNG { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap star { + get { + object obj = ResourceManager.GetObject("star", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// diff --git a/mRemoteV1/Properties/Resources.resx b/mRemoteV1/Properties/Resources.resx index 3797bb988..d0a6de6fc 100644 --- a/mRemoteV1/Properties/Resources.resx +++ b/mRemoteV1/Properties/Resources.resx @@ -565,4 +565,7 @@ ..\Resources\Images\tab_edit.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\Images\star.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/mRemoteV1/Properties/Settings.Designer.cs b/mRemoteV1/Properties/Settings.Designer.cs index 4c817b80b..54462bd0c 100644 --- a/mRemoteV1/Properties/Settings.Designer.cs +++ b/mRemoteV1/Properties/Settings.Designer.cs @@ -2794,5 +2794,29 @@ namespace mRemoteNG { this["OverrideFIPSCheck"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool ConDefaultFavorite { + get { + return ((bool)(this["ConDefaultFavorite"])); + } + set { + this["ConDefaultFavorite"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool InhDefaultFavorite { + get { + return ((bool)(this["InhDefaultFavorite"])); + } + set { + this["InhDefaultFavorite"] = value; + } + } } } diff --git a/mRemoteV1/Properties/Settings.settings b/mRemoteV1/Properties/Settings.settings index 630931987..e547dc895 100644 --- a/mRemoteV1/Properties/Settings.settings +++ b/mRemoteV1/Properties/Settings.settings @@ -1,701 +1,705 @@  - - - - - - 0, 0 - - - 0, 0 - - - Normal - - - False - - - True - - - - - - True - - - True - - - True - - - False - - - False - - - - - - True - - - True - - - False - - - False - - - True - - - False - - - False - - - noinfo - - - - - - - - - - - - False - - - True - - - False - - - False - - - False - - - - - - 80 - - - False - - - - - - - - - - - - RDP - - - Default Settings - - - False - - - FitToWindow - - - Colors16Bit - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - DoNotPlay - - - 2 - - - False - - - False - - - False - - - 0 - - - False - - - True - - - 0, 0 - - - Bottom - - - True - - - 3, 24 - - - Top - - - False - - - False - - - - - - - - - - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - EncrBasic - - - False - - - - - - - - - False - - - False - - - False - - - True - - - False - - - False - - - AuthVNC - - - ColNormal - - - SmartSAspect - - - False - - - CompNone - - - EncHextile - - - - - - - - - 0 - - - ProxyNone - - - - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - NoAuth - - - False - - - 5500 - - - False - - - - - - IE - - - False - - - - - - False - - - False - - - - - - False - - - - - - False - - - False - - - 14 - - - 1980-01-01 - - - False - - - Never - - - Yes - - - mRemoteNG - - - False - - - False - - - False - - - False - - - False - - - False - - - 5 - - - - - - - - - - - - - - - - - - False - - - False - - - False - - - False - - - 4 - - - - - - - - - mRemoteNG - - - 10 - - - {0}.{1:yyyyMMdd-HHmmssffff}.backup - - - False - - - True - - - False - - - False - - - release - - - - - - True - - - - - - - - - True - - - https://mremoteng.org/ - - - - - - True - - - False - - - False - - - RDP - - - 9/9, 33/8 - - - 9/8, 34/8 - - - False - - - 20 - - - AES - - - GCM - - - 1000 - - - Dynamic - - - False - - - 0 - - - False - - - False - - - False - - - False - - - 00000000-0000-0000-0000-000000000000 - - - - - - False - - - True - - - True - - - True - - - False - - - False - - - True - - - True - - - False - - - False - - - False - - - False - - - True - - - True - - - cs-CZ,de,el,en,en-US,es-AR,es,fr,hu,it,ja-JP,ko-KR,nb-NO,nl,pt,pt-BR,pl,ru,uk,tr-TR,zh-CN,zh-TW - - - True - - - - - - - - - - - - General - - - True - - - False - - - False - - - False - - - False - - - 0, 0 - - - - - - False - - - False - - - General - - - False - - - False - - - True - - - False - - + + + + + 0, 0 + + + 0, 0 + + + Normal + + + False + + + True + + + + + + True + + + True + + + True + + + False + + + False + + + + + + True + + + True + + + False + + + False + + + True + + + False + + + False + + + noinfo + + + + + + + + + + + + False + + + True + + + False + + + False + + + False + + + + + + 80 + + + False + + + + + + + + + + + + RDP + + + Default Settings + + + False + + + FitToWindow + + + Colors16Bit + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + DoNotPlay + + + 2 + + + False + + + False + + + False + + + 0 + + + False + + + True + + + 0, 0 + + + Bottom + + + True + + + 3, 24 + + + Top + + + False + + + False + + + + + + + + + + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + EncrBasic + + + False + + + + + + + + + False + + + False + + + False + + + True + + + False + + + False + + + AuthVNC + + + ColNormal + + + SmartSAspect + + + False + + + CompNone + + + EncHextile + + + + + + + + + 0 + + + ProxyNone + + + + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + NoAuth + + + False + + + 5500 + + + False + + + + + + IE + + + False + + + + + + False + + + False + + + + + + False + + + + + + False + + + False + + + 14 + + + 1980-01-01 + + + False + + + Never + + + Yes + + + mRemoteNG + + + False + + + False + + + False + + + False + + + False + + + False + + + 5 + + + + + + + + + + + + + + + + + + False + + + False + + + False + + + False + + + 4 + + + + + + + + + mRemoteNG + + + 10 + + + {0}.{1:yyyyMMdd-HHmmssffff}.backup + + + False + + + True + + + False + + + False + + + release + + + + + + True + + + + + + + + + True + + + https://mremoteng.org/ + + + + + + True + + + False + + + False + + + RDP + + + 9/9, 33/8 + + + 9/8, 34/8 + + + False + + + 20 + + + AES + + + GCM + + + 1000 + + + Dynamic + + + False + + + 0 + + + False + + + False + + + False + + + False + + + 00000000-0000-0000-0000-000000000000 + + + + + + False + + + True + + + True + + + True + + + False + + + False + + + True + + + True + + + False + + + False + + + False + + + False + + + True + + + True + + + cs-CZ,de,el,en,en-US,es-AR,es,fr,hu,it,ja-JP,ko-KR,nb-NO,nl,pt,pt-BR,pl,ru,uk,tr-TR,zh-CN,zh-TW + + + True + + + + + + + + + + + + General + + + True + + + False + + + False + + + False + + + False + + + 0, 0 + + + + + + False + + + False + + + General + + + False + + + False + + + True + + + False + + + False + + + False + + \ No newline at end of file diff --git a/mRemoteV1/Resources/Images/star.png b/mRemoteV1/Resources/Images/star.png new file mode 100644 index 0000000000000000000000000000000000000000..b88c8578956ceec4ff17f81995b8652f6aa2b58d GIT binary patch literal 670 zcmV;P0%84$P)rx?szq&Dw38OK zY!^{rCAFy_2z8TV&4=Ube7+y|oYO*02OOyb5BD7I^ZdAQt`ZS+tMaFrb6^=AxbXHx zH;=|4CCm%L{PZwSS3v3G^sH+#W3JcR_xs(&`Tqt8^J9}d0vU#im5^f#04JL4qMaI^seoYDXwB>7;oyw=|M z1!ayym?6XvqV3ae_f95{py8ukt2TxB^!VIzRRh4#rNu~y^X+P>L{SXo3_|Qqm>9wY zz(9!5s#OBElpmj4DRyjO`0`RiEIkUg%7D)8y}}Ye3}prow;JG>UQOIs{kfZSJ9bYz zskMPbH9)1H6FDf)1=ZKVfe+;jf`a(O{!9meiN~~d0iA$0qX=t0D6Ydx4#RO76h@#R z9_k7Z;$fv6G>QeZ{Yu0n&xL4%!?l}UPj4!j&Vs@?dl=y8#_IQ`5I-5a_T$dJtJ_~5 z4&186>klZh{hfba + /// Looks up a localized string similar to Show this connection in the favorites menu.. + /// + internal static string strPropertyDescriptionFavorite { + get { + return ResourceManager.GetString("strPropertyDescriptionFavorite", resourceCulture); + } + } + /// /// Looks up a localized string similar to Choose a icon that will be displayed when connected to the host.. /// @@ -5289,6 +5298,15 @@ namespace mRemoteNG { } } + /// + /// Looks up a localized string similar to Favorite. + /// + internal static string strPropertyNameFavorite { + get { + return ResourceManager.GetString("strPropertyNameFavorite", resourceCulture); + } + } + /// /// Looks up a localized string similar to Icon. /// diff --git a/mRemoteV1/Resources/Language/Language.de.resx b/mRemoteV1/Resources/Language/Language.de.resx index 5592cc1ba..67bec4ddf 100644 --- a/mRemoteV1/Resources/Language/Language.de.resx +++ b/mRemoteV1/Resources/Language/Language.de.resx @@ -2654,4 +2654,10 @@ Development umfasst Alphas, Betas und Release Candidates. Multi-SSH Symbolleiste + + Zeige diese Verbindung in den Favoriten + + + Favorit + \ No newline at end of file diff --git a/mRemoteV1/Resources/Language/Language.resx b/mRemoteV1/Resources/Language/Language.resx index 723513529..71ee97f27 100644 --- a/mRemoteV1/Resources/Language/Language.resx +++ b/mRemoteV1/Resources/Language/Language.resx @@ -2760,4 +2760,10 @@ Development Channel includes Alphas, Betas & Release Candidates. Proxy + + Show this connection in the favorites menu. + + + Favorite + \ No newline at end of file diff --git a/mRemoteV1/Tree/ConnectionTreeModel.cs b/mRemoteV1/Tree/ConnectionTreeModel.cs index 3a0fefb59..e1a83ad95 100644 --- a/mRemoteV1/Tree/ConnectionTreeModel.cs +++ b/mRemoteV1/Tree/ConnectionTreeModel.cs @@ -50,6 +50,11 @@ namespace mRemoteNG.Tree return container.GetRecursiveChildList(); } + public IEnumerable GetRecursiveFavoriteChildList(ContainerInfo container) + { + return container.GetRecursiveFavoriteChildList(); + } + public void RenameNode(ConnectionInfo connectionInfo, string newName) { if (newName == null || newName.Length <= 0) diff --git a/mRemoteV1/UI/Window/ConfigWindow.cs b/mRemoteV1/UI/Window/ConfigWindow.cs index dad7ba317..549dbf070 100644 --- a/mRemoteV1/UI/Window/ConfigWindow.cs +++ b/mRemoteV1/UI/Window/ConfigWindow.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics; using System.Drawing; @@ -863,6 +863,7 @@ namespace mRemoteNG.UI.Window strHide.Add("PostExtApp"); strHide.Add("MacAddress"); strHide.Add("UserField"); + strHide.Add("Favorite"); strHide.Add("Description"); strHide.Add("SoundQuality"); strHide.Add("CredentialRecord"); @@ -1410,6 +1411,8 @@ namespace mRemoteNG.UI.Window strHide.Add("MacAddress"); if (conI.Inheritance.UserField) strHide.Add("UserField"); + if (conI.Inheritance.Favorite) + strHide.Add("Favorite"); if (conI.Inheritance.VNCAuthMode) strHide.Add("VNCAuthMode"); if (conI.Inheritance.VNCColors) diff --git a/mRemoteV1/UI/Window/ConnectionTreeWindow.Designer.cs b/mRemoteV1/UI/Window/ConnectionTreeWindow.Designer.cs index 52965e136..821c74960 100644 --- a/mRemoteV1/UI/Window/ConnectionTreeWindow.Designer.cs +++ b/mRemoteV1/UI/Window/ConnectionTreeWindow.Designer.cs @@ -33,6 +33,7 @@ namespace mRemoteNG.UI.Window this.PictureBoxSearch = new mRemoteNG.UI.Controls.Base.NGPictureBox(this.components); this.txtSearch = new mRemoteNG.UI.Controls.Base.NGTextBox(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.mMenFavorites = new System.Windows.Forms.ToolStripMenuItem(); ((System.ComponentModel.ISupportInitialize)(this.olvConnections)).BeginInit(); this.msMain.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.PictureBoxSearch)).BeginInit(); @@ -53,6 +54,7 @@ namespace mRemoteNG.UI.Window this.olvConnections.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None; this.olvConnections.HideSelection = false; this.olvConnections.IsSimpleDragSource = true; + this.olvConnections.IsSimpleDropSink = true; this.olvConnections.LabelEdit = true; this.olvConnections.Location = new System.Drawing.Point(0, 24); this.olvConnections.MultiSelect = false; @@ -81,7 +83,8 @@ namespace mRemoteNG.UI.Window this.mMenAddFolder, this.mMenViewExpandAllFolders, this.mMenViewCollapseAllFolders, - this.mMenSortAscending}); + this.mMenSortAscending, + this.mMenFavorites}); this.msMain.Location = new System.Drawing.Point(0, 0); this.msMain.Name = "msMain"; this.msMain.Padding = new System.Windows.Forms.Padding(0, 2, 0, 2); @@ -120,7 +123,7 @@ namespace mRemoteNG.UI.Window this.mMenViewCollapseAllFolders.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.mMenViewCollapseAllFolders.Image = global::mRemoteNG.Resources.Collapse; this.mMenViewCollapseAllFolders.Name = "mMenViewCollapseAllFolders"; - this.mMenViewCollapseAllFolders.Size = new System.Drawing.Size(133, 20); + this.mMenViewCollapseAllFolders.Size = new System.Drawing.Size(28, 20); this.mMenViewCollapseAllFolders.Text = "Collapse all folders"; // // mMenSortAscending @@ -180,6 +183,14 @@ namespace mRemoteNG.UI.Window this.tableLayoutPanel1.Size = new System.Drawing.Size(204, 21); this.tableLayoutPanel1.TabIndex = 32; // + // mMenFavorites + // + this.mMenFavorites.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.mMenFavorites.Image = global::mRemoteNG.Resources.star; + this.mMenFavorites.Name = "mMenFavorites"; + this.mMenFavorites.Size = new System.Drawing.Size(28, 20); + this.mMenFavorites.Text = "Favorites"; + // // ConnectionTreeWindow // this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); @@ -213,5 +224,6 @@ namespace mRemoteNG.UI.Window internal Controls.Base.NGPictureBox PictureBoxSearch; internal Controls.Base.NGTextBox txtSearch; public System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; + internal System.Windows.Forms.ToolStripMenuItem mMenFavorites; } } diff --git a/mRemoteV1/UI/Window/ConnectionTreeWindow.cs b/mRemoteV1/UI/Window/ConnectionTreeWindow.cs index 76595a9dd..7cde9cbb0 100644 --- a/mRemoteV1/UI/Window/ConnectionTreeWindow.cs +++ b/mRemoteV1/UI/Window/ConnectionTreeWindow.cs @@ -1,6 +1,7 @@ -using mRemoteNG.App; +using mRemoteNG.App; using mRemoteNG.Config.Connections; using mRemoteNG.Connection; +using mRemoteNG.Container; using mRemoteNG.Themes; using mRemoteNG.Tree; using mRemoteNG.Tree.Root; @@ -199,8 +200,37 @@ namespace mRemoteNG.UI.Window olvConnections.CollapseAll(); olvConnections.Expand(olvConnections.GetRootConnectionNode()); }; - mMenSortAscending.Click += (sender, args) => - olvConnections.SortRecursive(olvConnections.GetRootConnectionNode(), ListSortDirection.Ascending); + mMenSortAscending.Click += (sender, args) => olvConnections.SortRecursive(olvConnections.GetRootConnectionNode(), ListSortDirection.Ascending); + mMenFavorites.Click += (sender, args) => + { + mMenFavorites.DropDownItems.Clear(); + var rootNodes = Runtime.ConnectionsService.ConnectionTreeModel.RootNodes; + List favoritesList = new List(); + + foreach (var node in rootNodes) + { + foreach (var containerInfo in Runtime.ConnectionsService.ConnectionTreeModel.GetRecursiveFavoriteChildList(node)) + { + var favoriteMenuItem = new ToolStripMenuItem + { + Text = containerInfo.Name, + Tag = containerInfo, + Image = containerInfo.OpenConnections.Count > 0 ? Resources.Play : Resources.Pause + }; + favoriteMenuItem.MouseUp += FavoriteMenuItem_MouseUp; + favoritesList.Add(favoriteMenuItem); + } + } + + mMenFavorites.DropDownItems.AddRange(favoritesList.ToArray()); + mMenFavorites.ShowDropDown(); + }; + } + + private void FavoriteMenuItem_MouseUp(object sender, MouseEventArgs e) + { + if (((ToolStripMenuItem)sender).Tag is ContainerInfo) return; + _connectionInitiator.OpenConnection((ConnectionInfo)((ToolStripMenuItem)sender).Tag); } #endregion diff --git a/mRemoteV1/app.config b/mRemoteV1/app.config index 2299a9ca9..6986d55c5 100644 --- a/mRemoteV1/app.config +++ b/mRemoteV1/app.config @@ -729,6 +729,12 @@ False + + False + + + False + diff --git a/mRemoteV1/mRemoteV1.csproj b/mRemoteV1/mRemoteV1.csproj index 1d52374b8..ad32d1643 100644 --- a/mRemoteV1/mRemoteV1.csproj +++ b/mRemoteV1/mRemoteV1.csproj @@ -791,12 +791,18 @@ - + + Designer + Designer - - + + Designer + + + Designer + ResXFileCodeGenerator ColorMapTheme.Designer.cs @@ -928,7 +934,9 @@ Designer - + + Designer + Designer @@ -1246,6 +1254,7 @@ + Designer PreserveNewest