ui tweaks
This commit is contained in:
parent
084a35b794
commit
7d5d8a042f
@ -74,8 +74,8 @@ class Anki:
|
|||||||
return aqt.mw
|
return aqt.mw
|
||||||
|
|
||||||
|
|
||||||
def toolsMenu(self):
|
def addUiAction(self, action):
|
||||||
return self.window().form.menuTools
|
self.window().form.menuTools.addAction(action)
|
||||||
|
|
||||||
|
|
||||||
def collection(self):
|
def collection(self):
|
||||||
|
16
yomichan.py
16
yomichan.py
@ -40,14 +40,16 @@ class YomichanPlugin(Yomichan):
|
|||||||
self.window = None
|
self.window = None
|
||||||
self.anki = anki_host.Anki()
|
self.anki = anki_host.Anki()
|
||||||
self.parent = self.anki.window()
|
self.parent = self.anki.window()
|
||||||
self.separator = QtGui.QAction(self.parent)
|
|
||||||
self.separator.setSeparator(True)
|
|
||||||
self.action = QtGui.QAction(QtGui.QIcon(buildResPath('img/logo32x32.png')), '&Yomichan...', self.parent)
|
|
||||||
self.action.setIconVisibleInMenu(True)
|
|
||||||
self.action.triggered.connect(self.onShowRequest)
|
|
||||||
|
|
||||||
self.anki.toolsMenu().addAction(self.separator)
|
separator = QtGui.QAction(self.parent)
|
||||||
self.anki.toolsMenu().addAction(self.action)
|
separator.setSeparator(True)
|
||||||
|
self.anki.addUiAction(separator)
|
||||||
|
|
||||||
|
action = QtGui.QAction(QtGui.QIcon(buildResPath('img/icon_logo_32.png')), '&Yomichan...', self.parent)
|
||||||
|
action.setIconVisibleInMenu(True)
|
||||||
|
action.triggered.connect(self.onShowRequest)
|
||||||
|
self.anki.addUiAction(action)
|
||||||
|
|
||||||
|
|
||||||
def onShowRequest(self):
|
def onShowRequest(self):
|
||||||
if self.window:
|
if self.window:
|
||||||
|
Loading…
Reference in New Issue
Block a user