create empty panel on startup not working

Reference #1261
This commit is contained in:
Sean Kaim
2019-01-09 22:46:59 -05:00
parent 9da26358ba
commit 40682bc842
2 changed files with 12 additions and 16 deletions

View File

@@ -26,6 +26,7 @@ using System.IO;
using System.Runtime.InteropServices;
using System.Text;
using System.Windows.Forms;
using mRemoteNG.UI.Panels;
using WeifenLuo.WinFormsUI.Docking;
// ReSharper disable MemberCanBePrivate.Global
@@ -180,23 +181,18 @@ namespace mRemoteNG.UI.Forms
Opacity = 1;
//Fix MagicRemove , revision on panel strategy for mdi
//Fix MagicRemove, this is a setting
pnlDock.ShowDocumentIcon = true;
//Fix missing general panel at the first run
/* if (Settings.Default.CreateEmptyPanelOnStartUp)
{
var panelName = !string.IsNullOrEmpty(Settings.Default.StartUpPanelName)
? Settings.Default.StartUpPanelName
: Language.strNewPanel;
FrmSplashScreen.getInstance().Close();
var panelAdder = new PanelAdder();
if (!panelAdder.DoesPanelExist(panelName))
panelAdder.AddPanel(panelName);
}*/
if (!Settings.Default.CreateEmptyPanelOnStartUp) return;
var panelName = !string.IsNullOrEmpty(Settings.Default.StartUpPanelName)
? Settings.Default.StartUpPanelName
: Language.strNewPanel;
var frmSplashScreen = FrmSplashScreen.getInstance();
frmSplashScreen.Close();
var panelAdder = new PanelAdder();
if (!panelAdder.DoesPanelExist(panelName))
panelAdder.AddPanel(panelName);
}
private void ApplyLanguage()

View File

@@ -13,7 +13,7 @@ namespace mRemoteNG.UI.Panels
{
public class PanelAdder
{
public Form AddPanel(string title = "")
public ConnectionWindow AddPanel(string title = "")
{
try
{
@@ -44,12 +44,12 @@ namespace mRemoteNG.UI.Panels
private static void PrepareTabSupport(ConnectionWindow connectionForm)
{
Runtime.WindowList.Add(connectionForm);
Runtime.WindowList.Add(connectionForm);
}
private static void SetConnectionWindowTitle(string title, ConnectionWindow connectionForm)
{
if (title == "")
if (string.IsNullOrEmpty(title))
title = Language.strNewPanel;
connectionForm.SetFormText(title.Replace("&", "&&"));
}