Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
FSL
fslgui
Commits
06abdca4
Commit
06abdca4
authored
Jun 05, 2020
by
Taylor Hanayik
Browse files
indicate when background jobs are running
parent
6962d155
Changes
2
Hide whitespace changes
Inline
Side-by-side
fsl/gui/core.py
View file @
06abdca4
...
...
@@ -42,12 +42,33 @@ def runCommand(propObj, button):
if a propObj has a run method, then this funnction will call it
and run it on the idle loop.
"""
if
hasattr
(
propObj
,
"run"
):
idle
.
run
(
propObj
.
run
,
onFinish
=
updateStatus
)
def
enableButton
():
button
.
Enable
()
button
.
SetLabel
(
"Run"
)
layoutFrom
(
button
)
updateStatus
()
def
disableButton
():
button
.
SetLabel
(
"Running"
)
layoutFrom
(
button
)
button
.
Disable
()
updateStatus
(
"BUSY"
)
def
onFinish
():
enableButton
()
if
hasattr
(
propObj
,
"run"
):
"""
idle.run will return immediately, so it will start
the new thread and then call disableButton
"""
idle
.
run
(
propObj
.
run
,
onFinish
=
onFinish
)
disableButton
()
else
:
print
(
propObj
,
" has no attribute: run"
)
def
updateStatus
(
msg
=
"IDLE"
):
"""
if a frame has a statusbar then set its text with msg.
...
...
fsl/gui/widgets.py
View file @
06abdca4
...
...
@@ -208,11 +208,11 @@ class FsleyesImage(wx.Panel):
def
reset
(
self
):
self
.
overlayList
.
clear
()
def
add_image
(
self
,
new_img
,
valid
,
context
,
nam
e
):
def
add_image
(
self
,
new_img
,
valid
=
None
,
context
=
None
,
name
=
Non
e
):
self
.
reset
()
img
=
fslimage
.
Image
(
new_img
)
self
.
overlayList
.
append
(
img
)
def
add_mask
(
self
,
new_img
):
def
add_mask
(
self
,
new_img
,
valid
=
None
,
context
=
None
,
name
=
None
):
img
=
fslimage
.
Image
(
new_img
)
self
.
overlayList
.
append
(
img
,
cmap
=
'red'
,
alpha
=
30
)
Write
Preview
Supports
Markdown
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