Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
HEV - High Energy Ventilator
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
5
Issues
5
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
HEV - High Energy Ventilator
Commits
32528507
Commit
32528507
authored
May 17, 2021
by
Benjamin Mummery
💻
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
full-screen popups
parent
e2998300
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
18 deletions
+18
-18
NativeUI.py
NativeUI/NativeUI.py
+3
-2
global_send_popup.py
NativeUI/global_widgets/global_send_popup.py
+15
-16
No files found.
NativeUI/NativeUI.py
View file @
32528507
...
...
@@ -199,7 +199,7 @@ class NativeUI(HEVClient, QMainWindow):
self
.
__define_connections
()
# Update page buttons to match the shown view
self
.
display_stack
.
setCurrentWidget
(
self
.
confirm
Popup
)
self
.
display_stack
.
setCurrentWidget
(
self
.
messageCommand
Popup
)
self
.
widgets
.
page_buttons
.
buttons
[
0
]
.
on_press
()
def
__find_localisation_files
(
self
,
config_path
:
str
)
->
list
:
...
...
@@ -324,8 +324,9 @@ class NativeUI(HEVClient, QMainWindow):
for
button
in
self
.
widgets
.
page_buttons
.
buttons
:
button
.
PageButtonPressed
.
connect
(
self
.
change_page
)
# Start button should raise the startup widget.
self
.
widgets
.
ventilator_start_stop_buttons_widget
.
button_start
.
pressed
.
connect
(
self
.
startupWidget
.
show
lambda
:
self
.
display_stack
.
setCurrentWidget
(
self
.
startupWidget
)
)
##### Mode:
...
...
NativeUI/global_widgets/global_send_popup.py
View file @
32528507
...
...
@@ -18,6 +18,7 @@ from widget_library.expert_handler import ExpertHandler
from
mode_widgets.personal_handler
import
PersonalHandler
from
mode_widgets.mode_handler
import
ModeHandler
from
mode_widgets.clinical_handler
import
ClinicalHandler
import
logging
# from global_widgets.global_ok_cancel_buttons import okButton, cancelButton
...
...
@@ -38,9 +39,9 @@ class SetConfirmPopup(QtWidgets.QDialog):
super
()
.
__init__
(
*
args
,
**
kwargs
)
self
.
NativeUI
=
NativeUI
self
.
handler
=
None
self
.
listWidget
=
QtWidgets
.
QListWidget
()
self
.
listWidget
.
setVerticalScrollBarPolicy
(
QtCore
.
Qt
.
ScrollBarAlwaysOff
)
self
.
listWidget
.
setHorizontalScrollBarPolicy
(
QtCore
.
Qt
.
ScrollBarAlwaysOff
)
...
...
@@ -53,7 +54,6 @@ class SetConfirmPopup(QtWidgets.QDialog):
self
.
cancelButton
=
CancelButtonWidget
(
self
.
NativeUI
)
self
.
cancelButton
.
setEnabled
(
True
)
self
.
cancelButton
.
pressed
.
connect
(
self
.
cancel_button_pressed
)
buttonHLayout
.
addWidget
(
self
.
cancelButton
)
vlayout
=
QtWidgets
.
QVBoxLayout
()
...
...
@@ -61,14 +61,10 @@ class SetConfirmPopup(QtWidgets.QDialog):
vlayout
.
addLayout
(
buttonHLayout
)
self
.
setLayout
(
vlayout
)
# self.setWindowFlags(
# QtCore.Qt.FramelessWindowHint | QtCore.Qt.WindowStaysOnTopHint
# ) # no window title
self
.
setAttribute
(
QtCore
.
Qt
.
WA_NoSystemBackground
,
True
)
self
.
setWindowOpacity
(
0.5
)
# self.setAttribute(QtCore.Qt.WA_NoSystemBackground, True)
# self.setWindowOpacity(0.5)
def
populatePopup
(
self
,
handlerWidget
,
messageList
):
print
(
handlerWidget
)
self
.
handler
=
handlerWidget
self
.
clearPopup
()
if
messageList
==
[]:
...
...
@@ -86,16 +82,18 @@ class SetConfirmPopup(QtWidgets.QDialog):
self
.
listWidget
.
update
()
self
.
update
()
self
.
show
()
def
clearPopup
(
self
):
self
.
listWidget
.
clear
()
self
.
commandList
=
[]
def
ok_button_pressed
(
self
):
print
(
"ok button pressed"
)
"""Send commands when ok button is clicked"""
# self.parentTemplate.liveUpdating = True
if
self
.
handler
is
None
:
logging
.
error
(
"Popup ok_button_pressed called before popupatePopup"
)
return
1
if
isinstance
(
self
.
handler
,
ExpertHandler
):
self
.
ExpertSend
.
emit
()
elif
isinstance
(
self
.
handler
,
ModeHandler
):
...
...
@@ -104,14 +102,15 @@ class SetConfirmPopup(QtWidgets.QDialog):
self
.
PersonalSend
.
emit
()
elif
isinstance
(
self
.
handler
,
ClinicalHandler
):
self
.
ClinicalSend
.
emit
()
self
.
close
()
else
:
logging
.
warning
(
"Unrecognised handler type:
%
s"
,
type
(
self
.
handler
))
return
0
def
cancel_button_pressed
(
self
):
"""Close popup when cancel button is clicked"""
print
(
"CANCEL BUTTON PRESSED"
)
# self.close()
return
0
#
def cancel_button_pressed(self):
#
"""Close popup when cancel button is clicked"""
#
print("CANCEL BUTTON PRESSED")
#
# self.close()
#
return 0
class
confirmWidget
(
QtWidgets
.
QWidget
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment