Make sure there is always one enabled keyboard config

This commit is contained in:
Alayan-stk-2 2018-09-15 19:33:29 +02:00 committed by GitHub
parent 15bc188aa3
commit 9a82e168de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -107,9 +107,12 @@ void OptionsScreenDevice::init()
}
else
{
// Don't allow deleting the last config
delete_button->setActive(
input_manager->getDeviceManager()->getKeyboardAmount() > 1);
// Don't allow deleting or disabling the last enabled config
bool enable = (input_manager->getDeviceManager()
->getActiveKeyboardAmount() > 1 ||
!m_config->isEnabled());
delete_button->setActive(enable);
disable_toggle->setActive(enable);
label = (m_config->isEnabled()
? //I18N: button to disable a keyboard configuration