Skip to content
Merged
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 source/dbs-properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
"Type": 4
},
"NavPane Width": {
"Value": 494,
"Value": 557,
"Type": 4
},
"Never Cache": {
Expand Down
73 changes: 44 additions & 29 deletions source/forms/ACLibImportWizardForm.bas
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ Begin Form
GridY =10
Width =10214
DatasheetFontHeight =11
ItemSuffix =93
Left =5355
Top =3278
Right =17190
Bottom =10020
ItemSuffix =95
Left =4178
Top =3030
Right =16673
Bottom =12195
OnUnload ="[Event Procedure]"
RecSrcDt = Begin
0x212b6fd80e9ce340
Expand Down Expand Up @@ -367,7 +367,7 @@ Begin Form
Top =7456
Width =2205
Height =555
TabIndex =20
TabIndex =19
Name ="cmdImportFiles"
Caption ="&Import files"
OnClick ="[Event Procedure]"
Expand Down Expand Up @@ -539,27 +539,6 @@ Begin Form
LayoutCachedWidth =6815
LayoutCachedHeight =7501
End
Begin CommandButton
Visible = NotDefault
Enabled = NotDefault
OverlapFlags =215
Left =7042
Top =6196
Width =2925
Height =555
TabIndex =19
Name ="Command25"
Caption ="Show dependencies"
Tag ="LANG:"
HorizontalAnchor =1
VerticalAnchor =1

LayoutCachedLeft =7042
LayoutCachedTop =6196
LayoutCachedWidth =9967
LayoutCachedHeight =6751
Overlaps =1
End
Begin Label
Visible = NotDefault
OverlapFlags =215
Expand Down Expand Up @@ -598,7 +577,7 @@ Begin Form
Name ="chkImportTests"
AfterUpdate ="[Event Procedure]"
DefaultValue ="False"
ControlTipText ="Die Testklassen der importierten Code-Modulen ebenfalls importieren"
ControlTipText ="Import tests for imported code modules"
UnicodeAccessKey =116
HorizontalAnchor =1
VerticalAnchor =1
Expand Down Expand Up @@ -705,7 +684,7 @@ Begin Form
Top =7456
Width =555
Height =555
TabIndex =21
TabIndex =20
Name ="cmdOpenMenu"
Caption ="..."
OnClick ="[Event Procedure]"
Expand Down Expand Up @@ -1100,6 +1079,42 @@ Begin Form
End
End
End
Begin CheckBox
OverlapFlags =215
AccessKey =69
Left =7043
Top =6015
TabIndex =21
Name ="chkExamples"
DefaultValue ="False"
ControlTipText ="Import example code modules"
UnicodeAccessKey =101
HorizontalAnchor =1
VerticalAnchor =1

LayoutCachedLeft =7043
LayoutCachedTop =6015
LayoutCachedWidth =7303
LayoutCachedHeight =6255
Begin
Begin Label
OverlapFlags =215
Left =7319
Top =5955
Width =2730
Height =315
Name ="Label94"
Caption ="incl. &examples"
Tag ="LANG:"
HorizontalAnchor =1
VerticalAnchor =1
LayoutCachedLeft =7319
LayoutCachedTop =5955
LayoutCachedWidth =10049
LayoutCachedHeight =6270
End
End
End
End
End
End
Expand Down
2 changes: 1 addition & 1 deletion source/forms/ACLibImportWizardForm.cls
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ On Error GoTo HandleErr
Else '
Set m_ACLibFileManager = Nothing
End If
ACLibFileMngr.ImportRepositoryFiles FileNameArray, Nz(Me.ogImportMode.Value, 0), Nz(Me.chkImportTests.Value, False)
ACLibFileMngr.ImportRepositoryFiles FileNameArray, Nz(Me.ogImportMode.Value, 0), Nz(Me.chkImportTests.Value, False), Nz(Me.chkExamples.Value, False)

Me.labInfo.Caption = L10n.Text("Files have been imported")
Me.Repaint
Expand Down
62 changes: 50 additions & 12 deletions source/modules/ACLibFileManager.cls
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ Private Const SEARCHSTRING_REF_GUID_BEGIN As String = "<guid>"
Private Const SEARCHSTRING_REF_GUID_END As String = "</guid>"
Private Const SEARCHSTRING_TEST_BEGIN As String = "<test>"
Private Const SEARCHSTRING_TEST_END As String = "</test>"
Private Const SEARCHSTRING_EXAMPLE_BEGIN As String = "<example>"
Private Const SEARCHSTRING_EXAMPLE_END As String = "</example>"

Private Const SEARCHSTRING_EXECUTE_BEGIN As String = "<execute>"
Private Const SEARCHSTRING_EXECUTE_END As String = "</execute>"
Expand Down Expand Up @@ -268,7 +270,8 @@ Public Sub ExportAllReports()
End Sub

Public Sub ImportAllFilesFromRepository(Optional ByVal ImportMode As CodeLibImportMode = clim_ImportMissingItems, _
Optional ByVal ImportTestFiles As Boolean = False)
Optional ByVal ImportTestFiles As Boolean = False, _
Optional ByVal ImportExampleFiles As Boolean = False)

Dim FolderCol As Collection
#If EARLYBINDING Then
Expand Down Expand Up @@ -309,13 +312,14 @@ Public Sub ImportAllFilesFromRepository(Optional ByVal ImportMode As CodeLibImpo
Set TempFile = Nothing
Set FolderCol = Nothing

ImportFilesFromImportCollection True, ImportTestFiles
ImportFilesFromImportCollection True, ImportTestFiles, ImportExampleFiles

End Sub

Public Sub ImportRepositoryFile(ByVal RepositoryPath As String, _
Optional ByVal ImportMode As CodeLibImportMode = clim_ImportMissingItems, _
Optional ByVal ImportTestFiles As Boolean = False)
Optional ByVal ImportTestFiles As Boolean = False, _
Optional ByVal ImportExampleFiles As Boolean = False)

Dim PathString As String

Expand All @@ -326,13 +330,14 @@ Public Sub ImportRepositoryFile(ByVal RepositoryPath As String, _
AddMissingFile TempFile, ImportMode
Set TempFile = Nothing

ImportFilesFromImportCollection True, ImportTestFiles
ImportFilesFromImportCollection True, ImportTestFiles, ImportExampleFiles

End Sub

Public Sub ImportRepositoryFiles(ByRef RepositoryPathArray() As String, _
Optional ByVal ImportMode As CodeLibImportMode = clim_ImportMissingItems, _
Optional ByVal ImportTestFiles As Boolean = False)
Optional ByVal ImportTestFiles As Boolean = False, _
Optional ByVal ImportExampleFiles As Boolean = False)

Dim ArraySize As Long
Dim i As Long
Expand All @@ -349,13 +354,14 @@ Public Sub ImportRepositoryFiles(ByRef RepositoryPathArray() As String, _
Next
Set TempFile = Nothing

ImportFilesFromImportCollection True, ImportTestFiles
ImportFilesFromImportCollection True, ImportTestFiles, ImportExampleFiles

End Sub

Private Sub ImportFilesFromImportCollection( _
Optional ByRef CompileAfterImport As Boolean = True, _
Optional ByVal ImportTestFiles As Boolean = False)
Optional ByVal ImportTestFiles As Boolean = False, _
Optional ByVal ImportExampleFiles As Boolean = False)

Dim TempFile As Object
Dim FileImportMode As CodeLibImportMode
Expand Down Expand Up @@ -393,7 +399,7 @@ Private Sub ImportFilesFromImportCollection( _
AccessProgressBar.Init "Importiere " & TempFile & "...", 2, 1
AccessProgressBar.PerformStep

ImportFile TempFile, FileImportMode, ImportTestFiles, DownloadBase
ImportFile TempFile, FileImportMode, ImportTestFiles, ImportExampleFiles, DownloadBase

AccessProgressBar.PerformStep
MaxCnt = m_ImportFileCollection.Count
Expand Down Expand Up @@ -764,7 +770,8 @@ Private Property Get GitHubTempRepositoryPath() As String
End Property

Private Sub ImportFile(ByRef ImportFile As Object, ByRef ImportMode As CodeLibImportMode, _
Optional ByVal ImportTestFiles As Boolean = False, Optional ByVal DownloadBase As String)
Optional ByVal ImportTestFiles As Boolean = False, Optional ByRef ImportExampleFiles As Boolean = False, _
Optional ByVal DownloadBase As String)

Dim i As Long
Dim TempFile As Object
Expand All @@ -779,8 +786,6 @@ Private Sub ImportFile(ByRef ImportFile As Object, ByRef ImportMode As CodeLibIm

If Len(DownloadBase) > 0 Then
m_CLI.ForceRemoveIfExists = True
Else
Stop
End If

'Enable abort
Expand Down Expand Up @@ -843,6 +848,19 @@ Private Sub ImportFile(ByRef ImportFile As Object, ByRef ImportMode As CodeLibIm
End If
End If

'possibly the examples
If ImportExampleFiles Then
If (0 / 1) + (Not Not m_CLI.ExampleFiles) Then
For i = 0 To UBound(m_CLI.ExampleFiles)
FilePath = GetRepositoryFullPath(m_CLI.ExampleFiles(i), DownloadBase)
If fso.FileExists(FilePath) Then
Set TempFile = fso.GetFile(FilePath)
AddMissingFile TempFile, ImportMode, DownloadBase
End If
Next
End If
End If

#If DEBUGMODE Then
Debug.Print ImportFile.Path; " --> "; m_CLI.Name
#End If
Expand Down Expand Up @@ -1347,7 +1365,8 @@ End Function

Private Sub GetCodeLibInfoFromFile(ByRef CodeLibInf As CodeLibInfo, ByVal InputFile As Object, _
Optional ByVal FindDependency As Boolean = True, _
Optional ByVal FindTests As Boolean = True)
Optional ByVal FindTests As Boolean = True, _
Optional ByVal FindExamples As Boolean = True)

Dim Pos As Long
Dim CheckString As String
Expand Down Expand Up @@ -1436,6 +1455,7 @@ Private Sub GetCodeLibInfoFromFile(ByRef CodeLibInf As CodeLibInfo, ByVal InputF
If FindDependency Then GetCodeLibInfoDependency CodeLibInf, CheckString
GetCodeLibInfoReferences CodeLibInf, CheckString
If FindTests Then GetCodeLibInfoTests CodeLibInf, CheckString
If FindExamples Then GetCodeLibInfoExamples CodeLibInf, CheckString
GetCodeLibInfoDescription CodeLibInf, CheckString
GetCodeLibInfoExecuteList CodeLibInf, CheckString
End If
Expand Down Expand Up @@ -1497,6 +1517,16 @@ Private Sub GetCodeLibInfoTests(ByRef CodeLibInf As CodeLibInfo, ByRef SourceStr

End Sub

Private Sub GetCodeLibInfoExamples(ByRef CodeLibInf As CodeLibInfo, ByRef SourceString As String)

Dim Examples() As String

If GetCodelibInfoTagStrings(SourceString, SEARCHSTRING_EXAMPLE_BEGIN, SEARCHSTRING_EXAMPLE_END, Examples) > 0 Then
CodeLibInf.ExampleFiles = Examples
End If

End Sub

Private Function GetCodelibInfoTagStrings(ByRef SourceString As String, _
ByRef StartTag As String, ByRef EndTag As String, _
ByRef TagStrings() As String) As Long
Expand Down Expand Up @@ -1779,6 +1809,14 @@ Public Sub InsertCodeLibInfo(ByRef CodMod As Object, ByRef CodeLibInf As CodeLib
Next
End If

'<example> blocks
ClTagArray = CodeLibInf.ExampleFiles
If Not ((0 / 1) + (Not Not ClTagArray) = 0) Then
For i = LBound(ClTagArray) To UBound(ClTagArray)
CodeLibInfoText = CodeLibInfoText & "' <example>" & ClTagArray(i) & "</example>" & vbNewLine
Next
End If

'<execute> blocks
ExecuteList = CodeLibInf.ExecuteList
If Not ((0 / 1) + (Not Not ExecuteList) = 0) Then
Expand Down
1 change: 1 addition & 0 deletions source/modules/defGlobal_ACLibImportWizard.bas
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Public Type CodeLibInfo
Dependency() As String
References() As CodeLibInfoReference
TestFiles() As String
ExampleFiles() As String
ExecuteList() As String
LicenseFile As String
Description As String
Expand Down