Skip to content

Commit

Permalink
2021.0 hotfix - language change no longer causes crash
Browse files Browse the repository at this point in the history
  • Loading branch information
berry120 committed Sep 9, 2021
1 parent 258b66b commit b238b50
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,17 @@ public String toFriendlyString() {
* @return the text alignment object.
*/
public static TextAlignment parse(String val) {
if(val.equals(LabelGrabber.INSTANCE.getLabel("left"))) {
if(val.equalsIgnoreCase(LabelGrabber.INSTANCE.getLabel("left"))) {
return TextAlignment.LEFT;
}
// else if(val.equals(LabelGrabber.INSTANCE.getLabel("right"))) {
// return TextAlignment.RIGHT;
// }
else if(val.equals(LabelGrabber.INSTANCE.getLabel("centre"))) {
else if(val.equalsIgnoreCase(LabelGrabber.INSTANCE.getLabel("centre"))) {
return TextAlignment.CENTRE;
}
else {
return null;
return TextAlignment.LEFT;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,7 @@ public void setStageTextFont(String font) {
* @return the alignment of the text on stage view.
*/
public String getStageTextAlignment() {
return TextAlignment.valueOf(getProperty(stageTextAlignmentKey, "LEFT")).toFriendlyString();
return TextAlignment.parse(getProperty(stageTextAlignmentKey, "LEFT")).toFriendlyString();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,13 @@ public void saveObject(String breadcrumb, Object object) {
case QueleaPropertyKeys.smallSongTextHPositionKey:
case QueleaPropertyKeys.smallSongTextVPositionKey:
case QueleaPropertyKeys.stageTextAlignmentKey:
String pos = LabelGrabber.INSTANCE.getEngKey(object.toString()).toLowerCase();
if (breadcrumb.contains("alignment"))
pos = pos.toUpperCase();
QueleaProperties.get().setProperty(breadcrumb, pos);
String pos = LabelGrabber.INSTANCE.getEngKey(object.toString());
if (pos != null) {
pos = pos.toLowerCase();
if (breadcrumb.contains("alignment"))
pos = pos.toUpperCase();
QueleaProperties.get().setProperty(breadcrumb, pos);
}
break;
case QueleaPropertyKeys.mobLyricsPortKey:
case QueleaPropertyKeys.remoteControlPortKey:
Expand Down

0 comments on commit b238b50

Please sign in to comment.