ui improvements
This commit is contained in:
parent
6f1d9cd495
commit
e9c176e31d
10
gui.go
10
gui.go
@ -130,13 +130,17 @@ func gui() error {
|
||||
language := languageEntry.Text()
|
||||
|
||||
go func() {
|
||||
var success bool
|
||||
defer ui.QueueMain(func() {
|
||||
importButton.Enable()
|
||||
if success {
|
||||
ui.MsgBox(window, "Success", "Conversion process complete")
|
||||
} else {
|
||||
ui.MsgBox(window, "Error", "Conversion process failed")
|
||||
}
|
||||
})
|
||||
|
||||
if err := exportDb(inputPath, outputPath, format, language, title, DEFAULT_STRIDE, false); err != nil {
|
||||
log.Print(err)
|
||||
}
|
||||
success = exportDb(inputPath, outputPath, format, language, title, DEFAULT_STRIDE, false) == nil
|
||||
}()
|
||||
})
|
||||
|
||||
|
8
main.go
8
main.go
@ -60,7 +60,13 @@ func exportDb(inputPath, outputPath, format, language, title string, stride int,
|
||||
}
|
||||
|
||||
log.Printf("converting '%s' to '%s' in '%s' format...", inputPath, outputPath, format)
|
||||
return handler(inputPath, outputPath, strings.ToLower(language), title, stride, pretty)
|
||||
if err := handler(inputPath, outputPath, strings.ToLower(language), title, stride, pretty); err != nil {
|
||||
log.Printf("conversion process failed: %s", err.Error())
|
||||
return err
|
||||
}
|
||||
|
||||
log.Print("conversion process complete")
|
||||
return nil
|
||||
}
|
||||
|
||||
func makeTmpDir() (string, error) {
|
||||
|
Loading…
Reference in New Issue
Block a user