Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mantid
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mantidproject
mantid
Commits
00df37d1
Commit
00df37d1
authored
5 years ago
by
Conor Finn
Browse files
Options
Downloads
Patches
Plain Diff
RE #27965 Add warning if focusing > 10 workspaces
parent
0fd1afa5
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/Engineering/gui/engineering_diffraction/tabs/focus/presenter.py
+14
-1
14 additions, 1 deletion
...ering/gui/engineering_diffraction/tabs/focus/presenter.py
with
14 additions
and
1 deletion
scripts/Engineering/gui/engineering_diffraction/tabs/focus/presenter.py
+
14
−
1
View file @
00df37d1
...
@@ -14,6 +14,8 @@ from Engineering.gui.engineering_diffraction.tabs.common.cropping.cropping_widge
...
@@ -14,6 +14,8 @@ from Engineering.gui.engineering_diffraction.tabs.common.cropping.cropping_widge
from
mantidqt.utils.asynchronous
import
AsyncTask
from
mantidqt.utils.asynchronous
import
AsyncTask
from
mantidqt.utils.observer_pattern
import
Observer
from
mantidqt.utils.observer_pattern
import
Observer
from
qtpy.QtWidgets
import
QMessageBox
class
FocusPresenter
(
object
):
class
FocusPresenter
(
object
):
def
__init__
(
self
,
model
,
view
):
def
__init__
(
self
,
model
,
view
):
...
@@ -41,7 +43,8 @@ class FocusPresenter(object):
...
@@ -41,7 +43,8 @@ class FocusPresenter(object):
return
return
banks
,
spectrum_numbers
=
self
.
_get_banks
()
banks
,
spectrum_numbers
=
self
.
_get_banks
()
focus_paths
=
self
.
view
.
get_focus_filenames
()
focus_paths
=
self
.
view
.
get_focus_filenames
()
self
.
start_focus_worker
(
focus_paths
,
banks
,
self
.
view
.
get_plot_output
(),
self
.
rb_num
,
spectrum_numbers
)
if
self
.
_number_of_files_warning
(
focus_paths
):
self
.
start_focus_worker
(
focus_paths
,
banks
,
self
.
view
.
get_plot_output
(),
self
.
rb_num
,
spectrum_numbers
)
def
start_focus_worker
(
self
,
focus_paths
,
banks
,
plot_output
,
rb_num
,
spectrum_numbers
=
None
):
def
start_focus_worker
(
self
,
focus_paths
,
banks
,
plot_output
,
rb_num
,
spectrum_numbers
=
None
):
"""
"""
...
@@ -94,6 +97,16 @@ class FocusPresenter(object):
...
@@ -94,6 +97,16 @@ class FocusPresenter(object):
return
False
return
False
return
True
return
True
def
_number_of_files_warning
(
self
,
paths
):
if
len
(
paths
)
>
10
:
# Just a guess on the warning for now. May change in future.
response
=
QMessageBox
.
warning
(
self
.
view
,
'
Engineering Diffraction - Warning
'
,
'
You are attempting to focus {} workspaces. This may take some time.
\n\n
Would you like to continue?
'
.
format
(
len
(
paths
)),
QMessageBox
.
Ok
|
QMessageBox
.
Cancel
)
return
response
==
QMessageBox
.
Ok
else
:
return
True
def
_on_worker_error
(
self
,
_
):
def
_on_worker_error
(
self
,
_
):
self
.
emit_enable_button_signal
()
self
.
emit_enable_button_signal
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment