Skip to content
Snippets Groups Projects
Commit fd38452e authored by Raphael Grimm's avatar Raphael Grimm
Browse files

Add SimpleConfigDialog::get

parent c9224828
No related branches found
No related tags found
No related merge requests found
......@@ -157,6 +157,28 @@ namespace armarx
{
return lineEdits.at(entryName)->text().toStdString();
}
bool hasLineEdit(const std::string& entryName) const
{
return lineEdits.count(entryName);
}
std::string get(const std::string& entryName) const
{
const auto hasprx = hasProxyName(entryName);
const auto hasedt = hasLineEdit(entryName);
ARMARX_CHECK_EXPRESSION(hasprx != hasedt)
<< VAROUT(entryName) << ' ' << VAROUT(hasprx) << ' ' << VAROUT(hasedt);
return hasprx ? getProxyName(entryName) : getLineEditText(entryName);
}
std::string get(const std::string& entryName, const std::string& def) const
{
const auto hasprx = hasProxyName(entryName);
const auto hasedt = hasLineEdit(entryName);
ARMARX_CHECK_EXPRESSION(!(hasprx && hasedt))
<< VAROUT(entryName) << ' ' << VAROUT(hasprx) << ' ' << VAROUT(hasedt);
return hasprx ? getProxyName(entryName) : (hasedt ? getLineEditText(entryName) : def);
}
private:
template<class...ProxyTs>
struct SimpleConfigDialogAdder
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment