Make it so Advanced Search filter automatically prompts to select a filter if no filters defined already

Prevent crash when clearing a filter
This commit is contained in:
drdev
2015-11-26 16:37:33 +00:00
parent b5cf6e97f1
commit ac172d0d4d
3 changed files with 31 additions and 7 deletions

View File

@@ -1063,17 +1063,18 @@ public class AdvancedSearch {
control.setFilter(filter);
if (filter != null) {
control.getBtnFilter().setText(GuiBase.getInterface().encodeSymbols(filter.toString(), false));
if (filter.getOption() == FilterOption.CARD_KEYWORDS) {
//the first time the user selects keywords, preload keywords for all cards
Runnable preloadTask = Keyword.getPreloadTask();
if (preloadTask != null) {
GuiBase.getInterface().runBackgroundTask("Loading keywords...", preloadTask);
}
}
}
else {
control.getBtnFilter().setText(EMPTY_FILTER_TEXT);
}
if (filter.getOption() == FilterOption.CARD_KEYWORDS) {
//the first time the user selects keywords, preload keywords for all cards
Runnable preloadTask = Keyword.getPreloadTask();
if (preloadTask != null) {
GuiBase.getInterface().runBackgroundTask("Loading keywords...", preloadTask);
}
}
if (onChange != null) {
onChange.run();
}