From 0948929ffebfb922471b74a596e273d1cf7536c5 Mon Sep 17 00:00:00 2001 From: sirius-fan Date: Tue, 31 Jan 2023 14:29:30 +0800 Subject: [PATCH] fix qmenu action args bug --- addons21/fastwq/common.py | 8 ++++---- addons21/fastwq/gui/dictmanager.py | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/addons21/fastwq/common.py b/addons21/fastwq/common.py index fc71c27..d148739 100644 --- a/addons21/fastwq/common.py +++ b/addons21/fastwq/common.py @@ -158,8 +158,8 @@ def customize_addcards(): menu = QMenu(self) menu.addAction( _("ALL_FIELDS"), - lambda: query_from_editor_fields(self.editor), - QKeySequence(my_shortcut)) + lambda: query_from_editor_fields(self.editor)) + # ,QKeySequence(my_shortcut)) # default options mid = self.editor.note.model()['id'] conf = config.get_maps(mid) @@ -238,8 +238,8 @@ def context_menu(): submenu = menu.addMenu(_('QUERY')) submenu.addAction( - _('ALL_FIELDS'), lambda: query_from_editor_fields(web_view.editor), - QKeySequence(my_shortcut)) + _('ALL_FIELDS'), lambda: query_from_editor_fields(web_view.editor)) + # ,QKeySequence(my_shortcut)) if len(curr_flds) > 0: # quer hook method def query_from_editor_hook(i): diff --git a/addons21/fastwq/gui/dictmanager.py b/addons21/fastwq/gui/dictmanager.py index bea195b..8f5af92 100644 --- a/addons21/fastwq/gui/dictmanager.py +++ b/addons21/fastwq/gui/dictmanager.py @@ -37,9 +37,9 @@ __all__ = ['DictManageDialog'] class DictManageDialog(Dialog): - ''' + """ Dictionary manager window. enabled or disabled dictionary, and setting params of dictionary. - ''' + """ def __init__(self, parent, title=u'Dictionary Manager'): super(DictManageDialog, self).__init__(parent, title) @@ -60,7 +60,7 @@ class DictManageDialog(Dialog): self.build() def build(self): - ''' ''' + """ """ # labels f = QFont() f.setBold(True) @@ -143,7 +143,7 @@ class DictManageDialog(Dialog): row['check_btn'].setChecked(b) def on_edit(self, path): - '''edit dictionary file''' + """edit dictionary file""" d = QDialog(self) frm = Ui_Dialog() frm.setupUi(d) @@ -154,10 +154,10 @@ class DictManageDialog(Dialog): else: frm.text.setPlainText(unicode(open(path).read(), "utf8")) d.accepted.connect(lambda: self.on_accept_edit(path, frm)) - d.exec_() + d.exec() def on_accept_edit(self, path, frm): - '''save dictionary file''' + """save dictionary file""" # 2x3 compatible if sys.hexversion >= 0x03000000: open(path, "w", encoding='utf-8').write(frm.text.toPlainText()) @@ -165,12 +165,12 @@ class DictManageDialog(Dialog): open(path, "w").write(frm.text.toPlainText().encode("utf8")) def accept(self): - '''ok button clicked''' + """ok button clicked""" self.save() super(DictManageDialog, self).accept() def save(self): - '''save config to file''' + """save config to file""" data = dict() dicts = {} for row in self._options: