-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
61 lines (53 loc) · 1.44 KB
/
Copy pathmain.go
File metadata and controls
61 lines (53 loc) · 1.44 KB
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
package main
import (
"embed"
"log"
"time"
"github.com/buchfink/buchfink/internal/wailsbridge"
"github.com/wailsapp/wails/v3/pkg/application"
)
// Wails uses Go's embed package to embed the frontend files into the binary.
//
//go:embed all:frontend/dist
var assets embed.FS
func main() {
bridge, err := wailsbridge.NewBuchfinkBridge()
if err != nil {
log.Fatalf("Fehler beim Initialisieren des Buchfink-Service: %v", err)
}
app := application.New(application.Options{
Name: "Buchfink",
Description: "Open-Source-Buchhaltung für kleine Unternehmen (SKR04, GoBD-konform, E-Bilanz)",
Services: []application.Service{
application.NewService(bridge),
},
Assets: application.AssetOptions{
Handler: application.AssetFileServerFS(assets),
},
Mac: application.MacOptions{
ApplicationShouldTerminateAfterLastWindowClosed: true,
},
})
app.Window.NewWithOptions(application.WebviewWindowOptions{
Title: "Buchfink — Buchhaltung",
Width: 1280,
Height: 820,
Mac: application.MacWindow{
InvisibleTitleBarHeight: 48,
Backdrop: application.MacBackdropTranslucent,
TitleBar: application.MacTitleBarHiddenInset,
},
BackgroundColour: application.NewRGB(250, 249, 246),
URL: "/",
})
go func() {
for {
now := time.Now().Format("15:04:05")
app.Event.Emit("tick", now)
time.Sleep(10 * time.Second)
}
}()
if err := app.Run(); err != nil {
log.Fatal(err)
}
}