Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Favorite Folders expert in new versions of RAD Studio #133

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion jcl/experts/common/JclOtaResources.pas
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ interface
RsEMapFileNotFound = 'Map file "%s" for project "%s" not found.' +
'No conversions of debug information were made';
RsConvertedMapToJdbg = 'Converted MAP file "%s" (%d bytes) to .jdbg (%d bytes)';
RsInsertedJdbg = 'Converted MAP file "%s" (%d bytes) and inserted debug information (%d bytes) into the binary';
RsInsertedJdbg = 'Converted MAP file "%s" (%d bytes) and inserted debug information (%d bytes) into the binary "%s"';
RsDeletedMapFile = 'Deleted %s file "%s"';
RsEFailedToDeleteMapFile = 'Failed to delete %s file "%s"';
RsEMapConversion = 'Failed to convert MAP file "%s"';
Expand Down
14 changes: 14 additions & 0 deletions jcl/experts/common/JclOtaUtils.pas
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ TJclOTAExpertBase = class(TInterfacedObject, IJclOTAOptionsCallback)
var ExecutableFileName: TFileName): Boolean;
function GetDrcFileName(const Project: IOTAProject): TFileName;
function GetMapFileName(const Project: IOTAProject): TFileName;
function GetTargetFileName(const Project: IOTAProject): TFileName;
function GetOutputDirectory(const Project: IOTAProject): string;
function IsInstalledPackage(const Project: IOTAProject): Boolean;
function IsPackage(const Project: IOTAProject): Boolean;
Expand Down Expand Up @@ -1177,6 +1178,19 @@ function TJclOTAExpertBase.GetDrcFileName(const Project: IOTAProject): TFileName
Result := ChangeFileExt(Project.FileName, CompilerExtensionDRC);
end;

function TJclOTAExpertBase.GetTargetFileName(const Project: IOTAProject): TFileName;
begin
if not Assigned(Project) then
raise EJclExpertException.CreateRes(@RsENoActiveProject);
if not Assigned(Project.ProjectOptions) then
raise EJclExpertException.CreateRes(@RsENoProjectOptions);
{$IFDEF BDS2_UP}
Result := Project.ProjectOptions.TargetName;
{$ELSE ~BDS2_UP}
Result := '';
{$ENDIF ~BDS2_UP}
end;

function TJclOTAExpertBase.GetMapFileName(const Project: IOTAProject): TFileName;
var
ProjectFileName: TFileName;
Expand Down
8 changes: 6 additions & 2 deletions jcl/experts/debug/converter/JclDebugIdeImpl.pas
Original file line number Diff line number Diff line change
Expand Up @@ -360,15 +360,19 @@ procedure TJclDebugExtension.AfterCompile(const Project: IOTAProject; Succeeded:
// insertion of JEDI Debug Information into the binary
if Succ and (deInsertJdbg in EnabledActions) then
begin
Succ := FindExecutableName(MapFileName, OutputDirectory, ExecutableFileName);
ExecutableFileName := GetTargetFileName(Project);
Succ := ExecutableFileName <> '';
if not Succ then
Succ := FindExecutableName(MapFileName, OutputDirectory, ExecutableFileName);
if Succ then
begin
Succ := InsertDebugDataIntoExecutableFile(ExecutableFileName, MapFileName,
LinkerBugUnit, MapFileSize, JclDebugDataSize, LineNumberErrors);
if Succ then
begin
if not FQuiet then
OutputToolMessage(Format(LoadResString(@RsInsertedJdbg), [MapFileName, MapFileSize, JclDebugDataSize]));
OutputToolMessage(Format(LoadResString(@RsInsertedJdbg),
[MapFileName, MapFileSize, JclDebugDataSize, ExecutableFileName]));
end
else
OutputToolMessage(Format(LoadResString(@RsEMapInsertion), [MapFileName]));
Expand Down
3 changes: 3 additions & 0 deletions jcl/source/vcl/JclOpenDialogFavorites.pas
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,8 @@ procedure TJclOpenDialogFavoritesHook.FileDialogCreate(
//CheckOSError(FileDialogCustomize.EndVisualGroup);
CheckOSError(FileDialogCustomize.MakeProminent(CTRLID_COMBOBOX));
CheckOSError(AFileDialog.Advise(Self, Unused));

DoShow;
end;

procedure TJclOpenDialogFavoritesHook.FileDialogCleanCombobox(
Expand Down Expand Up @@ -422,6 +424,7 @@ function TJclOpenDialogFavoritesHook.OnControlActivating(

function TJclOpenDialogFavoritesHook.OnFileOk(const pfd: IFileDialog): HResult;
begin
DoClose;
Result := S_OK;
end;

Expand Down