Compare commits

..

21 Commits

Author SHA1 Message Date
David Sparer
1a2b906e0a bump assembly version to 1.75.7012 2017-12-01 10:18:52 -06:00
David Sparer
d48331b706 Merge branch '1.75.7012' 2017-12-01 10:17:06 -06:00
David Sparer
d95cc62c8e update changelog 2017-12-01 10:15:43 -06:00
David Sparer
f04aa78fd7 resolves #803 2017-12-01 10:06:33 -06:00
David Sparer
b03d355d69 connection's inheritance is now correctly disabled when rootnode is the parent 2017-11-30 12:29:56 -06:00
David Sparer
c37caa95a4 resigned putty with new code signing cert 2017-11-24 08:32:44 -06:00
David Sparer
3ffcc5d5ba fixed bug where our custom drag sink was being overwritten
closes #814
2017-11-21 12:40:22 -06:00
David Sparer
f63980f122 Merge branch 'hotfix11' 2017-11-07 20:22:00 -06:00
David Sparer
9cee827f6b updated changelog 2017-11-07 20:21:13 -06:00
David Sparer
9c57976906 singleton instance should be given focus 2017-11-07 20:20:24 -06:00
David Sparer
ef5b09b6fa fix issue where /resetpanels did nothing 2017-11-07 16:35:25 -06:00
David Sparer
469b4224dc fixed bug with resetting window position
resetting window position now places app in center of main monitor like it should
2017-11-07 10:05:18 -06:00
David Sparer
afc410cfe6 fixed #778
custom cons param bug introduced in commit f73c9c9d
2017-11-07 08:21:32 -06:00
David Sparer
aed509155b inheritance button should be disabled when parent is root connection node 2017-11-05 09:04:10 -06:00
David Sparer
0120762dbe putty sessions should not have the inheritance button 2017-11-05 08:41:13 -06:00
David Sparer
85b67ecd0b fixed bug in connection tree context menu
right clicking in white space (no connection tree item selected) made the context menu appear with all options enabled. No context menu should appear in that case
2017-11-05 07:24:28 -06:00
David Sparer
7451383c24 putty nodes and root putty node should not have context menu items "import" or "export" 2017-11-05 07:09:17 -06:00
David Sparer
88d735ed56 resolved bug that would sometimes disable connection tree hot keys
bug was introduced in #652. I made sure that the original issue is still resolved
2017-11-04 22:04:08 -05:00
David Sparer
7a002e4b89 updated changelog 2017-11-04 11:45:14 -05:00
David Sparer
01ad0b4875 safer connection tree gui updating 2017-11-03 15:10:35 -05:00
David Sparer
4defa5fa9c Resolves #758
introduced in commit 8a3e3704
2017-11-03 15:09:18 -05:00
15 changed files with 152 additions and 75 deletions

View File

@@ -1,9 +1,22 @@
1.75.7011 (2017-xx-xx):
1.75.7012 (2017-12-01):
Fixes:
------
#814: Fixed bug that prevented reordering connections by dragging
#810: Official mRemoteNG builds will now be signed with a DigiCert certificate
#803: File path command line argument not working with network path
1.75.7011 (2017-11-07):
Fixes:
------
#778: Custom connection file path command line argument (/c) not working
#763: Sometimes minimizing folder causes connection tree to disappear
#761: Connections using external tools do not start (introduced in v1.75.7009)
Minor changes to how the connection tree column widths are calculated
#758: "Decryption failed" message when loading from SQL server
Fixed issues with /resetpanels and /resetpos command line arguments
Resolved bug where connection tree hotkeys would sometimes be disabled
1.75.7010 (2017-10-29):

View File

@@ -1,13 +1,16 @@
using mRemoteNG.Connection;
using System.Collections.Generic;
using System.Reflection;
using mRemoteNG.Connection;
using mRemoteNG.Connection.Protocol;
using mRemoteNG.Connection.Protocol.SSH;
using mRemoteNG.Container;
using mRemoteNG.Tree.Root;
using NUnit.Framework;
namespace mRemoteNGTests.Connection
{
public class ConnectionInfoTests
public class ConnectionInfoTests
{
private ConnectionInfo _connectionInfo;
private const string TestDomain = "somedomain";
@@ -91,7 +94,29 @@ namespace mRemoteNGTests.Connection
Assert.That(nameOfModifiedProperty, Is.EqualTo("OpenConnections"));
}
[TestCase(ProtocolType.HTTP, ExpectedResult = 80)]
[TestCaseSource(typeof(InheritancePropertyProvider), nameof(InheritancePropertyProvider.GetProperties))]
public void MovingAConnectionUnderRootNodeDisablesInheritance(PropertyInfo property)
{
var rootNode = new RootNodeInfo(RootNodeType.Connection);
_connectionInfo.Inheritance.EverythingInherited = true;
_connectionInfo.SetParent(rootNode);
var propertyValue = property.GetValue(_connectionInfo.Inheritance);
Assert.That(propertyValue, Is.False);
}
[TestCaseSource(typeof(InheritancePropertyProvider), nameof(InheritancePropertyProvider.GetProperties))]
public void MovingAConnectionFromUnderRootNodeToUnderADifferentNodeEnablesInheritance(PropertyInfo property)
{
var rootNode = new RootNodeInfo(RootNodeType.Connection);
var otherContainer = new ContainerInfo();
_connectionInfo.Inheritance.EverythingInherited = true;
_connectionInfo.SetParent(rootNode);
_connectionInfo.SetParent(otherContainer);
var propertyValue = property.GetValue(_connectionInfo.Inheritance);
Assert.That(propertyValue, Is.True);
}
[TestCase(ProtocolType.HTTP, ExpectedResult = 80)]
[TestCase(ProtocolType.HTTPS, ExpectedResult = 443)]
[TestCase(ProtocolType.ICA, ExpectedResult = 1494)]
[TestCase(ProtocolType.IntApp, ExpectedResult = 0)]
@@ -107,5 +132,13 @@ namespace mRemoteNGTests.Connection
_connectionInfo.Protocol = protocolType;
return _connectionInfo.GetDefaultPort();
}
private class InheritancePropertyProvider
{
public static IEnumerable<PropertyInfo> GetProperties()
{
return new ConnectionInfoInheritance(new object()).GetProperties();
}
}
}
}

View File

@@ -56,6 +56,7 @@ namespace mRemoteNG.App
if (singletonInstanceWindowHandle == IntPtr.Zero) return;
if (NativeMethods.IsIconic(singletonInstanceWindowHandle) != 0)
NativeMethods.ShowWindow(singletonInstanceWindowHandle, (int)NativeMethods.SW_RESTORE);
NativeMethods.SetForegroundWindow(singletonInstanceWindowHandle);
}
private static IntPtr GetRunningSingletonInstanceWindowHandle()

View File

@@ -469,7 +469,7 @@ namespace mRemoteNG.App
connectionsSaver.SQLDatabaseName = Settings.Default.SQLDatabaseName;
connectionsSaver.SQLUsername = Settings.Default.SQLUser;
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
connectionsSaver.SQLPassword = cryptographyProvider.Decrypt(Settings.Default.SQLUser, EncryptionKey);
connectionsSaver.SQLPassword = cryptographyProvider.Decrypt(Settings.Default.SQLPass, EncryptionKey);
}
connectionsSaver.SaveConnections();

View File

@@ -227,13 +227,13 @@ namespace mRemoteNG.App
if (string.IsNullOrEmpty(ConsParam))
return null;
if (File.Exists(ConsParam))
return ConsParam;
// trim invalid characters for the Combine method (see: https://msdn.microsoft.com/en-us/library/fyy7a5kt.aspx#Anchor_2)
ConsParam = ConsParam.Trim().TrimStart('\\').Trim();
// fallback paths
if (File.Exists(ConsParam))
return ConsParam;
if (File.Exists(Path.Combine(GeneralAppInfo.HomePath, ConsParam)))
return GeneralAppInfo.HomePath + Path.DirectorySeparatorChar + ConsParam;
@@ -253,11 +253,11 @@ namespace mRemoteNG.App
var ConsParam = "";
if (cmd["cons"] != null)
{
ConsParam = "cons";
ConsParam = cmd["cons"];
}
if (cmd["c"] != null)
{
ConsParam = "c";
ConsParam = cmd["c"];
}
var ResetPosParam = "";
@@ -318,8 +318,12 @@ namespace mRemoteNG.App
if (!string.IsNullOrEmpty(ResetPosParam))
{
Settings.Default.MainFormKiosk = false;
Settings.Default.MainFormLocation = new Point(999, 999);
Settings.Default.MainFormSize = new Size(900, 600);
var newWidth = 900;
var newHeight = 600;
var newX = Screen.PrimaryScreen.WorkingArea.Width/2 - newWidth/2;
var newY = Screen.PrimaryScreen.WorkingArea.Height/2 - newHeight/2;
Settings.Default.MainFormLocation = new Point(newX, newY);
Settings.Default.MainFormSize = new Size(newWidth, newHeight);
Settings.Default.MainFormState = FormWindowState.Normal;
}

View File

@@ -3,19 +3,20 @@ using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
using mRemoteNG.Tools;
using mRemoteNG.App;
using mRemoteNG.Connection.Protocol.VNC;
using mRemoteNG.Connection.Protocol.SSH;
using mRemoteNG.Connection.Protocol.Http;
using mRemoteNG.Connection.Protocol.RAW;
using mRemoteNG.Connection.Protocol.ICA;
using mRemoteNG.Connection.Protocol.RDP;
using mRemoteNG.Connection.Protocol.Telnet;
using mRemoteNG.Connection.Protocol.Rlogin;
using mRemoteNG.Container;
using mRemoteNG.Connection.Protocol;
using mRemoteNG.Connection.Protocol.Http;
using mRemoteNG.Connection.Protocol.ICA;
using mRemoteNG.Connection.Protocol.RAW;
using mRemoteNG.Connection.Protocol.RDP;
using mRemoteNG.Connection.Protocol.Rlogin;
using mRemoteNG.Connection.Protocol.SSH;
using mRemoteNG.Connection.Protocol.Telnet;
using mRemoteNG.Connection.Protocol.VNC;
using mRemoteNG.Container;
using mRemoteNG.Tools;
using mRemoteNG.Tree;
using mRemoteNG.Tree.Root;
namespace mRemoteNG.Connection
@@ -125,14 +126,19 @@ namespace mRemoteNG.Connection
return filteredProperties;
}
public virtual void SetParent(ContainerInfo parent)
public virtual void SetParent(ContainerInfo newParent)
{
RemoveParent();
parent?.AddChild(this);
newParent?.AddChild(this);
if (newParent is RootNodeInfo)
Inheritance.DisableInheritance();
}
public void RemoveParent()
{
if (Parent is RootNodeInfo)
Inheritance.EnableInheritance();
Parent?.RemoveChild(this);
}
#endregion

View File

@@ -33,7 +33,7 @@ using System.Runtime.InteropServices;
// by using the '*' as shown below:
// <Assembly: AssemblyVersion("1.0.*")>
[assembly: AssemblyVersion("1.75.7011.*")]
[assembly: AssemblyVersion("1.75.7012.*")]
[assembly:NeutralResourcesLanguageAttribute("en")]

Binary file not shown.

View File

@@ -60,9 +60,13 @@ namespace mRemoteNG.UI.Controls
Opening += (sender, args) =>
{
AddExternalApps();
if (_connectionTree.SelectedNode == null)
{
args.Cancel = true;
return;
}
ShowHideMenuItems();
};
Closing += (sender, args) => EnableMenuItemsRecursive(Items);
}
private void InitializeComponent()
@@ -397,9 +401,6 @@ namespace mRemoteNG.UI.Controls
internal void ShowHideMenuItems()
{
if (_connectionTree.SelectedNode == null)
return;
try
{
Enabled = true;
@@ -443,7 +444,9 @@ namespace mRemoteNG.UI.Controls
_cMenTreeToolsSort.Enabled = false;
_cMenTreeToolsExternalApps.Enabled = false;
_cMenTreeDuplicate.Enabled = false;
_cMenTreeRename.Enabled = true;
_cMenTreeImport.Enabled = false;
_cMenTreeExportFile.Enabled = false;
_cMenTreeRename.Enabled = false;
_cMenTreeDelete.Enabled = false;
_cMenTreeMoveUp.Enabled = false;
_cMenTreeMoveDown.Enabled = false;
@@ -498,6 +501,8 @@ namespace mRemoteNG.UI.Controls
_cMenTreeDelete.Enabled = false;
_cMenTreeMoveUp.Enabled = false;
_cMenTreeMoveDown.Enabled = false;
_cMenTreeImport.Enabled = false;
_cMenTreeExportFile.Enabled = false;
}
internal void ShowHideMenuItemsForConnectionNode(ConnectionInfo connectionInfo)

View File

@@ -20,7 +20,9 @@ namespace mRemoteNG.UI.Controls
private ConnectionTreeModel _connectionTreeModel;
private readonly ConnectionTreeDragAndDropHandler _dragAndDropHandler = new ConnectionTreeDragAndDropHandler();
private readonly PuttySessionsManager _puttySessionsManager = PuttySessionsManager.Instance;
private bool _nodeInEditMode;
private bool _allowEdit;
private ConnectionContextMenu _contextMenu;
public ConnectionInfo SelectedNode => (ConnectionInfo) SelectedObject;
@@ -59,6 +61,8 @@ namespace mRemoteNG.UI.Controls
SmallImageList = imageList.GetImageList();
AddColumns(imageList.ImageGetter);
LinkModelToView();
_contextMenu = new ConnectionContextMenu(this);
ContextMenuStrip = _contextMenu;
SetupDropSink();
SetEventHandlers();
}
@@ -108,7 +112,8 @@ namespace mRemoteNG.UI.Controls
CellToolTipShowing += tvConnections_CellToolTipShowing;
ModelCanDrop += _dragAndDropHandler.HandleEvent_ModelCanDrop;
ModelDropped += _dragAndDropHandler.HandleEvent_ModelDropped;
BeforeLabelEdit += HandleCheckForValidEdit;
BeforeLabelEdit += OnBeforeLabelEdit;
AfterLabelEdit += OnAfterLabelEdit;
}
/// <summary>
@@ -116,6 +121,12 @@ namespace mRemoteNG.UI.Controls
/// </summary>
private void AutoResizeColumn(ColumnHeader column)
{
if (InvokeRequired)
{
Invoke((MethodInvoker) (() => AutoResizeColumn(column)));
return;
}
var longestIndentationAndTextWidth = int.MinValue;
var horizontalScrollOffset = LowLevelScrollPosition.X;
const int padding = 10;
@@ -257,20 +268,6 @@ namespace mRemoteNG.UI.Controls
{
_allowEdit = true;
SelectedItem.BeginEdit();
Runtime.SaveConnectionsAsync();
}
public void HandleCheckForValidEdit(object sender, LabelEditEventArgs e)
{
if (!(sender is ConnectionTree)) return;
if (_allowEdit)
{
_allowEdit = false;
}
else
{
e.CancelEdit = true;
}
}
public void DeleteSelectedNode()
@@ -331,6 +328,41 @@ namespace mRemoteNG.UI.Controls
Runtime.MessageCollector.AddExceptionStackTrace("tvConnections_MouseMove (UI.Window.ConnectionTreeWindow) failed", ex);
}
}
private void OnBeforeLabelEdit(object sender, LabelEditEventArgs e)
{
if (_nodeInEditMode || !(sender is ConnectionTree))
return;
if (!_allowEdit || SelectedNode is PuttySessionInfo || SelectedNode is RootPuttySessionsNodeInfo)
{
e.CancelEdit = true;
return;
}
_nodeInEditMode = true;
_contextMenu.DisableShortcutKeys();
}
private void OnAfterLabelEdit(object sender, LabelEditEventArgs e)
{
if (!_nodeInEditMode)
return;
try
{
_contextMenu.EnableShortcutKeys();
ConnectionTreeModel.RenameNode(SelectedNode, e.Label);
_nodeInEditMode = false;
_allowEdit = false;
Windows.ConfigForm.SelectedTreeNode = SelectedNode;
Runtime.SaveConnectionsAsync();
}
catch (Exception ex)
{
Runtime.MessageCollector.AddExceptionStackTrace("tvConnections_AfterLabelEdit (UI.Window.ConnectionTreeWindow) failed", ex);
}
}
#endregion
}
}

View File

@@ -12,6 +12,7 @@ namespace mRemoteNG.UI.Controls
FillsFreeSpace = false;
AspectGetter = item => ((ConnectionInfo) item).Name;
ImageGetter = imageGetterDelegate;
AutoCompleteEditor = false;
}
}
}

View File

@@ -204,6 +204,9 @@ namespace mRemoteNG.UI.Forms
Runtime.NewConnections(Runtime.GetStartupConnectionFileName());
}
if (Settings.Default.ResetPanels)
SetDefaultLayout();
Runtime.LoadConnections();
Windows.TreePanel.Focus();

View File

@@ -476,7 +476,9 @@ namespace mRemoteNG.UI.Window
_pGrid.SelectedObject = propertyGridObject;
_btnShowProperties.Enabled = true;
_btnShowInheritance.Enabled = gridObjectAsContainerInfo.Parent != null;
_btnShowInheritance.Enabled =
gridObjectAsContainerInfo.Parent != null &&
!(gridObjectAsContainerInfo.Parent is RootNodeInfo);
_btnShowDefaultProperties.Enabled = false;
_btnShowDefaultInheritance.Enabled = false;
_btnIcon.Enabled = true;
@@ -492,7 +494,10 @@ namespace mRemoteNG.UI.Window
_pGrid.SelectedObject = propertyGridObject;
_btnShowProperties.Enabled = true;
_btnShowInheritance.Enabled = gridObjectAsConnectionInfo.Parent != null;
_btnShowInheritance.Enabled =
!(gridObjectAsConnectionInfo is PuttySessionInfo) &&
gridObjectAsConnectionInfo.Parent != null &&
!(gridObjectAsConnectionInfo.Parent is RootNodeInfo);
_btnShowDefaultProperties.Enabled = false;
_btnShowDefaultInheritance.Enabled = false;
_btnIcon.Enabled = true;

View File

@@ -56,7 +56,6 @@ 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, 0);
this.olvConnections.MultiSelect = false;

View File

@@ -7,6 +7,7 @@ using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using mRemoteNG.Tree.Root;
using mRemoteNG.UI.Controls;
using WeifenLuo.WinFormsUI.Docking;
@@ -15,10 +16,8 @@ namespace mRemoteNG.UI.Window
{
public partial class ConnectionTreeWindow
{
private readonly ConnectionContextMenu _contextMenu;
private readonly IConnectionInitiator _connectionInitiator = new ConnectionInitiator();
public ConnectionInfo SelectedNode => olvConnections.SelectedNode;
public ConnectionTree ConnectionTree
@@ -32,8 +31,6 @@ namespace mRemoteNG.UI.Window
WindowType = WindowType.Tree;
DockPnl = panel;
InitializeComponent();
_contextMenu = new ConnectionContextMenu(olvConnections);
olvConnections.ContextMenuStrip = _contextMenu;
SetMenuEventHandlers();
SetConnectionTreeEventHandlers();
Settings.Default.PropertyChanged += (sender, args) => SetConnectionTreeEventHandlers();
@@ -84,8 +81,6 @@ namespace mRemoteNG.UI.Window
private void SetConnectionTreeEventHandlers()
{
olvConnections.NodeDeletionConfirmer = new SelectedConnectionDeletionConfirmer(olvConnections, MessageBox.Show);
olvConnections.BeforeLabelEdit += tvConnections_BeforeLabelEdit;
olvConnections.AfterLabelEdit += tvConnections_AfterLabelEdit;
olvConnections.KeyDown += tvConnections_KeyDown;
olvConnections.KeyPress += tvConnections_KeyPress;
SetTreePostSetupActions();
@@ -171,26 +166,6 @@ namespace mRemoteNG.UI.Window
Runtime.SaveConnectionsAsync();
}
private void tvConnections_BeforeLabelEdit(object sender, LabelEditEventArgs e)
{
_contextMenu.DisableShortcutKeys();
}
private void tvConnections_AfterLabelEdit(object sender, LabelEditEventArgs e)
{
try
{
_contextMenu.EnableShortcutKeys();
ConnectionTree.ConnectionTreeModel.RenameNode(SelectedNode, e.Label);
Windows.ConfigForm.SelectedTreeNode = SelectedNode;
Runtime.SaveConnectionsAsync();
}
catch (Exception ex)
{
Runtime.MessageCollector.AddExceptionStackTrace("tvConnections_AfterLabelEdit (UI.Window.ConnectionTreeWindow) failed", ex);
}
}
#endregion
#region Search