---
--- @package   eg4-crank-ui
--- @file      settings-profile.lua
--- @brief     Functionality for settings profile
---
--- @copyright Copyright 2020 Hanover Displays Limited.
--- @license   This program is the confidential and proprietary product of
---            Hanover Displays Limited. Any unauthorised use, reproduction or
---            transfer of this program is strictly prohibited. (Subject to
---            limited distribution and restricted disclosure only.) All
---            rights reserved.
---
---


---
--- @brief  Sets the current profile ID setting.      
--- @param gre#context mapargs
---
function CBSetSettingsProfile(mapargs)
  if mapargs.value == "" then return end
  local value = tonumber(mapargs.value)

  if value ~= sbsettings.get_settings_profile() then
    sbsettings.set_settings_profile(value)
    SendEvent("settings_updated_startup")
    CBUpdateUISettings(mapargs)
  end
  TransitionBackScreen(mapargs)
end
