1

ui tweaks

This commit is contained in:
Alex Yatskov 2012-12-25 09:11:51 -08:00
parent 084a35b794
commit 7d5d8a042f
2 changed files with 11 additions and 9 deletions

View File

@ -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):

View File

@ -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: