Skip to content

Commit

Permalink
Added font smoothing setting for RDP connections.
Browse files Browse the repository at this point in the history
  • Loading branch information
Riley McArdle committed May 26, 2011
1 parent ec850f6 commit 935df3d
Show file tree
Hide file tree
Showing 13 changed files with 164 additions and 14 deletions.
2 changes: 1 addition & 1 deletion mRemoteV1/App/App.Info.vb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Namespace App
Public Shared ReadOnly DefaultConnectionsPath As String = App.Info.Settings.SettingsPath
Public Shared ReadOnly DefaultConnectionsFile As String = "confCons.xml"
Public Shared ReadOnly DefaultConnectionsFileNew As String = "confConsNew.xml"
Public Shared ReadOnly ConnectionFileVersion As Double = 2.2
Public Shared ReadOnly ConnectionFileVersion As Double = 2.3
End Class

Public Class Credentials
Expand Down
8 changes: 8 additions & 0 deletions mRemoteV1/App/App.Runtime.vb
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,7 @@ Namespace App
My.Settings.ConDefaultCacheBitmaps = .CacheBitmaps
My.Settings.ConDefaultDisplayWallpaper = .DisplayWallpaper
My.Settings.ConDefaultDisplayThemes = .DisplayThemes
My.Settings.ConDefaultEnableFontSmoothing = .EnableFontSmoothing
My.Settings.ConDefaultRedirectKeys = .RedirectKeys
My.Settings.ConDefaultRedirectDiskDrives = .RedirectDiskDrives
My.Settings.ConDefaultRedirectPrinters = .RedirectPrinters
Expand Down Expand Up @@ -509,6 +510,7 @@ Namespace App
My.Settings.InhDefaultCacheBitmaps = .CacheBitmaps
My.Settings.InhDefaultDisplayWallpaper = .DisplayWallpaper
My.Settings.InhDefaultDisplayThemes = .DisplayThemes
My.Settings.InhDefaultEnableFontSmoothing = .EnableFontSmoothing
My.Settings.InhDefaultRedirectKeys = .RedirectKeys
My.Settings.InhDefaultRedirectDiskDrives = .RedirectDiskDrives
My.Settings.InhDefaultRedirectPrinters = .RedirectPrinters
Expand Down Expand Up @@ -923,6 +925,12 @@ Namespace App
Else
nConI.DisplayThemes = False
End If
Case "allow font smoothing"
If pValue = 1 Then
nConI.EnableFontSmoothing = True
Else
nConI.EnableFontSmoothing = False
End If
Case "redirectsmartcards"
If pValue = 1 Then
nConI.RedirectSmartCards = True
Expand Down
10 changes: 10 additions & 0 deletions mRemoteV1/Config/Config.Connections.Load.vb
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,7 @@ Namespace Config
conI.Domain = .Item("DomainName")
conI.DisplayWallpaper = .Item("DisplayWallpaper")
conI.DisplayThemes = .Item("DisplayThemes")
conI.EnableFontSmoothing = .Item("EnableFontSmoothing")
conI.CacheBitmaps = .Item("CacheBitmaps")
conI.UseConsoleSession = .Item("ConnectToConsole")

Expand All @@ -449,6 +450,7 @@ Namespace Config
conI.Inherit.Description = .Item("InheritDescription")
conI.Inherit.DisplayThemes = .Item("InheritDisplayThemes")
conI.Inherit.DisplayWallpaper = .Item("InheritDisplayWallpaper")
conI.Inherit.EnableFontSmoothing = .Item("InheritEnableFontSmoothing")
conI.Inherit.Domain = .Item("InheritDomain")
conI.Inherit.Icon = .Item("InheritIcon")
conI.Inherit.Panel = .Item("InheritPanel")
Expand Down Expand Up @@ -1000,6 +1002,14 @@ Namespace Config
conI.Inherit.RDGatewayPassword = .Attributes("InheritRDGatewayPassword").Value
conI.Inherit.RDGatewayDomain = .Attributes("InheritRDGatewayDomain").Value
End If

If Me.confVersion > 2.2 Then '2.3
' Get settings
conI.EnableFontSmoothing = .Attributes("EnableFontSmoothing").Value

' Get inheritance settings
conI.Inherit.EnableFontSmoothing = .Attributes("InheritEnableFontSmoothing").Value
End If
End With

Return conI
Expand Down
18 changes: 12 additions & 6 deletions mRemoteV1/Config/Config.Connections.Save.vb
Original file line number Diff line number Diff line change
Expand Up @@ -220,14 +220,14 @@ Namespace Config
sqlQuery = New SqlCommand("INSERT INTO tblCons (Name, Type, Expanded, Description, Icon, Panel, Username, " & _
"DomainName, Password, Hostname, Protocol, PuttySession, " & _
"Port, ConnectToConsole, RenderingEngine, ICAEncryptionStrength, RDPAuthenticationLevel, Colors, Resolution, DisplayWallpaper, " & _
"DisplayThemes, CacheBitmaps, RedirectDiskDrives, RedirectPorts, " & _
"DisplayThemes, EnableFontSmoothing, CacheBitmaps, RedirectDiskDrives, RedirectPorts, " & _
"RedirectPrinters, RedirectSmartCards, RedirectSound, RedirectKeys, " & _
"Connected, PreExtApp, PostExtApp, MacAddress, UserField, ExtApp, VNCCompression, VNCEncoding, VNCAuthMode, " & _
"VNCProxyType, VNCProxyIP, VNCProxyPort, VNCProxyUsername, VNCProxyPassword, " & _
"VNCColors, VNCSmartSizeMode, VNCViewOnly, " & _
"RDGatewayUsageMethod, RDGatewayHostname, RDGatewayUseConnectionCredentials, RDGatewayUsername, RDGatewayPassword, RDGatewayDomain, " & _
"InheritCacheBitmaps, InheritColors, " & _
"InheritDescription, InheritDisplayThemes, InheritDisplayWallpaper, InheritDomain, " & _
"InheritDescription, InheritDisplayThemes, InheritDisplayWallpaper, InheritEnableFontSmoothing, InheritDomain, " & _
"InheritIcon, InheritPanel, InheritPassword, InheritPort, " & _
"InheritProtocol, InheritPuttySession, InheritRedirectDiskDrives, " & _
"InheritRedirectKeys, InheritRedirectPorts, InheritRedirectPrinters, " & _
Expand Down Expand Up @@ -308,6 +308,7 @@ Namespace Config
sqlQuery.CommandText &= "'" & .Resolution.ToString & "',"
sqlQuery.CommandText &= "'" & .DisplayWallpaper & "',"
sqlQuery.CommandText &= "'" & .DisplayThemes & "',"
sqlQuery.CommandText &= "'" & .EnableFontSmoothing & "',"
sqlQuery.CommandText &= "'" & .CacheBitmaps & "',"
sqlQuery.CommandText &= "'" & .RedirectDiskDrives & "',"
sqlQuery.CommandText &= "'" & .RedirectPorts & "',"
Expand Down Expand Up @@ -369,6 +370,7 @@ Namespace Config
sqlQuery.CommandText &= "'" & .Description & "',"
sqlQuery.CommandText &= "'" & .DisplayThemes & "',"
sqlQuery.CommandText &= "'" & .DisplayWallpaper & "',"
sqlQuery.CommandText &= "'" & .EnableFontSmoothing & "',"
sqlQuery.CommandText &= "'" & .Domain & "',"
sqlQuery.CommandText &= "'" & .Icon & "',"
sqlQuery.CommandText &= "'" & .Panel & "',"
Expand Down Expand Up @@ -634,6 +636,8 @@ Namespace Config

xW.WriteAttributeString("DisplayThemes", "", curConI.DisplayThemes)

xW.WriteAttributeString("EnableFontSmoothing", "", curConI.EnableFontSmoothing)

xW.WriteAttributeString("CacheBitmaps", "", curConI.CacheBitmaps)

xW.WriteAttributeString("RedirectDiskDrives", "", curConI.RedirectDiskDrives)
Expand Down Expand Up @@ -701,6 +705,7 @@ Namespace Config
xW.WriteAttributeString("InheritDescription", "", curConI.Inherit.Description)
xW.WriteAttributeString("InheritDisplayThemes", "", curConI.Inherit.DisplayThemes)
xW.WriteAttributeString("InheritDisplayWallpaper", "", curConI.Inherit.DisplayWallpaper)
xW.WriteAttributeString("InheritEnableFontSmoothing", "", curConI.Inherit.EnableFontSmoothing)
xW.WriteAttributeString("InheritDomain", "", curConI.Inherit.Domain)
xW.WriteAttributeString("InheritIcon", "", curConI.Inherit.Icon)
xW.WriteAttributeString("InheritPanel", "", curConI.Inherit.Panel)
Expand Down Expand Up @@ -748,6 +753,7 @@ Namespace Config
xW.WriteAttributeString("InheritDescription", "", False)
xW.WriteAttributeString("InheritDisplayThemes", "", False)
xW.WriteAttributeString("InheritDisplayWallpaper", "", False)
xW.WriteAttributeString("InheritEnableFontSmoothing", "", False)
xW.WriteAttributeString("InheritDomain", "", False)
xW.WriteAttributeString("InheritIcon", "", False)
xW.WriteAttributeString("InheritPanel", "", False)
Expand Down Expand Up @@ -828,10 +834,10 @@ Namespace Config
csvLn += "Domain;"
End If

csvLn += "Hostname;Protocol;PuttySession;Port;ConnectToConsole;RenderingEngine;ICAEncryptionStrength;RDPAuthenticationLevel;Colors;Resolution;DisplayWallpaper;DisplayThemes;CacheBitmaps;RedirectDiskDrives;RedirectPorts;RedirectPrinters;RedirectSmartCards;RedirectSound;RedirectKeys;PreExtApp;PostExtApp;MacAddress;UserField;ExtApp;VNCCompression;VNCEncoding;VNCAuthMode;VNCProxyType;VNCProxyIP;VNCProxyPort;VNCProxyUsername;VNCProxyPassword;VNCColors;VNCSmartSizeMode;VNCViewOnly;RDGatewayUsageMethod;RDGatewayHostname;RDGatewayUseConnectionCredentials;RDGatewayUsername;RDGatewayPassword;RDGatewayDomain;"
csvLn += "Hostname;Protocol;PuttySession;Port;ConnectToConsole;RenderingEngine;ICAEncryptionStrength;RDPAuthenticationLevel;Colors;Resolution;DisplayWallpaper;DisplayThemes;EnableFontSmoothing;CacheBitmaps;RedirectDiskDrives;RedirectPorts;RedirectPrinters;RedirectSmartCards;RedirectSound;RedirectKeys;PreExtApp;PostExtApp;MacAddress;UserField;ExtApp;VNCCompression;VNCEncoding;VNCAuthMode;VNCProxyType;VNCProxyIP;VNCProxyPort;VNCProxyUsername;VNCProxyPassword;VNCColors;VNCSmartSizeMode;VNCViewOnly;RDGatewayUsageMethod;RDGatewayHostname;RDGatewayUseConnectionCredentials;RDGatewayUsername;RDGatewayPassword;RDGatewayDomain;"

If SaveSecurity.Inheritance Then
csvLn += "InheritCacheBitmaps;InheritColors;InheritDescription;InheritDisplayThemes;InheritDisplayWallpaper;InheritDomain;InheritIcon;InheritPanel;InheritPassword;InheritPort;InheritProtocol;InheritPuttySession;InheritRedirectDiskDrives;InheritRedirectKeys;InheritRedirectPorts;InheritRedirectPrinters;InheritRedirectSmartCards;InheritRedirectSound;InheritResolution;InheritUseConsoleSession;InheritRenderingEngine;InheritUsername;InheritICAEncryptionStrength;InheritRDPAuthenticationLevel;InheritPreExtApp;InheritPostExtApp;InheritMacAddress;InheritUserField;InheritExtApp;InheritVNCCompression;InheritVNCEncoding;InheritVNCAuthMode;InheritVNCProxyType;InheritVNCProxyIP;InheritVNCProxyPort;InheritVNCProxyUsername;InheritVNCProxyPassword;InheritVNCColors;InheritVNCSmartSizeMode;InheritVNCViewOnly;InheritRDGatewayUsageMethod;InheritRDGatewayHostname;InheritRDGatewayUseConnectionCredentials;InheritRDGatewayUsername;InheritRDGatewayPassword;InheritRDGatewayDomain"
csvLn += "InheritCacheBitmaps;InheritColors;InheritDescription;InheritDisplayThemes;InheritDisplayWallpaper;InheritEnableFontSmoothing;InheritDomain;InheritIcon;InheritPanel;InheritPassword;InheritPort;InheritProtocol;InheritPuttySession;InheritRedirectDiskDrives;InheritRedirectKeys;InheritRedirectPorts;InheritRedirectPrinters;InheritRedirectSmartCards;InheritRedirectSound;InheritResolution;InheritUseConsoleSession;InheritRenderingEngine;InheritUsername;InheritICAEncryptionStrength;InheritRDPAuthenticationLevel;InheritPreExtApp;InheritPostExtApp;InheritMacAddress;InheritUserField;InheritExtApp;InheritVNCCompression;InheritVNCEncoding;InheritVNCAuthMode;InheritVNCProxyType;InheritVNCProxyIP;InheritVNCProxyPort;InheritVNCProxyUsername;InheritVNCProxyPassword;InheritVNCColors;InheritVNCSmartSizeMode;InheritVNCViewOnly;InheritRDGatewayUsageMethod;InheritRDGatewayHostname;InheritRDGatewayUseConnectionCredentials;InheritRDGatewayUsername;InheritRDGatewayPassword;InheritRDGatewayDomain"
End If

csvWr.WriteLine(csvLn)
Expand Down Expand Up @@ -882,10 +888,10 @@ Namespace Config
csvLn += con.Domain & ";"
End If

csvLn += con.Hostname & ";" & con.Protocol.ToString & ";" & con.PuttySession & ";" & con.Port & ";" & con.UseConsoleSession & ";" & con.RenderingEngine.ToString & ";" & con.ICAEncryption.ToString & ";" & con.RDPAuthenticationLevel.ToString & ";" & con.Colors.ToString & ";" & con.Resolution.ToString & ";" & con.DisplayWallpaper & ";" & con.DisplayThemes & ";" & con.CacheBitmaps & ";" & con.RedirectDiskDrives & ";" & con.RedirectPorts & ";" & con.RedirectPrinters & ";" & con.RedirectSmartCards & ";" & con.RedirectSound.ToString & ";" & con.RedirectKeys & ";" & con.PreExtApp & ";" & con.PostExtApp & ";" & con.MacAddress & ";" & con.UserField & ";" & con.ExtApp & ";" & con.VNCCompression.ToString & ";" & con.VNCEncoding.ToString & ";" & con.VNCAuthMode.ToString & ";" & con.VNCProxyType.ToString & ";" & con.VNCProxyIP & ";" & con.VNCProxyPort & ";" & con.VNCProxyUsername & ";" & con.VNCProxyPassword & ";" & con.VNCColors.ToString & ";" & con.VNCSmartSizeMode.ToString & ";" & con.VNCViewOnly & ";"
csvLn += con.Hostname & ";" & con.Protocol.ToString & ";" & con.PuttySession & ";" & con.Port & ";" & con.UseConsoleSession & ";" & con.RenderingEngine.ToString & ";" & con.ICAEncryption.ToString & ";" & con.RDPAuthenticationLevel.ToString & ";" & con.Colors.ToString & ";" & con.Resolution.ToString & ";" & con.DisplayWallpaper & ";" & con.DisplayThemes & ";" & con.EnableFontSmoothing & ";" & con.CacheBitmaps & ";" & con.RedirectDiskDrives & ";" & con.RedirectPorts & ";" & con.RedirectPrinters & ";" & con.RedirectSmartCards & ";" & con.RedirectSound.ToString & ";" & con.RedirectKeys & ";" & con.PreExtApp & ";" & con.PostExtApp & ";" & con.MacAddress & ";" & con.UserField & ";" & con.ExtApp & ";" & con.VNCCompression.ToString & ";" & con.VNCEncoding.ToString & ";" & con.VNCAuthMode.ToString & ";" & con.VNCProxyType.ToString & ";" & con.VNCProxyIP & ";" & con.VNCProxyPort & ";" & con.VNCProxyUsername & ";" & con.VNCProxyPassword & ";" & con.VNCColors.ToString & ";" & con.VNCSmartSizeMode.ToString & ";" & con.VNCViewOnly & ";"

If SaveSecurity.Inheritance Then
csvLn += con.Inherit.CacheBitmaps & ";" & con.Inherit.Colors & ";" & con.Inherit.Description & ";" & con.Inherit.DisplayThemes & ";" & con.Inherit.DisplayWallpaper & ";" & con.Inherit.Domain & ";" & con.Inherit.Icon & ";" & con.Inherit.Panel & ";" & con.Inherit.Password & ";" & con.Inherit.Port & ";" & con.Inherit.Protocol & ";" & con.Inherit.PuttySession & ";" & con.Inherit.RedirectDiskDrives & ";" & con.Inherit.RedirectKeys & ";" & con.Inherit.RedirectPorts & ";" & con.Inherit.RedirectPrinters & ";" & con.Inherit.RedirectSmartCards & ";" & con.Inherit.RedirectSound & ";" & con.Inherit.Resolution & ";" & con.Inherit.UseConsoleSession & ";" & con.Inherit.RenderingEngine & ";" & con.Inherit.Username & ";" & con.Inherit.ICAEncryption & ";" & con.Inherit.RDPAuthenticationLevel & ";" & con.Inherit.PreExtApp & ";" & con.Inherit.PostExtApp & ";" & con.Inherit.MacAddress & ";" & con.Inherit.UserField & ";" & con.Inherit.ExtApp & ";" & con.Inherit.VNCCompression & ";" & con.Inherit.VNCEncoding & ";" & con.Inherit.VNCAuthMode & ";" & con.Inherit.VNCProxyType & ";" & con.Inherit.VNCProxyIP & ";" & con.Inherit.VNCProxyPort & ";" & con.Inherit.VNCProxyUsername & ";" & con.Inherit.VNCProxyPassword & ";" & con.Inherit.VNCColors & ";" & con.Inherit.VNCSmartSizeMode & ";" & con.Inherit.VNCViewOnly
csvLn += con.Inherit.CacheBitmaps & ";" & con.Inherit.Colors & ";" & con.Inherit.Description & ";" & con.Inherit.DisplayThemes & ";" & con.Inherit.DisplayWallpaper & ";" & con.Inherit.EnableFontSmoothing & ";" & con.Inherit.Domain & ";" & con.Inherit.Icon & ";" & con.Inherit.Panel & ";" & con.Inherit.Password & ";" & con.Inherit.Port & ";" & con.Inherit.Protocol & ";" & con.Inherit.PuttySession & ";" & con.Inherit.RedirectDiskDrives & ";" & con.Inherit.RedirectKeys & ";" & con.Inherit.RedirectPorts & ";" & con.Inherit.RedirectPrinters & ";" & con.Inherit.RedirectSmartCards & ";" & con.Inherit.RedirectSound & ";" & con.Inherit.Resolution & ";" & con.Inherit.UseConsoleSession & ";" & con.Inherit.RenderingEngine & ";" & con.Inherit.Username & ";" & con.Inherit.ICAEncryption & ";" & con.Inherit.RDPAuthenticationLevel & ";" & con.Inherit.PreExtApp & ";" & con.Inherit.PostExtApp & ";" & con.Inherit.MacAddress & ";" & con.Inherit.UserField & ";" & con.Inherit.ExtApp & ";" & con.Inherit.VNCCompression & ";" & con.Inherit.VNCEncoding & ";" & con.Inherit.VNCAuthMode & ";" & con.Inherit.VNCProxyType & ";" & con.Inherit.VNCProxyIP & ";" & con.Inherit.VNCProxyPort & ";" & con.Inherit.VNCProxyUsername & ";" & con.Inherit.VNCProxyPassword & ";" & con.Inherit.VNCColors & ";" & con.Inherit.VNCSmartSizeMode & ";" & con.Inherit.VNCViewOnly
End If

csvWr.WriteLine(csvLn)
Expand Down
42 changes: 42 additions & 0 deletions mRemoteV1/Connection/Connection.Info.vb
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,33 @@ Namespace Connection
Me._DisplayThemes = value
End Set
End Property

Private _EnableFontSmoothing As Boolean = My.Settings.ConDefaultEnableFontSmoothing
<LocalizedCategory("strCategoryAppearance", 5), _
Browsable(True), _
LocalizedDisplayName("strPropertyNameEnableFontSmoothing"), _
LocalizedDescription("strPropertyDescriptionEnableFontSmoothing"), _
TypeConverter(GetType(mRemoteNG.Tools.Misc.YesNoTypeConverter))> _
Public Property EnableFontSmoothing() As Boolean
Get
If Me._Inherit.EnableFontSmoothing And Me._Parent IsNot Nothing Then
Dim parCon As Connection.Info = TryCast(Me._Parent, Container.Info).ConnectionInfo

If Me._IsContainer = True Then
Dim curCont As Container.Info = Me._Parent
Dim parCont As Container.Info = curCont.Parent
parCon = parCont.ConnectionInfo
End If

Return parCon.EnableFontSmoothing
Else
Return Me._EnableFontSmoothing
End If
End Get
Set(ByVal value As Boolean)
Me._EnableFontSmoothing = value
End Set
End Property
#End Region
#Region "6 Redirect"
Private _RedirectKeys As Boolean = My.Settings.ConDefaultRedirectKeys
Expand Down Expand Up @@ -1957,6 +1984,21 @@ Namespace Connection
Me._DisplayThemes = value
End Set
End Property

Private _EnableFontSmoothing As Boolean = My.Settings.InhDefaultEnableFontSmoothing
<LocalizedCategory("strCategoryAppearance", 6), _
Browsable(True), _
LocalizedDisplayNameInheritAttribute("strPropertyNameEnableFontSmoothing"), _
LocalizedDescriptionInheritAttribute("strPropertyDescriptionEnableFontSmoothing"), _
TypeConverter(GetType(mRemoteNG.Tools.Misc.YesNoTypeConverter))> _
Public Property EnableFontSmoothing() As Boolean
Get
Return Me._EnableFontSmoothing
End Get
Set(ByVal value As Boolean)
Me._EnableFontSmoothing = value
End Set
End Property
#End Region
#Region "7 Redirect"
Private _RedirectKeys As Boolean = My.Settings.InhDefaultRedirectKeys
Expand Down
Loading

0 comments on commit 935df3d

Please sign in to comment.