diff --git a/source/apphelpers.pas b/source/apphelpers.pas index 281090ed..ea9f4b7f 100644 --- a/source/apphelpers.pas +++ b/source/apphelpers.pas @@ -92,23 +92,8 @@ type // Download THttpDownload = class(TFPHttpClient) - //private - // FOwner: TComponent; - // FURL: String; - // FLastContent: String; - // FBytesRead: Integer; - // FContentLength: Integer; - // FTimeOut: Cardinal; - // FOnProgress: TNotifyEvent; public constructor Create(Owner: TComponent); - // procedure SendRequest(Filename: String); - // property OnProgress: TNotifyEvent read FOnProgress write FOnProgress; - // property URL: String read FURL write FURL; - // property TimeOut: Cardinal read FTimeOut write FTimeOut; - // property BytesRead: Integer read FBytesRead; - // property ContentLength: Integer read FContentLength; - // property LastContent: String read FLastContent; end; // Extended string list with support for empty values @@ -4231,7 +4216,7 @@ function TAppSettings.ReadIntDpiAware(Index: TAppSettingIndex; AControl: TContro begin // take a forms DesignTimePPI into account Result := ReadInt(Index, FormatName, Default); - Result := AControl.Scale96ToForm(Result); + Result := AControl.ScaleDesignToForm(Result); end; @@ -4317,7 +4302,7 @@ end; procedure TAppSettings.WriteIntDpiAware(Index: TAppSettingIndex; AControl: TControl; Value: Integer; FormatName: String=''); begin - Value := AControl.ScaleFormTo96(Value); + Value := AControl.ScaleFormToDesign(Value); WriteInt(Index, Value, FormatName); end; diff --git a/source/connections.pas b/source/connections.pas index 650b3238..db663ef4 100644 --- a/source/connections.pas +++ b/source/connections.pas @@ -12,7 +12,7 @@ interface uses SysUtils, Classes, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, ComCtrls, laz.VirtualTrees, Menus, Graphics, Generics.Collections, extra_controls, - dbconnection, RegExpr, Types, GraphUtil, StrUtils, + dbconnection, RegExpr, Types, GraphUtil, StrUtils, FileUtil, Math, ActnList, StdActns, comboex, EditBtn, Buttons, colorbox; type @@ -284,8 +284,20 @@ var ComboItem: TComboExItem; Placeholders: TStringList; i: Integer; - ExeFiles: TStringDynArray; + ExeFiles: TStringList; begin + + Width := AppSettings.ReadInt(asSessionManagerWindowWidth); + Height := AppSettings.ReadInt(asSessionManagerWindowHeight); + Left := AppSettings.ReadInt(asSessionManagerWindowLeft, '', Left); + Top := AppSettings.ReadInt(asSessionManagerWindowTop, '', Top); + // Move to visible area if window was on a now plugged off monitor previously + MakeFullyVisible; + pnlLeft.Width := AppSettings.ReadInt(asSessionManagerListWidth); + splitterMain.OnMoved(Sender); + FixVT(ListSessions); + RestoreListSetup(ListSessions); + // Fix GUI stuff HasSizeGrip := True; Caption := GetWindowCaption; @@ -322,14 +334,14 @@ begin editLogFilePath.Hint := FilenameHint; // Populate dropdown with supported SSH executables - {ExeFiles := TDirectory.GetFiles(ExtractFilePath(ParamStr(0)), '*.exe'); + ExeFiles := FindAllFiles(ExtractFilePath(ParamStr(0)), '*.exe', False); for ExePath in ExeFiles do begin ExeFile := ExtractFileName(ExePath); if ExecRegExprI('([pk]link|putty)', ExeFile) then begin comboSSHExe.Items.Add(ExeFile); end; end; - SetLength(ExeFiles, 0);} + ExeFiles.Free; comboSSHExe.Items.Add('ssh.exe'); end; @@ -400,17 +412,6 @@ var PSess: PConnectionParameters; Node: PVirtualNode; begin - Width := AppSettings.ReadIntDpiAware(asSessionManagerWindowWidth, Self); - Height := AppSettings.ReadIntDpiAware(asSessionManagerWindowHeight, Self); - Left := AppSettings.ReadInt(asSessionManagerWindowLeft, '', Left); - Top := AppSettings.ReadInt(asSessionManagerWindowTop, '', Top); - // Move to visible area if window was on a now plugged off monitor previously - MakeFullyVisible; - pnlLeft.Width := AppSettings.ReadIntDpiAware(asSessionManagerListWidth, Self); - splitterMain.OnMoved(Sender); - FixVT(ListSessions); - RestoreListSetup(ListSessions); - // Init sessions tree RefreshSessions(nil);