Improve stability

This commit is contained in:
Xpl0itU 2023-08-24 16:18:30 +02:00
parent 93e55baa5f
commit 38e6be51c9
3 changed files with 24 additions and 11 deletions

View file

@ -18,6 +18,7 @@ import (
"time"
"unsafe"
"github.com/gotk3/gotk3/glib"
"github.com/gotk3/gotk3/gtk"
)
@ -35,11 +36,15 @@ func DecryptContents(path string, progress *ProgressWindow, deleteEncryptedConte
go runDecryption(path, errorChan, deleteEncryptedContents)
progress.bar.SetText("Decrypting...")
glib.IdleAdd(func() {
progress.bar.SetText("Decrypting...")
})
for progressInt := range progressChan {
if progressInt > 0 {
progress.bar.SetFraction(float64(progressInt) / 100)
glib.IdleAdd(func() {
progress.bar.SetFraction(float64(progressInt) / 100)
})
for gtk.EventsPending() {
gtk.MainIteration()
}