Merge branch 'reconnect' of dan/ui into master
the build was successful Details

This commit is contained in:
erinn 2019-09-30 12:40:16 -07:00 committed by Gogs
commit cf10647d4c
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] onion := e.Data[event.Identity]
the.CwtchApp.AddPeerPlugin(onion, plugins.CONTACTRETRY) the.CwtchApp.AddPeerPlugin(onion, plugins.CONNECTIONRETRY)
the.Peer = the.CwtchApp.GetPeer(onion) the.Peer = the.CwtchApp.GetPeer(onion)
the.EventBus = the.CwtchApp.GetEventBus(onion) the.EventBus = the.CwtchApp.GetEventBus(onion)

View File

@ -79,6 +79,7 @@ type GrandCentralDispatcher struct {
_ func(locale string) `signal:"setLocale,auto"` _ func(locale string) `signal:"setLocale,auto"`
_ func() `signal:"allowUnknownPeers,auto"` _ func() `signal:"allowUnknownPeers,auto"`
_ func() `signal:"blockUnknownPeers,auto"` _ func() `signal:"blockUnknownPeers,auto"`
_ func() `signal:"onActivate,auto"`
} }
func (this *GrandCentralDispatcher) sendMessage(message string, mID string) { 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) { func (this *GrandCentralDispatcher) SetLocale_helper(locale string) {
core.QCoreApplication_RemoveTranslator(this.Translator) core.QCoreApplication_RemoveTranslator(this.Translator)
this.Translator = core.NewQTranslator(nil) this.Translator = core.NewQTranslator(nil)

View File

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

View File

@ -250,4 +250,15 @@ ApplicationWindow {
theStack.title = str 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()
}
}
}
} }