Update registrar
This commit is contained in:
@@ -128,8 +128,9 @@ func (role ApplicationRole) Icon () tomo.Icon {
|
||||
}
|
||||
}
|
||||
|
||||
// RunApplication is like tomo.Run, but runs an application. If something fails
|
||||
// to initialize, an error is written to the standard logger.
|
||||
// RunApplication is like tomo.Run, but runs an application. It automatically
|
||||
// sets up a backend. If something fails to initialize, an error is written to
|
||||
// the standard logger.
|
||||
func RunApplication (application Application) {
|
||||
// TODO: see #4
|
||||
|
||||
@@ -138,20 +139,20 @@ func RunApplication (application Application) {
|
||||
}
|
||||
flag.Parse()
|
||||
|
||||
err := registrar.RegisterBackend()
|
||||
reg := new(registrar.Registrar)
|
||||
backend, err := reg.SetBackend()
|
||||
if err != nil { log.Fatalln("nasin: could not register backend:", err) }
|
||||
err = tomo.Run(func () {
|
||||
err := registrar.SetTheme()
|
||||
if err != nil { log.Fatalln("nasin: could not set theme:", err) }
|
||||
err = registrar.SetIconSet()
|
||||
if err != nil { log.Fatalln("nasin: could not set icon set:", err) }
|
||||
err = application.Init()
|
||||
if err != nil { log.Fatalln("nasin: could not run application:", err) }
|
||||
err = reg.SetTheme()
|
||||
if err != nil { log.Fatalln("nasin: could not set theme:", err) }
|
||||
err = reg.SetIconSet()
|
||||
if err != nil { log.Fatalln("nasin: could not set icon set:", err) }
|
||||
err = application.Init()
|
||||
if err != nil { log.Fatalln("nasin: could not run application:", err) }
|
||||
|
||||
// open URLs
|
||||
args := flag.Args()
|
||||
applicationOpenUrls(application, args...)
|
||||
})
|
||||
// open URLs
|
||||
args := flag.Args()
|
||||
applicationOpenUrls(application, args...)
|
||||
err = backend.Run()
|
||||
if err != nil { log.Fatalln("nasin: could not run application:", err) }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user