-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.go
More file actions
38 lines (32 loc) · 756 Bytes
/
main.go
File metadata and controls
38 lines (32 loc) · 756 Bytes
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
package main
import (
"github.com/therecipe/qt/widgets"
"os"
"path"
"vorta/app"
"vorta/borg"
"vorta/models"
"vorta/ui"
"vorta/utils"
)
func main() {
utils.InitLog()
pidFile := path.Join(utils.ConfigDir.UserData(), "vorta-go.pid")
err := utils.WritePidFile(pidFile)
if err != nil {
utils.Log.Error("Another instance of Vorta is already running.")
os.Exit(1)
}
models.InitDb(utils.ConfigDir.UserData())
app.InitApp()
app.AppChan = make(chan utils.VEvent)
borg.AppEventChan = app.AppChan
go utils.InitScheduler(app.AppChan)
go utils.UpdateWifiList()
defer models.DB.Close()
w := ui.NewMainWindow(nil)
go w.RunUIEventHandler(app.AppChan)
go app.RunAppEventHandler(ui.MainWindowChan)
w.AddTabs()
widgets.QApplication_Exec()
}