mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-26 12:08:37 +08:00
Update tab text for HTTP(S) connections
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using Gecko;
|
||||
using mRemoteNG.Tools;
|
||||
using mRemoteNG.App;
|
||||
using mRemoteNG.UI.Tabs;
|
||||
|
||||
|
||||
namespace mRemoteNG.Connection.Protocol.Http
|
||||
@@ -48,8 +49,7 @@ namespace mRemoteNG.Connection.Protocol.Http
|
||||
|
||||
try
|
||||
{
|
||||
var objTabPage = InterfaceControl.Parent as TabPage;
|
||||
// if (objTabPage != null) tabTitle = objTabPage.Title;
|
||||
if (InterfaceControl.Parent is ConnectionTab objConnectionTab) tabTitle = objConnectionTab.TabText;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
@@ -168,8 +168,7 @@ namespace mRemoteNG.Connection.Protocol.Http
|
||||
|
||||
private void wBrowser_Navigated(object sender, WebBrowserNavigatedEventArgs e)
|
||||
{
|
||||
var objWebBrowser = wBrowser as WebBrowser;
|
||||
if (objWebBrowser == null) return;
|
||||
if (!(wBrowser is WebBrowser objWebBrowser)) return;
|
||||
|
||||
// This can only be set once the WebBrowser control is shown, it will throw a COM exception otherwise.
|
||||
objWebBrowser.AllowWebBrowserDrop = false;
|
||||
@@ -181,9 +180,7 @@ namespace mRemoteNG.Connection.Protocol.Http
|
||||
{
|
||||
try
|
||||
{
|
||||
var tabP = InterfaceControl.Parent as TabPage;
|
||||
|
||||
if (tabP == null) return;
|
||||
if (!(InterfaceControl.Parent is ConnectionTab tabP)) return;
|
||||
string shortTitle;
|
||||
|
||||
if (InterfaceControl.Info.RenderingEngine == RenderingEngine.Gecko)
|
||||
@@ -209,14 +206,14 @@ namespace mRemoteNG.Connection.Protocol.Http
|
||||
}
|
||||
}
|
||||
|
||||
/* if (!string.IsNullOrEmpty(tabTitle))
|
||||
if (!string.IsNullOrEmpty(tabTitle))
|
||||
{
|
||||
tabP.Title = tabTitle + @" - " + shortTitle;
|
||||
tabP.TabText = tabTitle + @" - " + shortTitle;
|
||||
}
|
||||
else
|
||||
{
|
||||
tabP.Title = shortTitle;
|
||||
}*/
|
||||
tabP.TabText = shortTitle;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -229,9 +226,7 @@ namespace mRemoteNG.Connection.Protocol.Http
|
||||
{
|
||||
try
|
||||
{
|
||||
var tabP = InterfaceControl.Parent as TabPage;
|
||||
|
||||
if (tabP == null) return;
|
||||
if (!(InterfaceControl.Parent is ConnectionTab tabP)) return;
|
||||
string shortTitle;
|
||||
|
||||
if (InterfaceControl.Info.RenderingEngine == RenderingEngine.Gecko)
|
||||
@@ -257,14 +252,14 @@ namespace mRemoteNG.Connection.Protocol.Http
|
||||
}
|
||||
}
|
||||
|
||||
/* if (!string.IsNullOrEmpty(tabTitle))
|
||||
if (!string.IsNullOrEmpty(tabTitle))
|
||||
{
|
||||
tabP.Title = tabTitle + @" - " + shortTitle;
|
||||
tabP.TabText = tabTitle + @" - " + shortTitle;
|
||||
}
|
||||
else
|
||||
{
|
||||
tabP.Title = shortTitle;
|
||||
}*/
|
||||
tabP.TabText = shortTitle;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user