8
8
#include " MantidQtWidgets/Spectroscopy/SettingsWidget/Settings.h"
9
9
#include " Quasi.h"
10
10
#include " ResNormPresenter.h"
11
- #include " Stretch .h"
11
+ #include " StretchPresenter .h"
12
12
13
13
#include < MantidQtWidgets/Common/QtJobRunner.h>
14
14
15
- using namespace MantidQt ::CustomInterfaces;
16
-
17
15
namespace MantidQt ::CustomInterfaces {
18
16
DECLARE_SUBWINDOW (BayesFitting)
19
17
@@ -25,17 +23,26 @@ BayesFitting::BayesFitting(QWidget *parent)
25
23
// Connect Poco Notification Observer
26
24
Mantid::Kernel::ConfigService::Instance ().addObserver (m_changeObserver);
27
25
28
- auto jobRunner = std::make_unique<MantidQt::API::QtJobRunner>(true );
29
- auto algorithmRunner = std::make_unique<MantidQt::API::AlgorithmRunner>(std::move (jobRunner));
26
+ auto resNormRunner = createAlgorithmRunner ();
30
27
31
28
// insert each tab into the interface on creation
32
29
auto resNormModel = std::make_unique<ResNormModel>();
33
30
auto resNormWidget = m_uiForm.bayesFittingTabs ->widget (RES_NORM);
34
- m_bayesTabs.emplace (RES_NORM, new ResNormPresenter (resNormWidget, std::move (algorithmRunner ), std::move (resNormModel),
31
+ m_bayesTabs.emplace (RES_NORM, new ResNormPresenter (resNormWidget, std::move (resNormRunner ), std::move (resNormModel),
35
32
new ResNormView (resNormWidget)));
36
33
37
34
m_bayesTabs.emplace (QUASI, new Quasi (m_uiForm.bayesFittingTabs ->widget (QUASI)));
38
- m_bayesTabs.emplace (STRETCH, new Stretch (m_uiForm.bayesFittingTabs ->widget (STRETCH)));
35
+
36
+ auto stretchRunner = createAlgorithmRunner ();
37
+
38
+ auto tabContent = m_uiForm.bayesFittingTabs ->widget (STRETCH);
39
+ m_bayesTabs.emplace (STRETCH, new StretchPresenter (tabContent, new StretchView (tabContent),
40
+ std::make_unique<StretchModel>(), std::move (stretchRunner)));
41
+ }
42
+
43
+ std::unique_ptr<MantidQt::API::AlgorithmRunner> BayesFitting::createAlgorithmRunner () const {
44
+ auto jobRunner = std::make_unique<MantidQt::API::QtJobRunner>(true );
45
+ return std::make_unique<MantidQt::API::AlgorithmRunner>(std::move (jobRunner));
39
46
}
40
47
41
48
void BayesFitting::initLayout () {
0 commit comments