1

ui improvements

This commit is contained in:
Alex Yatskov 2017-06-25 18:17:00 -07:00
parent 6f1d9cd495
commit e9c176e31d
2 changed files with 14 additions and 4 deletions

10
gui.go
View File

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

View File

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