Can now import Kindle vocab decks
Former-commit-id: 79282c1efd08bc501505850d1613926f479a95b0
This commit is contained in:
parent
a8be8d8eb4
commit
bd1fe47502
@ -552,7 +552,18 @@ class MainWindowReader(QtGui.QMainWindow, gen.reader_ui.Ui_MainWindowReader):
|
|||||||
|
|
||||||
|
|
||||||
def importWordList(self, words):
|
def importWordList(self, words):
|
||||||
pass
|
self.state.vocabDefs = list()
|
||||||
|
self.state.kanjiDefs = list()
|
||||||
|
|
||||||
|
for word in words:
|
||||||
|
if self.dockVocab.isVisible():
|
||||||
|
self.state.vocabDefs += self.language.dictionary.findTerm(word)
|
||||||
|
|
||||||
|
if self.dockKanji.isVisible():
|
||||||
|
self.state.kanjiDefs += self.language.findCharacters(word)
|
||||||
|
|
||||||
|
self.updateVocabDefs()
|
||||||
|
self.updateKanjiDefs()
|
||||||
|
|
||||||
|
|
||||||
def setStatus(self, status):
|
def setStatus(self, status):
|
||||||
|
@ -174,7 +174,7 @@ def buildVocabDef(definition, index, query):
|
|||||||
reading = u'<span class = "reading">[{0}]<br/></span>'.format(definition['reading'])
|
reading = u'<span class = "reading">[{0}]<br/></span>'.format(definition['reading'])
|
||||||
|
|
||||||
rules = unicode()
|
rules = unicode()
|
||||||
if len(definition['rules']) > 0:
|
if definition.get('rules'):
|
||||||
rules = ' < '.join(definition['rules'])
|
rules = ' < '.join(definition['rules'])
|
||||||
rules = '<span class = "rules">({0})<br/></span>'.format(rules)
|
rules = '<span class = "rules">({0})<br/></span>'.format(rules)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user