Added a new option to the Appearance and Tabs configuration page to allow the user to toggle if connection windows display tabs or not as per #1171.

This commit is contained in:
Leaskovski
2018-12-03 15:46:14 +00:00
parent 5ee7b3fcbf
commit a40f66fc94
9 changed files with 90 additions and 26 deletions

View File

@@ -12,11 +12,7 @@ namespace mRemoteNG {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.7.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.0.1.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
@@ -2750,5 +2746,17 @@ namespace mRemoteNG {
this["StartUpPanelName"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool AlwaysShowConnectionTabs {
get {
return ((bool)(this["AlwaysShowConnectionTabs"]));
}
set {
this["AlwaysShowConnectionTabs"] = value;
}
}
}
}

View File

@@ -683,5 +683,8 @@
<Setting Name="StartUpPanelName" Type="System.String" Scope="User">
<Value Profile="(Default)">General</Value>
</Setting>
<Setting Name="AlwaysShowConnectionTabs" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
</Settings>
</SettingsFile>

View File

@@ -19,7 +19,7 @@ namespace mRemoteNG {
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Language {
@@ -375,6 +375,15 @@ namespace mRemoteNG {
}
}
/// <summary>
/// Looks up a localized string similar to Always show connection tabs.
/// </summary>
internal static string strAlwaysShowConnectionTabs {
get {
return ResourceManager.GetString("strAlwaysShowConnectionTabs", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Always show panel selection dialog when opening connections.
/// </summary>

View File

@@ -2721,4 +2721,7 @@ This page will walk you through the process of upgrading your connections file o
<data name="strMenuCopyHostname" xml:space="preserve">
<value>Copy Hostname</value>
</data>
<data name="strAlwaysShowConnectionTabs" xml:space="preserve">
<value>Always show connection tabs</value>
</data>
</root>

View File

@@ -32,7 +32,8 @@ namespace mRemoteNG.UI.Forms.OptionsPages
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(TabsPanelsPage));
this.chkAlwaysShowPanelTabs = new mRemoteNG.UI.Controls.Base.NGCheckBox();
this.chkIdentifyQuickConnectTabs = new mRemoteNG.UI.Controls.Base.NGCheckBox();
this.chkAlwaysShowConnectionTabs = new mRemoteNG.UI.Controls.Base.NGCheckBox();
this.chkIdentifyQuickConnectTabs = new mRemoteNG.UI.Controls.Base.NGCheckBox();
this.chkOpenNewTabRightOfSelected = new mRemoteNG.UI.Controls.Base.NGCheckBox();
this.chkAlwaysShowPanelSelectionDlg = new mRemoteNG.UI.Controls.Base.NGCheckBox();
this.chkShowLogonInfoOnTabs = new mRemoteNG.UI.Controls.Base.NGCheckBox();
@@ -53,12 +54,23 @@ namespace mRemoteNG.UI.Forms.OptionsPages
this.chkAlwaysShowPanelTabs.TabIndex = 0;
this.chkAlwaysShowPanelTabs.Text = "Always show panel tabs";
this.chkAlwaysShowPanelTabs.UseVisualStyleBackColor = true;
//
// chkIdentifyQuickConnectTabs
//
this.chkIdentifyQuickConnectTabs._mice = mRemoteNG.UI.Controls.Base.NGCheckBox.MouseState.HOVER;
//
// chkAlwaysShowConnectionTabs
//
this.chkAlwaysShowConnectionTabs._mice = mRemoteNG.UI.Controls.Base.NGCheckBox.MouseState.HOVER;
this.chkAlwaysShowConnectionTabs.AutoSize = true;
this.chkAlwaysShowConnectionTabs.Location = new System.Drawing.Point(3, 26);
this.chkAlwaysShowConnectionTabs.Name = "chkAlwaysShowConnectionTabs";
this.chkAlwaysShowConnectionTabs.Size = new System.Drawing.Size(200, 17);
this.chkAlwaysShowConnectionTabs.TabIndex = 0;
this.chkAlwaysShowConnectionTabs.Text = "Always show connection tabs";
this.chkAlwaysShowConnectionTabs.UseVisualStyleBackColor = true;
//
// chkIdentifyQuickConnectTabs
//
this.chkIdentifyQuickConnectTabs._mice = mRemoteNG.UI.Controls.Base.NGCheckBox.MouseState.HOVER;
this.chkIdentifyQuickConnectTabs.AutoSize = true;
this.chkIdentifyQuickConnectTabs.Location = new System.Drawing.Point(3, 95);
this.chkIdentifyQuickConnectTabs.Location = new System.Drawing.Point(3, 118);
this.chkIdentifyQuickConnectTabs.Name = "chkIdentifyQuickConnectTabs";
this.chkIdentifyQuickConnectTabs.Size = new System.Drawing.Size(293, 17);
this.chkIdentifyQuickConnectTabs.TabIndex = 4;
@@ -69,7 +81,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages
//
this.chkOpenNewTabRightOfSelected._mice = mRemoteNG.UI.Controls.Base.NGCheckBox.MouseState.HOVER;
this.chkOpenNewTabRightOfSelected.AutoSize = true;
this.chkOpenNewTabRightOfSelected.Location = new System.Drawing.Point(3, 26);
this.chkOpenNewTabRightOfSelected.Location = new System.Drawing.Point(3, 49);
this.chkOpenNewTabRightOfSelected.Name = "chkOpenNewTabRightOfSelected";
this.chkOpenNewTabRightOfSelected.Size = new System.Drawing.Size(280, 17);
this.chkOpenNewTabRightOfSelected.TabIndex = 1;
@@ -80,7 +92,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages
//
this.chkAlwaysShowPanelSelectionDlg._mice = mRemoteNG.UI.Controls.Base.NGCheckBox.MouseState.HOVER;
this.chkAlwaysShowPanelSelectionDlg.AutoSize = true;
this.chkAlwaysShowPanelSelectionDlg.Location = new System.Drawing.Point(3, 141);
this.chkAlwaysShowPanelSelectionDlg.Location = new System.Drawing.Point(3, 164);
this.chkAlwaysShowPanelSelectionDlg.Name = "chkAlwaysShowPanelSelectionDlg";
this.chkAlwaysShowPanelSelectionDlg.Size = new System.Drawing.Size(317, 17);
this.chkAlwaysShowPanelSelectionDlg.TabIndex = 6;
@@ -91,7 +103,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages
//
this.chkShowLogonInfoOnTabs._mice = mRemoteNG.UI.Controls.Base.NGCheckBox.MouseState.HOVER;
this.chkShowLogonInfoOnTabs.AutoSize = true;
this.chkShowLogonInfoOnTabs.Location = new System.Drawing.Point(3, 49);
this.chkShowLogonInfoOnTabs.Location = new System.Drawing.Point(3, 72);
this.chkShowLogonInfoOnTabs.Name = "chkShowLogonInfoOnTabs";
this.chkShowLogonInfoOnTabs.Size = new System.Drawing.Size(203, 17);
this.chkShowLogonInfoOnTabs.TabIndex = 2;
@@ -102,7 +114,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages
//
this.chkDoubleClickClosesTab._mice = mRemoteNG.UI.Controls.Base.NGCheckBox.MouseState.HOVER;
this.chkDoubleClickClosesTab.AutoSize = true;
this.chkDoubleClickClosesTab.Location = new System.Drawing.Point(3, 118);
this.chkDoubleClickClosesTab.Location = new System.Drawing.Point(3, 141);
this.chkDoubleClickClosesTab.Name = "chkDoubleClickClosesTab";
this.chkDoubleClickClosesTab.Size = new System.Drawing.Size(159, 17);
this.chkDoubleClickClosesTab.TabIndex = 5;
@@ -113,7 +125,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages
//
this.chkShowProtocolOnTabs._mice = mRemoteNG.UI.Controls.Base.NGCheckBox.MouseState.HOVER;
this.chkShowProtocolOnTabs.AutoSize = true;
this.chkShowProtocolOnTabs.Location = new System.Drawing.Point(3, 72);
this.chkShowProtocolOnTabs.Location = new System.Drawing.Point(3, 95);
this.chkShowProtocolOnTabs.Name = "chkShowProtocolOnTabs";
this.chkShowProtocolOnTabs.Size = new System.Drawing.Size(166, 17);
this.chkShowProtocolOnTabs.TabIndex = 3;
@@ -124,7 +136,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages
//
this.chkCreateEmptyPanelOnStart._mice = mRemoteNG.UI.Controls.Base.NGCheckBox.MouseState.HOVER;
this.chkCreateEmptyPanelOnStart.AutoSize = true;
this.chkCreateEmptyPanelOnStart.Location = new System.Drawing.Point(3, 164);
this.chkCreateEmptyPanelOnStart.Location = new System.Drawing.Point(3, 187);
this.chkCreateEmptyPanelOnStart.Name = "chkCreateEmptyPanelOnStart";
this.chkCreateEmptyPanelOnStart.Size = new System.Drawing.Size(253, 17);
this.chkCreateEmptyPanelOnStart.TabIndex = 7;
@@ -134,7 +146,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages
//
// txtBoxPanelName
//
this.txtBoxPanelName.Location = new System.Drawing.Point(43, 200);
this.txtBoxPanelName.Location = new System.Drawing.Point(43, 223);
this.txtBoxPanelName.Name = "txtBoxPanelName";
this.txtBoxPanelName.Size = new System.Drawing.Size(213, 20);
this.txtBoxPanelName.TabIndex = 8;
@@ -142,7 +154,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages
// lblPanelName
//
this.lblPanelName.AutoSize = true;
this.lblPanelName.Location = new System.Drawing.Point(40, 184);
this.lblPanelName.Location = new System.Drawing.Point(40, 207);
this.lblPanelName.Name = "lblPanelName";
this.lblPanelName.Size = new System.Drawing.Size(66, 13);
this.lblPanelName.TabIndex = 9;
@@ -156,7 +168,8 @@ namespace mRemoteNG.UI.Forms.OptionsPages
this.Controls.Add(this.txtBoxPanelName);
this.Controls.Add(this.chkCreateEmptyPanelOnStart);
this.Controls.Add(this.chkAlwaysShowPanelTabs);
this.Controls.Add(this.chkIdentifyQuickConnectTabs);
this.Controls.Add(this.chkAlwaysShowConnectionTabs);
this.Controls.Add(this.chkIdentifyQuickConnectTabs);
this.Controls.Add(this.chkOpenNewTabRightOfSelected);
this.Controls.Add(this.chkAlwaysShowPanelSelectionDlg);
this.Controls.Add(this.chkShowLogonInfoOnTabs);
@@ -170,6 +183,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages
}
internal Controls.Base.NGCheckBox chkAlwaysShowPanelTabs;
internal Controls.Base.NGCheckBox chkAlwaysShowConnectionTabs;
internal Controls.Base.NGCheckBox chkIdentifyQuickConnectTabs;
internal Controls.Base.NGCheckBox chkOpenNewTabRightOfSelected;
internal Controls.Base.NGCheckBox chkAlwaysShowPanelSelectionDlg;

View File

@@ -19,7 +19,8 @@ namespace mRemoteNG.UI.Forms.OptionsPages
base.ApplyLanguage();
chkAlwaysShowPanelTabs.Text = Language.strAlwaysShowPanelTabs;
chkOpenNewTabRightOfSelected.Text = Language.strOpenNewTabRight;
chkAlwaysShowConnectionTabs.Text = Language.strAlwaysShowConnectionTabs;
chkOpenNewTabRightOfSelected.Text = Language.strOpenNewTabRight;
chkShowLogonInfoOnTabs.Text = Language.strShowLogonInfoOnTabs;
chkShowProtocolOnTabs.Text = Language.strShowProtocolOnTabs;
chkIdentifyQuickConnectTabs.Text = Language.strIdentifyQuickConnectTabs;
@@ -34,7 +35,8 @@ namespace mRemoteNG.UI.Forms.OptionsPages
base.SaveSettings();
chkAlwaysShowPanelTabs.Checked = Settings.Default.AlwaysShowPanelTabs;
chkOpenNewTabRightOfSelected.Checked = Settings.Default.OpenTabsRightOfSelected;
chkAlwaysShowConnectionTabs.Checked = Settings.Default.AlwaysShowConnectionTabs;
chkOpenNewTabRightOfSelected.Checked = Settings.Default.OpenTabsRightOfSelected;
chkShowLogonInfoOnTabs.Checked = Settings.Default.ShowLogonInfoOnTabs;
chkShowProtocolOnTabs.Checked = Settings.Default.ShowProtocolOnTabs;
chkIdentifyQuickConnectTabs.Checked = Settings.Default.IdentifyQuickConnectTabs;
@@ -50,7 +52,8 @@ namespace mRemoteNG.UI.Forms.OptionsPages
base.SaveSettings();
Settings.Default.AlwaysShowPanelTabs = chkAlwaysShowPanelTabs.Checked;
FrmMain.Default.ShowHidePanelTabs();
Settings.Default.AlwaysShowConnectionTabs = chkAlwaysShowConnectionTabs.Checked;
FrmMain.Default.ShowHidePanelTabs();
Settings.Default.OpenTabsRightOfSelected = chkOpenNewTabRightOfSelected.Checked;
Settings.Default.ShowLogonInfoOnTabs = chkShowLogonInfoOnTabs.Checked;

View File

@@ -27,6 +27,7 @@ using mRemoteNG.UI.Panels;
using mRemoteNG.UI.TaskDialog;
using mRemoteNG.UI.Window;
using WeifenLuo.WinFormsUI.Docking;
using TabControl = Crownwood.Magic.Controls.TabControl;
// ReSharper disable MemberCanBePrivate.Global
@@ -587,7 +588,24 @@ namespace mRemoteNG.UI.Forms
newDocumentStyle = nonConnectionPanelCount == 0 ? DocumentStyle.DockingSdi : DocumentStyle.DockingWindow;
}
if (pnlDock.DocumentStyle == newDocumentStyle) return;
foreach (var dockContent in pnlDock.Documents)
{
var document = (DockContent)dockContent;
if (document is ConnectionWindow)
{
var connectionWindow = (ConnectionWindow)document;
if (Settings.Default.AlwaysShowConnectionTabs == false)
{
connectionWindow.TabController.HideTabsMode = TabControl.HideTabsModes.HideAlways;
}
else
{
connectionWindow.TabController.HideTabsMode = TabControl.HideTabsModes.ShowAlways;
}
}
}
if (pnlDock.DocumentStyle == newDocumentStyle) return;
pnlDock.DocumentStyle = newDocumentStyle;
pnlDock.Size = new Size(1, 1);
}

View File

@@ -140,7 +140,10 @@ namespace mRemoteNG.UI.Window
else
TabController.TabPages.Add(nTab);
nTab.Selected = true;
if (Settings.Default.AlwaysShowConnectionTabs == false)
TabController.HideTabsMode = TabControl.HideTabsModes.HideAlways;
nTab.Selected = true;
_ignoreChangeSelectedTabClick = false;
return nTab;

View File

@@ -708,6 +708,9 @@
<setting name="StartUpPanelName" serializeAs="String">
<value>General</value>
</setting>
<setting name="AlwaysShowConnectionTabs" serializeAs="String">
<value>True</value>
</setting>
</mRemoteNG.Settings>
</userSettings>
<applicationSettings>