Skip to content

Commit

Permalink
Add Split Files utility to ribbon (Advanced Tools)
Browse files Browse the repository at this point in the history
Also added an informational message box when the split is complete.
  • Loading branch information
joyfullservice committed Nov 14, 2023
1 parent b7985e9 commit fe35d3b
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Ribbon/Ribbon.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<button id="btnExportSelected" size="large" label="Export Selected" supertip="Export the database component currently selected in the navigation pane." imageMso="SelectionPane" tag="RibbonName:=;inMenu:=;CustomTagValue1:=;CustomTagValue2:=;CustomTagValue3:=;CustomPicture:=;CustomPicturePath:=" onAction="OnActionButton" getVisible="GetVisible" getEnabled="GetEnabled" />
<separator id="sep2" getVisible="GetVisible" />
<button id="btnBuild" size="large" label="Build From Source" supertip="Build the current project from source files." imageMso="FileCompactAndRepairDatabase" tag="RibbonName:=;inMenu:=;CustomTagValue1:=;CustomTagValue2:=;CustomTagValue3:=;CustomPicture:=;CustomPicturePath:=" onAction="OnActionButton" getVisible="GetVisible" getEnabled="GetEnabled" />
<button id="btnMergeBuild" size="large" label="Merge Build" supertip="Merge changed source files into the current database." imageMso="AdpDiagramArrangeTables" tag="RibbonName:=;inMenu:=;CustomTagValue1:=;CustomTagValue2:=;CustomTagValue3:=;CustomPicture:=;CustomPicturePath:=" onAction="OnActionButton" getVisible="GetVisible" getEnabled="GetEnabled" />
<button id="btnMergeBuild" size="large" label="Merge Build" supertip="Merge changed source files into the current database." imageMso="CellsInsertDialog" tag="RibbonName:=;inMenu:=;CustomTagValue1:=;CustomTagValue2:=;CustomTagValue3:=;CustomPicture:=;CustomPicturePath:=" onAction="OnActionButton" getVisible="GetVisible" getEnabled="GetEnabled" />
<button id="btnBuildAs" size="large" label="Build As․․․" supertip="Build from source files to a new name or location." imageMso="FileSaveAs" tag="RibbonName:=;inMenu:=;CustomTagValue1:=;CustomTagValue2:=;CustomTagValue3:=;CustomPicture:=;CustomPicturePath:=" onAction="OnActionButton" getVisible="GetVisible" getEnabled="GetEnabled" />
<button id="btnLoadSelected" size="large" label="Load Selected" supertip="Import from source files the database component currently selected in the navigation pane." imageMso="AlignDialog" tag="RibbonName:=;inMenu:=;CustomTagValue1:=;CustomTagValue2:=;CustomTagValue3:=;CustomPicture:=;CustomPicturePath:=" onAction="OnActionButton" getVisible="GetVisible" getEnabled="GetEnabled" />
</group>
Expand All @@ -29,6 +29,7 @@
<button id="btnGoToLinkAdvancedTools" label="View Documentation" description="See documentation on the purpose and usage of these custom tools..." imageMso="TentativeAcceptInvitation" tag="RibbonName:=;inMenu:=mnu15;CustomTagValue1:=;CustomTagValue2:=;CustomTagValue3:=;CustomPicture:=;CustomPicturePath:=" onAction="OnActionButton" getVisible="GetVisible" getEnabled="GetEnabled" />
<button id="btnLocalizeLibraryReferences" label="Localize Library References" description="Relink add-in library databases to the files located in the same folder as the current database" imageMso="MacroShowAllActions" tag="RibbonName:=;inMenu:=mnu15;CustomTagValue1:=;CustomTagValue2:=;CustomTagValue3:=;CustomPicture:=;CustomPicturePath:=" onAction="OnActionButton" getVisible="GetVisible" getEnabled="GetEnabled" />
<button id="btnRepairColors" label="Repair Colors" description="Rebuild color definition blocks in form objects (See documentation for more info)" supertip="test2" imageMso="SmartArtChangeColorsGallery" tag="RibbonName:=;inMenu:=mnu15;CustomTagValue1:=;CustomTagValue2:=;CustomTagValue3:=;CustomPicture:=;CustomPicturePath:=" onAction="OnActionButton" getVisible="GetVisible" getEnabled="GetEnabled" />
<button id="btnSplitFiles" label="Split Files" description="Duplicate files while preserving Git line history" imageMso="AdpDiagramArrangeTables" tag="RibbonName:=;inMenu:=mnuAdvancedTools;CustomTagValue1:=;CustomTagValue2:=;CustomTagValue3:=;CustomPicture:=;CustomPicturePath:=" onAction="OnActionButton" getVisible="GetVisible" getEnabled="GetEnabled" />
<button id="btnActivateHook" label="Activate Hook" description="Enable Access Application hook to report saving of objects and enabling automatic export on save." supertip="Activate Hook" imageMso="Call" tag="RibbonName:=;inMenu:=;CustomTagValue1:=;CustomTagValue2:=;CustomTagValue3:=;CustomPicture:=;CustomPicturePath:=" onAction="OnActionButton" getVisible="GetVisible" getEnabled="GetEnabled" />
<button id="btnReloadRibbon" label="Reload Ribbon" description="Refresh the add-in ribbon menu to reflect changes in XML source" imageMso="DataRefreshAll" tag="RibbonName:=;inMenu:=mnuAdvancedTools;CustomTagValue1:=;CustomTagValue2:=;CustomTagValue3:=;CustomPicture:=;CustomPicturePath:=" onAction="OnActionButton" getVisible="GetVisible" getEnabled="GetEnabled" />
</menu>
Expand Down
9 changes: 9 additions & 0 deletions Version Control.accda.src/forms/frmVCSSplitFiles.bas
Original file line number Diff line number Diff line change
Expand Up @@ -1040,7 +1040,16 @@ Private Sub cmdSplitFiles_Click()
MsgBox2 "Validation Failed", strError, "Please correct the problem to continue.", vbExclamation
Else
' Split the files using git commands
DoCmd.Hourglass True
Git.SplitFilesWithHistory strPaths, strNew, txtCommitMessage
DoCmd.Hourglass False

' Show success message
MsgBox2 "Finished", "The operation is complete.", _
"For additional details, please see `git.log` in the source folder.", vbInformation

' Clear existing list
txtFileList = vbNullString
End If

' Restore original working folder
Expand Down
12 changes: 12 additions & 0 deletions Version Control.accda.src/modules/clsVersionControl.cls
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,18 @@ Public Sub RepairColors()
End Sub


'---------------------------------------------------------------------------------------
' Procedure : SplitFiles
' Author : Adam Waller
' Date : 11/14/2023
' Purpose :
'---------------------------------------------------------------------------------------
'
Public Sub SplitFiles()
DoCmd.OpenForm "frmVCSSplitFiles"
End Sub


'---------------------------------------------------------------------------------------
' Procedure : LocalizeLibraryReferences
' Author : Adam Waller
Expand Down

0 comments on commit fe35d3b

Please sign in to comment.