Changeset 78210 in vbox
- Timestamp:
- Apr 18, 2019 4:08:51 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIFormEditorWidget.cpp
r78203 r78210 168 168 void setChoice(const ChoiceData &choice); 169 169 170 /** Updates value cells. */ 171 void updateValueCells(); 172 170 173 protected: 171 174 … … 181 184 /** Cleanups all. */ 182 185 void cleanup(); 183 184 /** Updates value cells. */185 void updateValueCells();186 186 187 187 /** Holds the row value. */ … … 369 369 void UIFormEditorRow::setChoice(const ChoiceData &choice) 370 370 { 371 /* Do nothing for empty choices: */ 372 if (choice.selectedChoice() == -1) 373 return; 374 371 375 AssertReturnVoid(valueType() == KFormValueType_Choice); 372 376 CChoiceFormValue comValue(m_comValue); … … 387 391 else 388 392 updateValueCells(); 393 } 394 } 395 396 void UIFormEditorRow::updateValueCells() 397 { 398 switch (m_enmValueType) 399 { 400 case KFormValueType_Boolean: 401 { 402 CBooleanFormValue comValue(m_comValue); 403 m_cells[UIFormEditorDataType_Value]->setText(comValue.GetSelected() ? "True" : "False"); 404 /// @todo check for errors 405 break; 406 } 407 case KFormValueType_String: 408 { 409 CStringFormValue comValue(m_comValue); 410 m_cells[UIFormEditorDataType_Value]->setText(comValue.GetString()); 411 /// @todo check for errors 412 break; 413 } 414 case KFormValueType_Choice: 415 { 416 CChoiceFormValue comValue(m_comValue); 417 const QVector<QString> values = comValue.GetValues(); 418 m_cells[UIFormEditorDataType_Value]->setText(values.at(comValue.GetSelectedIndex())); 419 /// @todo check for errors 420 break; 421 } 422 default: 423 break; 389 424 } 390 425 } … … 424 459 qDeleteAll(m_cells); 425 460 m_cells.clear(); 426 }427 428 void UIFormEditorRow::updateValueCells()429 {430 switch (m_enmValueType)431 {432 case KFormValueType_Boolean:433 {434 CBooleanFormValue comValue(m_comValue);435 m_cells[UIFormEditorDataType_Value]->setText(comValue.GetSelected() ? "True" : "False");436 /// @todo check for errors437 break;438 }439 case KFormValueType_String:440 {441 CStringFormValue comValue(m_comValue);442 m_cells[UIFormEditorDataType_Value]->setText(comValue.GetString());443 /// @todo check for errors444 break;445 }446 case KFormValueType_Choice:447 {448 CChoiceFormValue comValue(m_comValue);449 const QVector<QString> values = comValue.GetValues();450 m_cells[UIFormEditorDataType_Value]->setText(values.at(comValue.GetSelectedIndex()));451 /// @todo check for errors452 break;453 }454 default:455 break;456 }457 461 } 458 462
Note:
See TracChangeset
for help on using the changeset viewer.