Skip to content

Commit

Permalink
custom pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
vdelachaux committed Mar 11, 2020
1 parent 436621c commit 101800f
Show file tree
Hide file tree
Showing 13 changed files with 298 additions and 50 deletions.
74 changes: 37 additions & 37 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
# Ignore invisible files/folders except me
.*
!.gitignore

# Ignore data file
Data/
DATA/
data/
*.4DD
*.journal
*.4DIndx
*.Match
*symbols.txt

# Ignore derived data
DerivedData/

# Ignore logs
Logs/

# Ignore settings & preferences
Settings/
!buildApp.4DSettings

Preferences/
!4DPop AppMaker.xml

userPreferences.*/

# Miscellaneous
DEV/
*__Orphan__*
ehthumbs.db
Thumbs.db
Resources/php.ini
Project/Trash/
*.bbprojectd/
# Ignore invisible files/folders except me
.*
!.gitignore

# Ignore data file
Data/
DATA/
data/
*.4DD
*.journal
*.4DIndx
*.Match
*symbols.txt

# Ignore derived data
DerivedData/

# Ignore logs
Logs/

# Ignore settings & preferences
Settings/
!buildApp.4DSettings

Preferences/
!4DPop AppMaker.xml

userPreferences.*/

# Miscellaneous
DEV/
*__Orphan__*
ehthumbs.db
Thumbs.db
Resources/php.ini
Project/Trash/
*.bbprojectd/
2 changes: 1 addition & 1 deletion Info.plist
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"> <dict> <key>CFBundleName</key> <string>4DPop Git</string> <key>CFBundleShortVersionString</key> <string>18R3</string> <key>CFBundleLongVersionString</key> <string>18R3</string> <key>CFBundleGetInfoString</key> <string>4DPop Git</string> <key>CFBundleDisplayName</key> <string>4DPop</string> <key>CFBundleVersion</key> <string>15</string> <key>NSHumanReadableCopyright</key> <string>© 2020</string> </dict></plist>
<?xml version="1.0" encoding="UTF-8" standalone="no" ?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"> <dict> <key>NSHumanReadableCopyright</key> <string>© 2020</string> <key>CFBundleVersion</key> <string>16</string> <key>CFBundleDisplayName</key> <string>4DPop</string> <key>CFBundleGetInfoString</key> <string>4DPop Git</string> <key>CFBundleLongVersionString</key> <string>18R3</string> <key>CFBundleShortVersionString</key> <string>18R3</string> <key>CFBundleName</key> <string>4DPop Git</string> </dict></plist>
Expand Down
164 changes: 164 additions & 0 deletions Project/Sources/Forms/ADD_PATTERN/form.4DForm
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
{
"$4d": {
"version": "1",
"kind": "form"
},
"windowSizingX": "variable",
"windowSizingY": "variable",
"windowMinWidth": 0,
"windowMinHeight": 0,
"windowMaxWidth": 32767,
"windowMaxHeight": 32767,
"events": [
"onLoad",
"onDataChange",
"onTimer",
"onAfterEdit"
],
"windowTitle": "window title",
"destination": "detailScreen",
"pages": [
{
"objects": {}
},
{
"objects": {
"Text": {
"type": "text",
"text": "Add Pattern to .gitignore",
"top": 10,
"left": 84,
"width": 570,
"height": 16,
"fontTheme": "main"
},
"pattern": {
"type": "input",
"left": 84,
"top": 108,
"width": 570,
"height": 17,
"dataSource": "Form:C1466.pattern",
"events": [
"onDataChange",
"onAfterEdit"
],
"multiline": "no"
},
"Static Picture1": {
"type": "picture",
"top": 10,
"left": 10,
"width": 64,
"height": 64,
"picture": "/RESOURCES/4DPop.png",
"pictureFormat": "scaled"
},
"ok": {
"type": "button",
"text": "OK",
"top": 296,
"left": 573,
"width": 81,
"height": 22,
"events": [
"onClick"
],
"action": "accept"
},
"cancel": {
"type": "button",
"text": "Cancel",
"top": 296,
"left": 472,
"width": 81,
"height": 22,
"events": [
"onClick"
],
"action": "cancel"
},
"Text1": {
"type": "text",
"text": "A gitignore file specifies intentionally untracked files that Git should ignore. Files already tracked are not affected.",
"top": 34,
"left": 84,
"width": 570,
"height": 46,
"fontTheme": "normal",
"textAlign": "justify",
"borderStyle": "none"
},
"Text2": {
"type": "text",
"text": "Pattern",
"top": 87,
"left": 84,
"width": 568,
"height": 16,
"fontTheme": "normal",
"textAlign": "justify"
},
"Text3": {
"type": "text",
"text": "Preview",
"top": 142,
"left": 84,
"width": 83,
"height": 16,
"fontTheme": "normal",
"textAlign": "justify"
},
"preview": {
"type": "listbox",
"left": 84,
"top": 161,
"width": 570,
"height": 115,
"events": [],
"dataSource": "Form:C1466.preview",
"showHeaders": false,
"horizontalLineStroke": "transparent",
"verticalLineStroke": "transparent",
"selectionMode": "none",
"listboxType": "collection",
"resizingMode": "legacy",
"hideFocusRing": true,
"scrollbarHorizontal": "hidden",
"scrollbarVertical": "automatic",
"columns": [
{
"header": {
"text": "Header1",
"name": "Header1"
},
"name": "Column1",
"footer": {
"name": "Footer1"
},
"dataSource": "This:C1470.path"
}
]
},
"Input": {
"type": "input",
"left": 398,
"top": 145,
"width": 256,
"height": 15,
"dataSource": "String:C10(Form:C1466.preview.length)+\" file matches\"",
"contextMenu": "none",
"enterable": false,
"borderStyle": "none",
"textAlign": "right",
"fontSize": 11,
"fill": "transparent",
"focusable": false
}
}
}
],
"method": "method.4dm",
"width": 674,
"height": 338
}
56 changes: 56 additions & 0 deletions Project/Sources/Forms/ADD_PATTERN/method.4dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// ----------------------------------------------------
// Form method : ADD_PATTERN
// ID[F480A3B6285F424087B017C3B2CADCA1]
// Created 11-3-2020 by Vincent de Lachaux
// ----------------------------------------------------
C_TEXT:C284($tPattern)
C_OBJECT:C1216($event;$o)

// ----------------------------------------------------
// Initialisations
$event:=FORM Event:C1606

// ----------------------------------------------------

Case of

//______________________________________________________
: ($event.code=On Load:K2:1)

SET TIMER:C645(-1)

//______________________________________________________
: ($event.code=On Data Change:K2:15)\
| ($event.code=On After Edit:K2:43)

SET TIMER:C645(-1)

//______________________________________________________
: ($event.code=On Timer:K2:25)

SET TIMER:C645(0)

$tPattern:=Choose:C955(String:C10($event.objectName)="pattern";Get edited text:C655;String:C10(Form:C1466.pattern))
$tPattern:=Replace string:C233($tPattern;".";"\\.")
$tPattern:=Replace string:C233($tPattern;"*";".*")

Form:C1466.preview:=New collection:C1472

For each ($o;Form:C1466.files)

If (Match regex:C1019($tPattern;$o.path;1))

Form:C1466.preview.push($o)

End if
End for each

Form:C1466.preview:=Form:C1466.preview

//______________________________________________________
Else

ASSERT:C1129(False:C215;"Form event activated unnecessarily ("+$event.description+")")

//______________________________________________________
End case
9 changes: 5 additions & 4 deletions Project/Sources/Forms/GITLAB/form.4DForm
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@
"type": "button",
"text": ":xliff:fetch",
"top": 8,
"left": 9,
"left": 7,
"width": 52,
"height": 44,
"events": [
Expand Down Expand Up @@ -528,7 +528,7 @@
"width": 609,
"height": 17,
"dataSource": "Form:C1466.commitSubject",
"placeholder": "Commit Subject",
"placeholder": ":xliff:commitSubject",
"sizingX": "grow",
"sizingY": "move",
"hideFocusRing": true,
Expand All @@ -545,7 +545,7 @@
"width": 609,
"height": 17,
"dataSource": "Form:C1466.commitDescription",
"placeholder": "Description",
"placeholder": ":xliff:description",
"sizingX": "grow",
"sizingY": "move"
},
Expand Down Expand Up @@ -723,5 +723,6 @@
],
"method": "method.4dm",
"width": 1120,
"height": 910
"height": 910,
"memorizeGeometry": true
}
2 changes: 1 addition & 1 deletion Project/Sources/Forms/GITLAB/method.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Case of
Form:C1466.$.unstage.bestSize(Align right:K42:4).disable()
Form:C1466.$.commit.bestSize(Align right:K42:4).disable()

group ("fetch;pull;push").distributeHorizontally(New object:C1471("start";20;"gap";10;"minWidth";50))
group ("fetch;pull;push").distributeHorizontally(New object:C1471("start";10;"gap";10;"minWidth";50))

Form:C1466.$.open.bestSize(Align right:K42:4)

Expand Down
21 changes: 20 additions & 1 deletion Project/Sources/Methods/GITLAB_OBJECTS.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ Case of

$menu.line()\
.append("ignore";menu \
.append(Get localized string:C991("ignore")+"\""+$o.fullName+"\"";"ignoreFile")\
.append(Replace string:C233(Get localized string:C991("ignoreFile");"{file}";$o.fullName);"ignoreFile")\
.append(Replace string:C233(Get localized string:C991("ignoreAllExtensionFiles");"{extension}";$o.extension);"ignoreExtension")\
.line()\
.append("customPattern";"ignoreCustom"))
Expand Down Expand Up @@ -218,6 +218,25 @@ Case of

$t:=$t+"\r*"+$o.extension

//____________________________
: ($menu.choice="ignoreCustom")

$o:=New object:C1471(\
"window";Open form window:C675("ADD_PATTERN";\
Plain form window:K39:10;Horizontally centered:K39:1;\
Vertically centered:K39:4;*);\
"pattern";$oCurrent.path;\
"files";Form:C1466.git.changes)

DIALOG:C40("ADD_PATTERN";$o)
CLOSE WINDOW:C154

If (Bool:C1537(OK))

$t:=$t+"\r"+$o.pattern

End if

//____________________________
Else

Expand Down
Loading

0 comments on commit 101800f

Please sign in to comment.