1 {
2  ***************************************************************************
3  *                                                                         *
4  *   This source is free software; you can redistribute it and/or modify   *
5  *   it under the terms of the GNU General Public License as published by  *
6  *   the Free Software Foundation; either version 2 of the License, or     *
7  *   (at your option) any later version.                                   *
8  *                                                                         *
9  *   This code is distributed in the hope that it will be useful, but      *
10  *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
11  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
12  *   General Public License for more details.                              *
13  *                                                                         *
14  *   A copy of the GNU General Public License is available on the World    *
15  *   Wide Web at <http://www.gnu.org/copyleft/gpl.html>. You can also      *
16  *   obtain it by writing to the Free Software Foundation,                 *
17  *   Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1335, USA.   *
18  *                                                                         *
19  ***************************************************************************
20 
21  Author: Balázs Székely
22  Abstract:
23    Implementation of the options dialog.
24 }
25 
26 unit opkman_optionsfrm;
27 
28 {$mode objfpc}{$H+}
29 
30 interface
31 
32 uses
33   SysUtils, Math, Graphics, Classes,
34   // ideintf
35   MacroIntf, IDEImagesIntf,
36   // LCL
37   Forms, Controls, Dialogs, StdCtrls, ExtCtrls, Spin, ComCtrls, EditBtn, Menus,
38   ButtonPanel, Buttons,
39   // LazUtils
40   LazFileUtils,
41   // OpkMan
42   opkman_options, opkman_common, opkman_const, opkman_repositories, opkman_colorsfrm;
43 
44 type
45 
46   { TOptionsFrm }
47 
48   TOptionsFrm = class(TForm)
49     Bevel1: TBevel;
50     Bevel2: TBevel;
51     Bevel3: TBevel;
52     bFilesAdd: TButton;
53     bFilesDelete: TButton;
54     bFilesEdit: TButton;
55     bFoldersAdd: TButton;
56     bFoldersDelete: TButton;
57     bFoldersEdit: TButton;
58     bOpen: TButton;
59     bpOptions: TButtonPanel;
60     bColors: TButton;
61     cbIncompatiblePackages: TCheckBox;
62     cbAlreadyInstalledPackages: TCheckBox;
63     cbLoadJsonLocally: TCheckBox;
64     cbProxy: TCheckBox;
65     cbForceDownloadExtract: TCheckBox;
66     cbDeleteZipAfterInstall: TCheckBox;
67     cbCheckForUpdates: TComboBox;
68     cbUseDefaultTheme: TCheckBox;
69     cbRemoteRepository: TComboBox;
70     cbSelectProfile: TComboBox;
71     cbRegularIcons: TCheckBox;
72     edLocalRepositoryUpdate: TDirectoryEdit;
73     edLocalRepositoryPackages: TDirectoryEdit;
74     edLocalRepositoryArchive: TDirectoryEdit;
75     edProxyPassword: TEdit;
76     edProxyServer: TEdit;
77     edProxyUser: TEdit;
78     gbProxySettings: TGroupBox;
79     lbConTimeOut: TLabel;
80     lbFilterDirs: TLabel;
81     lbFilterFiles: TLabel;
82     lbLastUpdate: TLabel;
83     lbSelectProfile: TLabel;
84     lbUpdates: TLabel;
85     lbLocalRepositoryArchive: TLabel;
86     lbLocalRepositoryUpdate: TLabel;
87     lbRemoteRepository: TLabel;
88     lbServer: TLabel;
89     lbLocalRepositoryPackages: TLabel;
90     lbDaysToShowNewPackages: TLabel;
91     lbUserName: TLabel;
92     lbPort: TLabel;
93     lbPassword: TLabel;
94     lbExcludeFiles: TListBox;
95     lbExcludeFolders: TListBox;
96     pnRepositories: TPanel;
97     pnProfilesRight: TPanel;
98     pnProfilesTop: TPanel;
99     pnProfiles: TPanel;
100     pnFolders: TPanel;
101     pnProxy: TPanel;
102     pnGeneral: TPanel;
103     pgOptions: TPageControl;
104     pnBottom: TPanel;
105     pnProfilesMain: TPanel;
106     pnProfilesLeft: TPanel;
107     rbOpenSSL: TRadioGroup;
108     rbHintFormOptions: TRadioGroup;
109     SDD: TSelectDirectoryDialog;
110     seProxyPort: TSpinEdit;
111     spDaysToShowNewPackages: TSpinEdit;
112     spConTimeOut: TSpinEdit;
113     tsOpenSSL: TTabSheet;
114     tsFolders: TTabSheet;
115     tsProfiles: TTabSheet;
116     tsGeneral: TTabSheet;
117     tsProxy: TTabSheet;
118     procedure bColorsClick(Sender: TObject);
119     procedure bFilesAddClick(Sender: TObject);
120     procedure bFilesDeleteClick(Sender: TObject);
121     procedure bFilesEditClick(Sender: TObject);
122     procedure bOpenClick(Sender: TObject);
123     procedure cbProxyChange(Sender: TObject);
124     procedure cbSelectProfileChange(Sender: TObject);
125     procedure edLocalRepositoryPackagesButtonClick(Sender:TObject);
126     procedure edRemoteRepositoryKeyPress(Sender: TObject; var Key: char);
127     procedure FormCreate(Sender: TObject);
128     procedure FormDestroy(Sender: TObject);
129     procedure FormKeyPress(Sender: TObject; var Key: char);
130     procedure HelpButtonClick(Sender: TObject);
131     procedure OKButtonClick(Sender: TObject);
132     procedure pnProfilesMainResize(Sender: TObject);
133     procedure pnProfilesTopResize(Sender: TObject);
134   private
135     FHintFormOptionColors: TStringList;
GetSelectedTextnull136     function GetSelectedText(AListBox: TListBox; var AIndex: Integer): String;
137     procedure SetupColors;
138   public
139     procedure SetupControls(const AActivePageIndex: Integer = 0);
140   end;
141 
142 var
143   OptionsFrm: TOptionsFrm;
144 
145 implementation
146 
147 {$R *.lfm}
148 
149 { TOptionsFrm }
150 
151 procedure TOptionsFrm.bOpenClick(Sender: TObject);
152 var
153   I: Integer;
154 begin
155   RepositoriesFrm := TRepositoriesFrm.Create(Self);
156   try
157     if RepositoriesFrm.ShowModal = mrOk then
158     begin
159       cbRemoteRepository.Clear;
160       for I := 0 to Options.RemoteRepositoryTmp.Count - 1 do
161         cbRemoteRepository.Items.Add(Options.RemoteRepositoryTmp.Strings[I]);
162       if Options.ActiveRepositoryIndex <= cbRemoteRepository.Items.Count - 1 then
163         cbRemoteRepository.ItemIndex := Options.ActiveRepositoryIndex
164       else
165       begin
166         cbRemoteRepository.ItemIndex := 0;
167         Options.ActiveRepositoryIndex := 0;
168       end;
169     end;
170   finally
171     RepositoriesFrm.Free;
172   end;
173 end;
174 
GetSelectedTextnull175 function TOptionsFrm.GetSelectedText(AListBox: TListBox; var AIndex: Integer): String;
176 var
177   I: Integer;
178 begin
179   Result := '';
180   for I := 0 to AListBox.Count - 1 do
181   begin
182     if AListBox.Selected[I] then
183     begin
184       Result := AListBox.Items.Strings[I];
185       AIndex := I;
186       Break;
187     end;
188   end;
189 end;
190 
191 procedure TOptionsFrm.SetupColors;
192 begin
193   if not Options.UseDefaultTheme then
194   begin
195     Self.Color := clBtnFace;
196     tsGeneral.Color := clBtnFace;
197     tsProxy.Color := clBtnFace;
198     tsFolders.Color := clBtnFace;
199     tsProfiles.Color := clBtnFace;
200     pnGeneral.Color := clBtnFace;
201     pnProxy.Color := clBtnFace;
202     pnFolders.Color := clBtnFace;
203     pnProfiles.Color := clBtnFace;
204     lbExcludeFiles.Color := clBtnFace;
205     lbExcludeFolders.Color := clBtnFace;
206   end;
207 end;
208 
209 procedure TOptionsFrm.bFilesAddClick(Sender: TObject);
210 var
211   Value: String;
212   Index: Integer;
213   ListBox: TListBox;
214 begin
215   case (Sender as TButton).Tag of
216     0: begin
217          ListBox := lbExcludeFiles;
218          Value := InputBox(rsOptions_InputBox_Caption, rsOptions_InputBox_Text0, '*.');
219        end;
220     1: begin
221          ListBox := lbExcludeFolders;
222          Value := InputBox(rsOptions_InputBox_Caption, rsOptions_InputBox_Text1, '');
223        end;
224   end;
225   if Value <> '' then
226   begin
227     Index := ListBox.Items.Add(Value);
228     ListBox.Selected[Index] := True;
229   end;
230 end;
231 
232 procedure TOptionsFrm.bColorsClick(Sender: TObject);
233 begin
234   ColorsFrm := TColorsFrm.Create(Self);
235   try
236     if FHintFormOptionColors.Count > 0 then
237       ColorsFrm.LoadColors(FHintFormOptionColors)
238     else
239       ColorsFrm.LoadColors(Options.HintFormOptionColors);
240     if ColorsFrm.ShowModal = mrOK then
241     begin
242       FHintFormOptionColors.Clear;
243       FHintFormOptionColors.Add(ColorToString(ColorsFrm.shName.Brush.Color));
244       FHintFormOptionColors.Add(ColorToString(ColorsFrm.shDescription.Brush.Color));
245       FHintFormOptionColors.Add(ColorToString(ColorsFrm.shLicense.Brush.Color));
246     end;
247   finally
248     ColorsFrm.Free;
249   end;
250 end;
251 
252 procedure TOptionsFrm.bFilesEditClick(Sender: TObject);
253 var
254   Value: String;
255   Index: Integer;
256   MsgInfo: String;
257   MsgTxt: String;
258   ListBox: TListBox;
259 begin
260   case (Sender as TButton).Tag of
261     0: begin
262          MsgInfo := rsOptions_InputBox_Info0;
263          MsgTxt := rsOptions_InputBox_Text0;
264          Listbox := lbExcludeFiles;
265        end;
266     1: begin
267          MsgInfo := rsOptions_InputBox_Info1;
268          MsgTxt := rsOptions_InputBox_Text1;
269          ListBox := lbExcludeFolders;
270        end;
271   end;
272   if ListBox.SelCount = 0 then
273   begin
274     MessageDlgEx(MsgInfo, mtInformation, [mbOk], Self);
275     ListBox.SetFocus;
276     Exit;
277   end;
278   Index := -1;
279   Value := InputBox(rsOptions_InputBox_Caption, MsgTxt, GetSelectedText(ListBox, Index));
280   if (Value <> '') and (Index <> -1) then
281   begin
282     ListBox.Sorted := False;
283     ListBox.Items[Index] := Value;
284     ListBox.Sorted := True;
285     Index := ListBox.Items.IndexOf(Value);
286     ListBox.Selected[Index] := True;
287   end;
288 end;
289 
290 procedure TOptionsFrm.bFilesDeleteClick(Sender: TObject);
291 var
292   MsgConf: String;
293   MsgInfo: String;
294   ListBox: TListBox;
295   Value: String;
296   Index: Integer;
297 begin
298   case (Sender as TButton).Tag of
299      0: begin
300           MsgInfo := rsOptions_InputBox_Info0;
301           MsgConf := rsOptions_InputBox_Conf0;
302           ListBox := lbExcludeFiles;
303         end;
304      1: begin
305           MsgInfo := rsOptions_InputBox_Info1;
306           MsgConf := rsOptions_InputBox_Conf1;
307           ListBox := lbExcludeFolders;
308         end;
309    end;
310   if ListBox.SelCount = 0 then
311   begin
312     MessageDlgEx(MsgInfo, mtInformation, [mbOk], Self);
313     ListBox.SetFocus;
314     Exit;
315   end;
316   Index := -1;
317   Value := GetSelectedText(ListBox, Index);
318   if (Value <> '') and (Index <> -1) then
319     if MessageDlgEx(Format(MsgConf, [Value]), mtConfirmation, [mbYes, mbNo], Self) = mrYes then
320       ListBox.Items.Delete(Index);
321 end;
322 
323 procedure TOptionsFrm.cbProxyChange(Sender: TObject);
324 begin
325   gbProxySettings.Enabled:= cbProxy.Checked;
326 end;
327 
328 procedure TOptionsFrm.cbSelectProfileChange(Sender: TObject);
329 begin
330   pnProfilesMain.Visible := cbSelectProfile.ItemIndex = 1;
331 end;
332 
333 procedure TOptionsFrm.edLocalRepositoryPackagesButtonClick(Sender:TObject);
334 var Sendert:TDirectoryEdit;
335     d:string;
336 begin
337   Sendert:=sender as TDirectoryEdit;
338   d:=Sendert.Directory;
339   IDEMacros.SubstituteMacros(d);
340   Sendert.Directory:=d;
341 end;
342 
343 procedure TOptionsFrm.edRemoteRepositoryKeyPress(Sender: TObject; var Key: char);
344 begin
345   if Key = #13 then
346     OKButtonClick(bpOptions.OKButton);
347 end;
348 
349 procedure TOptionsFrm.FormCreate(Sender: TObject);
350 begin
351   FHintFormOptionColors := TStringList.Create;
352 end;
353 
354 procedure TOptionsFrm.FormDestroy(Sender: TObject);
355 begin
356   FHintFormOptionColors.Free;
357 end;
358 
359 procedure TOptionsFrm.FormKeyPress(Sender: TObject; var Key: char);
360 begin
361   if Key = #27 then
362     Close;
363 end;
364 
365 procedure TOptionsFrm.HelpButtonClick(Sender: TObject);
366 begin
367   if MessageDlgEx(rsOptions_RestoreDefaults_Conf, mtInformation, [mbYes, mbNo], Self) = mrYes then
368   begin
369     Options.LoadDefault;
370     Options.CreateMissingPaths;
371     SetupControls;
372   end;
373 end;
374 
375 procedure TOptionsFrm.OKButtonClick(Sender: TObject);
376 var
377   I: Integer;
378 begin
379   ModalResult := mrNone;
380   if Trim(cbRemoteRepository.Text)  = '' then
381   begin
382     MessageDlgEx(rsOptions_RemoteRepository_Information, mtInformation, [mbOk], Self);
383     cbRemoteRepository.SetFocus;
384     Exit;
385   end;
386 
387   if cbProxy.Checked then
388   begin
389     if Trim(edProxyServer.Text)  = '' then
390     begin
391       MessageDlgEx(rsOptions_ProxyServer_Info, mtInformation, [mbOk], Self);
392       edProxyServer.SetFocus;
393       Exit;
394     end;
395     if seProxyPort.Value = 0 then
396     begin
397       MessageDlgEx(rsOptions_ProxyPort_Info, mtInformation, [mbOk], Self);
398       seProxyPort.SetFocus;
399       Exit;
400     end;
401   end;
402 
403   if Trim(edLocalRepositoryPackages.Text)  = '' then
404   begin
405     MessageDlgEx(rsOptions_InvalidDirectory_Info, mtInformation, [mbOk], Self);
406     edLocalRepositoryPackages.SetFocus;
407     Exit;
408   end;
409   if Trim(edLocalRepositoryArchive.Text)  = '' then
410   begin
411     MessageDlgEx(rsOptions_InvalidDirectory_Info, mtInformation, [mbOk], Self);
412     edLocalRepositoryArchive.SetFocus;
413     Exit;
414   end;
415   if Trim(edLocalRepositoryUpdate.Text)  = '' then
416   begin
417     MessageDlgEx(rsOptions_InvalidDirectory_Info, mtInformation, [mbOk], Self);
418     edLocalRepositoryUpdate.SetFocus;
419     Exit;
420   end;
421   if Options.RemoteRepositoryTmp.Count > 0 then
422     Options.RemoteRepository.Text := Options.RemoteRepositoryTmp.Text;
423   Options.ActiveRepositoryIndex := cbRemoteRepository.ItemIndex;
424   Options.LoadJsonLocally := cbLoadJsonLocally.Checked;
425   Options.ForceDownloadAndExtract := cbForceDownloadExtract.Checked;
426   Options.ConTimeOut := spConTimeOut.Value;
427   Options.DeleteZipAfterInstall := cbDeleteZipAfterInstall.Checked;
428   Options.IncompatiblePackages := cbIncompatiblePackages.Checked;
429   Options.AlreadyInstalledPackages := cbAlreadyInstalledPackages.Checked;
430   Options.CheckForUpdates := cbCheckForUpdates.ItemIndex;
431   Options.DaysToShowNewPackages := spDaysToShowNewPackages.Value;
432   Options.ShowRegularIcons := cbRegularIcons.Checked;
433   Options.HintFormOption := rbHintFormOptions.ItemIndex;
434   Options.UseDefaultTheme := cbUseDefaultTheme.Checked;
435 
436   Options.ProxyEnabled := cbProxy.Checked;
437   Options.ProxyServer := edProxyServer.Text;
438   Options.ProxyPort := seProxyPort.Value;
439   Options.ProxyUser := edProxyUser.Text;
440   Options.ProxyPassword := edProxyPassword.Text;
441 
442   Options.OpenSSLDownloadType:= rbOpenSSL.ItemIndex;
443 
444   Options.LocalRepositoryPackages := edLocalRepositoryPackages.Text;
445   Options.LocalRepositoryArchive := edLocalRepositoryArchive.Text;
446   Options.LocalRepositoryUpdate := edLocalRepositoryUpdate.Text;
447   if not DirectoryExists(Options.LocalRepositoryPackagesExpanded) then
448     ForceDirectories(Options.LocalRepositoryPackagesExpanded);
449   if not DirectoryExists(Options.LocalRepositoryArchiveExpanded) then
450     ForceDirectories(Options.LocalRepositoryArchiveExpanded);
451   if not DirectoryExists(Options.LocalRepositoryUpdateExpanded) then
452     ForceDirectories(Options.LocalRepositoryUpdateExpanded);
453 
454   Options.UserProfile := cbSelectProfile.ItemIndex;
455   for I := 0 to lbExcludeFiles.Items.Count - 1 do
456   begin
457     if I = 0 then
458       Options.ExcludedFiles := lbExcludeFiles.Items[I]
459     else
460       Options.ExcludedFiles := Options.ExcludedFiles + ',' + lbExcludeFiles.Items[I];
461   end;
462   for I := 0 to lbExcludeFolders.Items.Count - 1 do
463   begin
464     if I = 0 then
465       Options.ExcludedFolders := lbExcludeFolders.Items[I]
466     else
467       Options.ExcludedFolders := Options.ExcludedFolders + ',' + lbExcludeFolders.Items[I];
468   end;
469   if FHintFormOptionColors.Count > 0 then
470   begin
471     Options.HintFormOptionColors.Clear;
472     Options.HintFormOptionColors.Text := FHintFormOptionColors.Text;
473   end;
474 
475   Options.Save;
476   ModalResult := mrOk;
477 end;
478 
479 procedure TOptionsFrm.SetupControls(const AActivePageIndex: Integer = 0);
480 var
481   I: Integer;
482 begin
483   Self.DoubleBuffered := True;
484   Caption := rsOptions_FrmCaption;
485   pgOptions.ActivePageIndex := AActivePageIndex;
486   tsGeneral.Caption := rsOptions_tsGeneral_Caption;
487   lbRemoteRepository.Caption := rsOptions_lbRemoteRepository_Caption;
488   Options.RemoteRepositoryTmp.Clear;
489   cbRemoteRepository.Clear;
490   for I := 0 to Options.RemoteRepository.Count - 1 do
491     cbRemoteRepository.Items.Add(Options.RemoteRepository.Strings[I]);
492   cbRemoteRepository.ItemIndex := Options.ActiveRepositoryIndex;
493   cbLoadJsonLocally.Checked := Options.LoadJsonLocally;
494   cbForceDownloadExtract.Checked := Options.ForceDownloadAndExtract;
495   cbDeleteZipAfterInstall.Checked := Options.DeleteZipAfterInstall;
496   cbIncompatiblePackages.Checked := Options.IncompatiblePackages;
497   cbAlreadyInstalledPackages.Checked := Options.AlreadyInstalledPackages;
498   cbLoadJsonLocally.Caption := rsOptions_cbLoadJsonLocally_Caption;
499   cbLoadJsonLocally.Hint := rsOptions_cbLoadJsonLocally_Hint;
500   cbForceDownloadExtract.Caption := rsOptions_cbForceDownloadExtract_Caption;
501   cbForceDownloadExtract.Hint := rsOptions_cbForceDownloadExtract_Hint;
502   lbConTimeOut.Caption := rsOptions_lbConTimeOut_Caption;
503   lbConTimeOut.Hint := rsOptions_lbConTimeOut_Hint;
504   spConTimeOut.Value := Options.ConTimeOut;
505   cbDeleteZipAfterInstall.Caption := rsOptions_cbDelete_Caption;
506   cbDeleteZipAfterInstall.Hint := rsOptions_cbDelete_Hint;
507   cbIncompatiblePackages.Caption := rsOption_cbIncompatiblePackage_Caption;
508   cbIncompatiblePackages.Hint := rsOption_cbIncompatiblePackage_Hint;
509   cbAlreadyInstalledPackages.Caption := rsOption_cbcbAlreadyInstalledPackages_Caption;
510   cbAlreadyInstalledPackages.Hint := rsOption_cbcbAlreadyInstalledPackages_Hint;
511   lbUpdates.Caption := rsOptions_lbCheckForUpdates_Caption;
512   cbCheckForUpdates.Clear;
513   cbCheckForUpdates.Items.Add(rsOptions_cbCheckForUpdates_Item0);
514   cbCheckForUpdates.Items.Add(rsOptions_cbCheckForUpdates_Item1);
515   cbCheckForUpdates.Items.Add(rsOptions_cbCheckForUpdates_Item2);
516   cbCheckForUpdates.Items.Add(rsOptions_cbCheckForUpdates_Item3);
517   cbCheckForUpdates.Items.Add(rsOptions_cbCheckForUpdates_Item4);
518   cbCheckForUpdates.Items.Add(rsOptions_cbCheckForUpdates_Item5);
519   cbCheckForUpdates.ItemIndex := Options.CheckForUpdates;
520   if CompareValue(Options.LastUpdate, 0.0, 0.1) <= 0 then
521     lbLastUpdate.Caption := rsOptions_lbLastUpdate_Caption + rsOptions_LastUpdate_Never
522   else
523     lbLastUpdate.Caption := rsOptions_lbLastUpdate_Caption + FormatDateTime('YYYY.MM.DD  hh:mm:ss', Options.LastUpdate);
524   lbDaysToShowNewPackages.Caption := rsOptions_lbDaysToShowNewPackages_Caption;
525   spDaysToShowNewPackages.Value := Options.DaysToShowNewPackages;
526   cbRegularIcons.Checked := Options.ShowRegularIcons;
527   cbRegularIcons.Caption := rsOptions_cbRegular_Caption;
528   rbHintFormOptions.Caption := rsOptions_rbHintFormOptions_Caption;
529   rbHintFormOptions.Items.Clear;
530   rbHintFormOptions.Items.Add(rsOptions_rbHintFormOptions_Item0);
531   rbHintFormOptions.Items.Add(rsOptions_rbHintFormOptions_Item1);
532   rbHintFormOptions.Items.Add(rsOptions_rbHintFormOptions_Item2);
533   rbHintFormOptions.ItemIndex := Options.HintFormOption;
534   cbUseDefaultTheme.Checked := Options.UseDefaultTheme;
535   cbUseDefaultTheme.Caption := rsOptions_cbUseDefaultTheme_Caption;
536 
537   tsProxy.Caption := rsOptions_tsProxy_Caption;
538   cbProxy.Caption := rsOptions_cbProxy_Caption;
539   gbProxySettings.Caption := rsOptions_gbProxySettings_Caption;
540   lbServer.Caption := rsOptions_lbServer_Caption;
541   lbPort.Caption := rsOptions_lbPort_Caption;
542   lbUserName.Caption := rsOptions_lbUsername_Caption;
543   lbPassword.Caption := rsOptions_lbPassword_Caption;
544   cbProxy.Checked := Options.ProxyEnabled;
545   gbProxySettings.Enabled := Options.ProxyEnabled;
546   edProxyServer.Text := Options.ProxyServer;
547   seProxyPort.Value := Options.ProxyPort;
548   //seProxyPort.Top := edProxyServer.Top + (edProxyServer.Height - seProxyPort.Height) div 2;
549   edProxyUser.Text := Options.ProxyUser;
550   edProxyPassword.Text := Options.ProxyPassword;
551 
552   rbOpenSSL.Caption := rsOpenSSLFrm_lbMessage1_Caption;
553   rbOpenSSL.Items.Clear;
554   rbOpenSSL.Items.Add(rsOptions_rbOpenSSL_Item0);
555   rbOpenSSL.Items.Add(rsOptions_rbOpenSSL_Item1);
556   rbOpenSSL.Items.Add(rsOptions_rbOpenSSL_Item2);
557   rbOpenSSL.ItemIndex := Options.OpenSSLDownloadType;
558   {$IFDEF MSWINDOWS}
559   tsOpenSSL.TabVisible := True;
560   {$ELSE}
561   tsOpenSSL.TabVisible := False;
562   {$ENDIF}
563 
564   tsFolders.Caption := rsOptions_tsFolders_Caption;
565   lbLocalRepositoryPackages.Caption := rsOptions_lbLocalRepositoryPackages_Caption;
566   edLocalRepositoryPackages.Hint := rsOptions_edLocalRepositoryPackages_Hint;
567   lbLocalRepositoryArchive.Caption := rsOptions_lbLocalRepositoryArchive_Caption;
568   edLocalRepositoryArchive.Hint := rsOptions_edLocalRepositoryArchive_Hint;
569   lbLocalRepositoryUpdate.Caption := rsOptions_lbLocalRepositoryUpdate_Caption;
570   edLocalRepositoryUpdate.Hint := rsOptions_edLocalRepositoryUpdate_Hint;
571   edLocalRepositoryPackages.Text := Options.LocalRepositoryPackages;
572   edLocalRepositoryArchive.Text := Options.LocalRepositoryArchive;
573   edLocalRepositoryUpdate.Text := Options.LocalRepositoryUpdate;
574 
575   tsProfiles.Caption := rsOptions_tsProfiles_Caption;
576   lbSelectProfile.Caption := rsOptions_lbSelectProfile_Caption;
577   pnProfilesMain.DoubleBuffered := True;
578   pnProfilesLeft.DoubleBuffered := True;
579   pnProfilesTop.DoubleBuffered := True;
580   cbSelectProfile.Clear;
581   cbSelectProfile.Items.Add(rsOptions_cbSelectProfile_Item0);
582   cbSelectProfile.Items.Add(rsOptions_cbSelectProfile_Item1);
583   cbSelectProfile.ItemIndex := Options.UserProfile;
584   cbSelectProfile.Hint := rsOptions_cbSelectProfile_Hint;
585   lbFilterFiles.Caption := rsOptions_lbFilterFiles_Caption;
586   lbFilterDirs.Caption := rsOptions_lbFilterDirs_Caption;
587   bFilesAdd.Caption := rsOptions_bAdd_Caption;
588   bFilesEdit.Caption := rsOptions_bEdit_Caption;
589   bFilesDelete.Caption := rsOptions_bDelete_Caption;
590   bFoldersAdd.Caption := rsOptions_bAdd_Caption;
591   bFoldersEdit.Caption := rsOptions_bEdit_Caption;
592   bFoldersDelete.Caption := rsOptions_bDelete_Caption;
593   lbExcludeFiles.Hint := rsOptions_lbExcludeFiles_Hint;
594   lbExcludeFiles.Items.Delimiter := ',';
595   lbExcludeFiles.Items.StrictDelimiter := True;
596   lbExcludeFiles.Items.DelimitedText := Options.ExcludedFiles;
597   lbExcludeFolders.Hint := rsOptions_lbExcludeFolders_Hint;
598   lbExcludeFolders.Items.Delimiter := ',';
599   lbExcludeFolders.Items.StrictDelimiter := True;
600   lbExcludeFolders.Items.DelimitedText := Options.ExcludedFolders;
601   pnProfilesMain.Visible := Options.UserProfile = 1;
602   bColors.Caption := rsOptions_bColors_Caption;
603   bpOptions.HelpButton.Caption := rsOptions_bpOptions_bHelp;
604   IDEImages.AssignImage(bpOptions.HelpButton, 'restore_defaults');
605   bpOptions.HelpButton.Kind := bkCustom;
606   bpOptions.HelpButton.Glyph.Clear;
607   SetupColors;
608 end;
609 
610 procedure TOptionsFrm.pnProfilesMainResize(Sender: TObject);
611 begin
612   pnProfilesLeft.Width := pnProfilesMain.Width div 2;
613 end;
614 
615 procedure TOptionsFrm.pnProfilesTopResize(Sender: TObject);
616 begin
617   //cbSelectProfile.Left := lbSelectProfile.Left + lbSelectProfile.Width + 10;
618 end;
619 
620 end.
621 
622