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
Ying-Qiu Zheng
fsleyes
Commits
87b52156
Commit
87b52156
authored
Feb 24, 2021
by
Paul McCarthy
🚵
Browse files
RF: Show command line option shows a message if any unsaved/unsaveable images
are in overlay list
parent
521e336f
Changes
2
Hide whitespace changes
Inline
Side-by-side
fsleyes/actions/showcommandline.py
View file @
87b52156
...
...
@@ -18,6 +18,7 @@ are also defined here:
import
wx
import
fsl.data.image
as
fslimage
import
fsleyes_widgets.dialog
as
fsldlg
import
fsleyes.strings
as
strings
import
fsleyes.parseargs
as
parseargs
...
...
@@ -59,6 +60,21 @@ def showCommandLineArgs(overlayList, displayCtx, canvas):
:arg displayCtx: A :class:`.DisplayContext` instance.
:arg canvas: A :class:`CanvasPanel` instance.
"""
unsaved
=
False
for
o
in
overlayList
:
if
o
.
dataSource
is
None
:
unsaved
=
True
elif
isinstance
(
o
,
fslimage
.
Image
)
and
not
o
.
saveState
:
unsaved
=
True
if
unsaved
:
msg
=
strings
.
messages
[
canvas
,
'showCommandLineArgs'
,
'unsaved'
]
title
=
strings
.
titles
[
canvas
,
'showCommandLineArgs'
,
'unsaved'
]
wx
.
MessageBox
(
msg
,
title
,
wx
.
ICON_EXCLAMATION
|
wx
.
OK
)
return
args
=
genCommandLineArgs
(
overlayList
,
displayCtx
,
canvas
)
dlg
=
fsldlg
.
TextEditDialog
(
canvas
,
...
...
fsleyes/strings.py
View file @
87b52156
...
...
@@ -144,6 +144,9 @@ messages = TypeDict({
'CanvasPanel.showCommandLineArgs.message'
:
'Use these parameters on the '
'command line to recreate '
'the current scene'
,
'CanvasPanel.showCommandLineArgs.unsaved'
:
'All of your images must be saved to a file before a command line can be '
'generated!'
,
'PlotPanel.preparingData'
:
'Preparing data - please wait...'
,
...
...
@@ -447,6 +450,8 @@ titles = TypeDict({
'ClearSettingsAction.confirm'
:
'Clear all settings?'
,
'CanvasPanel.showCommandLineArgs.unsaved'
:
'Unsaved images'
,
'LoadColourMapAction.namecmap'
:
'Name colour map.'
,
'LoadColourMapAction.installcmap'
:
'Install colour map?'
,
...
...
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