mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-19 10:09:29 +02:00
IDE: Show Widgetset display name instead of dir name in selection list for project. Issue #40040, patch by theo222.
This commit is contained in:
parent
43d7f20349
commit
c45dfb7a56
@ -35,18 +35,13 @@ unit Compiler_ModeMatrix;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
//Classes, SysUtils, types, LazLoggerBase, LazUTF8, Controls, Graphics, ComCtrls,
|
|
||||||
//Menus, LCLProc, IDEOptionsIntf, IDEImagesIntf, CompOptsIntf, EnvironmentOpts,
|
|
||||||
//PackageSystem, PackageDefs, Project, LazarusIDEStrConsts, TransferMacros,
|
|
||||||
//ModeMatrixOpts, ModeMatrixCtrl, compiler_config_target;
|
|
||||||
Classes, SysUtils, types,
|
Classes, SysUtils, types,
|
||||||
// LazUtils
|
// LazUtils
|
||||||
LazLoggerBase, LazUTF8,
|
LazLoggerBase, LazUTF8,
|
||||||
// LCL
|
// LCL
|
||||||
LCLProc, Controls, Graphics, ComCtrls, Menus,
|
LCLPlatformDef, Controls, Graphics, ComCtrls, Menus,
|
||||||
// IdeIntf
|
// IdeIntf
|
||||||
IDEOptionsIntf, IDEOptEditorIntf, IDEImagesIntf, CompOptsIntf,
|
IDEOptionsIntf, IDEOptEditorIntf, IDEImagesIntf, CompOptsIntf, KeywordFuncLists,
|
||||||
KeywordFuncLists,
|
|
||||||
// IDE
|
// IDE
|
||||||
EnvironmentOpts, PackageSystem, PackageDefs, Project, LazarusIDEStrConsts,
|
EnvironmentOpts, PackageSystem, PackageDefs, Project, LazarusIDEStrConsts,
|
||||||
TransferMacros, ModeMatrixOpts, ModeMatrixCtrl, compiler_config_target;
|
TransferMacros, ModeMatrixOpts, ModeMatrixCtrl, compiler_config_target;
|
||||||
@ -514,6 +509,7 @@ var
|
|||||||
begin
|
begin
|
||||||
ValueMenuItem:=Sender as TMenuItem;
|
ValueMenuItem:=Sender as TMenuItem;
|
||||||
Value:=GetCaptionValue(ValueMenuItem.Caption,fCaptionPatternMacroValue);
|
Value:=GetCaptionValue(ValueMenuItem.Caption,fCaptionPatternMacroValue);
|
||||||
|
Value:=DisplayNameToDirName(Value);
|
||||||
CreateNewOption(BuildMatrixOptionTypeCaption(bmotIDEMacro),'LCLWidgetType:='+Value);
|
CreateNewOption(BuildMatrixOptionTypeCaption(bmotIDEMacro),'LCLWidgetType:='+Value);
|
||||||
// Update LCLWidgetType to Config and Target page. ToDo: update also when deleting or changing.
|
// Update LCLWidgetType to Config and Target page. ToDo: update also when deleting or changing.
|
||||||
TargetFrame := TCompilerConfigTargetFrame(FDialog.FindEditor(TCompilerConfigTargetFrame));
|
TargetFrame := TCompilerConfigTargetFrame(FDialog.FindEditor(TCompilerConfigTargetFrame));
|
||||||
@ -618,7 +614,7 @@ begin
|
|||||||
if i=ParentMenu.Items.Count then
|
if i=ParentMenu.Items.Count then
|
||||||
ParentMenu.Items.Add(TMenuItem.Create(Self));
|
ParentMenu.Items.Add(TMenuItem.Create(Self));
|
||||||
ValueMI:=ParentMenu.Items[i];
|
ValueMI:=ParentMenu.Items[i];
|
||||||
ValueMI.Caption:=Format(fCaptionPatternMacroValue,[Mcr.Values[i]]);
|
ValueMI.Caption:=Format(fCaptionPatternMacroValue,[DirNameToDisplayName(Mcr.Values[i])]);
|
||||||
ValueMI.OnClick:=@OnAddLCLWidgetTypeClick;
|
ValueMI.OnClick:=@OnAddLCLWidgetTypeClick;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
@ -39,6 +39,8 @@ type
|
|||||||
TLCLPlatforms = set of TLCLPlatform;
|
TLCLPlatforms = set of TLCLPlatform;
|
||||||
|
|
||||||
function DirNameToLCLPlatform(const ADirName: string): TLCLPlatform;
|
function DirNameToLCLPlatform(const ADirName: string): TLCLPlatform;
|
||||||
|
function DirNameToDisplayName(const ADirName: string): String;
|
||||||
|
function DisplayNameToDirName(const ADisplayName: String): String;
|
||||||
function GetBuildLCLWidgetType: TLCLPlatform;
|
function GetBuildLCLWidgetType: TLCLPlatform;
|
||||||
|
|
||||||
const
|
const
|
||||||
@ -106,6 +108,21 @@ begin
|
|||||||
Result:=lpGtk2;
|
Result:=lpGtk2;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function DirNameToDisplayName(const ADirName: string): String;
|
||||||
|
begin
|
||||||
|
Result:=LCLPlatformDisplayNames[DirNameToLCLPlatform(ADirName)];
|
||||||
|
end;
|
||||||
|
|
||||||
|
function DisplayNameToDirName(const ADisplayName: String): String;
|
||||||
|
var
|
||||||
|
PlatForm: TLCLPlatform;
|
||||||
|
begin
|
||||||
|
for PlatForm:=Low(TLCLPlatform) to High(TLCLPlatform) do
|
||||||
|
if CompareText(ADisplayName,LCLPlatformDisplayNames[PlatForm])=0 then
|
||||||
|
exit(LCLPlatformDirNames[PlatForm]);
|
||||||
|
Result:='gtk2';
|
||||||
|
end;
|
||||||
|
|
||||||
function GetBuildLCLWidgetType: TLCLPlatform;
|
function GetBuildLCLWidgetType: TLCLPlatform;
|
||||||
begin
|
begin
|
||||||
Result:=BuildLCLWidgetType;
|
Result:=BuildLCLWidgetType;
|
||||||
|
Loading…
Reference in New Issue
Block a user