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

Implemented eventFilter removal and improved Foster stability #297

Merged
merged 28 commits into from
Sep 8, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
2580f01
Implement eventFilter removal, eased #296
davidlatwe Aug 30, 2018
b854b3d
Reinstall eventFilter if removed
davidlatwe Aug 30, 2018
607a92a
Fix buggy window state
davidlatwe Aug 30, 2018
17e915d
Improve foster mode stability
davidlatwe Aug 30, 2018
577e8fa
Reinforce stay-on-top when detaching on foster mode
davidlatwe Aug 30, 2018
a3227fd
Foster mode stability, wait host during detach-attach
davidlatwe Aug 30, 2018
7a4ebf5
Fix buggy `pyblishQmlClose` signal emission
davidlatwe Aug 31, 2018
e237123
Use pyblish callback to trigger eventFilter's removal
davidlatwe Aug 31, 2018
33794e2
cleanup
davidlatwe Aug 31, 2018
8e0ddf0
Install eventFilter before server.listen
davidlatwe Aug 31, 2018
8ffec39
Disable foster mode when modal is on
davidlatwe Aug 31, 2018
d210a29
Ensure window closeEvent received in foster mode
davidlatwe Aug 31, 2018
bc7c0ac
Avoid main thread hanging on window close
davidlatwe Aug 31, 2018
3969a01
Detach before running Rest in foster mode
davidlatwe Aug 31, 2018
bd3f4b5
Cosmetic
davidlatwe Aug 31, 2018
23cae97
Aviod complicate detach-attach in foster mode's first run
davidlatwe Aug 31, 2018
8a5b469
Quit app when force quitting is triggered in foster mode
davidlatwe Aug 31, 2018
5869876
Add alert on finished in foster mode
davidlatwe Sep 1, 2018
e598d2a
Cosmetic
davidlatwe Sep 1, 2018
5eb3f66
Implement foster attach-detach switch
davidlatwe Sep 1, 2018
2a69568
Remove OS restriction
davidlatwe Sep 1, 2018
6ea9b6d
Foster mode first run in native vessel
davidlatwe Sep 1, 2018
7b3277c
Cosmetics
mottosso Sep 2, 2018
64e24eb
Document foster and modal environment variables
mottosso Sep 2, 2018
3dca545
Remove app argument from Window
mottosso Sep 2, 2018
4d4f8a2
Restore `server.Proxy.show` from 7b3277c
davidlatwe Sep 2, 2018
4b9b6a5
Rename uncleared param `ninja` to `foster_fixed`
davidlatwe Sep 2, 2018
3a0510e
Version bump
davidlatwe Sep 8, 2018
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
18 changes: 7 additions & 11 deletions pyblish_qml/host.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,17 +111,7 @@ def _foster_ninja(foster):
return False

value = os.environ.get("PYBLISH_QML_FOSTER_NINJA", "").lower()
if value in ("true", "yes", "1"):
return True

elif value in ("false", "no", "0"):
return False

else:
if QtCore.qVersion()[0] == "5":
return True
else:
return False
return value in ("true", "yes", "1") or QtCore.qVersion()[0] == "5"


def show(parent=None, targets=[], modal=None, foster=None):
Expand All @@ -130,6 +120,12 @@ def show(parent=None, targets=[], modal=None, foster=None):
Requires install() to have been run first, and
a live instance of Pyblish QML in the background.

Arguments:
parent (None, optional): Deprecated
targets (list, optional): Publishing targets
modal (bool, optional): Block interactions to parent
foster (bool, optional): Become a real child of the parent process

"""

# Get modal mode from environment
Expand Down
13 changes: 9 additions & 4 deletions pyblish_qml/ipc/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,12 @@ def show(self, settings=None):
settings (optional, dict): Client settings

"""
if not self.ninja:
if self.ninja:
return self._dispatch("show", args=[settings or {},
self._winId,
self.ninja])
else:
self.vessel.show()
return self._dispatch("show", args=[settings or {},
self._winId,
self.ninja])

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This spot, is the reason that make Maya 2015 and 16 freeze at startup.
ninja is disabled if host running Qt4, and if ninja is disabled, it need to call vessel.show before _dispatch("show"), or the window will not show up.

def hide(self):
"""Hide the GUI"""
Expand Down Expand Up @@ -224,6 +225,10 @@ class Server(object):
service (service.Service): Dispatch requests to this service
python (str, optional): Absolute path to Python executable
pyqt5 (str, optional): Absolute path to PyQt5
targets (list, optional): Publishing targets, e.g. `ftrack`
modal (bool, optional): Block interactions to parent
foster (bool, optional): Become a real child of the parent process
ninja (bool, optional): ...?

"""

Expand Down