File: opkman_optionsfrm.pas

package info (click to toggle)
lazarus 2.0.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 214,460 kB
  • sloc: pascal: 1,862,622; xml: 265,709; cpp: 56,595; sh: 3,008; java: 609; makefile: 535; perl: 297; sql: 222; ansic: 137
file content (589 lines) | stat: -rw-r--r-- 20,308 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
{
 ***************************************************************************
 *                                                                         *
 *   This source is free software; you can redistribute it and/or modify   *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This code is distributed in the hope that it will be useful, but      *
 *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
 *   General Public License for more details.                              *
 *                                                                         *
 *   A copy of the GNU General Public License is available on the World    *
 *   Wide Web at <http://www.gnu.org/copyleft/gpl.html>. You can also      *
 *   obtain it by writing to the Free Software Foundation,                 *
 *   Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1335, USA.   *
 *                                                                         *
 ***************************************************************************

 Author: Balázs Székely
 Abstract:
   Implementation of the options dialog.
}

unit opkman_optionsfrm;

{$mode objfpc}{$H+}

interface

uses
  SysUtils, Math, Graphics, Classes,
  // ideintf
  MacroIntf, IDEImagesIntf,
  // LCL
  Forms, Controls, Dialogs, StdCtrls, ExtCtrls, Spin, ComCtrls, EditBtn, Menus,
  ButtonPanel, Buttons,
  // LazUtils
  LazFileUtils,
  // OpkMan
  opkman_options, opkman_common, opkman_const, opkman_repositories, opkman_colorsfrm;

type

  { TOptionsFrm }

  TOptionsFrm = class(TForm)
    Bevel1: TBevel;
    Bevel2: TBevel;
    Bevel3: TBevel;
    bFilesAdd: TButton;
    bFilesDelete: TButton;
    bFilesEdit: TButton;
    bFoldersAdd: TButton;
    bFoldersDelete: TButton;
    bFoldersEdit: TButton;
    bOpen: TButton;
    bpOptions: TButtonPanel;
    bColors: TButton;
    cbProxy: TCheckBox;
    cbForceDownloadExtract: TCheckBox;
    cbDeleteZipAfterInstall: TCheckBox;
    cbCheckForUpdates: TComboBox;
    cbUseDefaultTheme: TCheckBox;
    cbRemoteRepository: TComboBox;
    cbSelectProfile: TComboBox;
    cbRegularIcons: TCheckBox;
    edLocalRepositoryUpdate: TDirectoryEdit;
    edLocalRepositoryPackages: TDirectoryEdit;
    edLocalRepositoryArchive: TDirectoryEdit;
    edProxyPassword: TEdit;
    edProxyServer: TEdit;
    edProxyUser: TEdit;
    gbProxySettings: TGroupBox;
    lbConTimeOut: TLabel;
    lbFilterDirs: TLabel;
    lbFilterFiles: TLabel;
    lbLastUpdate: TLabel;
    lbSelectProfile: TLabel;
    lbUpdates: TLabel;
    lbLocalRepositoryArchive: TLabel;
    lbLocalRepositoryUpdate: TLabel;
    lbRemoteRepository: TLabel;
    lbServer: TLabel;
    lbLocalRepositoryPackages: TLabel;
    lbDaysToShowNewPackages: TLabel;
    lbUserName: TLabel;
    lbPort: TLabel;
    lbPassword: TLabel;
    lbExcludeFiles: TListBox;
    lbExcludeFolders: TListBox;
    pnRepositories: TPanel;
    pnProfilesRight: TPanel;
    pnProfilesTop: TPanel;
    pnProfiles: TPanel;
    pnFolders: TPanel;
    pnProxy: TPanel;
    pnGeneral: TPanel;
    pgOptions: TPageControl;
    pnBottom: TPanel;
    pnProfilesMain: TPanel;
    pnProfilesLeft: TPanel;
    rbHintFormOptions: TRadioGroup;
    SDD: TSelectDirectoryDialog;
    seProxyPort: TSpinEdit;
    spDaysToShowNewPackages: TSpinEdit;
    spConTimeOut: TSpinEdit;
    tsFolders: TTabSheet;
    tsProfiles: TTabSheet;
    tsGeneral: TTabSheet;
    tsProxy: TTabSheet;
    procedure bColorsClick(Sender: TObject);
    procedure bFilesAddClick(Sender: TObject);
    procedure bFilesDeleteClick(Sender: TObject);
    procedure bFilesEditClick(Sender: TObject);
    procedure bOpenClick(Sender: TObject);
    procedure cbProxyChange(Sender: TObject);
    procedure cbSelectProfileChange(Sender: TObject);
    procedure edLocalRepositoryPackagesButtonClick(Sender:TObject);
    procedure edRemoteRepositoryKeyPress(Sender: TObject; var Key: char);
    procedure FormCreate(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
    procedure FormKeyPress(Sender: TObject; var Key: char);
    procedure HelpButtonClick(Sender: TObject);
    procedure OKButtonClick(Sender: TObject);
    procedure pnProfilesMainResize(Sender: TObject);
    procedure pnProfilesTopResize(Sender: TObject);
  private
    FHintFormOptionColors: TStringList;
    function GetSelectedText(AListBox: TListBox; var AIndex: Integer): String;
    procedure SetupColors;
  public
    procedure SetupControls(const AActivePageIndex: Integer = 0);
  end;

var
  OptionsFrm: TOptionsFrm;

implementation

{$R *.lfm}

{ TOptionsFrm }

procedure TOptionsFrm.bOpenClick(Sender: TObject);
var
  I: Integer;
begin
  RepositoriesFrm := TRepositoriesFrm.Create(Self);
  try
    if RepositoriesFrm.ShowModal = mrOk then
    begin
      cbRemoteRepository.Clear;
      for I := 0 to Options.RemoteRepositoryTmp.Count - 1 do
        cbRemoteRepository.Items.Add(Options.RemoteRepositoryTmp.Strings[I]);
      if Options.ActiveRepositoryIndex <= cbRemoteRepository.Items.Count - 1 then
        cbRemoteRepository.ItemIndex := Options.ActiveRepositoryIndex
      else
      begin
        cbRemoteRepository.ItemIndex := 0;
        Options.ActiveRepositoryIndex := 0;
      end;
    end;
  finally
    RepositoriesFrm.Free;
  end;
end;

function TOptionsFrm.GetSelectedText(AListBox: TListBox; var AIndex: Integer): String;
var
  I: Integer;
begin
  Result := '';
  for I := 0 to AListBox.Count - 1 do
  begin
    if AListBox.Selected[I] then
    begin
      Result := AListBox.Items.Strings[I];
      AIndex := I;
      Break;
    end;
  end;
end;

procedure TOptionsFrm.SetupColors;
begin
  if not Options.UseDefaultTheme then
  begin
    Self.Color := clBtnFace;
    tsGeneral.Color := clBtnFace;
    tsProxy.Color := clBtnFace;
    tsFolders.Color := clBtnFace;
    tsProfiles.Color := clBtnFace;
    pnGeneral.Color := clBtnFace;
    pnProxy.Color := clBtnFace;
    pnFolders.Color := clBtnFace;
    pnProfiles.Color := clBtnFace;
    lbExcludeFiles.Color := clBtnFace;
    lbExcludeFolders.Color := clBtnFace;
  end;
end;

procedure TOptionsFrm.bFilesAddClick(Sender: TObject);
var
  Value: String;
  Index: Integer;
  ListBox: TListBox;
begin
  case (Sender as TButton).Tag of
    0: begin
         ListBox := lbExcludeFiles;
         Value := InputBox(rsOptions_InputBox_Caption, rsOptions_InputBox_Text0, '*.');
       end;
    1: begin
         ListBox := lbExcludeFolders;
         Value := InputBox(rsOptions_InputBox_Caption, rsOptions_InputBox_Text1, '');
       end;
  end;
  if Value <> '' then
  begin
    Index := ListBox.Items.Add(Value);
    ListBox.Selected[Index] := True;
  end;
end;

procedure TOptionsFrm.bColorsClick(Sender: TObject);
begin
  ColorsFrm := TColorsFrm.Create(Self);
  try
    if FHintFormOptionColors.Count > 0 then
      ColorsFrm.LoadColors(FHintFormOptionColors)
    else
      ColorsFrm.LoadColors(Options.HintFormOptionColors);
    if ColorsFrm.ShowModal = mrOK then
    begin
      FHintFormOptionColors.Clear;
      FHintFormOptionColors.Add(ColorToString(ColorsFrm.shName.Brush.Color));
      FHintFormOptionColors.Add(ColorToString(ColorsFrm.shDescription.Brush.Color));
      FHintFormOptionColors.Add(ColorToString(ColorsFrm.shLicense.Brush.Color));
    end;
  finally
    ColorsFrm.Free;
  end;
end;

procedure TOptionsFrm.bFilesEditClick(Sender: TObject);
var
  Value: String;
  Index: Integer;
  MsgInfo: String;
  MsgTxt: String;
  ListBox: TListBox;
begin
  case (Sender as TButton).Tag of
    0: begin
         MsgInfo := rsOptions_InputBox_Info0;
         MsgTxt := rsOptions_InputBox_Text0;
         Listbox := lbExcludeFiles;
       end;
    1: begin
         MsgInfo := rsOptions_InputBox_Info1;
         MsgTxt := rsOptions_InputBox_Text1;
         ListBox := lbExcludeFolders;
       end;
  end;
  if ListBox.SelCount = 0 then
  begin
    MessageDlgEx(MsgInfo, mtInformation, [mbOk], Self);
    ListBox.SetFocus;
    Exit;
  end;
  Index := -1;
  Value := InputBox(rsOptions_InputBox_Caption, MsgTxt, GetSelectedText(ListBox, Index));
  if (Value <> '') and (Index <> -1) then
  begin
    ListBox.Sorted := False;
    ListBox.Items[Index] := Value;
    ListBox.Sorted := True;
    Index := ListBox.Items.IndexOf(Value);
    ListBox.Selected[Index] := True;
  end;
end;

procedure TOptionsFrm.bFilesDeleteClick(Sender: TObject);
var
  MsgConf: String;
  MsgInfo: String;
  ListBox: TListBox;
  Value: String;
  Index: Integer;
begin
  case (Sender as TButton).Tag of
     0: begin
          MsgInfo := rsOptions_InputBox_Info0;
          MsgConf := rsOptions_InputBox_Conf0;
          ListBox := lbExcludeFiles;
        end;
     1: begin
          MsgInfo := rsOptions_InputBox_Info1;
          MsgConf := rsOptions_InputBox_Conf1;
          ListBox := lbExcludeFolders;
        end;
   end;
  if ListBox.SelCount = 0 then
  begin
    MessageDlgEx(MsgInfo, mtInformation, [mbOk], Self);
    ListBox.SetFocus;
    Exit;
  end;
  Index := -1;
  Value := GetSelectedText(ListBox, Index);
  if (Value <> '') and (Index <> -1) then
    if MessageDlgEx(Format(MsgConf, [Value]), mtConfirmation, [mbYes, mbNo], Self) = mrYes then
      ListBox.Items.Delete(Index);
end;

procedure TOptionsFrm.cbProxyChange(Sender: TObject);
begin
  gbProxySettings.Enabled:= cbProxy.Checked;
end;

procedure TOptionsFrm.cbSelectProfileChange(Sender: TObject);
begin
  pnProfilesMain.Visible := cbSelectProfile.ItemIndex = 1;
end;

procedure TOptionsFrm.edLocalRepositoryPackagesButtonClick(Sender:TObject);
var Sendert:TDirectoryEdit;
    d:string;
begin
  Sendert:=sender as TDirectoryEdit;
  d:=Sendert.Directory;
  IDEMacros.SubstituteMacros(d);
  Sendert.Directory:=d;
end;

procedure TOptionsFrm.edRemoteRepositoryKeyPress(Sender: TObject; var Key: char);
begin
  if Key = #13 then
    OKButtonClick(bpOptions.OKButton);
end;

procedure TOptionsFrm.FormCreate(Sender: TObject);
begin
  FHintFormOptionColors := TStringList.Create;
end;

procedure TOptionsFrm.FormDestroy(Sender: TObject);
begin
  FHintFormOptionColors.Free;
end;

procedure TOptionsFrm.FormKeyPress(Sender: TObject; var Key: char);
begin
  if Key = #27 then
    Close;
end;

procedure TOptionsFrm.HelpButtonClick(Sender: TObject);
begin
  if MessageDlgEx(rsOptions_RestoreDefaults_Conf, mtInformation, [mbYes, mbNo], Self) = mrYes then
  begin
    Options.LoadDefault;
    Options.CreateMissingPaths;
    SetupControls;
  end;
end;

procedure TOptionsFrm.OKButtonClick(Sender: TObject);
var
  I: Integer;
begin
  ModalResult := mrNone;
  if Trim(cbRemoteRepository.Text)  = '' then
  begin
    MessageDlgEx(rsOptions_RemoteRepository_Information, mtInformation, [mbOk], Self);
    cbRemoteRepository.SetFocus;
    Exit;
  end;

  if cbProxy.Checked then
  begin
    if Trim(edProxyServer.Text)  = '' then
    begin
      MessageDlgEx(rsOptions_ProxyServer_Info, mtInformation, [mbOk], Self);
      edProxyServer.SetFocus;
      Exit;
    end;
    if seProxyPort.Value = 0 then
    begin
      MessageDlgEx(rsOptions_ProxyPort_Info, mtInformation, [mbOk], Self);
      seProxyPort.SetFocus;
      Exit;
    end;
  end;

  if Trim(edLocalRepositoryPackages.Text)  = '' then
  begin
    MessageDlgEx(rsOptions_InvalidDirectory_Info, mtInformation, [mbOk], Self);
    edLocalRepositoryPackages.SetFocus;
    Exit;
  end;
  if Trim(edLocalRepositoryArchive.Text)  = '' then
  begin
    MessageDlgEx(rsOptions_InvalidDirectory_Info, mtInformation, [mbOk], Self);
    edLocalRepositoryArchive.SetFocus;
    Exit;
  end;
  if Trim(edLocalRepositoryUpdate.Text)  = '' then
  begin
    MessageDlgEx(rsOptions_InvalidDirectory_Info, mtInformation, [mbOk], Self);
    edLocalRepositoryUpdate.SetFocus;
    Exit;
  end;
  if Options.RemoteRepositoryTmp.Count > 0 then
    Options.RemoteRepository.Text := Options.RemoteRepositoryTmp.Text;
  Options.ActiveRepositoryIndex := cbRemoteRepository.ItemIndex;
  Options.ForceDownloadAndExtract := cbForceDownloadExtract.Checked;
  Options.ConTimeOut := spConTimeOut.Value;
  Options.DeleteZipAfterInstall := cbDeleteZipAfterInstall.Checked;
  Options.CheckForUpdates := cbCheckForUpdates.ItemIndex;
  Options.DaysToShowNewPackages := spDaysToShowNewPackages.Value;
  Options.ShowRegularIcons := cbRegularIcons.Checked;
  Options.HintFormOption := rbHintFormOptions.ItemIndex;
  Options.UseDefaultTheme := cbUseDefaultTheme.Checked;

  Options.ProxyEnabled := cbProxy.Checked;
  Options.ProxyServer := edProxyServer.Text;
  Options.ProxyPort := seProxyPort.Value;
  Options.ProxyUser := edProxyUser.Text;
  Options.ProxyPassword := edProxyPassword.Text;

  Options.LocalRepositoryPackages := edLocalRepositoryPackages.Text;
  Options.LocalRepositoryArchive := edLocalRepositoryArchive.Text;
  Options.LocalRepositoryUpdate := edLocalRepositoryUpdate.Text;
  if not DirectoryExists(Options.LocalRepositoryPackagesExpanded) then
    ForceDirectories(Options.LocalRepositoryPackagesExpanded);
  if not DirectoryExists(Options.LocalRepositoryArchiveExpanded) then
    ForceDirectories(Options.LocalRepositoryArchiveExpanded);
  if not DirectoryExists(Options.LocalRepositoryUpdateExpanded) then
    ForceDirectories(Options.LocalRepositoryUpdateExpanded);

  Options.UserProfile := cbSelectProfile.ItemIndex;
  for I := 0 to lbExcludeFiles.Items.Count - 1 do
  begin
    if I = 0 then
      Options.ExcludedFiles := lbExcludeFiles.Items[I]
    else
      Options.ExcludedFiles := Options.ExcludedFiles + ',' + lbExcludeFiles.Items[I];
  end;
  for I := 0 to lbExcludeFolders.Items.Count - 1 do
  begin
    if I = 0 then
      Options.ExcludedFolders := lbExcludeFolders.Items[I]
    else
      Options.ExcludedFolders := Options.ExcludedFolders + ',' + lbExcludeFolders.Items[I];
  end;
  if FHintFormOptionColors.Count > 0 then
  begin
    Options.HintFormOptionColors.Clear;
    Options.HintFormOptionColors.Text := FHintFormOptionColors.Text;
  end;

  Options.Save;
  ModalResult := mrOk;
end;

procedure TOptionsFrm.SetupControls(const AActivePageIndex: Integer = 0);
var
  I: Integer;
begin
  Self.DoubleBuffered := True;
  Caption := rsOptions_FrmCaption;
  pgOptions.ActivePageIndex := AActivePageIndex;
  tsGeneral.Caption := rsOptions_tsGeneral_Caption;
  lbRemoteRepository.Caption := rsOptions_lbRemoteRepository_Caption;
  Options.RemoteRepositoryTmp.Clear;
  cbRemoteRepository.Clear;
  for I := 0 to Options.RemoteRepository.Count - 1 do
    cbRemoteRepository.Items.Add(Options.RemoteRepository.Strings[I]);
  cbRemoteRepository.ItemIndex := Options.ActiveRepositoryIndex;
  cbForceDownloadExtract.Checked := Options.ForceDownloadAndExtract;
  cbDeleteZipAfterInstall.Checked := Options.DeleteZipAfterInstall;
  cbForceDownloadExtract.Caption := rsOptions_cbForceDownloadExtract_Caption;
  cbForceDownloadExtract.Hint := rsOptions_cbForceDownloadExtract_Hint;
  lbConTimeOut.Caption := rsOptions_lbConTimeOut_Caption;
  lbConTimeOut.Hint := rsOptions_lbConTimeOut_Hint;
  spConTimeOut.Value := Options.ConTimeOut;
  cbDeleteZipAfterInstall.Caption := rsOptions_cbDelete_Caption;
  cbDeleteZipAfterInstall.Hint := rsOptions_cbDelete_Hint;
  lbUpdates.Caption := rsOptions_lbCheckForUpdates_Caption;
  cbCheckForUpdates.Clear;
  cbCheckForUpdates.Items.Add(rsOptions_cbCheckForUpdates_Item0);
  cbCheckForUpdates.Items.Add(rsOptions_cbCheckForUpdates_Item1);
  cbCheckForUpdates.Items.Add(rsOptions_cbCheckForUpdates_Item2);
  cbCheckForUpdates.Items.Add(rsOptions_cbCheckForUpdates_Item3);
  cbCheckForUpdates.Items.Add(rsOptions_cbCheckForUpdates_Item4);
  cbCheckForUpdates.Items.Add(rsOptions_cbCheckForUpdates_Item5);
  cbCheckForUpdates.ItemIndex := Options.CheckForUpdates;
  if CompareValue(Options.LastUpdate, 0.0, 0.1) <= 0 then
    lbLastUpdate.Caption := rsOptions_lbLastUpdate_Caption + rsOptions_LastUpdate_Never
  else
    lbLastUpdate.Caption := rsOptions_lbLastUpdate_Caption + FormatDateTime('YYYY.MM.DD  hh:mm:ss', Options.LastUpdate);
  lbDaysToShowNewPackages.Caption := rsOptions_lbDaysToShowNewPackages_Caption;
  spDaysToShowNewPackages.Value := Options.DaysToShowNewPackages;
  cbRegularIcons.Checked := Options.ShowRegularIcons;
  cbRegularIcons.Caption := rsOptions_cbRegular_Caption;
  rbHintFormOptions.Caption := rsOptions_rbHintFormOptions_Caption;
  rbHintFormOptions.Items.Clear;
  rbHintFormOptions.Items.Add(rsOptions_rbHintFormOptions_Item0);
  rbHintFormOptions.Items.Add(rsOptions_rbHintFormOptions_Item1);
  rbHintFormOptions.Items.Add(rsOptions_rbHintFormOptions_Item2);
  rbHintFormOptions.ItemIndex := Options.HintFormOption;
  cbUseDefaultTheme.Checked := Options.UseDefaultTheme;
  cbUseDefaultTheme.Caption := rsOptions_cbUseDefaultTheme_Caption;
  tsProxy.Caption := rsOptions_tsProxy_Caption;
  cbProxy.Caption := rsOptions_cbProxy_Caption;
  gbProxySettings.Caption := rsOptions_gbProxySettings_Caption;
  lbServer.Caption := rsOptions_lbServer_Caption;
  lbPort.Caption := rsOptions_lbPort_Caption;
  lbUserName.Caption := rsOptions_lbUsername_Caption;
  lbPassword.Caption := rsOptions_lbPassword_Caption;
  cbProxy.Checked := Options.ProxyEnabled;
  gbProxySettings.Enabled := Options.ProxyEnabled;
  edProxyServer.Text := Options.ProxyServer;
  seProxyPort.Value := Options.ProxyPort;
  //seProxyPort.Top := edProxyServer.Top + (edProxyServer.Height - seProxyPort.Height) div 2;
  edProxyUser.Text := Options.ProxyUser;
  edProxyPassword.Text := Options.ProxyPassword;

  tsFolders.Caption := rsOptions_tsFolders_Caption;
  lbLocalRepositoryPackages.Caption := rsOptions_lbLocalRepositoryPackages_Caption;
  edLocalRepositoryPackages.Hint := rsOptions_edLocalRepositoryPackages_Hint;
  lbLocalRepositoryArchive.Caption := rsOptions_lbLocalRepositoryArchive_Caption;
  edLocalRepositoryArchive.Hint := rsOptions_edLocalRepositoryArchive_Hint;
  lbLocalRepositoryUpdate.Caption := rsOptions_lbLocalRepositoryUpdate_Caption;
  edLocalRepositoryUpdate.Hint := rsOptions_edLocalRepositoryUpdate_Hint;
  edLocalRepositoryPackages.Text := Options.LocalRepositoryPackages;
  edLocalRepositoryArchive.Text := Options.LocalRepositoryArchive;
  edLocalRepositoryUpdate.Text := Options.LocalRepositoryUpdate;

  tsProfiles.Caption := rsOptions_tsProfiles_Caption;
  lbSelectProfile.Caption := rsOptions_lbSelectProfile_Caption;
  pnProfilesMain.DoubleBuffered := True;
  pnProfilesLeft.DoubleBuffered := True;
  pnProfilesTop.DoubleBuffered := True;
  cbSelectProfile.Clear;
  cbSelectProfile.Items.Add(rsOptions_cbSelectProfile_Item0);
  cbSelectProfile.Items.Add(rsOptions_cbSelectProfile_Item1);
  cbSelectProfile.ItemIndex := Options.UserProfile;
  cbSelectProfile.Hint := rsOptions_cbSelectProfile_Hint;
  lbFilterFiles.Caption := rsOptions_lbFilterFiles_Caption;
  lbFilterDirs.Caption := rsOptions_lbFilterDirs_Caption;
  bFilesAdd.Caption := rsOptions_bAdd_Caption;
  bFilesEdit.Caption := rsOptions_bEdit_Caption;
  bFilesDelete.Caption := rsOptions_bDelete_Caption;
  bFoldersAdd.Caption := rsOptions_bAdd_Caption;
  bFoldersEdit.Caption := rsOptions_bEdit_Caption;
  bFoldersDelete.Caption := rsOptions_bDelete_Caption;
  lbExcludeFiles.Hint := rsOptions_lbExcludeFiles_Hint;
  lbExcludeFiles.Items.Delimiter := ',';
  lbExcludeFiles.Items.StrictDelimiter := True;
  lbExcludeFiles.Items.DelimitedText := Options.ExcludedFiles;
  lbExcludeFolders.Hint := rsOptions_lbExcludeFolders_Hint;
  lbExcludeFolders.Items.Delimiter := ',';
  lbExcludeFolders.Items.StrictDelimiter := True;
  lbExcludeFolders.Items.DelimitedText := Options.ExcludedFolders;
  pnProfilesMain.Visible := Options.UserProfile = 1;
  bColors.Caption := rsOptions_bColors_Caption;
  bpOptions.HelpButton.Caption := rsOptions_bpOptions_bHelp;
  IDEImages.AssignImage(bpOptions.HelpButton, 'restore_defaults');
  bpOptions.HelpButton.Kind := bkCustom;
  bpOptions.HelpButton.Glyph.Clear;
  SetupColors;
end;

procedure TOptionsFrm.pnProfilesMainResize(Sender: TObject);
begin
  pnProfilesLeft.Width := pnProfilesMain.Width div 2;
end;

procedure TOptionsFrm.pnProfilesTopResize(Sender: TObject);
begin
  //cbSelectProfile.Left := lbSelectProfile.Left + lbSelectProfile.Width + 10;
end;

end.