Lets the control know about the Options Model (and its signals) */
| 1275 | |
| 1276 | /** Lets the control know about the Options Model (and its signals) */ |
| 1277 | void UnitDisplayStatusBarControl::setOptionsModel(OptionsModel *_optionsModel) |
| 1278 | { |
| 1279 | if (_optionsModel) |
| 1280 | { |
| 1281 | this->optionsModel = _optionsModel; |
| 1282 | |
| 1283 | // be aware of a display unit change reported by the OptionsModel object. |
| 1284 | connect(_optionsModel,SIGNAL(displayUnitChanged(int)),this,SLOT(updateDisplayUnit(int))); |
| 1285 | |
| 1286 | // initialize the display units label with the current value in the model. |
| 1287 | updateDisplayUnit(_optionsModel->getDisplayUnit()); |
| 1288 | } |
| 1289 | } |
| 1290 | |
| 1291 | /** When Display Units are changed on OptionsModel it will refresh the display text of the control on the status bar */ |
| 1292 | void UnitDisplayStatusBarControl::updateDisplayUnit(int newUnits) |