mirror of
				https://gitlab.com/freepascal.org/lazarus/lazarus.git
				synced 2025-11-04 09:39:43 +01:00 
			
		
		
		
	Opkman: ShowHintfrm: localize "description" and "license". OptionsFrm: GUI tweak.
git-svn-id: trunk@56814 -
This commit is contained in:
		
							parent
							
								
									e94bf52f12
								
							
						
					
					
						commit
						ee02d44114
					
				@ -292,12 +292,13 @@ resourcestring
 | 
			
		||||
  rsOptions_lbDaysToShowNewPackages_Caption = 'Show different icon for newly added packages for (days):';
 | 
			
		||||
  rsOptions_cbRegular_Caption = 'Show regular icon for newly added packages after install';
 | 
			
		||||
  rsOptions_cbUseDefaultTheme_Caption = 'Use default theme manager';
 | 
			
		||||
  rsOptions_lbHintFrm = 'Show quick info for repository packages';
 | 
			
		||||
  rsOptions_rbHintFormOptions_Caption = 'Quick info for repository packages';
 | 
			
		||||
  rsOptions_rbHintFormOptions_Item0 = 'Behaves like a regular hint window';
 | 
			
		||||
  rsOptions_rbHintFormOptions_Item1 = 'It''s triggered by SHIFT, moves with the mouse';
 | 
			
		||||
  rsOptions_rbHintFormOptions_Item2 = 'Off';
 | 
			
		||||
  rsOptions_lbFilterFiles_Caption = 'Excluded files (packages)';
 | 
			
		||||
  rsOptions_lbFilterDirs_Caption = 'Excluded folders (packages)';
 | 
			
		||||
  rsOptions_bpOptions_bHelp = 'Restore defaults';
 | 
			
		||||
  rsOptions_bAdd_Caption = 'Add';
 | 
			
		||||
  rsOptions_bEdit_Caption = 'Edit';
 | 
			
		||||
  rsOptions_bDelete_Caption = 'Delete';
 | 
			
		||||
 | 
			
		||||
@ -1,12 +1,12 @@
 | 
			
		||||
object OptionsFrm: TOptionsFrm
 | 
			
		||||
  Left = 428
 | 
			
		||||
  Height = 555
 | 
			
		||||
  Height = 556
 | 
			
		||||
  Top = 141
 | 
			
		||||
  Width = 590
 | 
			
		||||
  Width = 635
 | 
			
		||||
  BorderIcons = [biSystemMenu]
 | 
			
		||||
  Caption = 'Options'
 | 
			
		||||
  ClientHeight = 555
 | 
			
		||||
  ClientWidth = 590
 | 
			
		||||
  ClientHeight = 556
 | 
			
		||||
  ClientWidth = 635
 | 
			
		||||
  Constraints.MinHeight = 300
 | 
			
		||||
  Constraints.MinWidth = 475
 | 
			
		||||
  KeyPreview = True
 | 
			
		||||
@ -16,70 +16,40 @@ object OptionsFrm: TOptionsFrm
 | 
			
		||||
  LCLVersion = '1.9.0.0'
 | 
			
		||||
  object pnBottom: TPanel
 | 
			
		||||
    Left = 0
 | 
			
		||||
    Height = 31
 | 
			
		||||
    Top = 524
 | 
			
		||||
    Width = 590
 | 
			
		||||
    Height = 46
 | 
			
		||||
    Top = 510
 | 
			
		||||
    Width = 635
 | 
			
		||||
    Align = alBottom
 | 
			
		||||
    AutoSize = True
 | 
			
		||||
    BevelOuter = bvNone
 | 
			
		||||
    ClientHeight = 31
 | 
			
		||||
    ClientWidth = 590
 | 
			
		||||
    ClientHeight = 46
 | 
			
		||||
    ClientWidth = 635
 | 
			
		||||
    TabOrder = 1
 | 
			
		||||
    object bOk: TButton
 | 
			
		||||
      AnchorSideRight.Control = bCancel
 | 
			
		||||
      AnchorSideBottom.Control = bRestore
 | 
			
		||||
      AnchorSideBottom.Side = asrBottom
 | 
			
		||||
      Left = 418
 | 
			
		||||
      Height = 25
 | 
			
		||||
      Top = 0
 | 
			
		||||
      Width = 80
 | 
			
		||||
      Anchors = [akTop, akRight, akBottom]
 | 
			
		||||
      AutoSize = True
 | 
			
		||||
      BorderSpacing.Right = 6
 | 
			
		||||
      Caption = 'OK'
 | 
			
		||||
      Constraints.MinWidth = 80
 | 
			
		||||
      OnClick = bOkClick
 | 
			
		||||
      TabOrder = 1
 | 
			
		||||
    end
 | 
			
		||||
    object bCancel: TButton
 | 
			
		||||
      AnchorSideRight.Control = pnBottom
 | 
			
		||||
      AnchorSideRight.Side = asrBottom
 | 
			
		||||
      AnchorSideBottom.Control = bRestore
 | 
			
		||||
      AnchorSideBottom.Side = asrBottom
 | 
			
		||||
      Left = 504
 | 
			
		||||
      Height = 25
 | 
			
		||||
      Top = 0
 | 
			
		||||
      Width = 80
 | 
			
		||||
      Anchors = [akTop, akRight, akBottom]
 | 
			
		||||
      AutoSize = True
 | 
			
		||||
      BorderSpacing.Right = 6
 | 
			
		||||
      Caption = 'Cancel'
 | 
			
		||||
      Constraints.MinWidth = 80
 | 
			
		||||
      ModalResult = 2
 | 
			
		||||
      TabOrder = 2
 | 
			
		||||
    end
 | 
			
		||||
    object bRestore: TButton
 | 
			
		||||
      AnchorSideLeft.Control = pnBottom
 | 
			
		||||
      AnchorSideBottom.Control = pnBottom
 | 
			
		||||
      AnchorSideBottom.Side = asrBottom
 | 
			
		||||
    object bpOptions: TButtonPanel
 | 
			
		||||
      Left = 6
 | 
			
		||||
      Height = 25
 | 
			
		||||
      Top = 0
 | 
			
		||||
      Width = 110
 | 
			
		||||
      Anchors = [akTop, akLeft, akBottom]
 | 
			
		||||
      AutoSize = True
 | 
			
		||||
      BorderSpacing.Left = 6
 | 
			
		||||
      BorderSpacing.Bottom = 6
 | 
			
		||||
      Caption = 'Restore defaults'
 | 
			
		||||
      OnClick = bRestoreClick
 | 
			
		||||
      Height = 34
 | 
			
		||||
      Top = 6
 | 
			
		||||
      Width = 623
 | 
			
		||||
      OKButton.Name = 'OKButton'
 | 
			
		||||
      OKButton.DefaultCaption = True
 | 
			
		||||
      OKButton.OnClick = OKButtonClick
 | 
			
		||||
      HelpButton.Name = 'HelpButton'
 | 
			
		||||
      HelpButton.Caption = '&Restore defaults'
 | 
			
		||||
      HelpButton.DefaultCaption = False
 | 
			
		||||
      HelpButton.OnClick = HelpButtonClick
 | 
			
		||||
      CloseButton.Name = 'CloseButton'
 | 
			
		||||
      CloseButton.DefaultCaption = True
 | 
			
		||||
      CancelButton.Name = 'CancelButton'
 | 
			
		||||
      CancelButton.DefaultCaption = True
 | 
			
		||||
      TabOrder = 0
 | 
			
		||||
      ShowButtons = [pbOK, pbCancel, pbHelp]
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
  object pgOptions: TPageControl
 | 
			
		||||
    Left = 6
 | 
			
		||||
    Height = 512
 | 
			
		||||
    Height = 498
 | 
			
		||||
    Top = 6
 | 
			
		||||
    Width = 578
 | 
			
		||||
    Width = 623
 | 
			
		||||
    ActivePage = tsGeneral
 | 
			
		||||
    Align = alClient
 | 
			
		||||
    BorderSpacing.Around = 6
 | 
			
		||||
@ -87,17 +57,17 @@ object OptionsFrm: TOptionsFrm
 | 
			
		||||
    TabOrder = 0
 | 
			
		||||
    object tsGeneral: TTabSheet
 | 
			
		||||
      Caption = 'General'
 | 
			
		||||
      ClientHeight = 484
 | 
			
		||||
      ClientWidth = 570
 | 
			
		||||
      ClientHeight = 470
 | 
			
		||||
      ClientWidth = 615
 | 
			
		||||
      object pnGeneral: TPanel
 | 
			
		||||
        Left = 0
 | 
			
		||||
        Height = 484
 | 
			
		||||
        Height = 470
 | 
			
		||||
        Top = 0
 | 
			
		||||
        Width = 570
 | 
			
		||||
        Width = 615
 | 
			
		||||
        Align = alClient
 | 
			
		||||
        BevelOuter = bvNone
 | 
			
		||||
        ClientHeight = 484
 | 
			
		||||
        ClientWidth = 570
 | 
			
		||||
        ClientHeight = 470
 | 
			
		||||
        ClientWidth = 615
 | 
			
		||||
        ParentColor = False
 | 
			
		||||
        TabOrder = 0
 | 
			
		||||
        object lbRemoteRepository: TLabel
 | 
			
		||||
@ -194,14 +164,14 @@ object OptionsFrm: TOptionsFrm
 | 
			
		||||
          Left = 6
 | 
			
		||||
          Height = 23
 | 
			
		||||
          Top = 27
 | 
			
		||||
          Width = 558
 | 
			
		||||
          Width = 603
 | 
			
		||||
          Anchors = [akTop, akLeft, akRight]
 | 
			
		||||
          AutoSize = True
 | 
			
		||||
          BorderSpacing.Top = 4
 | 
			
		||||
          BorderSpacing.Right = 6
 | 
			
		||||
          BevelOuter = bvNone
 | 
			
		||||
          ClientHeight = 23
 | 
			
		||||
          ClientWidth = 558
 | 
			
		||||
          ClientWidth = 603
 | 
			
		||||
          TabOrder = 0
 | 
			
		||||
          object cbRemoteRepository: TComboBox
 | 
			
		||||
            AnchorSideLeft.Control = pnRepositories
 | 
			
		||||
@ -210,7 +180,7 @@ object OptionsFrm: TOptionsFrm
 | 
			
		||||
            Left = 0
 | 
			
		||||
            Height = 23
 | 
			
		||||
            Top = 0
 | 
			
		||||
            Width = 495
 | 
			
		||||
            Width = 540
 | 
			
		||||
            Anchors = [akTop, akLeft, akRight]
 | 
			
		||||
            BorderSpacing.Right = 2
 | 
			
		||||
            ItemHeight = 15
 | 
			
		||||
@ -225,7 +195,7 @@ object OptionsFrm: TOptionsFrm
 | 
			
		||||
            AnchorSideRight.Side = asrBottom
 | 
			
		||||
            AnchorSideBottom.Control = cbRemoteRepository
 | 
			
		||||
            AnchorSideBottom.Side = asrBottom
 | 
			
		||||
            Left = 497
 | 
			
		||||
            Left = 542
 | 
			
		||||
            Height = 23
 | 
			
		||||
            Top = 0
 | 
			
		||||
            Width = 61
 | 
			
		||||
@ -279,7 +249,7 @@ object OptionsFrm: TOptionsFrm
 | 
			
		||||
          AnchorSideTop.Side = asrBottom
 | 
			
		||||
          Left = 6
 | 
			
		||||
          Height = 19
 | 
			
		||||
          Top = 419
 | 
			
		||||
          Top = 399
 | 
			
		||||
          Width = 116
 | 
			
		||||
          BorderSpacing.Top = 7
 | 
			
		||||
          Caption = 'Use default theme'
 | 
			
		||||
@ -291,7 +261,7 @@ object OptionsFrm: TOptionsFrm
 | 
			
		||||
          Left = 0
 | 
			
		||||
          Height = 2
 | 
			
		||||
          Top = 152
 | 
			
		||||
          Width = 566
 | 
			
		||||
          Width = 611
 | 
			
		||||
          Anchors = [akTop, akLeft, akRight]
 | 
			
		||||
          BorderSpacing.Top = 25
 | 
			
		||||
        end
 | 
			
		||||
@ -301,7 +271,7 @@ object OptionsFrm: TOptionsFrm
 | 
			
		||||
          Left = 4
 | 
			
		||||
          Height = 2
 | 
			
		||||
          Top = 285
 | 
			
		||||
          Width = 566
 | 
			
		||||
          Width = 611
 | 
			
		||||
          Anchors = [akTop, akLeft, akRight]
 | 
			
		||||
          BorderSpacing.Top = 25
 | 
			
		||||
        end
 | 
			
		||||
@ -338,33 +308,20 @@ object OptionsFrm: TOptionsFrm
 | 
			
		||||
          AnchorSideTop.Side = asrBottom
 | 
			
		||||
          Left = 4
 | 
			
		||||
          Height = 2
 | 
			
		||||
          Top = 410
 | 
			
		||||
          Width = 566
 | 
			
		||||
          Top = 390
 | 
			
		||||
          Width = 611
 | 
			
		||||
          Anchors = [akTop, akLeft, akRight]
 | 
			
		||||
          BorderSpacing.Top = 10
 | 
			
		||||
        end
 | 
			
		||||
        object lbHintForm: TLabel
 | 
			
		||||
          AnchorSideLeft.Control = lbDaysToShowNewPackages
 | 
			
		||||
          AnchorSideTop.Control = Bevel2
 | 
			
		||||
          AnchorSideTop.Side = asrBottom
 | 
			
		||||
          Left = 6
 | 
			
		||||
          Height = 15
 | 
			
		||||
          Top = 292
 | 
			
		||||
          Width = 211
 | 
			
		||||
          BorderSpacing.Top = 5
 | 
			
		||||
          Caption = 'Show quick info for repository packages'
 | 
			
		||||
          ParentColor = False
 | 
			
		||||
        end
 | 
			
		||||
        object rbHintFormOptions: TRadioGroup
 | 
			
		||||
          AnchorSideLeft.Control = lbHintForm
 | 
			
		||||
          AnchorSideTop.Control = lbHintForm
 | 
			
		||||
          AnchorSideTop.Control = Bevel2
 | 
			
		||||
          AnchorSideTop.Side = asrBottom
 | 
			
		||||
          AnchorSideRight.Control = pnGeneral
 | 
			
		||||
          AnchorSideRight.Side = asrBottom
 | 
			
		||||
          Left = 6
 | 
			
		||||
          Height = 88
 | 
			
		||||
          Top = 312
 | 
			
		||||
          Width = 554
 | 
			
		||||
          Top = 292
 | 
			
		||||
          Width = 599
 | 
			
		||||
          Anchors = [akTop, akLeft, akRight]
 | 
			
		||||
          AutoFill = True
 | 
			
		||||
          BorderSpacing.Top = 5
 | 
			
		||||
@ -378,7 +335,7 @@ object OptionsFrm: TOptionsFrm
 | 
			
		||||
          ChildSizing.Layout = cclLeftToRightThenTopToBottom
 | 
			
		||||
          ChildSizing.ControlsPerLine = 1
 | 
			
		||||
          ClientHeight = 68
 | 
			
		||||
          ClientWidth = 550
 | 
			
		||||
          ClientWidth = 595
 | 
			
		||||
          ItemIndex = 0
 | 
			
		||||
          Items.Strings = (
 | 
			
		||||
            'Behaves like a regular hint window'
 | 
			
		||||
 | 
			
		||||
@ -30,9 +30,10 @@ unit opkman_optionsfrm;
 | 
			
		||||
interface
 | 
			
		||||
 | 
			
		||||
uses
 | 
			
		||||
  SysUtils, Math, Graphics,
 | 
			
		||||
  SysUtils, Math, Graphics, Classes,
 | 
			
		||||
  // LCL
 | 
			
		||||
  Forms, Controls, Dialogs, StdCtrls, ExtCtrls, Spin, ComCtrls, EditBtn, Menus,
 | 
			
		||||
  ButtonPanel,
 | 
			
		||||
  // LazUtils
 | 
			
		||||
  LazFileUtils,
 | 
			
		||||
  // OpkMan
 | 
			
		||||
@ -43,7 +44,6 @@ type
 | 
			
		||||
  { TOptionsFrm }
 | 
			
		||||
 | 
			
		||||
  TOptionsFrm = class(TForm)
 | 
			
		||||
    bCancel: TButton;
 | 
			
		||||
    Bevel1: TBevel;
 | 
			
		||||
    Bevel2: TBevel;
 | 
			
		||||
    Bevel3: TBevel;
 | 
			
		||||
@ -53,9 +53,8 @@ type
 | 
			
		||||
    bFoldersAdd: TButton;
 | 
			
		||||
    bFoldersDelete: TButton;
 | 
			
		||||
    bFoldersEdit: TButton;
 | 
			
		||||
    bOk: TButton;
 | 
			
		||||
    bOpen: TButton;
 | 
			
		||||
    bRestore: TButton;
 | 
			
		||||
    bpOptions: TButtonPanel;
 | 
			
		||||
    cbProxy: TCheckBox;
 | 
			
		||||
    cbForceDownloadExtract: TCheckBox;
 | 
			
		||||
    cbDeleteZipAfterInstall: TCheckBox;
 | 
			
		||||
@ -71,7 +70,6 @@ type
 | 
			
		||||
    edProxyServer: TEdit;
 | 
			
		||||
    edProxyUser: TEdit;
 | 
			
		||||
    gbProxySettings: TGroupBox;
 | 
			
		||||
    lbHintForm: TLabel;
 | 
			
		||||
    lbConTimeOut: TLabel;
 | 
			
		||||
    lbFilterDirs: TLabel;
 | 
			
		||||
    lbFilterFiles: TLabel;
 | 
			
		||||
@ -112,13 +110,13 @@ type
 | 
			
		||||
    procedure bFilesAddClick(Sender: TObject);
 | 
			
		||||
    procedure bFilesDeleteClick(Sender: TObject);
 | 
			
		||||
    procedure bFilesEditClick(Sender: TObject);
 | 
			
		||||
    procedure bOkClick(Sender: TObject);
 | 
			
		||||
    procedure bOpenClick(Sender: TObject);
 | 
			
		||||
    procedure bRestoreClick(Sender: TObject);
 | 
			
		||||
    procedure cbProxyChange(Sender: TObject);
 | 
			
		||||
    procedure cbSelectProfileChange(Sender: TObject);
 | 
			
		||||
    procedure edRemoteRepositoryKeyPress(Sender: TObject; var Key: char);
 | 
			
		||||
    procedure FormKeyPress(Sender: TObject; var Key: char);
 | 
			
		||||
    procedure HelpButtonClick(Sender: TObject);
 | 
			
		||||
    procedure OKButtonClick(Sender: TObject);
 | 
			
		||||
    procedure pnProfilesMainResize(Sender: TObject);
 | 
			
		||||
    procedure pnProfilesTopResize(Sender: TObject);
 | 
			
		||||
  private
 | 
			
		||||
@ -137,99 +135,6 @@ implementation
 | 
			
		||||
 | 
			
		||||
{ TOptionsFrm }
 | 
			
		||||
 | 
			
		||||
procedure TOptionsFrm.bOkClick(Sender: TObject);
 | 
			
		||||
var
 | 
			
		||||
  I: Integer;
 | 
			
		||||
begin
 | 
			
		||||
  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 := AppendPathDelim(edLocalRepositoryPackages.Text);
 | 
			
		||||
  Options.LocalRepositoryArchive := AppendPathDelim(edLocalRepositoryArchive.Text);
 | 
			
		||||
  Options.LocalRepositoryUpdate := AppendPathDelim(edLocalRepositoryUpdate.Text);
 | 
			
		||||
  if not DirectoryExists(Options.LocalRepositoryPackages) then
 | 
			
		||||
    ForceDirectories(Options.LocalRepositoryPackages);
 | 
			
		||||
  if not DirectoryExists(Options.LocalRepositoryArchive) then
 | 
			
		||||
    ForceDirectories(Options.LocalRepositoryArchive);
 | 
			
		||||
  if not DirectoryExists(Options.LocalRepositoryUpdate) then
 | 
			
		||||
    ForceDirectories(Options.LocalRepositoryUpdate);
 | 
			
		||||
 | 
			
		||||
  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;
 | 
			
		||||
 | 
			
		||||
  Options.Save;
 | 
			
		||||
  ModalResult := mrOk;
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
procedure TOptionsFrm.bOpenClick(Sender: TObject);
 | 
			
		||||
var
 | 
			
		||||
  I: Integer;
 | 
			
		||||
@ -382,16 +287,6 @@ begin
 | 
			
		||||
      ListBox.Items.Delete(Index);
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
procedure TOptionsFrm.bRestoreClick(Sender: TObject);
 | 
			
		||||
begin
 | 
			
		||||
  if MessageDlgEx(rsOptions_RestoreDefaults_Conf, mtInformation, [mbYes, mbNo], Self) = mrYes then
 | 
			
		||||
  begin
 | 
			
		||||
    Options.LoadDefault;
 | 
			
		||||
    Options.CreateMissingPaths;
 | 
			
		||||
    SetupControls;
 | 
			
		||||
  end;
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
procedure TOptionsFrm.cbProxyChange(Sender: TObject);
 | 
			
		||||
begin
 | 
			
		||||
  gbProxySettings.Enabled:= cbProxy.Checked;
 | 
			
		||||
@ -405,7 +300,7 @@ end;
 | 
			
		||||
procedure TOptionsFrm.edRemoteRepositoryKeyPress(Sender: TObject; var Key: char);
 | 
			
		||||
begin
 | 
			
		||||
  if Key = #13 then
 | 
			
		||||
    bOkClick(bOk);
 | 
			
		||||
    OKButtonClick(bpOptions.OKButton);
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
procedure TOptionsFrm.FormKeyPress(Sender: TObject; var Key: char);
 | 
			
		||||
@ -414,6 +309,110 @@ begin
 | 
			
		||||
    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 := AppendPathDelim(edLocalRepositoryPackages.Text);
 | 
			
		||||
  Options.LocalRepositoryArchive := AppendPathDelim(edLocalRepositoryArchive.Text);
 | 
			
		||||
  Options.LocalRepositoryUpdate := AppendPathDelim(edLocalRepositoryUpdate.Text);
 | 
			
		||||
  if not DirectoryExists(Options.LocalRepositoryPackages) then
 | 
			
		||||
    ForceDirectories(Options.LocalRepositoryPackages);
 | 
			
		||||
  if not DirectoryExists(Options.LocalRepositoryArchive) then
 | 
			
		||||
    ForceDirectories(Options.LocalRepositoryArchive);
 | 
			
		||||
  if not DirectoryExists(Options.LocalRepositoryUpdate) then
 | 
			
		||||
    ForceDirectories(Options.LocalRepositoryUpdate);
 | 
			
		||||
 | 
			
		||||
  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;
 | 
			
		||||
 | 
			
		||||
  Options.Save;
 | 
			
		||||
  ModalResult := mrOk;
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
procedure TOptionsFrm.SetupControls(const AActivePageIndex: Integer = 0);
 | 
			
		||||
var
 | 
			
		||||
  I: Integer;
 | 
			
		||||
@ -454,7 +453,7 @@ begin
 | 
			
		||||
  spDaysToShowNewPackages.Value := Options.DaysToShowNewPackages;
 | 
			
		||||
  cbRegularIcons.Checked := Options.ShowRegularIcons;
 | 
			
		||||
  cbRegularIcons.Caption := rsOptions_cbRegular_Caption;
 | 
			
		||||
  lbHintForm.Caption := rsOptions_lbHintFrm;
 | 
			
		||||
  rbHintFormOptions.Caption := rsOptions_rbHintFormOptions_Caption;
 | 
			
		||||
  rbHintFormOptions.Items.Clear;
 | 
			
		||||
  rbHintFormOptions.Items.Add(rsOptions_rbHintFormOptions_Item0);
 | 
			
		||||
  rbHintFormOptions.Items.Add(rsOptions_rbHintFormOptions_Item1);
 | 
			
		||||
@ -515,6 +514,7 @@ begin
 | 
			
		||||
  lbExcludeFolders.Items.StrictDelimiter := True;
 | 
			
		||||
  lbExcludeFolders.Items.DelimitedText := Options.ExcludedFolders;
 | 
			
		||||
  pnProfilesMain.Visible := Options.UserProfile = 1;
 | 
			
		||||
  bpOptions.HelpButton.Caption := rsOptions_bpOptions_bHelp;
 | 
			
		||||
  SetupColors;
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -29,8 +29,13 @@ unit opkman_showhint;
 | 
			
		||||
interface
 | 
			
		||||
 | 
			
		||||
uses
 | 
			
		||||
  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, Menus, Messages,
 | 
			
		||||
  LCLType, LCLIntf, opkman_virtualtrees;
 | 
			
		||||
  Classes, SysUtils, Forms,
 | 
			
		||||
  //LCL
 | 
			
		||||
  Controls, Graphics, Dialogs, ExtCtrls, Menus, Messages, LCLType,
 | 
			
		||||
  //Interface
 | 
			
		||||
  LCLIntf,
 | 
			
		||||
  //OpkMan
 | 
			
		||||
  opkman_virtualtrees;
 | 
			
		||||
 | 
			
		||||
type
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,26 @@
 | 
			
		||||
{
 | 
			
		||||
 ***************************************************************************
 | 
			
		||||
 *                                                                         *
 | 
			
		||||
 *   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: Show hint for meta packages
 | 
			
		||||
}
 | 
			
		||||
unit opkman_showhintbase;
 | 
			
		||||
 | 
			
		||||
{$mode objfpc}{$H+}
 | 
			
		||||
@ -27,6 +50,7 @@ type
 | 
			
		||||
  end;
 | 
			
		||||
 | 
			
		||||
implementation
 | 
			
		||||
uses opkman_const;
 | 
			
		||||
 | 
			
		||||
{$R *.lfm}
 | 
			
		||||
 | 
			
		||||
@ -34,6 +58,8 @@ implementation
 | 
			
		||||
 | 
			
		||||
procedure TfrShowHint.Init;
 | 
			
		||||
begin
 | 
			
		||||
  lbDescription.Caption := rsMainFrm_VSTText_Description;
 | 
			
		||||
  lbLicense.Caption := rsMainFrm_VSTText_License;
 | 
			
		||||
  Self.DoubleBuffered := True;
 | 
			
		||||
  pnPackageName.Color := $00D9FFFF;
 | 
			
		||||
  pnDescription.Color := $00E6FFE6;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user