2020-05-26 06:51:06 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/diamondburned/cchat-gtk/internal/gts"
|
|
|
|
"github.com/diamondburned/cchat-gtk/internal/log"
|
|
|
|
"github.com/diamondburned/cchat-gtk/internal/ui"
|
|
|
|
"github.com/diamondburned/cchat/services"
|
|
|
|
|
2020-06-17 07:06:34 +00:00
|
|
|
_ "github.com/diamondburned/cchat-discord"
|
2020-05-26 06:51:06 +00:00
|
|
|
_ "github.com/diamondburned/cchat-mock"
|
|
|
|
)
|
|
|
|
|
2020-06-17 07:06:34 +00:00
|
|
|
var destructor = func() {}
|
|
|
|
|
2020-05-26 06:51:06 +00:00
|
|
|
func main() {
|
|
|
|
gts.Main(func() gts.WindowHeaderer {
|
|
|
|
var app = ui.NewApplication()
|
|
|
|
|
|
|
|
// Load all cchat services.
|
|
|
|
srvcs, errs := services.Get()
|
|
|
|
if len(errs) > 0 {
|
|
|
|
for _, err := range errs {
|
|
|
|
log.Error(err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Add the services.
|
|
|
|
for _, srvc := range srvcs {
|
|
|
|
app.AddService(srvc)
|
|
|
|
}
|
|
|
|
|
|
|
|
return app
|
|
|
|
})
|
2020-06-17 07:06:34 +00:00
|
|
|
|
|
|
|
destructor()
|
2020-05-26 06:51:06 +00:00
|
|
|
}
|