Only show info/warnings if status is "Ready"

If not, it's probably showing some error message which would happen after starting encryption, so user would've already seen the info/warning status
This commit is contained in:
Evan Su 2025-04-10 12:27:49 -04:00
parent a0e6e30e7b
commit 55ec72864e

View file

@ -781,21 +781,27 @@ func draw() {
return "Process" return "Process"
}()).Size(giu.Auto, 34).OnClick(onClickStartButton), }()).Size(giu.Auto, 34).OnClick(onClickStartButton),
giu.Custom(func() { giu.Custom(func() {
if mainStatus != "Ready" {
giu.Style().SetColor(giu.StyleColorText, mainStatusColor).To(
giu.Label(mainStatus),
).Build()
return
}
if temporaryZip && externalDst { if temporaryZip && externalDst {
giu.Style().SetColor(giu.StyleColorText, YELLOW).To( giu.Style().SetColor(giu.StyleColorText, YELLOW).To(
giu.Label("Warning: unencrypted temp files will be created"), giu.Label("Warning: unencrypted temp files will be created"),
).Build() ).Build()
} else if temporaryZip { } else if temporaryZip {
giu.Style().SetColor(giu.StyleColorText, WHITE).To( giu.Style().SetColor(giu.StyleColorText, WHITE).To(
giu.Label(mainStatus + " (info: will create temporary files)"), giu.Label("Ready (info: will create a temporary zip file)"),
).Build() ).Build()
} else if externalDst { } else if externalDst {
giu.Style().SetColor(giu.StyleColorText, WHITE).To( giu.Style().SetColor(giu.StyleColorText, WHITE).To(
giu.Label(mainStatus + " (info: target may be an external drive)"), giu.Label("Ready (info: target may be an external drive)"),
).Build() ).Build()
} else { } else {
giu.Style().SetColor(giu.StyleColorText, mainStatusColor).To( giu.Style().SetColor(giu.StyleColorText, mainStatusColor).To(
giu.Label(mainStatus), giu.Label("Ready"),
).Build() ).Build()
} }
}), }),