Details
-
Type:
Story
-
Status: Done
-
Resolution: Done
-
Fix Version/s: None
-
Component/s: ts_main_telescope
-
Labels:
-
Story Points:1
-
Epic Link:
-
Sprint:TSSW Sprint - May 09 - May 23
-
Team:Telescope and Site
-
Urgent?:No
Description
Develop the M2 Python EUI in the phase 10. The pyside2 will be used to construct the EUI to align with M1M3. This ticket will implement the warning window.
Petr recommend to have something like this:
def warning(parent, title, description): |
"""Creates future with QMessageBox. Enables use of QMessageBox with
|
asyncqt/asyncio. Mimics QMessageBox.warning behaviour - but QMessageBox |
cannot be used, as it blocks Qt loops from executing (as all modal dialogs |
does).
|
|
Parameters
|
---------- |
parent : `QtWidget`
|
Parent widget.
|
title : `str` |
Message window title.
|
description : `str` |
Descrption of warning occured.
|
"""
|
|
future = asyncio.Future() |
dialog = QMessageBox(parent) |
dialog.setWindowTitle(title)
|
dialog.setText(description)
|
dialog.setIcon(QMessageBox.Warning)
|
dialog.finished.connect(lambda r: future.set_result(r)) |
dialog.open() |
return future |
Please help to review the PR:
https://github.com/lsst-ts/ts_m2gui/pull/10
Thanks!