mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-17 22:11:48 +08:00
Re-enabled opening connections from last session
This commit is contained in:
@@ -85,7 +85,6 @@ namespace mRemoteNG.Config.Connections
|
||||
if (!import)
|
||||
Runtime.IsConnectionsFileLoaded = false;
|
||||
|
||||
// SECTION 2. Initialize the treeview control.
|
||||
var rootInfo = InitializeRootNode();
|
||||
var connectionTreeModel = new ConnectionTreeModel();
|
||||
connectionTreeModel.AddRootNode(rootInfo);
|
||||
@@ -107,22 +106,10 @@ namespace mRemoteNG.Config.Connections
|
||||
return null;
|
||||
}
|
||||
|
||||
//if (!IsExportFile())
|
||||
//{
|
||||
// RootTreeNode.ImageIndex = (int)TreeImageType.Root;
|
||||
// RootTreeNode.SelectedImageIndex = (int)TreeImageType.Root;
|
||||
//}
|
||||
|
||||
// SECTION 3. Populate the TreeView with the DOM nodes.
|
||||
//PopulateTreeview();
|
||||
AddNodesFromXmlRecursive(_xmlDocument.DocumentElement, rootInfo);
|
||||
//RootTreeNode.EnsureVisible();
|
||||
//Windows.treeForm.InitialRefresh();
|
||||
//SetSelectedNode(RootTreeNode);
|
||||
|
||||
//open connections from last mremote session
|
||||
//OpenConnectionsFromLastSession();
|
||||
|
||||
if (!import)
|
||||
Runtime.IsConnectionsFileLoaded = true;
|
||||
|
||||
@@ -490,15 +477,5 @@ namespace mRemoteNG.Config.Connections
|
||||
}
|
||||
Windows.treeForm.tvConnections.SelectedNode = treeNode;
|
||||
}
|
||||
|
||||
private void OpenConnectionsFromLastSession()
|
||||
{
|
||||
if (!mRemoteNG.Settings.Default.OpenConsFromLastSession || mRemoteNG.Settings.Default.NoReconnect) return;
|
||||
foreach (ConnectionInfo conI in ConnectionList)
|
||||
{
|
||||
if (conI.PleaseConnect)
|
||||
Runtime.OpenConnection(conI);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -153,7 +153,6 @@ namespace mRemoteNG.UI.Forms
|
||||
|
||||
Windows.treePanel.Focus();
|
||||
ConnectionTree.TreeView = Windows.treeForm.tvConnections;
|
||||
Windows.treeForm.ExpandPreviouslyOpenedFolders();
|
||||
|
||||
Config.Putty.Sessions.StartWatcher();
|
||||
if (Settings.Default.StartupComponentsCheck)
|
||||
@@ -167,7 +166,11 @@ namespace mRemoteNG.UI.Forms
|
||||
AddSysMenuItems();
|
||||
Microsoft.Win32.SystemEvents.DisplaySettingsChanged += DisplayChanged;
|
||||
Opacity = 1;
|
||||
}
|
||||
|
||||
Windows.treeForm.ExpandPreviouslyOpenedFolders();
|
||||
Windows.treeForm.EnsureRootNodeVisible();
|
||||
Windows.treeForm.OpenConnectionsFromLastSession();
|
||||
}
|
||||
|
||||
private void ApplySpecialSettingsForPortableVersion()
|
||||
{
|
||||
|
||||
@@ -94,10 +94,12 @@ namespace mRemoteNG.UI.Window
|
||||
DockPnl = panel;
|
||||
InitializeComponent();
|
||||
FillImageList();
|
||||
|
||||
DescriptionTooltip = new ToolTip();
|
||||
DescriptionTooltip.InitialDelay = 300;
|
||||
DescriptionTooltip.ReshowDelay = 0;
|
||||
|
||||
DescriptionTooltip = new ToolTip
|
||||
{
|
||||
InitialDelay = 300,
|
||||
ReshowDelay = 0
|
||||
};
|
||||
}
|
||||
|
||||
public void InitialRefresh()
|
||||
@@ -113,6 +115,22 @@ namespace mRemoteNG.UI.Window
|
||||
contI.TreeNode.Expand();
|
||||
}
|
||||
}
|
||||
|
||||
public void OpenConnectionsFromLastSession()
|
||||
{
|
||||
if (!Settings.Default.OpenConsFromLastSession || Settings.Default.NoReconnect) return;
|
||||
foreach (ConnectionInfo conI in Runtime.ConnectionList)
|
||||
{
|
||||
if (conI.PleaseConnect)
|
||||
Runtime.OpenConnection(conI);
|
||||
}
|
||||
}
|
||||
|
||||
public void EnsureRootNodeVisible()
|
||||
{
|
||||
var rootNode = tvConnections.Nodes[0];
|
||||
rootNode.EnsureVisible();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Public Properties
|
||||
|
||||
Reference in New Issue
Block a user