mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-17 22:11:48 +08:00
Merge branch 'Advanced_closing_tabs' of https://github.com/areytsman/mRemoteNG into areytsman-Advanced_closing_tabs
# Conflicts: # mRemoteV1/Resources/Language/Language.resx # mRemoteV1/Resources/Language/Language.ru.resx
This commit is contained in:
36
mRemoteV1/Resources/Language/Language.Designer.cs
generated
36
mRemoteV1/Resources/Language/Language.Designer.cs
generated
@@ -1301,6 +1301,15 @@ namespace mRemoteNG {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Do you want to close other connection except the "{0}"?.
|
||||
/// </summary>
|
||||
internal static string strConfirmCloseConnectionOthersInstruction {
|
||||
get {
|
||||
return ResourceManager.GetString("strConfirmCloseConnectionOthersInstruction", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Are you sure you want to close the panel, "{0}"? Any connections that it contains will also be closed..
|
||||
/// </summary>
|
||||
@@ -1310,6 +1319,15 @@ namespace mRemoteNG {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Do you want to close connections right to the "{0}"?.
|
||||
/// </summary>
|
||||
internal static string strConfirmCloseConnectionRightInstruction {
|
||||
get {
|
||||
return ResourceManager.GetString("strConfirmCloseConnectionRightInstruction", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Are you sure you want to delete the credential record, {0}?.
|
||||
/// </summary>
|
||||
@@ -3353,6 +3371,24 @@ namespace mRemoteNG {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Disconnect Other Tabs.
|
||||
/// </summary>
|
||||
internal static string strMenuDisconnectOthers {
|
||||
get {
|
||||
return ResourceManager.GetString("strMenuDisconnectOthers", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Disconnect Tabs To The Right.
|
||||
/// </summary>
|
||||
internal static string strMenuDisconnectOthersRight {
|
||||
get {
|
||||
return ResourceManager.GetString("strMenuDisconnectOthersRight", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Donate.
|
||||
/// </summary>
|
||||
|
||||
@@ -2694,4 +2694,16 @@ This page will walk you through the process of upgrading your connections file o
|
||||
<data name="strUltraVNCSingleClick" xml:space="preserve">
|
||||
<value>UltraVNC SingleClick</value>
|
||||
</data>
|
||||
<data name="strMenuDisconnectOthersRight" xml:space="preserve">
|
||||
<value>Disconnect Tabs To The Right</value>
|
||||
</data>
|
||||
<data name="strMenuDisconnectOthers" xml:space="preserve">
|
||||
<value>Disconnect Other Tabs</value>
|
||||
</data>
|
||||
<data name="strConfirmCloseConnectionOthersInstruction" xml:space="preserve">
|
||||
<value>Do you want to close other connection except the "{0}"?</value>
|
||||
</data>
|
||||
<data name="strConfirmCloseConnectionRightInstruction" xml:space="preserve">
|
||||
<value>Do you want to close connections right to the "{0}"?</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -2679,4 +2679,16 @@ mRemoteNG сейчас прекратит работу и начнет проц
|
||||
<data name="strCreateEmptyPanelOnStartUp" xml:space="preserve">
|
||||
<value>Создайте пустую панель при запуске mRemoteNG</value>
|
||||
</data>
|
||||
<data name="strMenuDisconnectOther" xml:space="preserve">
|
||||
<value>Отключить остальные вкладки</value>
|
||||
</data>
|
||||
<data name="strMenuDisconnectOthersRight" xml:space="preserve">
|
||||
<value>Отключить вкладки справа</value>
|
||||
</data>
|
||||
<data name="strConfirmCloseConnectionOthersInstruction" xml:space="preserve">
|
||||
<value>Хотите закрыть все подключения, кроме "{0}"?</value>
|
||||
</data>
|
||||
<data name="strConfirmCloseConnectionRightInstruction" xml:space="preserve">
|
||||
<value>Хотите закрыть все подключения справа от "{0}"?</value>
|
||||
</data>
|
||||
</root>
|
||||
22
mRemoteV1/UI/Window/ConnectionWindow.Designer.cs
generated
22
mRemoteV1/UI/Window/ConnectionWindow.Designer.cs
generated
@@ -18,6 +18,8 @@ namespace mRemoteNG.UI.Window
|
||||
private ToolStripMenuItem cmenTabRenameTab;
|
||||
private ToolStripMenuItem cmenTabDuplicateTab;
|
||||
private ToolStripMenuItem cmenTabDisconnect;
|
||||
private ToolStripMenuItem cmenTabDisconnectOthers;
|
||||
private ToolStripMenuItem cmenTabDisconnectOthersRight;
|
||||
private ToolStripMenuItem cmenTabSmartSize;
|
||||
private ToolStripMenuItem cmenTabSendSpecialKeysCtrlAltDel;
|
||||
private ToolStripMenuItem cmenTabSendSpecialKeysCtrlEsc;
|
||||
@@ -53,6 +55,8 @@ namespace mRemoteNG.UI.Window
|
||||
cmenTabDuplicateTab = new ToolStripMenuItem();
|
||||
cmenTabReconnect = new ToolStripMenuItem();
|
||||
cmenTabDisconnect = new ToolStripMenuItem();
|
||||
cmenTabDisconnectOthers = new ToolStripMenuItem();
|
||||
cmenTabDisconnectOthersRight = new ToolStripMenuItem();
|
||||
cmenTabPuttySettings = new ToolStripMenuItem();
|
||||
cmenTab.SuspendLayout();
|
||||
SuspendLayout();
|
||||
@@ -91,7 +95,9 @@ namespace mRemoteNG.UI.Window
|
||||
cmenTabRenameTab,
|
||||
cmenTabDuplicateTab,
|
||||
cmenTabReconnect,
|
||||
cmenTabDisconnect
|
||||
cmenTabDisconnect,
|
||||
cmenTabDisconnectOthers,
|
||||
cmenTabDisconnectOthersRight
|
||||
});
|
||||
cmenTab.Name = "cmenTab";
|
||||
cmenTab.RenderMode = ToolStripRenderMode.Professional;
|
||||
@@ -214,6 +220,20 @@ namespace mRemoteNG.UI.Window
|
||||
cmenTabDisconnect.Size = new Size(201, 22);
|
||||
cmenTabDisconnect.Text = @"Disconnect";
|
||||
//
|
||||
//cmenTabDisconnectOthers
|
||||
//
|
||||
cmenTabDisconnectOthers.Image = Resources.Pause;
|
||||
cmenTabDisconnectOthers.Name = "cmenTabDisconnectOthers";
|
||||
cmenTabDisconnectOthers.Size = new Size(201, 22);
|
||||
cmenTabDisconnectOthers.Text = @"Disconnect Other Tabs";
|
||||
//
|
||||
//cmenTabDisconnectOthersRight
|
||||
//
|
||||
cmenTabDisconnectOthersRight.Image = Resources.Pause;
|
||||
cmenTabDisconnectOthersRight.Name = "cmenTabDisconnectOthersRight";
|
||||
cmenTabDisconnectOthersRight.Size = new Size(201, 22);
|
||||
cmenTabDisconnectOthersRight.Text = @"Disconnect Tabs To The Right";
|
||||
//
|
||||
//cmenTabPuttySettings
|
||||
//
|
||||
cmenTabPuttySettings.Name = "cmenTabPuttySettings";
|
||||
|
||||
@@ -92,6 +92,8 @@ namespace mRemoteNG.UI.Window
|
||||
cmenTabDuplicateTab.Click += (sender, args) => DuplicateTab();
|
||||
cmenTabReconnect.Click += (sender, args) => Reconnect();
|
||||
cmenTabDisconnect.Click += (sender, args) => CloseTabMenu();
|
||||
cmenTabDisconnectOthers.Click += (sender, args) => CloseOtherTabs();
|
||||
cmenTabDisconnectOthersRight.Click += (sender, args) => CloseOtherTabsToTheRight();
|
||||
cmenTabPuttySettings.Click += (sender, args) => ShowPuttySettingsDialog();
|
||||
}
|
||||
|
||||
@@ -234,6 +236,8 @@ namespace mRemoteNG.UI.Window
|
||||
cmenTabDuplicateTab.Text = Language.strMenuDuplicateTab;
|
||||
cmenTabReconnect.Text = Language.strMenuReconnect;
|
||||
cmenTabDisconnect.Text = Language.strMenuDisconnect;
|
||||
cmenTabDisconnectOthers.Text = Language.strMenuDisconnectOthers;
|
||||
cmenTabDisconnectOthersRight.Text = Language.strMenuDisconnectOthersRight;
|
||||
cmenTabPuttySettings.Text = Language.strPuttySettings;
|
||||
}
|
||||
|
||||
@@ -661,6 +665,92 @@ namespace mRemoteNG.UI.Window
|
||||
}
|
||||
}
|
||||
|
||||
private void CloseOtherTabs()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (Settings.Default.ConfirmCloseConnection == (int)ConfirmCloseEnum.Multiple)
|
||||
{
|
||||
var result = CTaskDialog.MessageBox(this, GeneralAppInfo.ProductName, string.Format(Language.strConfirmCloseConnectionOthersInstruction, TabController.SelectedTab.Title), "", "", "", Language.strCheckboxDoNotShowThisMessageAgain, ETaskDialogButtons.YesNo, ESysIcons.Question, ESysIcons.Question);
|
||||
if (CTaskDialog.VerificationChecked)
|
||||
{
|
||||
Settings.Default.ConfirmCloseConnection--;
|
||||
}
|
||||
if (result == DialogResult.No)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
foreach (TabPage tab in TabController.TabPages)
|
||||
{
|
||||
if (TabController.TabPages.IndexOf(tab) != TabController.TabPages.IndexOf(TabController.SelectedTab))
|
||||
{
|
||||
if (Settings.Default.ConfirmCloseConnection == (int)ConfirmCloseEnum.All)
|
||||
{
|
||||
var result = CTaskDialog.MessageBox(this, GeneralAppInfo.ProductName, string.Format(Language.strConfirmCloseConnectionMainInstruction, tab.Title), "", "", "", Language.strCheckboxDoNotShowThisMessageAgain, ETaskDialogButtons.YesNo, ESysIcons.Question, ESysIcons.Question);
|
||||
if (CTaskDialog.VerificationChecked)
|
||||
{
|
||||
Settings.Default.ConfirmCloseConnection--;
|
||||
}
|
||||
if (result == DialogResult.No)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
var interfaceControl = tab.Tag as InterfaceControl;
|
||||
interfaceControl?.Protocol.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddExceptionMessage("CloseTabMenu (UI.Window.ConnectionWindow) failed", ex);
|
||||
}
|
||||
}
|
||||
|
||||
private void CloseOtherTabsToTheRight()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (Settings.Default.ConfirmCloseConnection == (int)ConfirmCloseEnum.Multiple)
|
||||
{
|
||||
var result = CTaskDialog.MessageBox(this, GeneralAppInfo.ProductName, string.Format(Language.strConfirmCloseConnectionRightInstruction, TabController.SelectedTab.Title), "", "", "", Language.strCheckboxDoNotShowThisMessageAgain, ETaskDialogButtons.YesNo, ESysIcons.Question, ESysIcons.Question);
|
||||
if (CTaskDialog.VerificationChecked)
|
||||
{
|
||||
Settings.Default.ConfirmCloseConnection--;
|
||||
}
|
||||
if (result == DialogResult.No)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
foreach (TabPage tab in TabController.TabPages)
|
||||
{
|
||||
if (TabController.TabPages.IndexOf(tab) > TabController.TabPages.IndexOf(TabController.SelectedTab))
|
||||
{
|
||||
if (Settings.Default.ConfirmCloseConnection == (int)ConfirmCloseEnum.All)
|
||||
{
|
||||
var result = CTaskDialog.MessageBox(this, GeneralAppInfo.ProductName, string.Format(Language.strConfirmCloseConnectionMainInstruction, tab.Title), "", "", "", Language.strCheckboxDoNotShowThisMessageAgain, ETaskDialogButtons.YesNo, ESysIcons.Question, ESysIcons.Question);
|
||||
if (CTaskDialog.VerificationChecked)
|
||||
{
|
||||
Settings.Default.ConfirmCloseConnection--;
|
||||
}
|
||||
if (result == DialogResult.No)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
var interfaceControl = tab.Tag as InterfaceControl;
|
||||
interfaceControl?.Protocol.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddExceptionMessage("CloseTabMenu (UI.Window.ConnectionWindow) failed", ex);
|
||||
}
|
||||
}
|
||||
|
||||
private void DuplicateTab()
|
||||
{
|
||||
try
|
||||
|
||||
Reference in New Issue
Block a user