Bug fixes

This commit is contained in:
Stowen 2018-08-27 01:21:59 +08:00
parent 9ab03a655d
commit 9d9f4337ca
7 changed files with 9 additions and 5 deletions

View File

@ -18,9 +18,10 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
from anki.hooks import addHook from anki.hooks import addHook
from anki.utils import isMac
############## other config here ################## ############## other config here ##################
shortcut = 'Ctrl+Q' shortcut = ('Ctrl+Alt' if isMac else 'Ctrl') + '+Q'
################################################### ###################################################
def start_here(): def start_here():

View File

@ -126,7 +126,7 @@ def context_menu():
""" """
add context menu to webview add context menu to webview
""" """
submenu = menu.addMenu('FastWQ') submenu = menu.addMenu(_('QUERY'))
submenu.addAction(_('ALL_FIELDS'), lambda: query_from_editor_fields(web_view.editor), QKeySequence(my_shortcut)) submenu.addAction(_('ALL_FIELDS'), lambda: query_from_editor_fields(web_view.editor), QKeySequence(my_shortcut))
submenu.addAction(_('CURRENT_FIELDS'), submenu.addAction(_('CURRENT_FIELDS'),
lambda: query_from_editor_fields( lambda: query_from_editor_fields(

View File

@ -76,6 +76,7 @@ class ProgressWindow(object):
) )
self._update(label=number_info, value=words_number+skips_number+fails_number) self._update(label=number_info, value=words_number+skips_number+fails_number)
self._win.adjustSize() self._win.adjustSize()
self.app.processEvents()
def update_title(self, title): def update_title(self, title):
if self.abort(): if self.abort():

View File

@ -86,6 +86,7 @@ def query_from_editor_fields(editor, fields=None):
fields fields
) )
else: else:
editor.setNote(editor.note)
query_all([editor.note], flush, fields) query_all([editor.note], flush, fields)
editor.setNote(editor.note, focus=True) editor.setNote(editor.note, focus=True)
editor.saveNow() editor.saveNow()

View File

@ -18,10 +18,10 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
from anki.hooks import addHook from anki.hooks import addHook
from anki.utils import isMac
############## other config here ################## ############## other config here ##################
shortcut = 'Ctrl+Q' shortcut = ('Ctrl+Alt' if isMac else 'Ctrl') + '+Q'
################################################### ###################################################

View File

@ -126,7 +126,7 @@ def context_menu():
""" """
add context menu to webview add context menu to webview
""" """
submenu = menu.addMenu('FastWQ') submenu = menu.addMenu(_('QUERY'))
submenu.addAction(_('ALL_FIELDS'), lambda: query_from_editor_fields(web_view.editor), QKeySequence(my_shortcut)) submenu.addAction(_('ALL_FIELDS'), lambda: query_from_editor_fields(web_view.editor), QKeySequence(my_shortcut))
submenu.addAction(_('CURRENT_FIELDS'), submenu.addAction(_('CURRENT_FIELDS'),
lambda: query_from_editor_fields( lambda: query_from_editor_fields(

View File

@ -76,6 +76,7 @@ class ProgressWindow(object):
) )
self._update(label=number_info, value=words_number+skips_number+fails_number) self._update(label=number_info, value=words_number+skips_number+fails_number)
self._win.adjustSize() self._win.adjustSize()
self.app.processEvents()
def update_title(self, title): def update_title(self, title):
if self.abort(): if self.abort():