Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/issue 3659 wrong window closes command w #3680

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ Christian Donat <https://github.com/cdonat2>
Asuka Minato <https://asukaminato.eu.org>
Dillon Baldwin <https://github.com/DillBal>
Voczi <https://github.com/voczi>
Ben Nguyen <[email protected]>
Ben Nguyen <[email protected]>
Themis Demetriades <[email protected]>
Luke Bartholomew <[email protected]>
Gregory Abrasaldo <[email protected]>
Expand All @@ -203,6 +203,7 @@ hideo aoyama <https://github.com/boukendesho>
Ross Brown <[email protected]>
🦙 <github.com/iamllama>
Lukas Sommer <[email protected]>
Tom Ampuero <[email protected]>

********************

Expand Down
13 changes: 10 additions & 3 deletions qt/aqt/browser/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,11 @@ def set_flag_func(desired_flag: int) -> Callable:
add_ellipsis_to_action_label(f.actionCopy)
add_ellipsis_to_action_label(f.action_forget)

if isinstance(self, AddCards):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self can't be AddCards here, so this doesn't make sense.

f.actionClose.setVisible(False)
else:
f.actionClose.setVisible(True)

def _editor_web_view(self) -> EditorWebView:
assert self.editor is not None
editor_web_view = self.editor.web
Expand All @@ -394,9 +399,11 @@ def closeEvent(self, evt: QCloseEvent | None) -> None:
return

assert self.editor is not None

self.editor.call_after_note_saved(self._closeWindow)
evt.ignore()
if current_window() == self:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

self.editor.call_after_note_saved(self._closeWindow)
evt.accept()
else:
evt.ignore()

def _closeWindow(self) -> None:
assert self.editor is not None
Expand Down