Skip to content

Commit 7edb7b4

Browse files
author
César Cardoso
committed
bk/2024-01-09-1536
1 parent 451cc63 commit 7edb7b4

6 files changed

Lines changed: 17 additions & 24 deletions

File tree

Src/IDE/CompileNotifier/C4D.Wizard.IDE.CompileNotifier.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ procedure TC4DWizardIDECompileNotifier.ProjectCompileStarted(const Project: IOTA
5959

6060
LIOTAProject := TC4DWizardUtilsOTA.GetCurrentProject;
6161

62-
if(ExtractFileName(LIOTAProject.FileName) = TC4DConsts.C_C4D_WIZARD_DPROJ)then
62+
if(TC4DWizardUtils.FileNameIsC4DWizardDPROJ(LIOTAProject.FileName))then
6363
Exit;
6464

6565
LCurrentBinaryPath := TC4DWizardUtilsOTA.GetBinaryPathCurrent;

Src/IDE/FileNotification/C4D.Wizard.IDE.FileNotification.Notifier.pas

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ procedure RegisterSelf;
3434
implementation
3535

3636
uses
37+
C4D.Wizard.Utils,
3738
C4D.Wizard.Utils.OTA,
3839
C4D.Wizard.Reopen.Model,
3940
C4D.Wizard.Reopen.SaveAs,
@@ -135,7 +136,7 @@ procedure TC4DWizardIDEFileNotificationNotifier.ProcessReopenSaveAs;
135136
if(FExtension <> '.dproj')and(FExtension <> '.groupproj')then
136137
Exit;
137138

138-
if(ExtractFileName(FFileName) = TC4DConsts.C_C4D_WIZARD_DPROJ)then
139+
if(TC4DWizardUtils.FileNameIsC4DWizardDPROJ(FFileName))then
139140
Exit;
140141

141142
{$IFDEF RELEASE}

Src/IDE/ToolBars/C4D.Wizard.IDE.ToolBars.Branch.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,6 @@ initialization
285285

286286
finalization
287287
if(Assigned(C4DWizardIDEToolBarsBranch))then
288-
C4DWizardIDEToolBarsBranch.Free;
288+
FreeAndNil(C4DWizardIDEToolBarsBranch);
289289

290290
end.

Src/IDE/ToolBars/C4D.Wizard.IDE.ToolBars.Build.pas

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ procedure TC4DWizardIDEToolBarsBuild.RemoveToolBarBuild;
165165
begin
166166
for i := Pred(FToolBarBuild.ButtonCount) DownTo 0 do
167167
FToolBarBuild.Buttons[i].Free;
168+
168169
FreeAndNil(FToolBarBuild);
169170
end;
170171
end;
@@ -297,21 +298,15 @@ procedure TC4DWizardIDEToolBarsBuild.OnC4DToolButtonBuildInReleaseClick(Sender:
297298
if(LIOTAProject = nil)then
298299
Exit;
299300

300-
if(ExtractFileName(LIOTAProject.FileName) = TC4DConsts.C_C4D_WIZARD_DPROJ)then
301+
if(TC4DWizardUtils.FileNameIsC4DWizardDPROJ(LIOTAProject.FileName))then
301302
TC4DWizardUtils.ShowMsgAndAbort('It is not possible to build in project: ' + TC4DConsts.C_C4D_WIZARD_DPROJ);
302303

303304
LCurrentBinaryPath := TC4DWizardUtilsOTA.GetBinaryPathCurrent;
304305
if(FileExists(LCurrentBinaryPath))then
305-
begin
306306
if(TC4DWizardUtils.ProcessWindowsExists(ExtractFileName(LCurrentBinaryPath), LCurrentBinaryPath))then
307-
begin
308307
if(not TC4DWizardUtils.ShowQuestion('The application is already running, do you wish to continue?'))then
309308
Exit;
310309

311-
//PostMessage(FindWindow(nil, PWideChar(LCurrentBinaryPath)), WM_QUIT, 0, 0);
312-
end;
313-
end;
314-
315310
LBuildConfCurrent := LIOTAProject.CurrentConfiguration;
316311
try
317312
LIOTAProject.CurrentConfiguration := TC4DConsts.C_BUILD_RELEASE;

Src/Messages/C4D.Wizard.Messages.Custom.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ function TC4DWizardMessageCustom.GetMessageGroup: IOTAMessageGroup;
200200
if(FGroupName.Trim.IsEmpty)then
201201
Exit;
202202

203-
//if(ExtractFileName(TC4DWizardUtilsOTA.GetCurrentProject.FileName) = TC4DConsts.C_C4D_WIZARD_DPROJ)then
203+
//if(TC4DWizardUtils.FileNameIsC4DWizardDPROJ(TC4DWizardUtilsOTA.GetCurrentProject.FileName))then
204204
// Exit;
205205

206206
Result := FIOTAMessageServices.AddMessageGroup(FGroupName.Trim);

Src/Utils/C4D.Wizard.Utils.pas

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,11 @@ interface
2323
type
2424
TC4DWizardUtils = class
2525
private
26-
class function ShowMsgInternal(
27-
const AMsg: string;
28-
const ADetails: string;
29-
const AIcon: TC4DWizardIcon;
30-
const AButtons: TC4DButtons;
31-
const ABtnFocu: TC4DBtnFocu;
32-
const AWinControlFocu: TWinControl): Boolean;
26+
class function ShowMsgInternal(const AMsg, ADetails: string; const AIcon: TC4DWizardIcon;
27+
const AButtons: TC4DButtons; const ABtnFocu: TC4DBtnFocu; const AWinControlFocu: TWinControl): Boolean;
3328
class function GetPathFromProcessID(const AProcessID: cardinal): string;
3429
public
30+
class function FileNameIsC4DWizardDPROJ(const AFileName: string): Boolean;
3531
class procedure RemoveBlankSpaceInBegin(var AValue: string; const ACount: Integer);
3632
class function BlankSpaceInBegin(const AValue: string): Integer;
3733
class procedure WaitingScreenShow(const AMsg: string = '');
@@ -140,6 +136,11 @@ function PathRelativePathTo(pszPath: PChar; pszFrom: PChar; dwAttrFrom: DWORD; p
140136
function PathCanonicalize(lpszDst: PChar; lpszSrc: PChar): LongBool; stdcall; external 'shlwapi.dll' name 'PathCanonicalizeW';
141137
{$ENDREGION}
142138

139+
class function TC4DWizardUtils.FileNameIsC4DWizardDPROJ(const AFileName: string): Boolean;
140+
begin
141+
Result := ExtractFileName(AFileName) = TC4DConsts.C_C4D_WIZARD_DPROJ;
142+
end;
143+
143144
class procedure TC4DWizardUtils.RemoveBlankSpaceInBegin(var AValue: string; const ACount: Integer);
144145
begin
145146
if(ACount <= 0)then
@@ -892,12 +893,8 @@ class function TC4DWizardUtils.IsBpr(const AFilePath: string): Boolean;
892893

893894
{$REGION 'MessagesImplementation'}
894895

895-
class function TC4DWizardUtils.ShowMsgInternal(const AMsg: string;
896-
const ADetails: string;
897-
const AIcon: TC4DWizardIcon;
898-
const AButtons: TC4DButtons;
899-
const ABtnFocu: TC4DBtnFocu;
900-
const AWinControlFocu: TWinControl): Boolean;
896+
class function TC4DWizardUtils.ShowMsgInternal(const AMsg, ADetails: string; const AIcon: TC4DWizardIcon;
897+
const AButtons: TC4DButtons; const ABtnFocu: TC4DBtnFocu; const AWinControlFocu: TWinControl): Boolean;
901898
begin
902899
Application.CreateForm(TC4DWizardViewDialog, C4DWizardViewDialog);
903900
try

0 commit comments

Comments
 (0)