Notify about update right after the start

create-reload-action
Michal Horejsek 5 years ago
parent 6d9d5f35ca
commit bcef1c36ba
  1. 4
      internal/events/events.go
  2. 9
      internal/frontend/qt-ie/frontend.go
  3. 13
      internal/frontend/qt/frontend.go
  4. 1
      unreleased.md

@ -49,7 +49,9 @@ const (
// SetupEvents specific to event type and data.
func SetupEvents(listener listener.Listener) {
listener.SetLimit(LogoutEvent, LogoutEventTimeout)
listener.SetBuffer(TLSCertIssue)
listener.SetBuffer(ErrorEvent)
listener.SetBuffer(CredentialsErrorEvent)
listener.SetBuffer(InternetOffEvent)
listener.SetBuffer(UpgradeApplicationEvent)
listener.SetBuffer(TLSCertIssue)
}

@ -109,10 +109,6 @@ func New(
// Loop function for Import-Export interface. It runs QtExecute in main thread
// with no additional function.
func (f *FrontendQt) Loop() (err error) {
go func() {
defer f.panicHandler.HandlePanic()
f.watchEvents()
}()
err = f.QtExecute(func(f *FrontendQt) error { return nil })
return err
}
@ -247,6 +243,11 @@ func (f *FrontendQt) QtExecute(Procedure func(*FrontendQt) error) error {
f.Qml.SetIsAutoUpdate(false)
}
go func() {
defer f.panicHandler.HandlePanic()
f.watchEvents()
}()
// Loop
if ret := gui.QGuiApplication_Exec(); ret != 0 {
//err := errors.New(errors.ErrQApplication, "Event loop ended with return value: %v", string(ret))

@ -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))

@ -16,3 +16,4 @@ Changelog [format](http://keepachangelog.com/en/1.0.0/)
### Fixed
* GODT-1011 Stable integration test deleting many messages using UID EXPUNGE.
* GODT-1015 Use lenient version parser to properly parse version provided by Mac.
* GODT-919 Notify about update right after the start.

Loading…
Cancel
Save