mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 06:52:21 -04:00
shortcut()
This commit is contained in:
parent
6f0168aec1
commit
1cdc92d7f5
1 changed files with 9 additions and 12 deletions
|
@ -155,16 +155,6 @@ $(function () {
|
||||||
</body></html>
|
</body></html>
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# fixme: use shortcut() for mac shortcuts
|
|
||||||
|
|
||||||
if sys.platform.startswith("win32"):
|
|
||||||
ActivateKeyboardLayout = ctypes.windll.user32.ActivateKeyboardLayout
|
|
||||||
ActivateKeyboardLayout.restype = ctypes.c_void_p
|
|
||||||
ActivateKeyboardLayout.argtypes = [ctypes.c_void_p, ctypes.c_uint]
|
|
||||||
GetKeyboardLayout = ctypes.windll.user32.GetKeyboardLayout
|
|
||||||
GetKeyboardLayout.restype = ctypes.c_void_p
|
|
||||||
GetKeyboardLayout.argtypes = [ctypes.c_uint]
|
|
||||||
|
|
||||||
class Editor(object):
|
class Editor(object):
|
||||||
def __init__(self, mw, widget):
|
def __init__(self, mw, widget):
|
||||||
self.widget = widget
|
self.widget = widget
|
||||||
|
@ -228,7 +218,7 @@ class Editor(object):
|
||||||
if key:
|
if key:
|
||||||
b.setShortcut(QKeySequence(key))
|
b.setShortcut(QKeySequence(key))
|
||||||
if tip:
|
if tip:
|
||||||
b.setToolTip(tip)
|
b.setToolTip(shortcut(tip))
|
||||||
if check:
|
if check:
|
||||||
b.setCheckable(True)
|
b.setCheckable(True)
|
||||||
self.iconsBox.addWidget(b)
|
self.iconsBox.addWidget(b)
|
||||||
|
@ -838,12 +828,19 @@ class EditorWebView(AnkiWebView):
|
||||||
file.close()
|
file.close()
|
||||||
return self.editor._addMedia(path)
|
return self.editor._addMedia(path)
|
||||||
|
|
||||||
|
|
||||||
def _tmpDir(self):
|
def _tmpDir(self):
|
||||||
if not self.__tmpDir:
|
if not self.__tmpDir:
|
||||||
self.__tmpDir = tempfile.mkdtemp(prefix="anki")
|
self.__tmpDir = tempfile.mkdtemp(prefix="anki")
|
||||||
return self.__tmpDir
|
return self.__tmpDir
|
||||||
|
|
||||||
|
# if sys.platform.startswith("win32"):
|
||||||
|
# ActivateKeyboardLayout = ctypes.windll.user32.ActivateKeyboardLayout
|
||||||
|
# ActivateKeyboardLayout.restype = ctypes.c_void_p
|
||||||
|
# ActivateKeyboardLayout.argtypes = [ctypes.c_void_p, ctypes.c_uint]
|
||||||
|
# GetKeyboardLayout = ctypes.windll.user32.GetKeyboardLayout
|
||||||
|
# GetKeyboardLayout.restype = ctypes.c_void_p
|
||||||
|
# GetKeyboardLayout.argtypes = [ctypes.c_uint]
|
||||||
|
|
||||||
# def focusOutEvent(self, evt):
|
# def focusOutEvent(self, evt):
|
||||||
# if self.mw.config['preserveKeyboard'] and sys.platform.startswith("win32"):
|
# if self.mw.config['preserveKeyboard'] and sys.platform.startswith("win32"):
|
||||||
# self._ownLayout = GetKeyboardLayout(0)
|
# self._ownLayout = GetKeyboardLayout(0)
|
||||||
|
|
Loading…
Reference in a new issue