mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-26 10:39:18 +02:00
IDE: Add manifest options for Name/Description. Issue #30953, patch from AlexeyT.
git-svn-id: trunk@53381 -
This commit is contained in:
parent
b0aef0595b
commit
3913650b87
@ -1,21 +1,21 @@
|
||||
object ProjectApplicationOptionsFrame: TProjectApplicationOptionsFrame
|
||||
Left = 0
|
||||
Height = 477
|
||||
Height = 550
|
||||
Top = 0
|
||||
Width = 487
|
||||
ClientHeight = 477
|
||||
ClientHeight = 550
|
||||
ClientWidth = 487
|
||||
TabOrder = 0
|
||||
DesignLeft = 392
|
||||
DesignTop = 251
|
||||
object AppSettingsGroupBox: TGroupBox
|
||||
Left = 0
|
||||
Height = 469
|
||||
Height = 501
|
||||
Top = 0
|
||||
Width = 487
|
||||
Align = alTop
|
||||
Caption = 'AppSettingsGroupBox'
|
||||
ClientHeight = 450
|
||||
ClientHeight = 482
|
||||
ClientWidth = 483
|
||||
TabOrder = 0
|
||||
object TitleLabel: TLabel
|
||||
@ -73,12 +73,12 @@ object ProjectApplicationOptionsFrame: TProjectApplicationOptionsFrame
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 24
|
||||
Top = 381
|
||||
Top = 413
|
||||
Width = 191
|
||||
BorderSpacing.Left = 6
|
||||
BorderSpacing.Top = 3
|
||||
Caption = 'UseAppBundleCheckBox'
|
||||
TabOrder = 11
|
||||
TabOrder = 12
|
||||
end
|
||||
object UseXPManifestCheckBox: TCheckBox
|
||||
AnchorSideLeft.Control = AppSettingsGroupBox
|
||||
@ -247,11 +247,11 @@ object ProjectApplicationOptionsFrame: TProjectApplicationOptionsFrame
|
||||
ParentFont = False
|
||||
end
|
||||
object DarwinDividerBevel: TDividerBevel
|
||||
AnchorSideTop.Control = UIAccessCheckBox
|
||||
AnchorSideTop.Control = TextFieldButton
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Left = 8
|
||||
Height = 17
|
||||
Top = 361
|
||||
Top = 393
|
||||
Width = 471
|
||||
Caption = 'For Darwin'
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
@ -265,14 +265,14 @@ object ProjectApplicationOptionsFrame: TProjectApplicationOptionsFrame
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 27
|
||||
Height = 29
|
||||
Top = 411
|
||||
Top = 443
|
||||
Width = 177
|
||||
AutoSize = True
|
||||
BorderSpacing.Left = 21
|
||||
BorderSpacing.Top = 6
|
||||
Caption = 'CreateAppBundleButton'
|
||||
OnClick = CreateAppBundleButtonClick
|
||||
TabOrder = 12
|
||||
TabOrder = 13
|
||||
end
|
||||
object DpiAwareLabel: TLabel
|
||||
AnchorSideLeft.Control = UseXPManifestCheckBox
|
||||
@ -305,6 +305,20 @@ object ProjectApplicationOptionsFrame: TProjectApplicationOptionsFrame
|
||||
Style = csDropDownList
|
||||
TabOrder = 8
|
||||
end
|
||||
object TextFieldButton: TButton
|
||||
AnchorSideLeft.Control = UIAccessCheckBox
|
||||
AnchorSideTop.Control = UIAccessCheckBox
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 27
|
||||
Height = 29
|
||||
Top = 358
|
||||
Width = 120
|
||||
AutoSize = True
|
||||
BorderSpacing.Top = 3
|
||||
Caption = 'TextFieldButton'
|
||||
OnClick = TextFieldButtonClick
|
||||
TabOrder = 11
|
||||
end
|
||||
end
|
||||
object OpenPictureDialog1: TOpenPictureDialog
|
||||
left = 385
|
||||
|
@ -16,6 +16,7 @@ type
|
||||
|
||||
TProjectApplicationOptionsFrame = class(TAbstractIDEOptionsEditor)
|
||||
AppSettingsGroupBox: TGroupBox;
|
||||
TextFieldButton: TButton;
|
||||
CreateAppBundleButton: TBitBtn;
|
||||
DefaultIconButton: TButton;
|
||||
DpiAwareLabel: TLabel;
|
||||
@ -46,6 +47,7 @@ type
|
||||
procedure IconTrackChange(Sender: TObject);
|
||||
procedure LoadIconButtonClick(Sender: TObject);
|
||||
procedure SaveIconButtonClick(Sender: TObject);
|
||||
procedure TextFieldButtonClick(Sender: TObject);
|
||||
procedure UseXPManifestCheckBoxChange(Sender: TObject);
|
||||
private
|
||||
FProject: TProject;
|
||||
@ -171,6 +173,22 @@ begin
|
||||
IconImage.Picture.SaveToFile(SavePictureDialog1.FileName);
|
||||
end;
|
||||
|
||||
procedure TProjectApplicationOptionsFrame.TextFieldButtonClick(Sender: TObject);
|
||||
var
|
||||
Caps, Values: array[0..1] of string;
|
||||
begin
|
||||
Caps[0] := lisName;
|
||||
Caps[1] := lisCodeHelpDescrTag;
|
||||
Values[0] := FProject.ProjResources.XPManifest.TextName;
|
||||
Values[1] := FProject.ProjResources.XPManifest.TextDesc;
|
||||
|
||||
if InputQuery(TextFieldButton.Caption, Caps, Values) then
|
||||
begin
|
||||
FProject.ProjResources.XPManifest.TextName := Values[0];
|
||||
FProject.ProjResources.XPManifest.TextDesc := Values[1];
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TProjectApplicationOptionsFrame.UseXPManifestCheckBoxChange(Sender: TObject);
|
||||
begin
|
||||
DpiAwareLabel.Enabled := UseXPManifestCheckBox.Checked;
|
||||
@ -178,6 +196,7 @@ begin
|
||||
ExecutionLevelLabel.Enabled := UseXPManifestCheckBox.Checked;
|
||||
ExecutionLevelComboBox.Enabled := UseXPManifestCheckBox.Checked;
|
||||
UIAccessCheckBox.Enabled := UseXPManifestCheckBox.Checked;
|
||||
TextFieldButton.Enabled := UseXPManifestCheckBox.Checked;
|
||||
end;
|
||||
|
||||
procedure TProjectApplicationOptionsFrame.SetIconFromStream(Value: TStream);
|
||||
@ -236,6 +255,7 @@ begin
|
||||
for DpiLevel in TXPManifestDpiAware do
|
||||
DpiAwareComboBox.Items.Add(DpiLevelNames[DpiLevel] + ' (' + ManifestDpiAwareValues[DpiLevel] + ')');
|
||||
UIAccessCheckBox.Caption := dlgPOUIAccess;
|
||||
TextFieldButton.Caption := dlgPOTextFields;
|
||||
|
||||
// Darwin specific, Application Bundle
|
||||
DarwinDividerBevel.Caption := lisForDarwin;
|
||||
@ -281,6 +301,7 @@ begin
|
||||
ExecutionLevelLabel.Enabled := UseXPManifestCheckBox.Checked;
|
||||
ExecutionLevelComboBox.Enabled := UseXPManifestCheckBox.Checked;
|
||||
UIAccessCheckBox.Enabled := UseXPManifestCheckBox.Checked;
|
||||
TextFieldButton.Enabled := UseXPManifestCheckBox.Checked;
|
||||
AStream := TProjectIcon(ProjResources[TProjectIcon]).GetStream;
|
||||
try
|
||||
SetIconFromStream(AStream);
|
||||
|
@ -2554,6 +2554,7 @@ resourcestring
|
||||
dlgPODpiAwarenessOldOffNewPerMonitor = 'Vista-8: off, 8.1+: per monitor';
|
||||
dlgPODpiAwarenessOldOnNewPerMonitor = 'Vista-8: on, 8.1+: per monitor';
|
||||
dlgPOUIAccess = 'UI Access (uiAccess)';
|
||||
dlgPOTextFields = 'Text fields';
|
||||
dlgPOAsInvoker = 'as invoker (asInvoker)';
|
||||
dlgPOHighestAvailable = 'highest available (highestAvailable)';
|
||||
dlgPORequireAdministrator = 'require administrator (requireAdministrator)';
|
||||
|
@ -64,10 +64,14 @@ type
|
||||
FDpiAware: TXPManifestDpiAware;
|
||||
FUIAccess: Boolean;
|
||||
FUseManifest: boolean;
|
||||
FTextName: string;
|
||||
FTextDesc: string;
|
||||
procedure SetDpiAware(AValue: TXPManifestDpiAware);
|
||||
procedure SetExecutionLevel(AValue: TXPManifestExecutionLevel);
|
||||
procedure SetUIAccess(AValue: Boolean);
|
||||
procedure SetUseManifest(const AValue: boolean);
|
||||
procedure SetTextName(const AValue: string);
|
||||
procedure SetTextDesc(const AValue: string);
|
||||
public
|
||||
constructor Create; override;
|
||||
function UpdateResources(AResources: TAbstractProjectResources; const {%H-}MainFilename: string): Boolean; override;
|
||||
@ -78,6 +82,8 @@ type
|
||||
property DpiAware: TXPManifestDpiAware read FDpiAware write SetDpiAware;
|
||||
property ExecutionLevel: TXPManifestExecutionLevel read FExecutionLevel write SetExecutionLevel;
|
||||
property UIAccess: Boolean read FUIAccess write SetUIAccess;
|
||||
property TextName: string read FTextName write SetTextName;
|
||||
property TextDesc: string read FTextDesc write SetTextDesc;
|
||||
end;
|
||||
|
||||
const
|
||||
@ -100,8 +106,8 @@ const
|
||||
sManifestFileData: String =
|
||||
'<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'#$D#$A+
|
||||
'<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">'#$D#$A+
|
||||
' <assemblyIdentity version="1.0.0.0" processorArchitecture="*" name="CompanyName.ProductName.YourApp" type="win32"/>'#$D#$A+
|
||||
' <description>Your application description here.</description>'#$D#$A+
|
||||
' <assemblyIdentity version="1.0.0.0" processorArchitecture="*" name="%s" type="win32"/>'#$D#$A+
|
||||
' <description>%s</description>'#$D#$A+
|
||||
' <dependency>'#$D#$A+
|
||||
' <dependentAssembly>'#$D#$A+
|
||||
' <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"/>'#$D#$A+
|
||||
@ -170,6 +176,20 @@ begin
|
||||
Modified := True;
|
||||
end;
|
||||
|
||||
procedure TProjectXPManifest.SetTextDesc(const AValue: string);
|
||||
begin
|
||||
if FTextDesc = AValue then Exit;
|
||||
FTextDesc := AValue;
|
||||
Modified := True;
|
||||
end;
|
||||
|
||||
procedure TProjectXPManifest.SetTextName(const AValue: string);
|
||||
begin
|
||||
if FTextName = AValue then Exit;
|
||||
FTextName := AValue;
|
||||
Modified := True;
|
||||
end;
|
||||
|
||||
procedure TProjectXPManifest.SetUIAccess(AValue: Boolean);
|
||||
begin
|
||||
if FUIAccess = AValue then Exit;
|
||||
@ -185,6 +205,8 @@ begin
|
||||
DpiAware := xmdaFalse;
|
||||
ExecutionLevel := xmelAsInvoker;
|
||||
UIAccess := False;
|
||||
TextName := 'CompanyName.ProductName.AppName';
|
||||
TextDesc := 'Your application description.';
|
||||
end;
|
||||
|
||||
function TProjectXPManifest.UpdateResources(AResources: TAbstractProjectResources;
|
||||
@ -203,6 +225,8 @@ begin
|
||||
RType.Free; //no longer needed
|
||||
RName.Free;
|
||||
ManifestFileData := Format(sManifestFileData, [
|
||||
TextName,
|
||||
TextDesc,
|
||||
ExecutionLevelToStr[ExecutionLevel],
|
||||
BoolToStr(UIAccess, 'true', 'false'),
|
||||
ManifestDpiAwareValues[DpiAware]]);
|
||||
@ -218,6 +242,8 @@ begin
|
||||
TXMLConfig(AConfig).SetDeleteValue(Path+'General/XPManifest/DpiAware/Value', ManifestDpiAwareValues[DpiAware], ManifestDpiAwareValues[xmdaFalse]);
|
||||
TXMLConfig(AConfig).SetDeleteValue(Path+'General/XPManifest/ExecutionLevel/Value', ExecutionLevelToStr[ExecutionLevel], ExecutionLevelToStr[xmelAsInvoker]);
|
||||
TXMLConfig(AConfig).SetDeleteValue(Path+'General/XPManifest/UIAccess/Value', UIAccess, False);
|
||||
TXMLConfig(AConfig).SetDeleteValue(Path+'General/XPManifest/TextName/Value', TextName, '');
|
||||
TXMLConfig(AConfig).SetDeleteValue(Path+'General/XPManifest/TextDesc/Value', TextDesc, '');
|
||||
end;
|
||||
|
||||
procedure TProjectXPManifest.ReadFromProjectFile(AConfig: TObject;
|
||||
@ -242,7 +268,10 @@ begin
|
||||
ExecutionLevel := TXPManifestExecutionLevel(Cfg.GetValue(Path+'General/XPManifest/ExecutionLevel/Value', 0))
|
||||
else
|
||||
ExecutionLevel := StrToXPManifestExecutionLevel(Cfg.GetValue(Path+'General/XPManifest/ExecutionLevel/Value', ''));
|
||||
|
||||
UIAccess := Cfg.GetValue(Path+'General/XPManifest/UIAccess/Value', False);
|
||||
TextName := Cfg.GetValue(Path+'General/XPManifest/TextName/Value', TextName);
|
||||
TextDesc := Cfg.GetValue(Path+'General/XPManifest/TextDesc/Value', TextDesc);
|
||||
end;
|
||||
|
||||
initialization
|
||||
|
Loading…
Reference in New Issue
Block a user