mirror of
https://github.com/mappu/miqt.git
synced 2024-12-22 08:58:37 +00:00
uic: move all setCurrentIndex() calls to end, to match qt uic output
This commit is contained in:
parent
6ed51553ac
commit
773cbec6b0
@ -479,17 +479,24 @@ func New` + u.Class + `Ui() *` + u.Class + `Ui {
|
||||
// Don't emit any of the lines that included .Tr(), move them into the
|
||||
// retranslateUi() function
|
||||
var translateFunc []string
|
||||
var setCurrentIndex []string
|
||||
for _, line := range strings.Split(nest, "\n") {
|
||||
if strings.Contains(line, `_Tr(`) {
|
||||
translateFunc = append(translateFunc, line)
|
||||
} else if strings.Contains(line, `.SetCurrentIndex(`) {
|
||||
setCurrentIndex = append(setCurrentIndex, line)
|
||||
} else {
|
||||
ret.WriteString(line + "\n")
|
||||
}
|
||||
}
|
||||
|
||||
ret.WriteString("\nui.Retranslate()\n\n")
|
||||
|
||||
for _, sci := range setCurrentIndex {
|
||||
ret.WriteString(sci + "\n")
|
||||
}
|
||||
|
||||
ret.WriteString(`
|
||||
ui.Retranslate()
|
||||
|
||||
return ui
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user