void CGUIDialogLockSettings::SetupView() { CGUIDialogSettingsManualBase::SetupView(); // set the title if (m_getUser) SetHeading(StringUtils::Format(g_localizeStrings.Get(20152).c_str(), CURL::Decode(m_url).c_str())); else { SetHeading(20066); setLockCodeLabel(); setDetailSettingsEnabled(m_locks.mode != LOCK_MODE_EVERYONE); } SET_CONTROL_HIDDEN(CONTROL_SETTINGS_CUSTOM_BUTTON); SET_CONTROL_LABEL(CONTROL_SETTINGS_OKAY_BUTTON, 186); SET_CONTROL_LABEL(CONTROL_SETTINGS_CANCEL_BUTTON, 222); }
void CGUIDialogLockSettings::SetupView() { CGUIDialogSettingsManualBase::SetupView(); // set the title if (m_getUser) { int string = 20152; if (m_getModule) string = 24149; SetHeading(StringUtils::Format(g_localizeStrings.Get(string).c_str(), CURL::Decode(m_url).c_str())); } else { SetHeading(20066); setLockCodeLabel(); setDetailSettingsEnabled(m_locks.mode != LOCK_MODE_EVERYONE); } }
void CGUIDialogLockSettings::OnSettingAction(std::shared_ptr<const CSetting> setting) { if (setting == NULL) return; CGUIDialogSettingsManualBase::OnSettingAction(setting); const std::string &settingId = setting->GetId(); if (settingId == SETTING_LOCKCODE) { CContextButtons choices; choices.Add(1, 1223); choices.Add(2, 12337); choices.Add(3, 12338); choices.Add(4, 12339); int choice = CGUIDialogContextMenu::ShowAndGetChoice(choices); std::string newPassword; LockType iLockMode = LOCK_MODE_UNKNOWN; bool bResult = false; switch(choice) { case 1: iLockMode = LOCK_MODE_EVERYONE; //Disabled! Need check routine!!! bResult = true; break; case 2: iLockMode = LOCK_MODE_NUMERIC; bResult = CGUIDialogNumeric::ShowAndVerifyNewPassword(newPassword); break; case 3: iLockMode = LOCK_MODE_GAMEPAD; bResult = CGUIDialogGamepad::ShowAndVerifyNewPassword(newPassword); break; case 4: iLockMode = LOCK_MODE_QWERTY; bResult = CGUIKeyboardFactory::ShowAndVerifyNewPassword(newPassword); break; default: break; } if (bResult) { if (iLockMode == LOCK_MODE_EVERYONE) newPassword = "******"; m_locks.code = newPassword; if (m_locks.code == "-") iLockMode = LOCK_MODE_EVERYONE; m_locks.mode = iLockMode; setLockCodeLabel(); setDetailSettingsEnabled(m_locks.mode != LOCK_MODE_EVERYONE); m_changed = true; } } }