ping ACN status on window acticate (mostly for android)
the build was successful Details

This commit is contained in:
Dan Ballard 2019-09-26 16:36:35 -07:00
parent f3a453f5a6
commit ab92e68628
4 changed files with 19 additions and 1 deletions

View File

@ -73,7 +73,7 @@ func AppEventListener(gcd *gothings.GrandCentralDispatcher, subscribed chan bool
}
onion := e.Data[event.Identity]
the.CwtchApp.AddPeerPlugin(onion, plugins.CONTACTRETRY)
the.CwtchApp.AddPeerPlugin(onion, plugins.CONNECTIONRETRY)
the.Peer = the.CwtchApp.GetPeer(onion)
the.EventBus = the.CwtchApp.GetEventBus(onion)

View File

@ -79,6 +79,7 @@ type GrandCentralDispatcher struct {
_ func(locale string) `signal:"setLocale,auto"`
_ func() `signal:"allowUnknownPeers,auto"`
_ func() `signal:"blockUnknownPeers,auto"`
_ func() `signal:"onActivate,auto"`
}
func (this *GrandCentralDispatcher) sendMessage(message string, mID string) {
@ -581,6 +582,11 @@ func (this *GrandCentralDispatcher) setLocale(locale string) {
}
func (this *GrandCentralDispatcher) onActivate() {
log.Debugln("onActivate")
the.CwtchApp.QueryACNStatus()
}
func (this *GrandCentralDispatcher) SetLocale_helper(locale string) {
core.QCoreApplication_RemoveTranslator(this.Translator)
this.Translator = core.NewQTranslator(nil)

View File

@ -118,6 +118,7 @@ func mainService() {
log.Infoln("Making QGuiApplication...")
app = gui.NewQGuiApplication(len(os.Args), os.Args)
}
log.Infoln("Cwtch Service starting app.Exec")
app.Exec()
}

View File

@ -250,4 +250,15 @@ ApplicationWindow {
theStack.title = str
}
}
Connections {
target: Qt.application
onStateChanged: function() {
// https://doc.qt.io/qt-5/qt.html#ApplicationState-enum
if (Qt.application.state == 4) {
// Active
gcd.onActivate()
}
}
}
}