Put DBus into MainScreen

This commit is contained in:
cuu
2018-06-16 22:08:10 +08:00
parent 30c7c675ad
commit 1e862f61a1
3 changed files with 13 additions and 5 deletions

View File

@@ -61,12 +61,15 @@ type DBus struct {
Wifi *DbusInterface
}
func NewDBus() *DBus {
d := &DBus{}
return d
}
func (self *DBus) Init() {
conn, err := dbus.SystemBus()
if err != nil {
fmt.Fprintln(os.Stderr, "Failed to connect to session bus:", err)
os.Exit(1)
panic(fmt.Sprintf("Failed to connect to system bus:", err))
}
self.Conn = conn