Skip to content

Commit 66a2975

Browse files
authored
Feature: use package from GitHub (#13)
use AccessCodeLib/ACLibImportWizard-Packages for default package repo
1 parent a77eb60 commit 66a2975

File tree

6 files changed

+193
-108
lines changed

6 files changed

+193
-108
lines changed

source/dbs-properties.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
"Type": 4
102102
},
103103
"NavPane Width": {
104-
"Value": 215,
104+
"Value": 494,
105105
"Type": 4
106106
},
107107
"Never Cache": {

source/forms/ACLibImportWizardForm.bas

Lines changed: 83 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ Begin Form
1616
GridY =10
1717
Width =10214
1818
DatasheetFontHeight =11
19-
ItemSuffix =91
20-
Left =3255
21-
Top =2940
22-
Right =15975
23-
Bottom =12750
19+
ItemSuffix =93
20+
Left =5355
21+
Top =3278
22+
Right =17190
23+
Bottom =10020
2424
OnUnload ="[Event Procedure]"
2525
RecSrcDt = Begin
2626
0x212b6fd80e9ce340
@@ -733,7 +733,7 @@ Begin Form
733733
Width =561
734734
Height =228
735735
FontSize =8
736-
TabIndex =2
736+
TabIndex =3
737737
BackColor =14151142
738738
BorderColor =0
739739
ForeColor =0
@@ -764,71 +764,100 @@ Begin Form
764764
SpecialEffect =0
765765
OldBorderStyle =0
766766
OverlapFlags =93
767-
Left =113
768-
Top =105
769-
Width =8330
770-
Height =397
771-
TabIndex =3
767+
Left =53
768+
Top =53
769+
Width =9414
770+
Height =454
771+
TabIndex =2
772772
Name ="ogRepositorySource"
773773
AfterUpdate ="[Event Procedure]"
774774

775-
LayoutCachedLeft =113
776-
LayoutCachedTop =105
777-
LayoutCachedWidth =8443
778-
LayoutCachedHeight =502
775+
LayoutCachedLeft =53
776+
LayoutCachedTop =53
777+
LayoutCachedWidth =9467
778+
LayoutCachedHeight =507
779779
Begin
780780
Begin OptionButton
781781
OverlapFlags =87
782-
Left =3855
783-
Top =203
784-
OptionValue =1
782+
Left =3878
783+
Top =195
784+
OptionValue =2
785785
Name ="Option56"
786786

787-
LayoutCachedLeft =3855
788-
LayoutCachedTop =203
789-
LayoutCachedWidth =4115
790-
LayoutCachedHeight =443
787+
LayoutCachedLeft =3878
788+
LayoutCachedTop =195
789+
LayoutCachedWidth =4138
790+
LayoutCachedHeight =435
791791
Begin
792792
Begin Label
793793
OverlapFlags =247
794-
Left =4085
795-
Top =173
794+
Left =4108
795+
Top =165
796796
Width =1921
797797
Height =293
798798
Name ="Label57"
799799
Caption ="GitHub (web access)"
800-
LayoutCachedLeft =4085
801-
LayoutCachedTop =173
802-
LayoutCachedWidth =6006
803-
LayoutCachedHeight =466
800+
LayoutCachedLeft =4108
801+
LayoutCachedTop =165
802+
LayoutCachedWidth =6029
803+
LayoutCachedHeight =458
804804
End
805805
End
806806
End
807807
Begin OptionButton
808808
OverlapFlags =87
809-
Left =6292
810-
Top =203
809+
Left =6180
810+
Top =195
811+
Width =365
811812
TabIndex =1
812-
OptionValue =2
813+
OptionValue =6
814+
Name ="Option91"
815+
816+
LayoutCachedLeft =6180
817+
LayoutCachedTop =195
818+
LayoutCachedWidth =6545
819+
LayoutCachedHeight =435
820+
Begin
821+
Begin Label
822+
OverlapFlags =247
823+
Left =6410
824+
Top =165
825+
Width =1013
826+
Height =293
827+
Name ="Label92"
828+
Caption ="Packages"
829+
LayoutCachedLeft =6410
830+
LayoutCachedTop =165
831+
LayoutCachedWidth =7423
832+
LayoutCachedHeight =458
833+
End
834+
End
835+
End
836+
Begin OptionButton
837+
OverlapFlags =87
838+
Left =7507
839+
Top =195
840+
TabIndex =2
841+
OptionValue =1
813842
Name ="Option58"
814843

815-
LayoutCachedLeft =6292
816-
LayoutCachedTop =203
817-
LayoutCachedWidth =6552
818-
LayoutCachedHeight =443
844+
LayoutCachedLeft =7507
845+
LayoutCachedTop =195
846+
LayoutCachedWidth =7767
847+
LayoutCachedHeight =435
819848
Begin
820849
Begin Label
821850
OverlapFlags =247
822-
Left =6522
823-
Top =173
851+
Left =7737
852+
Top =165
824853
Width =1643
825854
Height =293
826855
Name ="Label59"
827856
Caption ="Local repository"
828-
LayoutCachedLeft =6522
829-
LayoutCachedTop =173
830-
LayoutCachedWidth =8165
831-
LayoutCachedHeight =466
857+
LayoutCachedLeft =7737
858+
LayoutCachedTop =165
859+
LayoutCachedWidth =9380
860+
LayoutCachedHeight =458
832861
End
833862
End
834863
End
@@ -900,9 +929,9 @@ Begin Form
900929
OverlapFlags =85
901930
TextAlign =1
902931
IMESentenceMode =3
903-
Left =6135
932+
Left =6143
904933
Top =960
905-
Width =1703
934+
Width =1786
906935
Height =293
907936
TabIndex =8
908937
Name ="txtRepoName"
@@ -912,9 +941,9 @@ Begin Form
912941
BottomPadding =150
913942
HorizontalAnchor =2
914943

915-
LayoutCachedLeft =6135
944+
LayoutCachedLeft =6143
916945
LayoutCachedTop =960
917-
LayoutCachedWidth =7838
946+
LayoutCachedWidth =7929
918947
LayoutCachedHeight =1253
919948
ColumnStart =4
920949
ColumnEnd =4
@@ -952,7 +981,7 @@ Begin Form
952981
OverlapFlags =85
953982
TextAlign =1
954983
IMESentenceMode =3
955-
Left =3600
984+
Left =3608
956985
Top =960
957986
Width =1703
958987
Height =293
@@ -963,9 +992,9 @@ Begin Form
963992
GroupTable =1
964993
BottomPadding =150
965994

966-
LayoutCachedLeft =3600
995+
LayoutCachedLeft =3608
967996
LayoutCachedTop =960
968-
LayoutCachedWidth =5303
997+
LayoutCachedWidth =5311
969998
LayoutCachedHeight =1253
970999
ColumnStart =2
9711000
ColumnEnd =2
@@ -1023,7 +1052,7 @@ Begin Form
10231052
OverlapFlags =85
10241053
TextAlign =1
10251054
IMESentenceMode =3
1026-
Left =8805
1055+
Left =8813
10271056
Top =960
10281057
Width =1290
10291058
Height =293
@@ -1035,9 +1064,9 @@ Begin Form
10351064
BottomPadding =150
10361065
HorizontalAnchor =2
10371066

1038-
LayoutCachedLeft =8805
1067+
LayoutCachedLeft =8813
10391068
LayoutCachedTop =960
1040-
LayoutCachedWidth =10095
1069+
LayoutCachedWidth =10103
10411070
LayoutCachedHeight =1253
10421071
ColumnStart =6
10431072
ColumnEnd =6
@@ -1050,15 +1079,15 @@ Begin Form
10501079
Begin Label
10511080
OverlapFlags =85
10521081
TextAlign =3
1053-
Left =7905
1082+
Left =7988
10541083
Top =960
1055-
Width =840
1084+
Width =757
10561085
Height =293
10571086
Name ="Label78"
10581087
Caption ="Branch:"
10591088
GroupTable =1
10601089
BottomPadding =150
1061-
LayoutCachedLeft =7905
1090+
LayoutCachedLeft =7988
10621091
LayoutCachedTop =960
10631092
LayoutCachedWidth =8745
10641093
LayoutCachedHeight =1253

source/forms/ACLibImportWizardForm.cls

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ Option Explicit
1919
' verwendete Erweiterungen
2020
Private Const EXTENSION_KEY_APPFILE As String = "AppFile"
2121
Private Const APPFILE_PROPNAME_APPICON As String = "AppIcon"
22-
Private Const RepositorySource_GitHub As Long = 1
23-
Private Const RepositorySource_LocalRepository As Long = 2
22+
Private Const RepositorySource_LocalRepository As Long = 1
23+
Private Const RepositorySource_GitHub As Long = 2
24+
Private Const RepositorySource_Package As Long = 4
2425

2526
Private Const TEMPDB_TABNAME As String = "tRepositoryFiles"
2627
Private Const TEMPDB_TABDDL As String = "create table " & TEMPDB_TABNAME & " (LocalRepositoryPath varchar(255) primary key, ObjectName varchar(255), Description memo)"
@@ -171,7 +172,7 @@ On Error GoTo HandleErr
171172
Me.Repaint
172173

173174
Set ACLibFileMngr = CurrentACLibFileManager
174-
If Me.ogRepositorySource = RepositorySource_GitHub Then
175+
If (Me.ogRepositorySource And RepositorySource_GitHub) = RepositorySource_GitHub Then
175176
Set m_ACLibFileManager = ACLibFileMngr
176177
Else '
177178
Set m_ACLibFileManager = Nothing
@@ -409,7 +410,9 @@ On Error GoTo HandleErr
409410
Loop
410411
End If
411412

412-
StartFolder = CurrentLocalRepositoryPath & StartFolder
413+
If Mid(StartFolder, 2, 1) <> ":" Then
414+
StartFolder = CurrentLocalRepositoryPath & StartFolder
415+
End If
413416
Do While Not DirExists(StartFolder)
414417
Pos = InStrRev(StartFolder, "\")
415418
If Pos = 0 Then Exit Do
@@ -670,13 +673,30 @@ Private Sub ConfigReproSourceMode(Optional NewMode As Long = 0)
670673
End Sub
671674

672675
Private Sub SetACLibGitHubImporterConfig()
673-
If Me.ogRepositorySource = RepositorySource_GitHub Then
674-
If Len(Me.txtGitHubAuthPersonalAccessToken.Value) > 0 Then
675-
ACLibGitHubImporter.GitHubApiAuthorizationToken = Me.txtGitHubAuthPersonalAccessToken.Value
676-
End If
676+
If (Me.ogRepositorySource.Value And RepositorySource_GitHub) = RepositorySource_GitHub Then
677+
If Len(Me.txtGitHubAuthPersonalAccessToken.Value) > 0 Then
678+
ACLibGitHubImporter.GitHubApiAuthorizationToken = Me.txtGitHubAuthPersonalAccessToken.Value
679+
End If
680+
If (Me.ogRepositorySource.Value And RepositorySource_Package) = RepositorySource_Package Then
681+
SetRepositoryData "AccessCodeLib", "ACLibImportWizard-Package", "main"
682+
ElseIf Me.txtRepoName.Value = "ACLibImportWizard-Package" Then
683+
SetRepositoryData "AccessCodeLib", "AccessCodeLib", "master"
684+
End If
677685
End If
678686
End Sub
679687

688+
Private Sub SetRepositoryData(ByVal RepositoryOwner As String, ByVal RepositoryName As String, ByVal BranchName As String)
689+
690+
Me.txtRepoOwner.Value = RepositoryOwner
691+
Me.txtRepoName.Value = RepositoryName
692+
Me.txtRepoBranch.Value = BranchName
693+
694+
ACLibGitHubImporter.RepositoryOwner = RepositoryOwner
695+
ACLibGitHubImporter.RepositoryName = RepositoryName
696+
ACLibGitHubImporter.BranchName = BranchName
697+
698+
End Sub
699+
680700
Private Sub Form_Unload(ByRef Cancel As Integer)
681701
On Error Resume Next
682702
If Not (m_TempDb Is Nothing) Then
@@ -846,7 +866,7 @@ Private Sub AddFileFromFileName(ByVal ACLibFileString As String)
846866

847867
On Error GoTo HandleErr
848868

849-
If Me.ogRepositorySource = RepositorySource_GitHub Then
869+
If (Me.ogRepositorySource.Value And RepositorySource_GitHub) = RepositorySource_GitHub Then
850870

851871
FileArray(0) = ACLibFileString
852872
DownLoadFiles FileArray
@@ -1139,7 +1159,7 @@ Private Sub OpenRepositoryFileInTextViewer(ByVal ACLibPath As String)
11391159

11401160
Dim FullPath As String
11411161

1142-
If Me.ogRepositorySource = RepositorySource_GitHub Then
1162+
If (Me.ogRepositorySource.Value And RepositorySource_GitHub) = RepositorySource_GitHub Then
11431163
FullPath = DownLoadFile(ACLibPath)
11441164
Else
11451165
FullPath = CurrentACLibFileManager.GetRepositoryFullPath(ACLibPath)

0 commit comments

Comments
 (0)