Skip to content

Commit

Permalink
Merge pull request #2506 from NREL/measure_issues
Browse files Browse the repository at this point in the history
Fixes #2418
  • Loading branch information
macumber authored Mar 3, 2017
2 parents 6fa63dc + 24c2303 commit f28afa0
Showing 1 changed file with 30 additions and 3 deletions.
33 changes: 30 additions & 3 deletions openstudiocore/src/shared_gui_components/EditController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,28 +201,55 @@ InputController::InputController(EditController * editController,const measure::
{
choiceInputView->comboBox->insertItem(0,"");
}
else if( choiceInputView->comboBox->findText(QString::fromStdString(m_argument.defaultValueAsString())) == -1 )
else
{
choiceInputView->comboBox->insertItem(0,"");
int index = choiceInputView->comboBox->findData(QString::fromStdString(m_argument.defaultValueAsString()));

if (index == -1){
index = choiceInputView->comboBox->findText(QString::fromStdString(m_argument.defaultValueAsString()));
}

if (index == -1)
{
// DLM: this is an error
choiceInputView->comboBox->insertItem(0, "");
}
}

// Set the initial value
if( m_argument.hasValue() )
{
int index = choiceInputView->comboBox->findData(QString::fromStdString(m_argument.valueAsString()));

choiceInputView->comboBox->setCurrentIndex(index);
if (index == -1){
index = choiceInputView->comboBox->findText(QString::fromStdString(m_argument.valueAsString()));
}

if( index != -1 )
{
choiceInputView->comboBox->setCurrentIndex(index);
}
else
{
// DLM: this is an error
choiceInputView->comboBox->setCurrentIndex(0);
}
}
else if( m_argument.hasDefaultValue() )
{
int index = choiceInputView->comboBox->findData(QString::fromStdString(m_argument.defaultValueAsString()));

if (index == -1){
index = choiceInputView->comboBox->findText(QString::fromStdString(m_argument.defaultValueAsString()));
}

if( index != -1 )
{
choiceInputView->comboBox->setCurrentIndex(index);
}
else
{
// DLM: this is an error
choiceInputView->comboBox->setCurrentIndex(0);
}
}
Expand Down

5 comments on commit f28afa0

@nrel-bot-3
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

develop (macumber) - x86_64-MacOS-10.10-clang: Build Failed

Build Badge Test Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

develop (macumber) - x86_64-Linux-Ubuntu-14.04-clang-3.5: Build Failed

Build Badge Test Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

develop (macumber) - x86_64-Linux-Ubuntu-14.04-cppcheck-1.61: Build Failed

Build Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

develop (macumber) - i386-Windows-7-VisualStudio-12: Build Failed

Build Badge Test Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

develop (macumber) - Win64-Windows-7-VisualStudio-12: Build Failed

Build Badge Test Badge

Please sign in to comment.