mirror of
https://github.com/mappu/miqt.git
synced 2024-12-22 17:08:38 +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
|
// Don't emit any of the lines that included .Tr(), move them into the
|
||||||
// retranslateUi() function
|
// retranslateUi() function
|
||||||
var translateFunc []string
|
var translateFunc []string
|
||||||
|
var setCurrentIndex []string
|
||||||
for _, line := range strings.Split(nest, "\n") {
|
for _, line := range strings.Split(nest, "\n") {
|
||||||
if strings.Contains(line, `_Tr(`) {
|
if strings.Contains(line, `_Tr(`) {
|
||||||
translateFunc = append(translateFunc, line)
|
translateFunc = append(translateFunc, line)
|
||||||
|
} else if strings.Contains(line, `.SetCurrentIndex(`) {
|
||||||
|
setCurrentIndex = append(setCurrentIndex, line)
|
||||||
} else {
|
} else {
|
||||||
ret.WriteString(line + "\n")
|
ret.WriteString(line + "\n")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ret.WriteString(`
|
ret.WriteString("\nui.Retranslate()\n\n")
|
||||||
ui.Retranslate()
|
|
||||||
|
|
||||||
|
for _, sci := range setCurrentIndex {
|
||||||
|
ret.WriteString(sci + "\n")
|
||||||
|
}
|
||||||
|
|
||||||
|
ret.WriteString(`
|
||||||
return ui
|
return ui
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user