mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 14:40:24 +02:00
ide, packager: add provides and i18n options frames
git-svn-id: trunk@29501 -
This commit is contained in:
parent
4f3a72534b
commit
9224d401fc
4
.gitattributes
vendored
4
.gitattributes
vendored
@ -5500,8 +5500,12 @@ packager/confirmpkglistdlg.lfm svneol=native#text/plain
|
||||
packager/confirmpkglistdlg.pas svneol=native#text/plain
|
||||
packager/frames/package_description_options.lfm svneol=native#text/plain
|
||||
packager/frames/package_description_options.pas svneol=native#text/pascal
|
||||
packager/frames/package_i18n_options.lfm svneol=native#text/plain
|
||||
packager/frames/package_i18n_options.pas svneol=native#text/pascal
|
||||
packager/frames/package_integration_options.lfm svneol=native#text/plain
|
||||
packager/frames/package_integration_options.pas svneol=native#text/pascal
|
||||
packager/frames/package_provides_options.lfm svneol=native#text/plain
|
||||
packager/frames/package_provides_options.pas svneol=native#text/pascal
|
||||
packager/frames/package_usage_options.lfm svneol=native#text/plain
|
||||
packager/frames/package_usage_options.pas svneol=native#text/pascal
|
||||
packager/globallinks/README.txt svneol=native#text/plain
|
||||
|
@ -59,7 +59,7 @@
|
||||
<PackageName Value="SynEdit"/>
|
||||
</Item6>
|
||||
</RequiredPackages>
|
||||
<Units Count="80">
|
||||
<Units Count="82">
|
||||
<Unit0>
|
||||
<Filename Value="lazarus.pp"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
@ -607,6 +607,20 @@
|
||||
<ResourceBaseClass Value="Frame"/>
|
||||
<UnitName Value="package_integration_options"/>
|
||||
</Unit79>
|
||||
<Unit80>
|
||||
<Filename Value="../packager/frames/package_provides_options.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="PackageProvidesOptionsFrame"/>
|
||||
<ResourceBaseClass Value="Frame"/>
|
||||
<UnitName Value="package_provides_options"/>
|
||||
</Unit80>
|
||||
<Unit81>
|
||||
<Filename Value="../packager/frames/package_i18n_options.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="PackageI18NOptionsFrame"/>
|
||||
<ResourceBaseClass Value="Frame"/>
|
||||
<UnitName Value="package_i18n_options"/>
|
||||
</Unit81>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
|
@ -132,6 +132,7 @@ uses
|
||||
BuildModesEditor,
|
||||
// package option frames
|
||||
package_usage_options, package_description_options, package_integration_options,
|
||||
package_provides_options, package_i18n_options,
|
||||
|
||||
// rest of the ide
|
||||
Splash, IDEDefs, LazarusIDEStrConsts, LazConf, MsgView, SearchResultView,
|
||||
|
79
packager/frames/package_i18n_options.lfm
Normal file
79
packager/frames/package_i18n_options.lfm
Normal file
@ -0,0 +1,79 @@
|
||||
inherited PackageI18NOptionsFrame: TPackageI18NOptionsFrame
|
||||
Height = 322
|
||||
Width = 551
|
||||
ClientHeight = 322
|
||||
ClientWidth = 551
|
||||
TabOrder = 0
|
||||
DesignLeft = 245
|
||||
DesignTop = 173
|
||||
object I18NGroupBox: TGroupBox[0]
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideTop.Control = EnableI18NCheckBox
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 0
|
||||
Height = 75
|
||||
Top = 25
|
||||
Width = 551
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
AutoSize = True
|
||||
BorderSpacing.Top = 6
|
||||
Caption = 'i18n Options'
|
||||
ClientHeight = 57
|
||||
ClientWidth = 547
|
||||
TabOrder = 0
|
||||
object PoOutDirLabel: TLabel
|
||||
AnchorSideLeft.Control = I18NGroupBox
|
||||
AnchorSideTop.Control = I18NGroupBox
|
||||
Left = 6
|
||||
Height = 16
|
||||
Top = 6
|
||||
Width = 112
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'PO Output Directory:'
|
||||
ParentColor = False
|
||||
end
|
||||
object POOutDirEdit: TEdit
|
||||
AnchorSideLeft.Control = I18NGroupBox
|
||||
AnchorSideTop.Control = PoOutDirLabel
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = POOutDirButton
|
||||
Left = 6
|
||||
Height = 23
|
||||
Top = 28
|
||||
Width = 494
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Around = 6
|
||||
TabOrder = 0
|
||||
end
|
||||
object POOutDirButton: TButton
|
||||
AnchorSideTop.Control = POOutDirEdit
|
||||
AnchorSideRight.Control = I18NGroupBox
|
||||
AnchorSideRight.Side = asrBottom
|
||||
AnchorSideBottom.Control = POOutDirEdit
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 506
|
||||
Height = 23
|
||||
Top = 28
|
||||
Width = 35
|
||||
Anchors = [akTop, akRight, akBottom]
|
||||
AutoSize = True
|
||||
BorderSpacing.Right = 6
|
||||
Caption = '...'
|
||||
OnClick = POOutDirButtonClick
|
||||
TabOrder = 1
|
||||
end
|
||||
end
|
||||
object EnableI18NCheckBox: TCheckBox[1]
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideTop.Control = Owner
|
||||
Left = 0
|
||||
Height = 19
|
||||
Top = 0
|
||||
Width = 80
|
||||
Caption = 'Enable i18n'
|
||||
OnChange = EnableI18NCheckBoxChange
|
||||
TabOrder = 1
|
||||
end
|
||||
end
|
95
packager/frames/package_i18n_options.pas
Normal file
95
packager/frames/package_i18n_options.pas
Normal file
@ -0,0 +1,95 @@
|
||||
unit package_i18n_options;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, FileUtil, Forms, Controls, StdCtrls,
|
||||
IDEOptionsIntf, LazarusIDEStrConsts, PackageDefs, IDEDialogs;
|
||||
|
||||
type
|
||||
|
||||
{ TPackageI18NOptionsFrame }
|
||||
|
||||
TPackageI18NOptionsFrame = class(TAbstractIDEOptionsEditor)
|
||||
EnableI18NCheckBox: TCheckBox;
|
||||
I18NGroupBox: TGroupBox;
|
||||
POOutDirButton: TButton;
|
||||
POOutDirEdit: TEdit;
|
||||
PoOutDirLabel: TLabel;
|
||||
procedure EnableI18NCheckBoxChange(Sender: TObject);
|
||||
procedure POOutDirButtonClick(Sender: TObject);
|
||||
private
|
||||
FLazPackage: TLazPackage;
|
||||
public
|
||||
function GetTitle: string; override;
|
||||
procedure Setup(ADialog: TAbstractOptionsEditorDialog); override;
|
||||
procedure ReadSettings(AOptions: TAbstractIDEOptions); override;
|
||||
procedure WriteSettings(AOptions: TAbstractIDEOptions); override;
|
||||
class function SupportedOptionsClass: TAbstractIDEOptionsClass; override;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
{ TPackageI18NOptionsFrame }
|
||||
|
||||
procedure TPackageI18NOptionsFrame.EnableI18NCheckBoxChange(Sender: TObject);
|
||||
begin
|
||||
I18NGroupBox.Enabled := EnableI18NCheckBox.Checked;
|
||||
end;
|
||||
|
||||
procedure TPackageI18NOptionsFrame.POOutDirButtonClick(Sender: TObject);
|
||||
var
|
||||
NewDirectory: string;
|
||||
begin
|
||||
NewDirectory := LazSelectDirectory(lisPOChoosePoFileDirectory,
|
||||
FLazPackage.Directory);
|
||||
if NewDirectory = '' then
|
||||
exit;
|
||||
FLazPackage.ShortenFilename(NewDirectory, True);
|
||||
POOutDirEdit.Text := NewDirectory;
|
||||
end;
|
||||
|
||||
function TPackageI18NOptionsFrame.GetTitle: string;
|
||||
begin
|
||||
Result := dlgPOI18n;
|
||||
end;
|
||||
|
||||
procedure TPackageI18NOptionsFrame.Setup(ADialog: TAbstractOptionsEditorDialog);
|
||||
begin
|
||||
EnableI18NCheckBox.Caption := rsEnableI18n;
|
||||
I18NGroupBox.Caption := rsI18nOptions;
|
||||
PoOutDirlabel.Caption := rsPOOutputDirectory;
|
||||
end;
|
||||
|
||||
procedure TPackageI18NOptionsFrame.ReadSettings(AOptions: TAbstractIDEOptions);
|
||||
var
|
||||
LazPackage: TLazPackage absolute AOptions;
|
||||
begin
|
||||
FLazPackage := LazPackage;
|
||||
EnableI18NCheckBox.Checked := LazPackage.EnableI18N;
|
||||
I18NGroupBox.Enabled := LazPackage.EnableI18N;
|
||||
POOutDirEdit.Text := LazPackage.POOutputDirectory;
|
||||
end;
|
||||
|
||||
procedure TPackageI18NOptionsFrame.WriteSettings(AOptions: TAbstractIDEOptions);
|
||||
var
|
||||
LazPackage: TLazPackage absolute AOptions;
|
||||
begin
|
||||
LazPackage.EnableI18N := EnableI18NCheckBox.Checked;
|
||||
LazPackage.POOutputDirectory := POOutDirEdit.Text;
|
||||
end;
|
||||
|
||||
class function TPackageI18NOptionsFrame.SupportedOptionsClass: TAbstractIDEOptionsClass;
|
||||
begin
|
||||
Result := TLazPackage;
|
||||
end;
|
||||
|
||||
initialization
|
||||
RegisterIDEOptionsEditor(GroupPackage, TPackageI18NOptionsFrame,
|
||||
PackageOptionsI18N);
|
||||
end.
|
||||
|
36
packager/frames/package_provides_options.lfm
Normal file
36
packager/frames/package_provides_options.lfm
Normal file
@ -0,0 +1,36 @@
|
||||
object PackageProvidesOptionsFrame: TPackageProvidesOptionsFrame
|
||||
Left = 0
|
||||
Height = 346
|
||||
Top = 0
|
||||
Width = 470
|
||||
ClientHeight = 346
|
||||
ClientWidth = 470
|
||||
TabOrder = 0
|
||||
DesignLeft = 245
|
||||
DesignTop = 173
|
||||
object ProvidesGroupBox: TGroupBox
|
||||
Left = 0
|
||||
Height = 346
|
||||
Top = 0
|
||||
Width = 470
|
||||
Align = alClient
|
||||
Caption = 'This package provides the same as the following packages:'
|
||||
ClientHeight = 328
|
||||
ClientWidth = 466
|
||||
TabOrder = 0
|
||||
object ProvidesMemo: TMemo
|
||||
AnchorSideLeft.Control = ProvidesGroupBox
|
||||
AnchorSideTop.Control = ProvidesGroupBox
|
||||
AnchorSideRight.Control = ProvidesGroupBox
|
||||
AnchorSideBottom.Control = ProvidesGroupBox
|
||||
Left = 6
|
||||
Height = 316
|
||||
Top = 6
|
||||
Width = 454
|
||||
Align = alClient
|
||||
BorderSpacing.Around = 6
|
||||
ScrollBars = ssAutoVertical
|
||||
TabOrder = 0
|
||||
end
|
||||
end
|
||||
end
|
65
packager/frames/package_provides_options.pas
Normal file
65
packager/frames/package_provides_options.pas
Normal file
@ -0,0 +1,65 @@
|
||||
unit package_provides_options;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, FileUtil, Forms, Controls, StdCtrls,
|
||||
IDEOptionsIntf, LazarusIDEStrConsts, PackageDefs;
|
||||
|
||||
type
|
||||
|
||||
{ TPackageProvidesOptionsFrame }
|
||||
|
||||
TPackageProvidesOptionsFrame = class(TAbstractIDEOptionsEditor)
|
||||
ProvidesGroupBox: TGroupBox;
|
||||
ProvidesMemo: TMemo;
|
||||
public
|
||||
function GetTitle: string; override;
|
||||
procedure Setup(ADialog: TAbstractOptionsEditorDialog); override;
|
||||
procedure ReadSettings(AOptions: TAbstractIDEOptions); override;
|
||||
procedure WriteSettings(AOptions: TAbstractIDEOptions); override;
|
||||
class function SupportedOptionsClass: TAbstractIDEOptionsClass; override;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
{ TPackageProvidesOptionsFrame }
|
||||
|
||||
function TPackageProvidesOptionsFrame.GetTitle: string;
|
||||
begin
|
||||
Result := lisPckOptsProvides;
|
||||
end;
|
||||
|
||||
procedure TPackageProvidesOptionsFrame.Setup(ADialog: TAbstractOptionsEditorDialog);
|
||||
begin
|
||||
ProvidesGroupBox.Caption := lisPckOptsThisPackageProvidesTheSameAsTheFollowingPackages;
|
||||
end;
|
||||
|
||||
procedure TPackageProvidesOptionsFrame.ReadSettings(AOptions: TAbstractIDEOptions);
|
||||
var
|
||||
LazPackage: TLazPackage absolute AOptions;
|
||||
begin
|
||||
ProvidesMemo.Lines.Assign(LazPackage.Provides);
|
||||
end;
|
||||
|
||||
procedure TPackageProvidesOptionsFrame.WriteSettings(AOptions: TAbstractIDEOptions);
|
||||
var
|
||||
LazPackage: TLazPackage absolute AOptions;
|
||||
begin
|
||||
LazPackage.Provides := ProvidesMemo.Lines;
|
||||
end;
|
||||
|
||||
class function TPackageProvidesOptionsFrame.SupportedOptionsClass: TAbstractIDEOptionsClass;
|
||||
begin
|
||||
Result := TLazPackage;
|
||||
end;
|
||||
|
||||
initialization
|
||||
RegisterIDEOptionsEditor(GroupPackage, TPackageProvidesOptionsFrame,
|
||||
PackageOptionsProvides);
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user