Bug fixes
This commit is contained in:
		
							parent
							
								
									9ab03a655d
								
							
						
					
					
						commit
						9d9f4337ca
					
				@ -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():
 | 
				
			||||||
 | 
				
			|||||||
@ -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(
 | 
				
			||||||
 | 
				
			|||||||
@ -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():
 | 
				
			||||||
 | 
				
			|||||||
@ -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()
 | 
				
			||||||
 | 
				
			|||||||
@ -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'
 | 
				
			||||||
###################################################
 | 
					###################################################
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -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(
 | 
				
			||||||
 | 
				
			|||||||
@ -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():
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user