-
Notifications
You must be signed in to change notification settings - Fork 1
/
Photo_Club_Hub_HTMLApp.swift
79 lines (66 loc) · 3.44 KB
/
Photo_Club_Hub_HTMLApp.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
//
// Photo_Club_Hub_HTMLApp.swift
// Photo Club Hub HTML
//
// Created by Peter van den Hamer on 07/09/2024.
//
import SwiftUI
import Ignite
@main
struct PhotoClubHubHtmlApp: App {
let persistenceController = PersistenceController.shared
init() {
OrganizationType.initConstants() // creates records for club, museum, and unknown
}
var body: some Scene {
Window("Photo Club Hub HTML", id: "mainWindow") {
ContentView()
.environment(\.managedObjectContext, persistenceController.container.viewContext)
.onAppear {
Self.loadClubsAndMembers()
}
}
.commands {
CommandGroup(replacing: .newItem) { }
CommandGroup(replacing: .undoRedo) { }
CommandGroup(replacing: .help) { }
CommandGroup(replacing: .systemServices) { }
}
}
}
extension PhotoClubHubHtmlApp {
static fileprivate func loadClubsAndMembers() {
// // load list of photo clubs and museums from root.Level1.json file TODO
// let level1BackgroundContext = PersistenceController.shared.container.newBackgroundContext()
// level1BackgroundContext.name = "root.level1.json"
// level1BackgroundContext.mergePolicy = NSMergePolicy.mergeByPropertyObjectTrump
// level1BackgroundContext.automaticallyMergesChangesFromParent = true // to push ObjectTypes to bgContext?
// _ = Level1JsonReader(bgContext: level1BackgroundContext, // read root.Level1.json file
// useOnlyFile: false)
// warning: following clubs rely on Level 1 file for filling in their coordinates
// load test member(s) of Fotogroep Bellus Imago
// let bellusBackgroundContext = PersistenceController.shared.container.newBackgroundContext()
// bellusBackgroundContext.name = "Bellus Imago"
// bellusBackgroundContext.mergePolicy = NSMergePolicy.mergeByPropertyObjectTrump
// bellusBackgroundContext.automaticallyMergesChangesFromParent = true
// _ = BellusImagoMembersProvider(bgContext: bellusBackgroundContext)
// load member(s) of Fotogroep De Gender
let genderBackgroundContext = PersistenceController.shared.container.newBackgroundContext()
genderBackgroundContext.name = "FG de Gender"
genderBackgroundContext.mergePolicy = NSMergePolicy.mergeByPropertyObjectTrump
genderBackgroundContext.automaticallyMergesChangesFromParent = true
_ = FotogroepDeGenderMembersProvider(bgContext: genderBackgroundContext) // TODO
// load all current/former members of Fotogroep Waalre
let waalreBackgroundContext = PersistenceController.shared.container.newBackgroundContext()
waalreBackgroundContext.name = "Fotogroep Waalre"
waalreBackgroundContext.mergePolicy = NSMergePolicy.mergeByPropertyObjectTrump
waalreBackgroundContext.automaticallyMergesChangesFromParent = true
_ = FotogroepWaalreMembersProvider(bgContext: waalreBackgroundContext)
// load all current members of Fotogroep Anders
// let andersBackgroundContext = PersistenceController.shared.container.newBackgroundContext()
// andersBackgroundContext.name = "FG Anders"
// andersBackgroundContext.mergePolicy = NSMergePolicy.mergeByPropertyObjectTrump
// andersBackgroundContext.automaticallyMergesChangesFromParent = true
// _ = AndersMembersProvider(bgContext: andersBackgroundContext)
}
}