Skip to content

Commit

Permalink
Update cRefactorEngine.pkg
Browse files Browse the repository at this point in the history
Additions and changes for the new status panel. (RefactorStatusPanel.pkg)
  • Loading branch information
NilsSve committed Dec 6, 2023
1 parent 3f6fe71 commit 5726937
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions AppSrc/cRefactorEngine.pkg
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// This class is automatically instantiated by the cRefactorApplication class. See: End_Construct_Object
//
Use BatchDD.pkg
Use seq_chnl.pkg
Use BatchDD.pkg
Use RefactorStatusPanel.pkg

// Needs to be before any usage of other cRefactor classes
Global_Variable Handle ghoRefactorEngine
Expand Down Expand Up @@ -49,7 +50,8 @@ Class cRefactorEngine is a BusinessProcess

Procedure End_Construct_Object
Forward Send End_Construct_Object

// Override of weird setting in the BatchDD class.
Set Status_Panel_Id to ghoStatusPanel
End_Procedure

// Collect all settings to one common struct to be passed amongst the main operating procedures.
Expand Down Expand Up @@ -215,7 +217,11 @@ Class cRefactorEngine is a BusinessProcess

Move 0 to iTotNoOfFiles
Move 0 to iTotNoOfLines
Move 0 to iRetval
Move 0 to iRetval

Set piPosition of ghoProgressBarOverall to 0
Set piAdvanceBy of ghoProgressBarOverall to 1
Set piMaximum of ghoProgressBarOverall to (SizeOfArray(RefactorSettings.FileData.asFullFileNames))

If (RefactorSettings.iSelectedLineByLineFunctions or RefactorSettings.iSelectedFullFileFunctions) Begin
Move (SizeOfArray(RefactorSettings.FileData.asFolders)) to iFolders
Expand All @@ -233,10 +239,14 @@ Class cRefactorEngine is a BusinessProcess
Error DFErr_Program "Filen name in array is blank, cannot continue. (GetTheWorkDone)"
Function_Return eEngineSelError
End
Send DoAdvance of ghoProgressBarOverall
Get ParseFolderName sFileName to sFolderName
Get ParseFileName sFileName to sFileShort
Get ReadFileToStringArray sFileName to asCode
Move asCode to asCodeOrg
Set piPosition of ghoProgressBar to 0
Set piAdvanceBy of ghoProgressBar to 1
Set piMaximum of ghoProgressBar to (SizeOfArray(asCodeOrg))
Send ResetFuncLibProperties of ghoRefactorFuncLib

// We do _not_ refactor files generated by the Studio for COM components (.ocx files et al)
Expand Down Expand Up @@ -365,6 +375,7 @@ Class cRefactorEngine is a BusinessProcess
Move True to bOK

For iLine from 0 to iSize
Send DoAdvance of ghoProgressBar
Send UpdateStatusBar ("Refactoring line:" * String(iLine) * "of:" * String(iSize + 1)) True
Set Action_Text of ghoStatusPanel to ("Refactoring line:" * String(iLine) * "of:" * String(iSize + 1))

Expand Down

0 comments on commit 5726937

Please sign in to comment.