mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-17 14:07:46 +08:00
fixed an incomplete merge
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
using System.IO;
|
||||
using mRemoteNG.Config.Connections;
|
||||
using mRemoteNG.Connection;
|
||||
using mRemoteNG.Connection;
|
||||
using mRemoteNG.Tools;
|
||||
using System.IO;
|
||||
|
||||
namespace mRemoteNG.App.Initialization
|
||||
{
|
||||
@@ -16,8 +15,6 @@ namespace mRemoteNG.App.Initialization
|
||||
|
||||
public void LoadCredsAndCons()
|
||||
{
|
||||
new SaveConnectionsOnEdit(_connectionsService);
|
||||
|
||||
if (Settings.Default.FirstStart && !Settings.Default.LoadConsFromCustomLocation && !File.Exists(_connectionsService.GetStartupConnectionFileName()))
|
||||
_connectionsService.NewConnectionsFile(_connectionsService.GetStartupConnectionFileName());
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
using System;
|
||||
using mRemoteNG.Connection;
|
||||
using System;
|
||||
using System.Collections.Specialized;
|
||||
using System.ComponentModel;
|
||||
using mRemoteNG.Connection;
|
||||
using mRemoteNG.UI.Forms;
|
||||
|
||||
namespace mRemoteNG.Config.Connections
|
||||
{
|
||||
@@ -10,6 +9,8 @@ namespace mRemoteNG.Config.Connections
|
||||
{
|
||||
private readonly IConnectionsService _connectionsService;
|
||||
|
||||
public bool Enabled { get; set; } = true;
|
||||
|
||||
public SaveConnectionsOnEdit(IConnectionsService connectionsService)
|
||||
{
|
||||
if (connectionsService == null)
|
||||
@@ -45,7 +46,8 @@ namespace mRemoteNG.Config.Connections
|
||||
{
|
||||
if (!mRemoteNG.Settings.Default.SaveConnectionsAfterEveryEdit)
|
||||
return;
|
||||
if (FrmMain.Default.IsClosing)
|
||||
|
||||
if (!Enabled)
|
||||
return;
|
||||
|
||||
_connectionsService.SaveConnectionsAsync();
|
||||
|
||||
@@ -72,6 +72,7 @@ namespace mRemoteNG.UI.Forms
|
||||
private readonly Screens _screens;
|
||||
private readonly FileBackupPruner _backupPruner;
|
||||
private readonly MessageCollector _messageCollector = Runtime.MessageCollector;
|
||||
private SaveConnectionsOnEdit _saveConnectionsOnEdit;
|
||||
|
||||
internal FullscreenHandler Fullscreen { get; set; }
|
||||
|
||||
@@ -242,6 +243,8 @@ namespace mRemoteNG.UI.Forms
|
||||
|
||||
_connectionsService.ConnectionsLoaded += ConnectionsServiceOnConnectionsLoaded;
|
||||
_connectionsService.ConnectionsSaved += ConnectionsServiceOnConnectionsSaved;
|
||||
|
||||
_saveConnectionsOnEdit = new SaveConnectionsOnEdit(_connectionsService);
|
||||
var credsAndConsSetup = new CredsAndConsSetup(_connectionsService);
|
||||
credsAndConsSetup.LoadCredsAndCons();
|
||||
|
||||
@@ -448,6 +451,7 @@ namespace mRemoteNG.UI.Forms
|
||||
_shutdown.Cleanup(_quickConnectToolStrip, _externalToolsToolStrip, _multiSshToolStrip, this);
|
||||
|
||||
IsClosing = true;
|
||||
_saveConnectionsOnEdit.Enabled = false;
|
||||
|
||||
if (_windowList != null)
|
||||
{
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
using System;
|
||||
using mRemoteNG.App;
|
||||
using mRemoteNG.Messages;
|
||||
using mRemoteNG.Tools;
|
||||
using mRemoteNG.UI.Forms.Input;
|
||||
using mRemoteNG.UI.Window;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
using mRemoteNG.App;
|
||||
using mRemoteNG.Messages;
|
||||
using mRemoteNG.Tools;
|
||||
using mRemoteNG.UI.Forms;
|
||||
using mRemoteNG.UI.Forms.Input;
|
||||
using mRemoteNG.UI.Window;
|
||||
using WeifenLuo.WinFormsUI.Docking;
|
||||
|
||||
namespace mRemoteNG.UI.Panels
|
||||
@@ -47,8 +46,9 @@ namespace mRemoteNG.UI.Panels
|
||||
|
||||
public bool DoesPanelExist(string panelName)
|
||||
{
|
||||
return Runtime.WindowList?.OfType<ConnectionWindow>().Any(w => w.TabText == panelName)
|
||||
?? false;
|
||||
return _windowList
|
||||
.OfType<ConnectionWindow>()
|
||||
.Any(w => w.TabText == panelName);
|
||||
}
|
||||
|
||||
private void ShowConnectionWindow(ConnectionWindow connectionForm)
|
||||
|
||||
Reference in New Issue
Block a user