Commit c9ea8af1 authored by Peterson, Peter's avatar Peterson, Peter
Browse files

Undo inappropriate cherry-pick

parent a892cb53
......@@ -12,7 +12,7 @@ namespace MantidWidgets {
class IAlgorithmProgressWidget {
public:
IAlgorithmProgressWidget() = default;
virtual ~IAlgorithmProgressWidget() = default;
~IAlgorithmProgressWidget() = default;
virtual void algorithmStarted() = 0;
virtual void algorithmEnded() = 0;
......
......@@ -24,6 +24,18 @@ class QWidget;
class MockAlgorithmProgressDialogWidget : public IAlgorithmProgressDialogWidget {
public:
virtual ~MockAlgorithmProgressDialogWidget() = default;
MOCK_METHOD((std::pair<QTreeWidgetItem *, QProgressBar *>), addAlgorithm, (Mantid::API::IAlgorithm_sptr), (override));
};
MockAlgorithmProgressDialogWidget() {
mainProgressBar = std::make_shared<MockAlgorithmProgressWidget>();
auto pres = mainProgressBar->m_presenter.get();
m_presenter =
std::make_shared<AlgorithmProgressDialogPresenter>(static_cast<QWidget *>(nullptr), this, pres->model());
}
virtual ~MockAlgorithmProgressDialogWidget() {}
MOCK_METHOD1(addAlgorithm, std::pair<QTreeWidgetItem *, QProgressBar *>(Mantid::API::IAlgorithm_sptr));
std::shared_ptr<AlgorithmProgressDialogPresenter> m_presenter;
// This is the mocked main progress bar,
// always shown on the Workbench GUI
std::shared_ptr<MockAlgorithmProgressWidget> mainProgressBar;
};
\ No newline at end of file
......@@ -23,9 +23,15 @@ class QWidget;
class MockAlgorithmProgressWidget : public IAlgorithmProgressWidget {
public:
virtual ~MockAlgorithmProgressWidget() = default;
MOCK_METHOD(void, algorithmStarted, (), (override));
MOCK_METHOD(void, algorithmEnded, (), (override));
MOCK_METHOD(void, updateProgress, (const double, const QString &, const double, const int), (override));
MOCK_METHOD(void, showDetailsDialog, (), (override));
};
MockAlgorithmProgressWidget() {
m_presenter = std::make_shared<AlgorithmProgressPresenter>(static_cast<QWidget *>(nullptr), this);
}
virtual ~MockAlgorithmProgressWidget() {}
MOCK_METHOD0(algorithmStarted, void());
MOCK_METHOD0(algorithmEnded, void());
MOCK_METHOD4(updateProgress, void(const double, const QString &, const double, const int));
MOCK_METHOD0(showDetailsDialog, void());
std::shared_ptr<AlgorithmProgressPresenter> m_presenter;
};
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment