@@ -43,6 +43,7 @@ procedure Register;
43
43
rsCopyTrue = ' Copy successful' ;
44
44
rsCopyFalse = ' Copy error' ;
45
45
rsDownloadFFmpeg = ' Download the necessary ffmpeg libraries' ;
46
+ rsSSL = ' Copy OpenSSL to Lazarus directory' ;
46
47
47
48
implementation
48
49
uses HttpDownloader;
@@ -67,11 +68,14 @@ function RayUsed: boolean;
67
68
68
69
procedure RayFunction (Sender: TObject);
69
70
var Editor: TSourceEditorInterface;
70
-
71
+ Pos: TPoint;
71
72
procedure insertXY (Text:String);
72
73
begin
73
74
Editor.CutToClipboard;
74
75
Editor.ReplaceText(editor.CursorTextXY,editor.CursorTextXY,Text);
76
+ Pos := editor.CursorTextXY;
77
+ Pos.X := Pos.x-1 ;
78
+ Editor.CursorTextXY := Pos;
75
79
end ;
76
80
77
81
begin
@@ -146,6 +150,14 @@ function GetRay4lazDir: string;
146
150
if Pkg <> nil then result := ExtractFilePath(ExcludeTrailingPathDelimiter(Pkg.DirectoryExpanded));
147
151
end ;
148
152
153
+
154
+ function GetLazdir : string;
155
+ begin
156
+ Result:=' $(LazarusDir)' ;
157
+ if not IDEMacros.SubstituteMacros(Result) then
158
+ raise Exception.Create(' unable to retrieve target file of project' );
159
+ end ;
160
+
149
161
procedure CopyByName (dllFile: String);
150
162
var Src, Dst: string;
151
163
begin
@@ -184,6 +196,24 @@ procedure CopyMediaToProject(Sender: Tobject);
184
196
CopyByName(dllFile);
185
197
end ;
186
198
199
+ procedure CopySSl (dllFile: string);
200
+ var Src, Dst : string;
201
+ begin
202
+ Src := GetRay4lazDir + ' package' + PathDelim + ' openssl' + PathDelim + GetOslibFolder + PathDelim + dllFile;
203
+ Dst := GetLazdir + dllFile;
204
+
205
+ if CopyFile(Src, Dst) then
206
+ IDEMessagesWindow.AddCustomMessage(mluHint, rsCopyTrue, dllFile, 0 ,0 ) else
207
+ IDEMessagesWindow.AddCustomMessage(mluError, rsCopyFalse);
208
+ end ;
209
+
210
+
211
+ procedure CopySSlAll (Sender: TObject);
212
+ begin
213
+ CopySSl(' ssleay32.dll' );
214
+ CopySSl(' libeay32.dll' );
215
+ end ;
216
+
187
217
procedure CompileRay4laz (Sender: TObject);
188
218
var Pkg: TIDEPackage;
189
219
begin
@@ -283,6 +313,7 @@ procedure Register;
283
313
RegisterIDEMenuCommand(SectionTool, ' Sep2' ,' -' ,nil ,nil );
284
314
RegisterIDEMenuCommand(SectionTool, ' CopyDll4' , rsCopyDll4, nil , @CopyMediaToProject,nil , ' pkg_lrs' );
285
315
RegisterIDEMenuCommand(SectionTool, ' DownloadLibs' , rsDownloadFFmpeg , nil , @DownloadFFmpeg,nil , ' menu_exporthtml' );
316
+ RegisterIDEMenuCommand(SectionTool, ' DownloadLibs1' , rsSSL , nil , @CopySSlAll,nil , ' pkg_lrs' );
286
317
287
318
RegisterIDEMenuCommand(SectionToolMenu, ' Sep3' ,' -' ,nil ,nil );
288
319
RegisterIDEMenuCommand(SectionToolMenu, ' ShowCheatsheet' , rsHelpCheat , nil , @RayFunction, nil , ' ce_interface' );
@@ -321,7 +352,6 @@ procedure TEventClass.DoSomething(Sender: TObject);
321
352
end else SectionTool.Visible := false;
322
353
end ;
323
354
324
-
325
355
initialization
326
356
EventCode := TEventClass.Create;
327
357
finalization
0 commit comments