1.2dev: Simplify code using `setWarningUnsavedChanges`.
1.2dev: Simplify code using `setWarningUnsavedChanges`.

This change also eliminates one translatable string.

Refs #11682.

pkdevbox/trac,pkdevbox/trac,pkdevbox/trac,pkdevbox/trac