mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-17 22:11:48 +08:00
reapplied changes from old PR
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -114,6 +114,7 @@ namespace mRemoteNGTests.UI.Window.ConfigWindowTests
|
||||
nameof(ConnectionInfo.PostExtApp),
|
||||
nameof(ConnectionInfo.MacAddress),
|
||||
nameof(ConnectionInfo.UserField),
|
||||
nameof(ConnectionInfo.Favorite),
|
||||
};
|
||||
|
||||
if (!isContainer)
|
||||
|
||||
@@ -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;
|
||||
});
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -16,5 +16,10 @@
|
||||
/// Indicates whether this container is expanded in the tree
|
||||
/// </summary>
|
||||
public bool Expanded { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether this container is expanded in the tree
|
||||
/// </summary>
|
||||
public bool Favorite { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -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));
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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;}
|
||||
|
||||
@@ -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;
|
||||
|
||||
25
mRemoteV1/Properties/Resources.Designer.cs
generated
25
mRemoteV1/Properties/Resources.Designer.cs
generated
@@ -882,14 +882,13 @@ namespace mRemoteNG {
|
||||
|
||||
/// <summary>
|
||||
/// 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>.
|
||||
/// </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>
|
||||
|
||||
@@ -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>
|
||||
24
mRemoteV1/Properties/Settings.Designer.cs
generated
24
mRemoteV1/Properties/Settings.Designer.cs
generated
@@ -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
BIN
mRemoteV1/Resources/Images/star.png
Normal file
BIN
mRemoteV1/Resources/Images/star.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 670 B |
18
mRemoteV1/Resources/Language/Language.Designer.cs
generated
18
mRemoteV1/Resources/Language/Language.Designer.cs
generated
@@ -4785,6 +4785,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>
|
||||
@@ -5289,6 +5298,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>
|
||||
|
||||
@@ -2654,4 +2654,10 @@ Development umfasst Alphas, Betas und Release Candidates.</value>
|
||||
<data name="strMultiSshToolbar" xml:space="preserve">
|
||||
<value>Multi-SSH Symbolleiste</value>
|
||||
</data>
|
||||
<data name="strPropertyDescriptionFavorite" xml:space="preserve">
|
||||
<value>Zeige diese Verbindung in den Favoriten</value>
|
||||
</data>
|
||||
<data name="strPropertyNameFavorite" xml:space="preserve">
|
||||
<value>Favorit</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -2760,4 +2760,10 @@ Development Channel includes Alphas, Betas & Release Candidates.</value>
|
||||
<data name="strCategoryProxy" xml:space="preserve">
|
||||
<value>Proxy</value>
|
||||
</data>
|
||||
<data name="strPropertyDescriptionFavorite" xml:space="preserve">
|
||||
<value>Show this connection in the favorites menu.</value>
|
||||
</data>
|
||||
<data name="strPropertyNameFavorite" xml:space="preserve">
|
||||
<value>Favorite</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
16
mRemoteV1/UI/Window/ConnectionTreeWindow.Designer.cs
generated
16
mRemoteV1/UI/Window/ConnectionTreeWindow.Designer.cs
generated
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<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
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
@@ -1246,6 +1254,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>
|
||||
|
||||
Reference in New Issue
Block a user