mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
UPD: Save connection encoding
This commit is contained in:
parent
79197fe192
commit
10afeb115d
2 changed files with 35 additions and 12 deletions
|
|
@ -13,7 +13,7 @@ object DialogBox: TDialogBox
|
|||
ClientWidth = 420
|
||||
OnShow = DialogBoxShow
|
||||
Position = poScreenCenter
|
||||
LCLVersion = '1.6.0.2'
|
||||
LCLVersion = '1.6.0.3'
|
||||
object lblName: TLabel
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideTop.Control = edtName
|
||||
|
|
@ -145,6 +145,8 @@ object DialogBox: TDialogBox
|
|||
BorderSpacing.Left = 12
|
||||
BorderSpacing.Top = 18
|
||||
Caption = 'Use passive mode for transfers (like a WWW brower)'
|
||||
Checked = True
|
||||
State = cbChecked
|
||||
TabOrder = 10
|
||||
end
|
||||
object btnCancel: TButton
|
||||
|
|
@ -293,6 +295,30 @@ object DialogBox: TDialogBox
|
|||
ItemIndex = 0
|
||||
Items.Strings = (
|
||||
'Auto'
|
||||
'UTF-8'
|
||||
'CP1250'
|
||||
'CP1251'
|
||||
'CP1252'
|
||||
'CP1253'
|
||||
'CP1254'
|
||||
'CP1255'
|
||||
'CP1256'
|
||||
'CP1257'
|
||||
'CP1258'
|
||||
'CP437'
|
||||
'CP850'
|
||||
'CP852'
|
||||
'CP866'
|
||||
'CP874'
|
||||
'CP932'
|
||||
'CP936'
|
||||
'CP949'
|
||||
'CP950'
|
||||
'KOI-8'
|
||||
'ISO-8859-1'
|
||||
'ISO-8859-2'
|
||||
'ISO-8859-15'
|
||||
'Macintosh'
|
||||
)
|
||||
Style = csDropDownList
|
||||
TabOrder = 13
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ unit FtpConfDlg;
|
|||
interface
|
||||
|
||||
uses
|
||||
SysUtils, Classes, Extension;
|
||||
SysUtils, Extension;
|
||||
|
||||
function ShowFtpConfDlg: Boolean;
|
||||
|
||||
|
|
@ -43,8 +43,6 @@ function DlgProc (pDlg: PtrUInt; DlgItemName: PAnsiChar; Msg, wParam, lParam: Pt
|
|||
var
|
||||
Data: PtrInt;
|
||||
Text: String;
|
||||
Index: Integer;
|
||||
Encoding: TStringList;
|
||||
begin
|
||||
Result:= 0;
|
||||
with gStartupInfo do
|
||||
|
|
@ -52,14 +50,10 @@ begin
|
|||
case Msg of
|
||||
DN_INITDIALOG:
|
||||
begin
|
||||
Encoding:= TStringList.Create;
|
||||
GetSupportedEncodings(Encoding);
|
||||
for Index:= 0 to Encoding.Count - 1 do
|
||||
begin
|
||||
Data:= PtrInt(PAnsiChar(Encoding[Index]));
|
||||
SendDlgMsg(pDlg, 'cmbEncoding', DM_LISTADDSTR, Data, 0);
|
||||
end;
|
||||
Encoding.Free;
|
||||
Text:= gConnection.Encoding;
|
||||
Data:= PtrInt(PAnsiChar(Text));
|
||||
Data:= SendDlgMsg(pDlg, 'cmbEncoding', DM_LISTINDEXOF, 0, Data);
|
||||
if Data >= 0 then SendDlgMsg(pDlg, 'cmbEncoding', DM_LISTSETITEMINDEX, Data, 0);
|
||||
Text:= gConnection.ConnectionName;
|
||||
Data:= PtrInt(PAnsiChar(Text));
|
||||
SendDlgMsg(pDlg, 'edtName', DM_SETTEXT, Data, 0);
|
||||
|
|
@ -149,6 +143,9 @@ begin
|
|||
end
|
||||
else if DlgItemName = 'btnOK' then
|
||||
begin
|
||||
Data:= SendDlgMsg(pDlg, 'cmbEncoding', DM_GETTEXT, 0, 0);
|
||||
Text:= PAnsiChar(Data);
|
||||
gConnection.Encoding:= Text;
|
||||
Data:= SendDlgMsg(pDlg, 'edtName', DM_GETTEXT, 0, 0);
|
||||
Text:= PAnsiChar(Data);
|
||||
gConnection.ConnectionName:= RepairConnectionName(Text);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue