Skip to content

Commit

Permalink
Refs #10392 Add getSearchString accessor
Browse files Browse the repository at this point in the history
  • Loading branch information
Harry Jeffery committed Nov 6, 2014
1 parent d30aac8 commit 224b5f0
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 3 deletions.
Expand Up @@ -76,6 +76,7 @@ namespace MantidQt
virtual std::string getProcessInstrument() const;
virtual std::string getWorkspaceToOpen() const;
virtual std::string getClipboard() const;
virtual std::string getSearchString() const;

virtual boost::shared_ptr<IReflPresenter> getPresenter() const;

Expand Down
Expand Up @@ -68,6 +68,7 @@ namespace MantidQt
virtual std::string getProcessInstrument() const = 0;
virtual std::string getWorkspaceToOpen() const = 0;
virtual std::string getClipboard() const = 0;
virtual std::string getSearchString() const = 0;

virtual boost::shared_ptr<IReflPresenter> getPresenter() const = 0;
};
Expand Down
Expand Up @@ -104,12 +104,12 @@
<string>RB Search:</string>
</property>
<property name="buddy">
<cstring>textRB</cstring>
<cstring>textSearch</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="textRB">
<widget class="QLineEdit" name="textSearch">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
Expand Down
9 changes: 9 additions & 0 deletions Code/Mantid/MantidQt/CustomInterfaces/src/QtReflMainView.cpp
Expand Up @@ -436,5 +436,14 @@ namespace MantidQt
return QApplication::clipboard()->text().toStdString();
}

/**
Get the string the user wants to search for.
@returns The search string
*/
std::string QtReflMainView::getSearchString() const
{
return ui.textSearch->text().toStdString();
}

} // namespace CustomInterfaces
} // namespace Mantid
Expand Up @@ -39,6 +39,8 @@ class MockView : public ReflMainView
MOCK_CONST_METHOD0(getSelectedRows, std::set<int>());
MOCK_METHOD1(setClipboard, void(const std::string& text));
MOCK_CONST_METHOD0(getClipboard, std::string());
MOCK_CONST_METHOD0(getSearchString, std::string());
MOCK_CONST_METHOD0(getSearchInstrument, std::string());

//Calls we don't care about
virtual void showTable(QReflTableModel_sptr) {};
Expand All @@ -48,7 +50,6 @@ class MockView : public ReflMainView
virtual void setTableList(const std::set<std::string>&) {};
virtual void setInstrumentList(const std::vector<std::string>&, const std::string&) {};
virtual std::string getProcessInstrument() const {return "FAKE";}
virtual std::string getSearchInstrument() const {return "FAKE";}
virtual boost::shared_ptr<IReflPresenter> getPresenter() const {return boost::shared_ptr<IReflPresenter>();}
};

Expand Down

0 comments on commit 224b5f0

Please sign in to comment.