use panel setting from connection info unless empty or overriden

fixes #1425
This commit is contained in:
David Sparer
2019-04-30 10:28:03 -05:00
parent 100b101e60
commit 3fad296e3f

View File

@@ -162,34 +162,15 @@ namespace mRemoteNG.Connection
private static string SetConnectionPanel(ConnectionInfo connectionInfo, ConnectionInfo.Force force)
{
string connectionPanel;
if (connectionInfo.Panel == "" || force.HasFlag(ConnectionInfo.Force.OverridePanel) ||
Settings.Default.AlwaysShowPanelSelectionDlg)
{
var frmPnl = new FrmChoosePanel();
if (frmPnl.ShowDialog() == DialogResult.OK)
{
connectionPanel = frmPnl.Panel;
}
else
{
return null;
}
}
else
{
//Return the current panel if exist, if not return default panel
if (TabHelper.Instance.CurrentPanel != null)
{
connectionPanel = TabHelper.Instance.CurrentPanel.TabText;
}
else
{
connectionPanel = connectionInfo.Panel;
}
}
if (connectionInfo.Panel != "" &&
!force.HasFlag(ConnectionInfo.Force.OverridePanel) &&
!Settings.Default.AlwaysShowPanelSelectionDlg)
return connectionInfo.Panel;
return connectionPanel;
var frmPnl = new FrmChoosePanel();
return frmPnl.ShowDialog() == DialogResult.OK
? frmPnl.Panel
: null;
}
private Form SetConnectionForm(Form conForm, string connectionPanel)