Notify about update right after the start

This commit is contained in:
Michal Horejsek
2021-02-01 13:22:26 +01:00
parent 6d9d5f35ca
commit bcef1c36ba
4 changed files with 15 additions and 12 deletions

View File

@ -154,10 +154,6 @@ func (s *FrontendQt) InstanceExistAlert() {
//
// It runs QtExecute in main thread with no additional function.
func (s *FrontendQt) Loop() (err error) {
go func() {
defer s.panicHandler.HandlePanic()
s.watchEvents()
}()
err = s.qtExecute(func(s *FrontendQt) error { return nil })
return err
}
@ -250,6 +246,7 @@ func (s *FrontendQt) watchEvents() {
func (s *FrontendQt) getEventChannel(event string) <-chan string {
ch := make(chan string)
s.eventListener.Add(event, ch)
s.eventListener.RetryEmit(event)
return ch
}
@ -366,9 +363,6 @@ func (s *FrontendQt) qtExecute(Procedure func(*FrontendQt) error) error {
s.Qml.SetIsEarlyAccess(false)
}
s.eventListener.RetryEmit(events.TLSCertIssue)
s.eventListener.RetryEmit(events.ErrorEvent)
// Set reporting of outgoing email without encryption.
s.Qml.SetIsReportingOutgoingNoEnc(s.settings.GetBool(settings.ReportOutgoingNoEncKey))
@ -395,6 +389,11 @@ func (s *FrontendQt) qtExecute(Procedure func(*FrontendQt) error) error {
return err
}
go func() {
defer s.panicHandler.HandlePanic()
s.watchEvents()
}()
// Loop
if ret := gui.QGuiApplication_Exec(); ret != 0 {
err := errors.New("Event loop ended with return value:" + string(ret))