diff --git a/mRemoteV1/Resources/Language/Language.Designer.cs b/mRemoteV1/Resources/Language/Language.Designer.cs index d2c32ce5..5c353815 100644 --- a/mRemoteV1/Resources/Language/Language.Designer.cs +++ b/mRemoteV1/Resources/Language/Language.Designer.cs @@ -1301,6 +1301,15 @@ namespace mRemoteNG { } } + /// + /// Looks up a localized string similar to Do you want to close other connection except the "{0}"?. + /// + internal static string strConfirmCloseConnectionOthersInstruction { + get { + return ResourceManager.GetString("strConfirmCloseConnectionOthersInstruction", resourceCulture); + } + } + /// /// 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.. /// @@ -1310,6 +1319,15 @@ namespace mRemoteNG { } } + /// + /// Looks up a localized string similar to Do you want to close connections right to the "{0}"?. + /// + internal static string strConfirmCloseConnectionRightInstruction { + get { + return ResourceManager.GetString("strConfirmCloseConnectionRightInstruction", resourceCulture); + } + } + /// /// Looks up a localized string similar to Are you sure you want to delete the credential record, {0}?. /// @@ -3353,6 +3371,24 @@ namespace mRemoteNG { } } + /// + /// Looks up a localized string similar to Disconnect Other Tabs. + /// + internal static string strMenuDisconnectOthers { + get { + return ResourceManager.GetString("strMenuDisconnectOthers", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Disconnect Tabs To The Right. + /// + internal static string strMenuDisconnectOthersRight { + get { + return ResourceManager.GetString("strMenuDisconnectOthersRight", resourceCulture); + } + } + /// /// Looks up a localized string similar to Donate. /// diff --git a/mRemoteV1/Resources/Language/Language.resx b/mRemoteV1/Resources/Language/Language.resx index 1c99d700..df3ba0fa 100644 --- a/mRemoteV1/Resources/Language/Language.resx +++ b/mRemoteV1/Resources/Language/Language.resx @@ -2694,4 +2694,16 @@ This page will walk you through the process of upgrading your connections file o UltraVNC SingleClick + + Disconnect Tabs To The Right + + + Disconnect Other Tabs + + + Do you want to close other connection except the "{0}"? + + + Do you want to close connections right to the "{0}"? + \ No newline at end of file diff --git a/mRemoteV1/Resources/Language/Language.ru.resx b/mRemoteV1/Resources/Language/Language.ru.resx index c4e3425e..39758344 100644 --- a/mRemoteV1/Resources/Language/Language.ru.resx +++ b/mRemoteV1/Resources/Language/Language.ru.resx @@ -2679,4 +2679,16 @@ mRemoteNG сейчас прекратит работу и начнет проц Создайте пустую панель при запуске mRemoteNG + + Отключить остальные вкладки + + + Отключить вкладки справа + + + Хотите закрыть все подключения, кроме "{0}"? + + + Хотите закрыть все подключения справа от "{0}"? + \ No newline at end of file diff --git a/mRemoteV1/UI/Window/ConnectionWindow.Designer.cs b/mRemoteV1/UI/Window/ConnectionWindow.Designer.cs index 08a0ef4a..8e097cbc 100644 --- a/mRemoteV1/UI/Window/ConnectionWindow.Designer.cs +++ b/mRemoteV1/UI/Window/ConnectionWindow.Designer.cs @@ -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"; diff --git a/mRemoteV1/UI/Window/ConnectionWindow.cs b/mRemoteV1/UI/Window/ConnectionWindow.cs index 1b0a9412..135ebc7d 100644 --- a/mRemoteV1/UI/Window/ConnectionWindow.cs +++ b/mRemoteV1/UI/Window/ConnectionWindow.cs @@ -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