From 47cb288d6b35a4da725a976f52c8722a04f3ecbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sun, 4 Oct 2015 13:25:22 +0200 Subject: [PATCH] Don't add Autoconfigure button when the device has builtin controls. Restore to Default should suffice. --- UI/ControlMappingScreen.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/UI/ControlMappingScreen.cpp b/UI/ControlMappingScreen.cpp index a2a5fdb991..5838faed3c 100644 --- a/UI/ControlMappingScreen.cpp +++ b/UI/ControlMappingScreen.cpp @@ -203,14 +203,16 @@ void ControlMappingScreen::CreateViews() { mappers_.clear(); I18NCategory *km = GetI18NCategory("KeyMapping"); - I18NCategory *di = GetI18NCategory("Dialog"); root_ = new LinearLayout(ORIENT_HORIZONTAL); LinearLayout *leftColumn = new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(200, FILL_PARENT, Margins(10, 0, 0, 10))); leftColumn->Add(new Choice(km->T("Clear All")))->OnClick.Handle(this, &ControlMappingScreen::OnClearMapping); leftColumn->Add(new Choice(km->T("Default All")))->OnClick.Handle(this, &ControlMappingScreen::OnDefaultMapping); - if (KeyMap::GetSeenPads().size()) { + + std::string sysName = System_GetProperty(SYSPROP_NAME); + // If there's a builtin controller, restore to default should suffice. No need to conf the controller on top. + if (!KeyMap::HasBuiltinController(sysName) && KeyMap::GetSeenPads().size()) { leftColumn->Add(new Choice(km->T("Autoconfigure")))->OnClick.Handle(this, &ControlMappingScreen::OnAutoConfigure); } leftColumn->Add(new Choice(km->T("Test Analogs")))->OnClick.Handle(this, &ControlMappingScreen::OnTestAnalogs);