Fix so advanced search encodes symbols on desktop

This commit is contained in:
drdev
2015-09-12 01:52:12 +00:00
parent 8d3fb1750d
commit f329d010b6
5 changed files with 17 additions and 3 deletions

View File

@@ -278,4 +278,9 @@ public class GuiDesktop implements IGuiBase {
//TODO: Show loading overlay
FThreads.invokeInBackgroundThread(task);
}
@Override
public String encodeSymbols(String str, boolean formatReminderText) {
return FSkin.encodeSymbols(str, formatReminderText);
}
}

View File

@@ -988,6 +988,9 @@ public class FSkin {
e.printStackTrace();
}
//ensure paragraph and line breaks aren't lost
str = str.replaceAll("\r?\n", "<br>");
return "<html>" + str + "</html>"; //must wrap in <html> tag for images to appear
}

View File

@@ -285,4 +285,9 @@ public class GuiMobile implements IGuiBase {
public void runBackgroundTask(String message, Runnable task) {
LoadingOverlay.runBackgroundTask(message, task);
}
@Override
public String encodeSymbols(String str, boolean formatReminderText) {
return str; //not needed for mobile
}
}

View File

@@ -52,4 +52,5 @@ public interface IGuiBase {
IGuiGame getNewGuiGame();
HostedMatch hostMatch();
void runBackgroundTask(String message, Runnable task);
String encodeSymbols(String str, boolean formatReminderText);
}

View File

@@ -1016,7 +1016,7 @@ public class AdvancedSearch {
public void run() {
control.setFilter(filter);
if (filter != null) {
control.getBtnFilter().setText(filter.toString());
control.getBtnFilter().setText(GuiBase.getInterface().encodeSymbols(filter.toString(), false));
}
else {
control.getBtnFilter().setText(emptyFilterText);
@@ -1087,7 +1087,7 @@ public class AdvancedSearch {
}
}
}
label.setText(builder.toString());
label.setText(GuiBase.getInterface().encodeSymbols(builder.toString(), false));
label.setToolTipText(getTooltip());
}
@@ -1108,7 +1108,7 @@ public class AdvancedSearch {
indent += " "; //add an indent level when an open paren is hit
}
}
return builder.toString();
return GuiBase.getInterface().encodeSymbols(builder.toString(), false);
}
public void updateExpression() {