Use Windows.pkg Use Cursor.pkg Use vWin32fh.pkg Use cRDCCJSelectionGrid.pkg Use cCJCommandBarSystem.pkg Use SourceCode.inc Use cRefactorTextbox.pkg Use cRDCButtonDPI.pkg Use cRDCModalPanel.pkg Object oBackupFiles_dg is a cRDCModalPanel Set Label to "Move Backup Files Back to Original Folder(s)" Set Size to 209 549 Set Location to 2 2 Set piMinSize to 209 548 Set Icon to "UndoRefactoring.ico" Property tsSearchResult[] psaSearchResultArray Object oBackupFiles_grd is a cRDCCJSelectionGrid Set Size to 164 522 Set Location to 14 14 Object oCJGridColumnRowIndicator is a cCJGridColumnRowIndicator Set piWidth to 24 Set pbResizable to False End_Object Object oFileName_col is a cCJGridColumn Set piWidth to 217 Set psCaption to "Backup File Name" Set psToolTip to "Backup file name without path" End_Object Object oFileDate_col is a cCJGridColumn Set piWidth to 183 Set psCaption to "File Date & Time" Set psToolTip to "The backed up file name including full path" Set pbResizable to False End_Object Object oPath_col is a cCJGridColumn // This must be here: Set phoData_Col to Self Set piWidth to 657 Set psCaption to "Full Path and File Name" End_Object Procedure LoadData Handle hoDataSource tDataSourceRow[] TheData TheDataEmpty tsSearchResult[] saSearchResultArray Integer iSize iRow iCount iFileNameCol iPathCol iFileDateCol iCheckBoxCol If (not(IsComObjectCreated(Self))) Begin Procedure_Return End Get psaSearchResultArray to saSearchResultArray Move (SizeOfArray(saSearchResultArray)) to iSize If (iSize = 0) Begin Procedure_Return End Move 0 to iCount Decrement iSize Get phoDataSource to hoDataSource Get DataSource of hoDataSource to TheData Move TheDataEmpty to TheData Get piColumnId of oFileName_col to iFileNameCol Get piColumnId of oFileDate_col to iFileDateCol Get piColumnId of oPath_col to iPathCol Get piColumnId of (phoCheckbox_Col(Self)) to iCheckBoxCol Move 0 to iRow For iCount from 0 to iSize Move saSearchResultArray[iCount].sFilename to TheData[iRow].sValue[iFileNameCol] Move saSearchResultArray[iCount].dtLastWriteDateTime to TheData[iRow].sValue[iFileDateCol] Move (Trim(saSearchResultArray[iCount].sAlternateFileName) + Trim(saSearchResultArray[iCount].sFilename)) to TheData[iRow].sValue[iPathCol] Move False to TheData[iRow].sValue[iCheckBoxCol] Increment iRow Loop If (iRow <> 0) Begin Send ReInitializeData TheData False Send MoveToFirstRow End Else Begin Send InitializeData TheDataEmpty End Get CheckedItems to iCount Set psFooterText of oFileName_col to ("No of Backup Files:" * String(iCount)) End_Procedure End_Object Object oInfo_tb is a cRefactorTextbox Set Size to 10 315 Set Location to 189 45 Set Label to "The selected backup files will be moved to their original place, overwriting what is already there." Set peAnchors to anBottomRight Set Justification_Mode to JMode_Left End_Object Object oOK_Btn is a cRDCButtonDPI Set Size to 14 60 Set Label to "Move Files" Set Location to 186 364 Set peAnchors to anBottomRight Set psToolTip to "The selected backup files will be moved to their original place, overwriting what is already there." Set psImage to "ActionMoveBack.ico" Set pbAutoEnable to True Procedure OnClick Integer iCheckedItems iRetval Get CheckedItems of oBackupFiles_grd to iCheckedItems If (iCheckedItems = 0) Begin Send Info_Box "No backup files selected - nothing to do." Procedure_Return End Get YesNo_Box ("Are you sure you want to overwrite" * String(iCheckedItems) * "source file(s) with the selected backup file(s)?\n\nNo check will be performed if files already exists. Nor will any check be done if files are newer or not.") to iRetval If (iRetval <> MBR_Yes) Begin Procedure_Return End Get YesNo_Box ("Are you REALLY sure?") to iRetval If (iRetval <> MBR_Yes) Begin Procedure_Return End Send MoveBackBackupFiles Send Info_Box "Ready!" Send Close_Panel End_Procedure Function IsEnabled Returns Boolean Integer iCheckedItems Get CheckedItems of oBackupFiles_grd to iCheckedItems Function_Return (iCheckedItems <> 0) End_Function End_Object Object oCompare_btn is a cRDCButtonDPI Set Location to 186 428 Set Label to "Compare" Set psImage to "Compare.ico" Set psToolTip to "Start the compare tool that has been setup on the 'Program Settings' dialog, to compare and copy files from the backup area." Set pbAutoEnable to True Set peAnchors to anBottomRight Procedure OnClick String sCompareApp Get psFileCompareApp of ghoApplication to sCompareApp Send ComparePaths of ghoApplication sCompareApp End_Procedure Function IsEnabled Returns Boolean String sCompareApp Boolean bOK Move False to bOK Get psFileCompareApp of ghoApplication to sCompareApp Move (sCompareApp <> "") to bOK Function_Return bOK End_Function End_Object Object oCancel_Btn is a cRDCButton Set Label to "&Close" Set Location to 186 486 Set peAnchors to anBottomRight Procedure OnClick Send Close_Panel End_Procedure End_Object Object oTextBox1 is a TextBox Set Size to 9 86 Set Location to 3 25 Set Label to "Right click grid for options" End_Object Procedure MoveBackBackupFiles Integer iSize iCount iRetval String sBackupFileName sSourceFileName String[] saSelectedItems Get SelectedItems of oBackupFiles_grd to saSelectedItems Move (SizeOfArray(saSelectedItems)) to iSize Decrement iSize For iCount from 0 to iSize Move saSelectedItems[iCount] to sBackupFileName Move (Replace((CS_DirSeparator + CS_BackupFolder), sBackupFileName, "")) to sSourceFileName Get vMoveFile sBackupFileName sSourceFileName to iRetval If (iRetval = 0) Begin Showln "Moved File: " sBackupFileName " To: " sSourceFileName End Else Begin Showln "Error moving file: " sBackupFileName End Loop End_Procedure On_Key Key_Alt+Key_A Send SelectAll On_Key Key_Ctrl+Key_A Send SelectAll On_Key Key_Alt+Key_N Send SelectNone On_Key Key_Ctrl+Key_N Send SelectNone On_Key Key_Alt+Key_I Send SelectInvert On_Key Key_Ctrl+Key_I Send SelectInvert On_Key Key_Alt+Key_C Send KeyAction of oCancel_Btn End_Object Procedure FillBackupFilesDialog tsSearchResult[] SearchResultArray Handle ho Move (oBackupFiles_dg(Self)) to ho Set psaSearchResultArray of ho to SearchResultArray Send Popup of ho End_Procedure