file management
Before Width: | Height: | Size: 733 B After Width: | Height: | Size: 733 B |
Before Width: | Height: | Size: 286 B After Width: | Height: | Size: 286 B |
Before Width: | Height: | Size: 655 B After Width: | Height: | Size: 655 B |
Before Width: | Height: | Size: 641 B After Width: | Height: | Size: 641 B |
Before Width: | Height: | Size: 659 B After Width: | Height: | Size: 659 B |
Before Width: | Height: | Size: 688 B After Width: | Height: | Size: 688 B |
Before Width: | Height: | Size: 778 B After Width: | Height: | Size: 778 B |
Before Width: | Height: | Size: 143 B After Width: | Height: | Size: 143 B |
Before Width: | Height: | Size: 182 B After Width: | Height: | Size: 182 B |
Before Width: | Height: | Size: 111 B After Width: | Height: | Size: 111 B |
Before Width: | Height: | Size: 657 B After Width: | Height: | Size: 657 B |
Before Width: | Height: | Size: 615 B After Width: | Height: | Size: 615 B |
Before Width: | Height: | Size: 680 B After Width: | Height: | Size: 680 B |
Before Width: | Height: | Size: 663 B After Width: | Height: | Size: 663 B |
Before Width: | Height: | Size: 537 B After Width: | Height: | Size: 537 B |
Before Width: | Height: | Size: 944 B After Width: | Height: | Size: 944 B |
Before Width: | Height: | Size: 610 B After Width: | Height: | Size: 610 B |
@ -20,7 +20,6 @@ import os
|
|||||||
import tarfile
|
import tarfile
|
||||||
from PyQt4 import QtGui, QtCore, uic
|
from PyQt4 import QtGui, QtCore, uic
|
||||||
from preferences import DialogPreferences
|
from preferences import DialogPreferences
|
||||||
from preference_data import Preferences
|
|
||||||
from update import UpdateFinder
|
from update import UpdateFinder
|
||||||
from about import DialogAbout
|
from about import DialogAbout
|
||||||
from constants import constants
|
from constants import constants
|
@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
import re
|
import re
|
||||||
from PyQt4 import QtGui
|
from PyQt4 import QtGui
|
||||||
|
from util import buildResPath
|
||||||
|
|
||||||
|
|
||||||
class Definition:
|
class Definition:
|
||||||
@ -144,12 +145,12 @@ def buildDefinitionHtml(definition, factIndex, factQuery):
|
|||||||
if definition.conjugations:
|
if definition.conjugations:
|
||||||
conjugation = '<span class = "conjugations"><{0}><br/></span>'.format(definition.conjugations)
|
conjugation = '<span class = "conjugations"><{0}><br/></span>'.format(definition.conjugations)
|
||||||
|
|
||||||
links = '<a href = "copyDefinition:{0}"><img src = "://images/icons/page_copy.png" align = "right"/></a>'.format(factIndex)
|
links = '<a href = "copyDefinition:{0}"><img src = "{1}" align = "right"/></a>'.format(factIndex, buildResPath('img/page_copy.png'))
|
||||||
if factQuery:
|
if factQuery:
|
||||||
if factQuery(buildFactMarkupExpression(definition.expression, definition.reading, definition.glossary)):
|
if factQuery(buildFactMarkupExpression(definition.expression, definition.reading, definition.glossary)):
|
||||||
links += '<a href = "addFactExpression:{0}"><img src = "://images/icons/add.png" align = "right"/></a>'.format(factIndex)
|
links += '<a href = "addFactExpression:{0}"><img src = "{1}" align = "right"/></a>'.format(factIndex, buildResPath('img/add.png'))
|
||||||
if factQuery(buildFactMarkupReading(definition.reading, definition.glossary)):
|
if factQuery(buildFactMarkupReading(definition.reading, definition.glossary)):
|
||||||
links += '<a href = "addFactReading:{0}"><img src = "://images/icons/bullet_add.png" align = "right"/></a>'.format(factIndex)
|
links += '<a href = "addFactReading:{0}"><img src = "{1}" align = "right"/></a>'.format(factIndex, buildResPath('img/bullet_add.png'))
|
||||||
|
|
||||||
html = u"""
|
html = u"""
|
||||||
<span class = "links">{0}</span>
|
<span class = "links">{0}</span>
|
13
yomichan.py
@ -19,10 +19,10 @@
|
|||||||
|
|
||||||
import sys
|
import sys
|
||||||
from PyQt4 import QtGui, QtCore
|
from PyQt4 import QtGui, QtCore
|
||||||
from yomichan.lang import japanese
|
from yomi_base.lang import japanese
|
||||||
from yomichan.util import buildResPath
|
from yomi_base.util import buildResPath
|
||||||
from yomichan.preference_data import Preferences
|
from yomi_base.preference_data import Preferences
|
||||||
from yomichan.reader import MainWindowReader
|
from yomi_base.reader import MainWindowReader
|
||||||
|
|
||||||
|
|
||||||
class Yomichan:
|
class Yomichan:
|
||||||
@ -44,7 +44,7 @@ class YomichanPlugin(Yomichan):
|
|||||||
self.separator.setSeparator(True)
|
self.separator.setSeparator(True)
|
||||||
self.action = QtGui.QAction(QtGui.QIcon(buildResPath('img/logo32x32.png')), '&Yomichan...', self.parent)
|
self.action = QtGui.QAction(QtGui.QIcon(buildResPath('img/logo32x32.png')), '&Yomichan...', self.parent)
|
||||||
self.action.setIconVisibleInMenu(True)
|
self.action.setIconVisibleInMenu(True)
|
||||||
self.parent.connect(self.action, QtCore.SIGNAL('triggered()'), self.onShowRequest)
|
self.action.triggered.connect(self.onShowRequest)
|
||||||
|
|
||||||
self.anki.addHook('loadDeck', self.onDeckLoad)
|
self.anki.addHook('loadDeck', self.onDeckLoad)
|
||||||
self.anki.addHook('deckClosed', self.onDeckClose)
|
self.anki.addHook('deckClosed', self.onDeckClose)
|
||||||
@ -120,6 +120,7 @@ class YomichanStandalone(Yomichan):
|
|||||||
self.languages,
|
self.languages,
|
||||||
filename=sys.argv[1] if len(sys.argv) >= 2 else None
|
filename=sys.argv[1] if len(sys.argv) >= 2 else None
|
||||||
)
|
)
|
||||||
|
|
||||||
self.window.show()
|
self.window.show()
|
||||||
self.application.exec_()
|
self.application.exec_()
|
||||||
|
|
||||||
@ -127,5 +128,5 @@ class YomichanStandalone(Yomichan):
|
|||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
instance = YomichanStandalone()
|
instance = YomichanStandalone()
|
||||||
else:
|
else:
|
||||||
from yomichan import anki_host
|
from yomi_base import anki_host
|
||||||
instance = YomichanPlugin()
|
instance = YomichanPlugin()
|
||||||
|