mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 23:12:21 -04:00
add hidden option to disable keyboard preservation
This commit is contained in:
parent
90f419b088
commit
ebebd93548
2 changed files with 3 additions and 2 deletions
|
@ -69,6 +69,7 @@ class Config(dict):
|
||||||
'mediaLocation': "",
|
'mediaLocation': "",
|
||||||
'mainWindowState': None,
|
'mainWindowState': None,
|
||||||
'numBackups': 30,
|
'numBackups': 30,
|
||||||
|
'preserveKeyboard': True,
|
||||||
'preventEditUntilAnswer': False,
|
'preventEditUntilAnswer': False,
|
||||||
'proxyHost': '',
|
'proxyHost': '',
|
||||||
'proxyPass': '',
|
'proxyPass': '',
|
||||||
|
|
|
@ -1111,7 +1111,7 @@ class FactEdit(QTextEdit):
|
||||||
self.parent.lastFocusedEdit = self
|
self.parent.lastFocusedEdit = self
|
||||||
self.parent.resetFormatButtons()
|
self.parent.resetFormatButtons()
|
||||||
self.parent.disableButtons()
|
self.parent.disableButtons()
|
||||||
if sys.platform.startswith("win32"):
|
if ankiqt.mw.config['preserveKeyboard'] and sys.platform.startswith("win32"):
|
||||||
self._ownLayout = GetKeyboardLayout(0)
|
self._ownLayout = GetKeyboardLayout(0)
|
||||||
ActivateKeyboardLayout(self._programLayout, 0)
|
ActivateKeyboardLayout(self._programLayout, 0)
|
||||||
self.emit(SIGNAL("lostFocus"))
|
self.emit(SIGNAL("lostFocus"))
|
||||||
|
@ -1131,7 +1131,7 @@ class FactEdit(QTextEdit):
|
||||||
QTextEdit.focusInEvent(self, evt)
|
QTextEdit.focusInEvent(self, evt)
|
||||||
self.parent.formatChanged(None)
|
self.parent.formatChanged(None)
|
||||||
self.parent.enableButtons()
|
self.parent.enableButtons()
|
||||||
if sys.platform.startswith("win32"):
|
if ankiqt.mw.config['preserveKeyboard'] and sys.platform.startswith("win32"):
|
||||||
self._programLayout = GetKeyboardLayout(0)
|
self._programLayout = GetKeyboardLayout(0)
|
||||||
if self._ownLayout == None:
|
if self._ownLayout == None:
|
||||||
self._ownLayout = self._programLayout
|
self._ownLayout = self._programLayout
|
||||||
|
|
Loading…
Reference in a new issue