New Features #1
@ -34,6 +34,11 @@ class Model(
|
||||
private val internalIsFindingCharacters: BooleanProperty = SimpleBooleanProperty(false)
|
||||
private val internalIsFindingSentences: BooleanProperty = SimpleBooleanProperty(false)
|
||||
|
||||
private val internalFinishedFindingWordsBeginning: BooleanProperty = SimpleBooleanProperty(false)
|
||||
private val internalFinishedFindingWordsContaining: BooleanProperty = SimpleBooleanProperty(false)
|
||||
private val internalFinishedFindingCharacters: BooleanProperty = SimpleBooleanProperty(false)
|
||||
private val internalFinishedFindingSentences: BooleanProperty = SimpleBooleanProperty(false)
|
||||
|
||||
val selectedEntry: ReadOnlyObjectProperty<DictionaryEntryFx> = internalSelectedEntry
|
||||
|
||||
val searchResults: ObservableList<DictionaryEntryFx> =
|
||||
@ -53,6 +58,11 @@ class Model(
|
||||
val isFindingCharacters: ReadOnlyBooleanProperty = internalIsFindingCharacters
|
||||
val isFindingSentences: ReadOnlyBooleanProperty = internalIsFindingSentences
|
||||
|
||||
val finishedFindingWordsBeginning: ReadOnlyBooleanProperty = internalFinishedFindingWordsBeginning
|
||||
val finishedFindingWordsContaining: ReadOnlyBooleanProperty = internalFinishedFindingWordsContaining
|
||||
val finishedFindingCharacters: ReadOnlyBooleanProperty = internalFinishedFindingCharacters
|
||||
val finishedFindingSentences: ReadOnlyBooleanProperty = internalFinishedFindingSentences
|
||||
|
||||
private val coroutineScope = MainScope()
|
||||
|
||||
fun search(query: String, searchMode: SearchMode) {
|
||||
@ -72,6 +82,7 @@ class Model(
|
||||
.map { it.toFx() }
|
||||
)
|
||||
internalIsFindingWordsBeginning.value = false
|
||||
internalFinishedFindingWordsBeginning.value = true
|
||||
}
|
||||
}
|
||||
|
||||
@ -84,6 +95,7 @@ class Model(
|
||||
.map { it.toFx() }
|
||||
)
|
||||
internalIsFindingWordsContaining.value = false
|
||||
internalFinishedFindingWordsContaining.value = true
|
||||
}
|
||||
}
|
||||
|
||||
@ -96,6 +108,7 @@ class Model(
|
||||
.map { it.toFx() }
|
||||
)
|
||||
internalIsFindingCharacters.value = false
|
||||
internalFinishedFindingCharacters.value = true
|
||||
}
|
||||
}
|
||||
|
||||
@ -108,6 +121,7 @@ class Model(
|
||||
.map { it.toFx() }
|
||||
)
|
||||
internalIsFindingSentences.value = false
|
||||
internalFinishedFindingSentences.value = true
|
||||
}
|
||||
}
|
||||
|
||||
@ -116,6 +130,12 @@ class Model(
|
||||
internalWordsContaining.setAll(emptyList())
|
||||
internalCharacters.setAll(emptyList())
|
||||
internalSentences.setAll(emptyList())
|
||||
|
||||
internalFinishedFindingCharacters.value = false
|
||||
internalFinishedFindingWordsBeginning.value = false
|
||||
internalFinishedFindingWordsContaining.value = false
|
||||
internalFinishedFindingSentences.value = false
|
||||
|
||||
internalSelectedEntry.value = entry
|
||||
}
|
||||
|
||||
|
@ -275,22 +275,22 @@ class DetailsController(
|
||||
private fun lazyUpdateTabContent(selectedTabId: String?) {
|
||||
when (selectedTabId) {
|
||||
"tabWords" -> {
|
||||
if (model.wordsContaining.isEmpty()) {
|
||||
if (!model.finishedFindingWordsContaining.value) {
|
||||
model.findWordsContaining()
|
||||
}
|
||||
if (model.wordsBeginning.isEmpty()) {
|
||||
if (!model.finishedFindingWordsBeginning.value) {
|
||||
model.findWordsBeginning()
|
||||
}
|
||||
}
|
||||
|
||||
"tabCharacters" -> {
|
||||
if (model.characters.isNotEmpty()) return
|
||||
if (model.finishedFindingCharacters.value) return
|
||||
|
||||
model.findCharacters()
|
||||
}
|
||||
|
||||
"tabSentences" -> {
|
||||
if (model.sentences.isNotEmpty()) return
|
||||
if (model.finishedFindingSentences.value) return
|
||||
|
||||
model.findSentences()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user