Skip to content

Commit c934d72

Browse files
committed
feat: create checkbox in advanced session setting for new ForceUnicode setting
https://www.heidisql.com/forum.php?t=45113
1 parent b858cd6 commit c934d72

2 files changed

Lines changed: 35 additions & 17 deletions

File tree

source/connections.dfm

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -558,21 +558,21 @@ object connform: Tconnform
558558
end
559559
object lblBackgroundColor: TLabel
560560
Left = 3
561-
Top = 162
561+
Top = 185
562562
Width = 98
563563
Height = 14
564564
Caption = 'Background color:'
565565
end
566566
object lblIgnoreDatabasePattern: TLabel
567567
Left = 3
568-
Top = 190
568+
Top = 213
569569
Width = 126
570570
Height = 14
571571
Caption = 'Hide database pattern:'
572572
end
573573
object lblLogFile: TLabel
574574
Left = 3
575-
Top = 229
575+
Top = 252
576576
Width = 102
577577
Height = 14
578578
Caption = 'Log queries to file:'
@@ -669,7 +669,7 @@ object connform: Tconnform
669669
end
670670
object ColorBoxBackgroundColor: TColorBox
671671
Left = 190
672-
Top = 159
672+
Top = 182
673673
Width = 320
674674
Height = 22
675675
NoneColorColor = clNone
@@ -683,7 +683,7 @@ object connform: Tconnform
683683
end
684684
object editIgnoreDatabasePattern: TEdit
685685
Left = 190
686-
Top = 187
686+
Top = 210
687687
Width = 320
688688
Height = 22
689689
Anchors = [akLeft, akTop, akRight]
@@ -693,7 +693,7 @@ object connform: Tconnform
693693
end
694694
object chkLogFileDdl: TCheckBox
695695
Left = 190
696-
Top = 253
696+
Top = 276
697697
Width = 320
698698
Height = 17
699699
Anchors = [akLeft, akTop, akRight]
@@ -703,7 +703,7 @@ object connform: Tconnform
703703
end
704704
object editLogFilePath: TButtonedEdit
705705
Left = 190
706-
Top = 226
706+
Top = 249
707707
Width = 320
708708
Height = 22
709709
Anchors = [akLeft, akTop, akRight]
@@ -717,14 +717,24 @@ object connform: Tconnform
717717
end
718718
object chkLogFileDml: TCheckBox
719719
Left = 190
720-
Top = 276
720+
Top = 299
721721
Width = 320
722722
Height = 17
723723
Anchors = [akLeft, akTop, akRight]
724724
Caption = 'DML queries (INSERT, UPDATE, ...)'
725725
TabOrder = 12
726726
OnClick = Modification
727727
end
728+
object chkForceUnicode: TCheckBox
729+
Left = 190
730+
Top = 159
731+
Width = 320
732+
Height = 17
733+
Anchors = [akLeft, akTop, akRight]
734+
Caption = 'Force Unicode (disable on old servers only)'
735+
TabOrder = 13
736+
OnClick = Modification
737+
end
728738
end
729739
object tabSSL: TTabSheet
730740
Caption = 'SSL'
@@ -766,7 +776,7 @@ object connform: Tconnform
766776
object lblSSLVerification: TLabel
767777
Left = 3
768778
Top = 148
769-
Width = 131
779+
Width = 121
770780
Height = 14
771781
Caption = 'Certificate verification:'
772782
end

source/connections.pas

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Tconnform = class(TExtForm)
2222
btnSave: TButton;
2323
btnNew: TButton;
2424
btnDelete: TButton;
25+
chkForceUnicode: TCheckBox;
2526
popupSessions: TPopupMenu;
2627
menuSave: TMenuItem;
2728
menuDelete: TMenuItem;
@@ -496,6 +497,7 @@ procedure Tconnform.btnSaveClick(Sender: TObject);
496497
Sess.LoginPrompt := chkLoginPrompt.Checked;
497498
Sess.WindowsAuth := chkWindowsAuth.Checked;
498499
Sess.CleartextPluginEnabled := chkCleartextPluginEnabled.Checked;
500+
Sess.ForceUnicode := chkForceUnicode.Checked;
499501
Sess.Port := updownPort.Position;
500502
Sess.NetType := SelectedNetType;
501503
Sess.Compressed := chkCompressed.Checked;
@@ -725,6 +727,7 @@ function Tconnform.CurrentParams: TConnectionParameters;
725727
Result.LoginPrompt := chkLoginPrompt.Checked;
726728
Result.WindowsAuth := chkWindowsAuth.Checked;
727729
Result.CleartextPluginEnabled := chkCleartextPluginEnabled.Checked;
730+
Result.ForceUnicode := chkForceUnicode.Checked;
728731
if updownPort.Enabled then
729732
Result.Port := updownPort.Position
730733
else
@@ -1036,6 +1039,7 @@ procedure Tconnform.ListSessionsFocusChanged(Sender: TBaseVirtualTree;
10361039
chkLoginPrompt.Checked := Sess.LoginPrompt;
10371040
chkWindowsAuth.Checked := Sess.WindowsAuth;
10381041
chkCleartextPluginEnabled.Checked := Sess.CleartextPluginEnabled;
1042+
chkForceUnicode.Checked := Sess.ForceUnicode;
10391043
updownPort.Position := Sess.Port;
10401044
chkCompressed.Checked := Sess.Compressed;
10411045
updownQueryTimeout.Position := Sess.QueryTimeout;
@@ -1462,6 +1466,7 @@ procedure Tconnform.Modification(Sender: TObject);
14621466
or (Sess.LoginPrompt <> chkLoginPrompt.Checked)
14631467
or (Sess.WindowsAuth <> chkWindowsAuth.Checked)
14641468
or (Sess.CleartextPluginEnabled <> chkCleartextPluginEnabled.Checked)
1469+
or (Sess.ForceUnicode <> chkForceUnicode.Checked)
14651470
or (Sess.Port <> updownPort.Position)
14661471
or (Sess.Compressed <> chkCompressed.Checked)
14671472
or (Sess.QueryTimeout <> updownQueryTimeout.Position)
@@ -1499,7 +1504,8 @@ procedure Tconnform.Modification(Sender: TObject);
14991504
FSessionModified := FSessionModified or PasswordModified;
15001505
if (Sender=editHost) or (Sender=editUsername) or (Sender=editPassword) or
15011506
(Sender=comboNetType) or (Sender=chkWindowsAuth) or (Sender=editPort) or
1502-
(Sender=chkCleartextPluginEnabled) then begin
1507+
(Sender=chkCleartextPluginEnabled) or (Sender=chkForceUnicode)
1508+
then begin
15031509
// Be sure to use the modified connection params next time the user clicks the "Databases" pulldown
15041510
FreeAndNil(FPopupDatabases);
15051511
end;
@@ -1616,6 +1622,15 @@ procedure Tconnform.ValidateControls;
16161622
lblSSHLocalPort.Enabled := Params.SSHActive;
16171623
editSSHlocalport.Enabled := Params.SSHActive;
16181624
// Advanced tab:
1625+
lblQueryTimeout.Enabled := True;
1626+
editQueryTimeout.Enabled := lblQueryTimeout.Enabled;
1627+
updownQueryTimeout.Enabled := lblQueryTimeout.Enabled;
1628+
chkLocalTimeZone.Enabled := Params.NetTypeGroup = ngMySQL;
1629+
chkFullTableStatus.Enabled := (Params.NetTypeGroup in [ngMySQL, ngPgSQL, ngSQLite]) and (Params.NetType <> ntMySQL_ProxySQLAdmin);
1630+
chkCleartextPluginEnabled.Enabled := Params.NetTypeGroup = ngMySQL;
1631+
chkForceUnicode.Enabled := Params.NetTypeGroup = ngMySQL;
1632+
editLogFilePath.Enabled := Params.LogFileDdl or Params.LogFileDml;
1633+
// SSL tab:
16191634
chkWantSSL.Enabled := Params.NetType in [ntMySQL_TCPIP, ntMySQL_SSHtunnel, ntMySQL_ProxySQLAdmin, ntMySQL_RDS, ntPgSQL_TCPIP, ntPgSQL_SSHtunnel];
16201635
lblSSLPrivateKey.Enabled := Params.WantSSL;
16211636
editSSLPrivateKey.Enabled := Params.WantSSL;
@@ -1627,13 +1642,6 @@ procedure Tconnform.ValidateControls;
16271642
editSSLcipher.Enabled := Params.WantSSL;
16281643
lblSSLVerification.Enabled := Params.WantSSL;
16291644
comboSSLVerification.Enabled := Params.WantSSL;
1630-
lblQueryTimeout.Enabled := True;
1631-
editQueryTimeout.Enabled := lblQueryTimeout.Enabled;
1632-
updownQueryTimeout.Enabled := lblQueryTimeout.Enabled;
1633-
chkLocalTimeZone.Enabled := Params.NetTypeGroup = ngMySQL;
1634-
chkFullTableStatus.Enabled := (Params.NetTypeGroup in [ngMySQL, ngPgSQL, ngSQLite]) and (Params.NetType <> ntMySQL_ProxySQLAdmin);
1635-
chkCleartextPluginEnabled.Enabled := Params.NetTypeGroup = ngMySQL;
1636-
editLogFilePath.Enabled := Params.LogFileDdl or Params.LogFileDml;
16371645

16381646
Params.Free;
16391647
end;

0 commit comments

Comments
 (0)