Merge branch 'reconnect' of dan/ui into master
the build was successful
Details
the build was successful
Details
This commit is contained in:
commit
cf10647d4c
|
@ -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)
|
||||||
|
|
|
@ -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)
|
||||||
|
|
1
main.go
1
main.go
|
@ -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()
|
||||||
}
|
}
|
||||||
|
|
11
qml/main.qml
11
qml/main.qml
|
@ -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()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue