Merge pull request #1320 from mRemoteNG/favorites2

Add connection tree favorites
This commit is contained in:
David Sparer
2019-02-28 08:55:46 -06:00
committed by GitHub
32 changed files with 2825 additions and 2565 deletions

View File

@@ -83,6 +83,7 @@ namespace mRemoteNGTests.Config.Serializers.ConnectionSerializers.Csv
PostExtApp = "SomePostExtApp",
MacAddress = "SomeMacAddress",
UserField = "SomeUserField",
Favorite = true,
ExtApp = "SomeExtApp",
VNCProxyUsername = "SomeVNCProxyUsername",
VNCProxyPassword = "SomeVNCProxyPassword",

View File

@@ -412,6 +412,15 @@ namespace mRemoteNGTests.Connection
Assert.That(wasCalled, Is.True);
}
[Test]
public void FavoriteNotifiesOnValueChange()
{
var wasCalled = false;
_testAbstractConnectionInfoData.PropertyChanged += (sender, args) => wasCalled = true;
_testAbstractConnectionInfoData.Favorite = true;
Assert.That(wasCalled, Is.True);
}
[Test]
public void VncCompressionNotifiesOnValueChange()
{

View File

@@ -63,10 +63,11 @@ namespace mRemoteNGTests.TestHelpers
RedirectSmartCards = RandomBool(),
UseConsoleSession = RandomBool(),
UseCredSsp = RandomBool(),
VNCViewOnly = RandomBool(),
VNCViewOnly = RandomBool(),
Favorite = RandomBool(),
// ints
Port = RandomInt(),
// ints
Port = RandomInt(),
RDPMinutesToIdleTimeout = RandomInt(),
VNCProxyPort = RandomInt(),

View File

@@ -48,8 +48,9 @@
public TType PreExtApp { get; set; }
public TType PostExtApp { get; set; }
public TType MacAddress { get; set; }
public TType UserField { get; set; }
public TType VNCCompression { get; set; }
public TType UserField { get; set; }
public TType Favorite { get; set; }
public TType VNCCompression { get; set; }
public TType VNCEncoding { get; set; }
public TType VNCAuthMode { get; set; }
public TType VNCProxyType { get; set; }

View File

@@ -114,6 +114,7 @@ namespace mRemoteNGTests.UI.Window.ConfigWindowTests
nameof(ConnectionInfo.PostExtApp),
nameof(ConnectionInfo.MacAddress),
nameof(ConnectionInfo.UserField),
nameof(ConnectionInfo.Favorite),
};
if (!isContainer)

View File

@@ -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;
});

View File

@@ -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);

View File

@@ -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;

View File

@@ -56,10 +56,10 @@ namespace mRemoteNG.Config.Serializers.Csv
if (_saveFilter.SaveDomain)
sb.Append("Domain;");
sb.Append(
"Hostname;Protocol;PuttySession;Port;ConnectToConsole;UseCredSsp;RenderingEngine;ICAEncryptionStrength;RDPAuthenticationLevel;LoadBalanceInfo;Colors;Resolution;AutomaticResize;DisplayWallpaper;DisplayThemes;EnableFontSmoothing;EnableDesktopComposition;CacheBitmaps;RedirectDiskDrives;RedirectPorts;RedirectPrinters;RedirectClipboard;RedirectSmartCards;RedirectSound;RedirectKeys;PreExtApp;PostExtApp;MacAddress;UserField;ExtApp;VNCCompression;VNCEncoding;VNCAuthMode;VNCProxyType;VNCProxyIP;VNCProxyPort;VNCProxyUsername;VNCProxyPassword;VNCColors;VNCSmartSizeMode;VNCViewOnly;RDGatewayUsageMethod;RDGatewayHostname;RDGatewayUseConnectionCredentials;RDGatewayUsername;RDGatewayPassword;RDGatewayDomain;");
"Hostname;Protocol;PuttySession;Port;ConnectToConsole;UseCredSsp;RenderingEngine;ICAEncryptionStrength;RDPAuthenticationLevel;LoadBalanceInfo;Colors;Resolution;AutomaticResize;DisplayWallpaper;DisplayThemes;EnableFontSmoothing;EnableDesktopComposition;CacheBitmaps;RedirectDiskDrives;RedirectPorts;RedirectPrinters;RedirectClipboard;RedirectSmartCards;RedirectSound;RedirectKeys;PreExtApp;PostExtApp;MacAddress;UserField;ExtApp;Favorite;VNCCompression;VNCEncoding;VNCAuthMode;VNCProxyType;VNCProxyIP;VNCProxyPort;VNCProxyUsername;VNCProxyPassword;VNCColors;VNCSmartSizeMode;VNCViewOnly;RDGatewayUsageMethod;RDGatewayHostname;RDGatewayUseConnectionCredentials;RDGatewayUsername;RDGatewayPassword;RDGatewayDomain;");
if (_saveFilter.SaveInheritance)
sb.Append(
"InheritCacheBitmaps;InheritColors;InheritDescription;InheritDisplayThemes;InheritDisplayWallpaper;InheritEnableFontSmoothing;InheritEnableDesktopComposition;InheritDomain;InheritIcon;InheritPanel;InheritPassword;InheritPort;InheritProtocol;InheritPuttySession;InheritRedirectDiskDrives;InheritRedirectKeys;InheritRedirectPorts;InheritRedirectPrinters;InheritRedirectClipboard;InheritRedirectSmartCards;InheritRedirectSound;InheritResolution;InheritAutomaticResize;InheritUseConsoleSession;InheritUseCredSsp;InheritRenderingEngine;InheritUsername;InheritICAEncryptionStrength;InheritRDPAuthenticationLevel;InheritLoadBalanceInfo;InheritPreExtApp;InheritPostExtApp;InheritMacAddress;InheritUserField;InheritExtApp;InheritVNCCompression;InheritVNCEncoding;InheritVNCAuthMode;InheritVNCProxyType;InheritVNCProxyIP;InheritVNCProxyPort;InheritVNCProxyUsername;InheritVNCProxyPassword;InheritVNCColors;InheritVNCSmartSizeMode;InheritVNCViewOnly;InheritRDGatewayUsageMethod;InheritRDGatewayHostname;InheritRDGatewayUseConnectionCredentials;InheritRDGatewayUsername;InheritRDGatewayPassword;InheritRDGatewayDomain;InheritRDPAlertIdleTimeout;InheritRDPMinutesToIdleTimeout;InheritSoundQuality");
"InheritCacheBitmaps;InheritColors;InheritDescription;InheritDisplayThemes;InheritDisplayWallpaper;InheritEnableFontSmoothing;InheritEnableDesktopComposition;InheritDomain;InheritIcon;InheritPanel;InheritPassword;InheritPort;InheritProtocol;InheritPuttySession;InheritRedirectDiskDrives;InheritRedirectKeys;InheritRedirectPorts;InheritRedirectPrinters;InheritRedirectClipboard;InheritRedirectSmartCards;InheritRedirectSound;InheritResolution;InheritAutomaticResize;InheritUseConsoleSession;InheritUseCredSsp;InheritRenderingEngine;InheritUsername;InheritICAEncryptionStrength;InheritRDPAuthenticationLevel;InheritLoadBalanceInfo;InheritPreExtApp;InheritPostExtApp;InheritMacAddress;InheritUserField;InheritFavorite;InheritExtApp;InheritVNCCompression;InheritVNCEncoding;InheritVNCAuthMode;InheritVNCProxyType;InheritVNCProxyIP;InheritVNCProxyPort;InheritVNCProxyUsername;InheritVNCProxyPassword;InheritVNCColors;InheritVNCSmartSizeMode;InheritVNCViewOnly;InheritRDGatewayUsageMethod;InheritRDGatewayHostname;InheritRDGatewayUseConnectionCredentials;InheritRDGatewayUsername;InheritRDGatewayPassword;InheritRDGatewayDomain;InheritRDPAlertIdleTimeout;InheritRDPMinutesToIdleTimeout;InheritSoundQuality");
}
private void SerializeNodesRecursive(ConnectionInfo node, StringBuilder sb)
@@ -130,6 +130,7 @@ namespace mRemoteNG.Config.Serializers.Csv
.Append(FormatForCsv(con.MacAddress))
.Append(FormatForCsv(con.UserField))
.Append(FormatForCsv(con.ExtApp))
.Append(FormatForCsv(con.Favorite))
.Append(FormatForCsv(con.VNCCompression))
.Append(FormatForCsv(con.VNCEncoding))
.Append(FormatForCsv(con.VNCAuthMode))
@@ -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))

View File

@@ -16,5 +16,10 @@
/// Indicates whether this container is expanded in the tree
/// </summary>
public bool Expanded { get; set; }
/// <summary>
/// Indicates whether this connection is a favorite
/// </summary>
public bool Favorite { get; set; }
}
}
}

View File

@@ -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));

View File

@@ -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)

View File

@@ -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

View File

@@ -1,4 +1,4 @@
using mRemoteNG.App;
using mRemoteNG.App;
using mRemoteNG.Connection.Protocol;
using mRemoteNG.Connection.Protocol.Http;
using mRemoteNG.Connection.Protocol.ICA;
@@ -34,9 +34,6 @@ namespace mRemoteNG.Connection
[Browsable(false)] public ContainerInfo Parent { get; internal set; }
//[Browsable(false)]
//private int PositionID { get; set; }
[Browsable(false)]
// ReSharper disable once UnusedAutoPropertyAccessor.Global
public bool IsQuickConnect { get; set; }
@@ -213,15 +210,17 @@ namespace mRemoteNG.Connection
var parentPropertyInfo = connectionInfoType.GetProperty(propertyName);
if (parentPropertyInfo == null)
throw new NullReferenceException(
$"Could not retrieve property data for property '{propertyName}' on parent node '{Parent?.Name}'");
$"Could not retrieve property data for property '{propertyName}' on parent node '{Parent?.Name}'"
);
inheritedValue = (TPropertyType)parentPropertyInfo.GetValue(Parent, null);
return true;
}
catch (Exception e)
{
Runtime.MessageCollector.AddExceptionStackTrace($"Error retrieving inherited property '{propertyName}'",
e);
Runtime.MessageCollector.AddExceptionStackTrace(
$"Error retrieving inherited property '{propertyName}'", e
);
inheritedValue = default(TPropertyType);
return false;
}
@@ -361,6 +360,7 @@ namespace mRemoteNG.Connection
PostExtApp = Settings.Default.ConDefaultPostExtApp;
MacAddress = Settings.Default.ConDefaultMacAddress;
UserField = Settings.Default.ConDefaultUserField;
Favorite = Settings.Default.ConDefaultFavorite;
}
private void SetVncDefaults()

View File

@@ -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;}

View File

@@ -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<ConnectionInfo> GetRecursiveFavoriteChildList()
{
var childList = new List<ConnectionInfo>();
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<ConnectionInfo> GetRecursiveFavoritChildList(ContainerInfo container)
{
var childList = new List<ConnectionInfo>();
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;

View File

@@ -882,14 +882,13 @@ namespace mRemoteNG {
/// <summary>
/// Looks up a localized string similar to &lt;Application xmlns:xsi=&apos;http://www.w3.org/2001/XMLSchema-instance&apos;&gt;
/// &lt;VisualElements
/// BackgroundColor=&apos;#343A40&apos;
/// ShowNameOnSquare150x150Logo=&apos;on&apos;
/// ForegroundText=&apos;light&apos;
/// Square150x150Logo=&apos;VisualElements_150.png&apos;
/// Square70x70Logo=&apos;VisualElements_70.png&apos;/&gt;
///&lt;/Application&gt;
///.
/// &lt;VisualElements
/// BackgroundColor=&apos;#343A40&apos;
/// ShowNameOnSquare150x150Logo=&apos;on&apos;
/// ForegroundText=&apos;light&apos;
/// Square150x150Logo=&apos;VisualElements_150.png&apos;
/// Square70x70Logo=&apos;VisualElements_70.png&apos; /&gt;
///&lt;/Application&gt;.
/// </summary>
internal static string mRemoteNG_VisualElementsManifest {
get {
@@ -1337,6 +1336,16 @@ namespace mRemoteNG {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap star {
get {
object obj = ResourceManager.GetObject("star", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
/// </summary>

View File

@@ -565,4 +565,7 @@
<data name="tab_edit" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Images\tab_edit.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="star" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Images\star.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

View File

@@ -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;
}
}
}
}

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 670 B

View File

@@ -177,6 +177,15 @@ namespace mRemoteNG {
}
}
/// <summary>
/// Looks up a localized string similar to Favorites.
/// </summary>
internal static string Favorites {
get {
return ResourceManager.GetString("Favorites", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Filter search matches in connection tree.
/// </summary>
@@ -4803,6 +4812,15 @@ namespace mRemoteNG {
}
}
/// <summary>
/// Looks up a localized string similar to Show this connection in the favorites menu..
/// </summary>
internal static string strPropertyDescriptionFavorite {
get {
return ResourceManager.GetString("strPropertyDescriptionFavorite", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Choose a icon that will be displayed when connected to the host..
/// </summary>
@@ -5307,6 +5325,15 @@ namespace mRemoteNG {
}
}
/// <summary>
/// Looks up a localized string similar to Favorite.
/// </summary>
internal static string strPropertyNameFavorite {
get {
return ResourceManager.GetString("strPropertyNameFavorite", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Icon.
/// </summary>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -76,6 +76,7 @@
<xs:attribute name="MacAddress" type="xs:string" use="required" />
<xs:attribute name="UserField" type="xs:string" use="required" />
<xs:attribute name="ExtApp" type="xs:string" use="required" />
<xs:attribute name="Favorite" type="xs:string" use="required" />
<xs:attribute name="VNCCompression" type="xs:string" use="required" />
<xs:attribute name="VNCEncoding" type="xs:string" use="required" />
<xs:attribute name="VNCAuthMode" type="xs:string" use="required" />
@@ -132,6 +133,7 @@
<xs:attribute name="InheritMacAddress" type="xs:boolean" use="optional" />
<xs:attribute name="InheritUserField" type="xs:boolean" use="optional" />
<xs:attribute name="InheritExtApp" type="xs:boolean" use="optional" />
<xs:attribute name="InheritFavorite" type="xs:boolean" use="optional" />
<xs:attribute name="InheritVNCCompression" type="xs:boolean" use="optional" />
<xs:attribute name="InheritVNCEncoding" type="xs:boolean" use="optional" />
<xs:attribute name="InheritVNCAuthMode" type="xs:boolean" use="optional" />

View File

@@ -50,6 +50,11 @@ namespace mRemoteNG.Tree
return container.GetRecursiveChildList();
}
public IEnumerable<ConnectionInfo> GetRecursiveFavoriteChildList(ContainerInfo container)
{
return container.GetRecursiveFavoriteChildList();
}
public void RenameNode(ConnectionInfo connectionInfo, string newName)
{
if (newName == null || newName.Length <= 0)

View File

@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Linq;
@@ -248,6 +249,27 @@ namespace mRemoteNG.UI.Controls
.CreateToolStripDropDownItems(Runtime.ConnectionsService
.ConnectionTreeModel).ToArray();
_btnConnections.DropDownItems.AddRange(rootMenuItems);
ToolStripMenuItem favorites = new ToolStripMenuItem(Language.Favorites, Resources.star);
var rootNodes = Runtime.ConnectionsService.ConnectionTreeModel.RootNodes;
List<ToolStripMenuItem> favoritesList = new List<ToolStripMenuItem>();
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 += ConnectionsMenuItem_MouseUp;
favoritesList.Add(favoriteMenuItem);
}
}
favorites.DropDownItems.AddRange(favoritesList.ToArray());
_btnConnections.DropDownItems.Add(favorites);
}
private void ConnectionsMenuItem_MouseUp(object sender, MouseEventArgs e)

View File

@@ -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)

View File

@@ -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;
}
}

View File

@@ -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;
@@ -86,9 +87,10 @@ namespace mRemoteNG.UI.Window
mMenAddConnection.ToolTipText = Language.strAddConnection;
mMenAddFolder.ToolTipText = Language.strAddFolder;
mMenViewExpandAllFolders.Text = Language.strExpandAllFolders;
mMenViewCollapseAllFolders.Text = Language.strCollapseAllFolders;
mMenViewExpandAllFolders.ToolTipText = Language.strExpandAllFolders;
mMenViewCollapseAllFolders.ToolTipText = Language.strCollapseAllFolders;
mMenSortAscending.ToolTipText = Language.strSortAsc;
mMenFavorites.ToolTipText = Language.Favorites;
txtSearch.Text = Language.strSearchPrompt;
}
@@ -199,8 +201,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<ToolStripMenuItem> favoritesList = new List<ToolStripMenuItem>();
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

View File

@@ -729,6 +729,12 @@
<setting name="OverrideFIPSCheck" serializeAs="String">
<value>False</value>
</setting>
<setting name="ConDefaultFavorite" serializeAs="String">
<value>False</value>
</setting>
<setting name="InhDefaultFavorite" serializeAs="String">
<value>False</value>
</setting>
</mRemoteNG.Settings>
</userSettings>
<applicationSettings>

View File

@@ -791,12 +791,18 @@
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\Language\Language.cs-CZ.resx" />
<EmbeddedResource Include="Resources\Language\Language.cs-CZ.resx">
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Resources\Language\Language.ja-JP.resx">
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Resources\Language\Language.ko-KR.resx" />
<EmbeddedResource Include="Resources\Language\Language.tr-TR.resx" />
<EmbeddedResource Include="Resources\Language\Language.ko-KR.resx">
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Resources\Language\Language.tr-TR.resx">
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Resources\Themes\ColorMapTheme.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>ColorMapTheme.Designer.cs</LastGenOutput>
@@ -928,7 +934,9 @@
<EmbeddedResource Include="Resources\Language\Language.en-US.resx">
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Resources\Language\Language.es-AR.resx" />
<EmbeddedResource Include="Resources\Language\Language.es-AR.resx">
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Resources\Language\Language.es.resx">
<SubType>Designer</SubType>
</EmbeddedResource>
@@ -1265,6 +1273,7 @@
<None Include="Resources\Images\tab_add.png" />
<None Include="Resources\Images\tab_edit.png" />
<None Include="Resources\Images\tab_delete.png" />
<None Include="Resources\Images\star.png" />
<Content Include="Schemas\mremoteng_confcons_v2_6.xsd">
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>