diff --git a/apps/settings/main_controller.cpp b/apps/settings/main_controller.cpp index 1d4391ef4..0908ccd79 100644 --- a/apps/settings/main_controller.cpp +++ b/apps/settings/main_controller.cpp @@ -140,26 +140,30 @@ void MainController::willDisplayCellForIndex(HighlightCell * cell, int index) { Preferences * preferences = Preferences::sharedPreferences(); MessageTableCell * myCell = (MessageTableCell *)cell; myCell->setMessage(model()->children(index)->label()); - if (model()->children(selectedRow())->label() == I18n::Message::Brightness) { + + //switch to irregular cell types + if (model()->children(index)->label() == I18n::Message::Brightness) { MessageTableCellWithGauge * myGaugeCell = (MessageTableCellWithGauge *)cell; GaugeView * myGauge = (GaugeView *)myGaugeCell->accessoryView(); myGauge->setLevel((float)globalPreferences->brightnessLevel()/(float)Ion::Backlight::MaxBrightness); return; } - if (model()->children(selectedRow())->label() == I18n::Message::Language) { + if (model()->children(index)->label() == I18n::Message::Language) { int index = (int)globalPreferences->language()-1; static_cast(cell)->setSubtitle(I18n::LanguageNames[index]); return; } - if (hasPrompt() && (model()->children(selectedRow())->label() == I18n::Message::UpdatePopUp || model()->children(selectedRow())->label() == I18n::Message::BetaPopUp)) { + if (hasPrompt() && (model()->children(index)->label() == I18n::Message::UpdatePopUp || model()->children(index)->label() == I18n::Message::BetaPopUp)) { MessageTableCellWithSwitch * mySwitchCell = (MessageTableCellWithSwitch *)cell; SwitchView * mySwitch = (SwitchView *)mySwitchCell->accessoryView(); mySwitch->setState(globalPreferences->showPopUp()); return; } + + //add text for preferences MessageTableCellWithChevronAndMessage * myTextCell = (MessageTableCellWithChevronAndMessage *)cell; int childIndex = -1; - switch (model()->children(selectedRow())->label()) { + switch (model()->children(index)->label()) { case I18n::Message::AngleUnit: childIndex = (int)preferences->angleUnit(); break;