From 3c69644f21737fa0e6d2a2021028219ed36d2108 Mon Sep 17 00:00:00 2001 From: David Sparer Date: Tue, 23 Aug 2016 09:35:08 -0600 Subject: [PATCH] Re-enable expanding previously expanded folders. Implementation is still not ideal, but it's better --- .../Connections/XmlConnectionsDeserializer.cs | 10 ---------- mRemoteV1/UI/Forms/frmMain.cs | 1 + mRemoteV1/UI/Window/ConnectionTreeWindow.cs | 13 +++++++++++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/mRemoteV1/Config/Connections/XmlConnectionsDeserializer.cs b/mRemoteV1/Config/Connections/XmlConnectionsDeserializer.cs index 2a0076e8b..e9a910b8a 100644 --- a/mRemoteV1/Config/Connections/XmlConnectionsDeserializer.cs +++ b/mRemoteV1/Config/Connections/XmlConnectionsDeserializer.cs @@ -31,7 +31,6 @@ namespace mRemoteNG.Config.Connections //TODO find way to inject data source info private string ConnectionFileName = ""; - //public TreeNode RootTreeNode { get; set; } public ConnectionList ConnectionList { get; set; } public ContainerList ContainerList { get; set; } @@ -461,15 +460,6 @@ namespace mRemoteNG.Config.Connections return connectionInfo; } - private void ExpandPreviouslyOpenedFolders() - { - foreach (ContainerInfo contI in ContainerList) - { - if (contI.IsExpanded) - contI.TreeNode.Expand(); - } - } - private bool IsExportFile() { var isExportFile = false; diff --git a/mRemoteV1/UI/Forms/frmMain.cs b/mRemoteV1/UI/Forms/frmMain.cs index af0dab542..aed7faf13 100644 --- a/mRemoteV1/UI/Forms/frmMain.cs +++ b/mRemoteV1/UI/Forms/frmMain.cs @@ -153,6 +153,7 @@ namespace mRemoteNG.UI.Forms Windows.treePanel.Focus(); ConnectionTree.TreeView = Windows.treeForm.tvConnections; + Windows.treeForm.ExpandPreviouslyOpenedFolders(); Config.Putty.Sessions.StartWatcher(); if (Settings.Default.StartupComponentsCheck) diff --git a/mRemoteV1/UI/Window/ConnectionTreeWindow.cs b/mRemoteV1/UI/Window/ConnectionTreeWindow.cs index 91590f95a..8f0f20208 100644 --- a/mRemoteV1/UI/Window/ConnectionTreeWindow.cs +++ b/mRemoteV1/UI/Window/ConnectionTreeWindow.cs @@ -104,10 +104,19 @@ namespace mRemoteNG.UI.Window { tvConnections_AfterSelect(tvConnections, new TreeViewEventArgs(tvConnections.SelectedNode, TreeViewAction.ByMouse)); } + + public void ExpandPreviouslyOpenedFolders() + { + foreach (ContainerInfo contI in Runtime.ContainerList) + { + if (contI.IsExpanded) + contI.TreeNode.Expand(); + } + } #endregion - + #region Public Properties - public ToolTip DescriptionTooltip {get; set;} + public ToolTip DescriptionTooltip {get; set;} #endregion #region Private Methods